feat: implement application management system

Add structured workflow for managing job applications with /new-application and /populate-application commands. Users can now organize applications in dated folders, store job documents, and have AI analyze requirements to populate strategy documents. Includes bug fix for src/ path references and safe update documentation.

OpenSpec: add-application-management

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-02 19:04:49 +01:00
co-authored by Claude
parent 751af9e310
commit f1ba0dd98d
9 changed files with 1263 additions and 18 deletions
@@ -0,0 +1,40 @@
# Add Application Management System
## Why
Currently, the framework has a profile template and validation, but no structured way to manage individual job applications. Users need a systematic approach to:
- Initiate new applications with proper organization
- Store job-related documents (ads, emails, recruiter communications) in one place
- Have the AI analyze these documents to populate application strategy
- Track applications in a folder structure that supports the workflow stages
This implements the first three steps of the project workflow (Research & Context, Proposal/Strategy, Specification) from `project.md`.
## What Changes
- Create two new slash commands:
- `/new-application` - Initializes a new application with folder structure
- `/populate-application` - Analyzes input documents and populates application.md
- Implement folder structure: `src/applications/pending/YYYY-MM-DD-CompanyName-JobTitle/`
- Create standardized `application.md` template with sections for research, strategy, and specification
- Automatically create `input/` folder for storing job-related documents
- Update `src/CLAUDE.md` to include application management workflow
## Impact
- **Affected specs**: New capability `application-management`
- **Affected code**:
- New file: `src/.claude/commands/new-application.md`
- New file: `src/.claude/commands/populate-application.md`
- Modified: `src/CLAUDE.md` (add application workflow instructions)
- New structure: `src/applications/pending/` (created dynamically)
- **User benefit**:
- Organized workspace for each application
- Centralized storage for all job-related documents
- AI-powered analysis of job requirements and company research
- Clear progression from research → strategy → content generation
- **Out of scope**:
- Actual CV/cover letter/email generation (future proposal)
- Moving applications between stages (pending → sent → archived)
- Application tracking and follow-up reminders
- **Breaking changes**: None - this is purely additive functionality
@@ -0,0 +1,147 @@
# Application Management
## ADDED Requirements
### Requirement: Application Initialization Command
The system SHALL provide a `/new-application` slash command that creates a new application workspace with proper folder structure.
#### Scenario: Create new application with minimal info
- **WHEN** user runs `/new-application "TechCorp - Senior Developer"`
- **THEN** system creates folder `src/applications/pending/2025-11-02-TechCorp-Senior-Developer/` with `application.md` template and empty `input/` folder
#### Scenario: Create application with date prefix
- **WHEN** application folder is created
- **THEN** folder name is prefixed with current date in `YYYY-MM-DD` format for chronological sorting
#### Scenario: Handle special characters in folder names
- **WHEN** organization name or job title contains special characters (/, \, :, etc.)
- **THEN** system sanitizes the folder name by replacing invalid characters with hyphens or removing them
#### Scenario: Application template is created
- **WHEN** new application is initialized
- **THEN** `application.md` file is created with template sections (Organization, Job Title, Research, Match Strategy, Key Messages, Tone, etc.)
#### Scenario: Input folder is created automatically
- **WHEN** new application is initialized
- **THEN** `input/` subfolder is created for storing job-related documents
### Requirement: Application Structure
Each application workspace SHALL contain a standardized folder structure and files.
#### Scenario: Folder hierarchy is consistent
- **WHEN** application is created
- **THEN** structure is: `src/applications/pending/[date-org-title]/application.md` and `src/applications/pending/[date-org-title]/input/`
#### Scenario: Application template has required sections
- **WHEN** `application.md` is created
- **THEN** it includes sections for: Organization Name, Job Title, Job Description Summary, Research Notes, Match Strategy, Key Messages, Tone of Voice, and Document Checklist
#### Scenario: Template provides guidance
- **WHEN** user opens newly created `application.md`
- **THEN** each section includes helpful comments explaining what information to include
### Requirement: Document Population Command
The system SHALL provide a `/populate-application` slash command that analyzes input documents and populates `application.md`.
#### Scenario: Populate from current directory
- **WHEN** user runs `/populate-application` from within an application folder
- **THEN** system reads all files in `input/` subfolder and extracts relevant information
#### Scenario: Analyze job advertisement
- **WHEN** `input/` contains a job advertisement (PDF, DOCX, TXT, MD)
- **THEN** system extracts: company name, job title, requirements, responsibilities, keywords, and company culture indicators
#### Scenario: Analyze email communications
- **WHEN** `input/` contains email files or text
- **THEN** system extracts: recruiter name, company context, timeline, special instructions, and tone expectations
#### Scenario: Update application.md with findings
- **WHEN** input analysis is complete
- **THEN** system updates relevant sections of `application.md` with extracted information while preserving any existing manual entries
#### Scenario: Ask user for missing information
- **WHEN** critical information cannot be extracted from input files (e.g., no clear job title)
- **THEN** system prompts user to provide missing details before completing population
#### Scenario: Handle empty input folder
- **WHEN** `/populate-application` is run and `input/` folder is empty or doesn't exist
- **THEN** system informs user to add job-related documents first and explains what types of files are helpful
### Requirement: Profile Integration
The application management system SHALL integrate with the existing profile system.
#### Scenario: Reference profile during population
- **WHEN** `/populate-application` runs
- **THEN** system reads `src/profile.md` to understand applicant's background for match strategy analysis
#### Scenario: Profile validation is preserved
- **WHEN** working with applications
- **THEN** the existing `/validate-profile` requirement remains enforced before document generation (to be implemented in future proposal)
#### Scenario: Match applicant to job requirements
- **WHEN** populating application
- **THEN** system identifies which experiences, skills, and projects from profile.md best match the job requirements
### Requirement: Claude Code Workflow Instructions
The `src/CLAUDE.md` file SHALL include instructions for the application management workflow.
#### Scenario: Instructions explain application lifecycle
- **WHEN** Claude Code is helping with applications
- **THEN** it understands the workflow: initialize → add input files → populate → [future: generate documents]
#### Scenario: Commands are documented
- **WHEN** user asks how to create an application
- **THEN** Claude Code can explain `/new-application` and `/populate-application` commands
#### Scenario: Input file guidance is provided
- **WHEN** user asks what files to add to input folder
- **THEN** Claude Code suggests: job postings (PDF/DOCX/text), recruiter emails, company research notes, or any relevant context
### Requirement: File Format Support
The population command SHALL support multiple input file formats.
#### Scenario: Read PDF files
- **WHEN** `input/` contains PDF files
- **THEN** system extracts text content for analysis (Note: Claude Code has built-in PDF reading capability)
#### Scenario: Read text-based formats
- **WHEN** `input/` contains TXT, MD, or copied text files
- **THEN** system reads and analyzes content directly
#### Scenario: Read email formats
- **WHEN** `input/` contains .eml or plain text email content
- **THEN** system parses sender, subject, body and extracts relevant application context
#### Scenario: Handle unsupported formats gracefully
- **WHEN** `input/` contains unsupported file types (e.g., images, videos)
- **THEN** system skips these files with a warning and processes supported formats
@@ -0,0 +1,112 @@
# Implementation Tasks
## 1. Create Application Folder Structure
- [x] 1.1 Create `src/applications/` directory structure
- [x] 1.2 Create `src/applications/pending/` directory for applications not yet sent
- [x] 1.3 Add `.gitkeep` file to preserve directory structure in git
## 2. Design Application Template
- [x] 2.1 Design `application.md` template structure with sections:
- Organization Information (name, website, contact person)
- Job Information (title, level, department)
- Job Description Summary (key points from posting)
- Research Notes (company culture, values, recent news)
- Match Strategy (which experiences/skills to emphasize)
- Key Messages (main points to convey in application)
- Tone of Voice (formal/balanced/casual assessment)
- Document Checklist (CV needed? Cover letter? Application form?)
- [x] 2.2 Add helpful comments and instructions within template
- [x] 2.3 Include metadata section (date created, status, deadline if known)
## 3. Implement `/new-application` Command
- [x] 3.1 Create `src/.claude/commands/new-application.md`
- [x] 3.2 Implement folder name generation logic:
- Get current date in YYYY-MM-DD format
- Parse user input for organization name and job title
- Sanitize names (remove/replace invalid filesystem characters)
- Combine into format: `YYYY-MM-DD-OrgName-JobTitle`
- [x] 3.3 Implement folder creation logic:
- Create `src/applications/pending/[generated-name]/`
- Copy `application.md` template to new folder
- Create `input/` subfolder
- [x] 3.4 Add user guidance:
- Confirm successful creation with folder path
- Explain next steps (add files to input/, run /populate-application)
- Provide examples of useful input files
## 4. Implement `/populate-application` Command
- [x] 4.1 Create `src/.claude/commands/populate-application.md`
- [x] 4.2 Implement current directory detection:
- Check if running from inside an application folder
- Verify `application.md` and `input/` exist
- Provide helpful error if not in correct location
- [x] 4.3 Implement input file discovery:
- List all files in `input/` folder
- Filter by supported formats (PDF, TXT, MD, DOCX, EML)
- Warn about unsupported files
- [x] 4.4 Implement document analysis:
- Read each supported file
- Extract key information (job requirements, company info, contact details)
- Identify keywords and skills mentioned
- Analyze tone and company culture from language
- [x] 4.5 Implement profile cross-reference:
- Read `src/profile.md`
- Match job requirements to applicant's experience
- Identify which projects/skills/achievements to emphasize
- Suggest relevant stories or examples from profile
- [x] 4.6 Implement application.md population:
- Update each section with extracted/analyzed information
- Preserve any existing manual entries
- Mark auto-populated sections with timestamp
- Leave sections empty if no relevant information found
- [x] 4.7 Implement interactive prompts:
- Ask user for missing critical information
- Confirm before overwriting existing content
- Provide summary of changes made
## 5. Update Framework Instructions
- [x] 5.1 Update `src/CLAUDE.md` to add application management workflow section
- [x] 5.2 Document the workflow sequence:
1. Validate profile (existing)
2. Initialize new application (`/new-application`)
3. Gather documents (user adds to input/)
4. Populate application (`/populate-application`)
5. Review and refine application.md manually if needed
6. Generate documents (future: CV, cover letter, email)
- [x] 5.3 Add command reference for `/new-application` and `/populate-application`
- [x] 5.4 Add guidance on what files to put in input/ folder
- [x] 5.5 Explain how to work with application.md after population
## 6. Handle Edge Cases
- [x] 6.1 Handle duplicate folder names (append counter if exists)
- [x] 6.2 Handle very long organization/job names (truncate with ellipsis)
- [x] 6.3 Handle missing input folder during population
- [x] 6.4 Handle corrupted or unreadable input files
- [x] 6.5 Handle running commands from wrong directory
- [x] 6.6 Handle missing profile.md during population (graceful degradation)
## 7. Create Example Application (for testing)
- [x] 7.1 Create example application folder structure manually for testing
- [x] 7.2 Add sample job posting to input/ folder
- [x] 7.3 Test population command with sample data
- [x] 7.4 Document expected output in tasks or design doc
## 8. Validation & Documentation
- [x] 8.1 Verify `/new-application` creates correct folder structure
- [x] 8.2 Verify application.md template has all required sections
- [x] 8.3 Verify input/ folder is created
- [x] 8.4 Verify `/populate-application` reads files from input/
- [x] 8.5 Verify population extracts key information correctly
- [x] 8.6 Verify profile integration works (matches skills/experience)
- [x] 8.7 Verify edge cases are handled gracefully
- [x] 8.8 Test with real job posting to validate workflow
- [x] 8.9 Update CLAUDE.md instructions are clear and complete
- [x] 8.10 Validate with `openspec validate add-application-management --strict`