feat: add cover letter generation command

Add /write-cover-letter slash command that generates tailored cover
letters based on application strategy (application.md) and applicant
profile (profile.md). Features:

- Auto-validates application before generation (stops if incomplete)
- Protects existing cover-letter.md (requires --force to overwrite)
- Generates 300-400 word cover letter with standard structure
- Applies tone from application.md (Formal/Balanced/Casual)
- Infers language from context (German/English)
- Uses match strategy to emphasize relevant experiences
- Incorporates company research and key messages
- Supports flags: --skip-validation, --force, --help

This is the first document generation command in the workflow.

OpenSpec: add-cover-letter-generation

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-02 21:42:47 +01:00
co-authored by Claude
parent 2b13cc4e69
commit f529dea015
5 changed files with 1656 additions and 15 deletions
@@ -0,0 +1,218 @@
# Proposal: Cover Letter Generation
## Why
The application management system now supports creating, populating, and validating applications, but users still must manually write their cover letters. This is time-consuming and doesn't leverage the strategic analysis already captured in `application.md`.
**Problems without automated cover letter generation:**
- Users must manually translate match strategy into compelling narrative
- Risk of inconsistency between application strategy and actual cover letter content
- Time-consuming to write personalized cover letters for each application
- May not effectively incorporate key messages and tone guidance from application.md
- Difficult to maintain consistent quality across multiple applications
**Current workflow gap:**
1. ✅ Validate profile
2. ✅ Create application
3. ✅ Populate application with job analysis
4. ✅ Validate application completeness
5.**Generate cover letter** ← Missing
6. ❌ Generate CV (future)
7. ❌ Generate application email (future)
## What
Add a `/write-cover-letter` slash command that generates tailored cover letters based on the strategic analysis in `application.md` and personal information in `profile.md`.
### Core Functionality
1. **Location Detection**: Auto-detect current application folder or accept optional application name parameter
2. **Safety Gates**:
- Automatically run `/validate-application` before generating (stop if fails)
- Check if `cover-letter.md` already exists (stop if exists)
- Allow explicit overrides via flags: `--skip-validation`, `--force`/`--overwrite`
3. **Multi-source Generation**:
- Read `profile.md` for applicant background (experience, skills, achievements)
- Read `application.md` for job-specific strategy (match strategy, key messages, tone, company insights)
4. **Standard Structure**: Generate 1-page cover letter with:
- **Opening**: Introduction and position reference
- **Why This Role**: Genuine interest, company research insights
- **What You Bring**: Relevant experience and skills (from match strategy)
- **Cultural Fit**: Alignment with company values and culture
- **Closing**: Strong call to action, availability
5. **Tone & Language**:
- Use tone guidance from application.md (Formal/Balanced/Casual)
- Infer language (German/English) from job posting context
6. **Output**: Save to `cover-letter.md` in application folder
### User Experience
```bash
# From inside application folder
cd applications/pending/2025-11-02-TechCorp-Senior-Developer
/write-cover-letter
# Or from anywhere with parameter
/write-cover-letter 2025-11-02-TechCorp-Senior-Developer
# Override safety checks
/write-cover-letter --skip-validation
/write-cover-letter --force # Overwrite existing cover-letter.md
```
**Success flow:**
```
🔍 Validating application...
✅ Application validation passed
📝 Generating cover letter...
✓ Read profile.md (applicant background)
✓ Read application.md (job strategy)
✓ Analyzed match strategy (3 key experiences identified)
✓ Incorporated key messages
✓ Applied tone: Balanced
✓ Language: English
✓ Generated 376 words (target: 300-400)
✅ Cover letter saved: cover-letter.md
Next steps:
1. Review cover-letter.md for accuracy and authenticity
2. Personalize with any additional insights
3. Generate CV: /write-cv (coming soon)
```
**Blocked flow (validation fails):**
```
🔍 Validating application...
❌ Application validation failed
Your application has incomplete sections. Please fix these issues first:
## Job Description Summary
- [ ] Required Skills: Missing or empty
Run /validate-application for full details, or use --skip-validation to proceed anyway (not recommended).
```
**Blocked flow (cover letter exists):**
```
❌ Cover letter already exists: cover-letter.md
To regenerate, use:
/write-cover-letter --force
Warning: This will overwrite your existing cover letter.
```
### Content Generation Strategy
**Opening Paragraph (Hook + Position):**
- Reference specific job title and company name
- Brief statement of interest
- One compelling reason for applying (from research notes or key messages)
**Why This Role Paragraph:**
- Connection to company mission/values (from research notes)
- Genuine interest in the role (from key messages)
- Reference to company news, projects, or initiatives
**What You Bring Paragraphs (1-2):**
- Highlight 2-3 most relevant experiences from match strategy
- Use specific achievements and quantifiable results from profile.md
- Connect experiences to job requirements
- Incorporate keywords from job description
**Cultural Fit Paragraph:**
- Align personal values with company culture (from research notes)
- Reference soft skills that match company culture indicators
- Show enthusiasm for work environment or team
**Closing Paragraph:**
- Strong statement of interest
- Availability for interview
- Thank you and call to action
- Professional sign-off
**Quality Standards:**
- Length: 300-400 words (1 page)
- Tone: Match application.md tone assessment
- Language: Inferred from job posting
- Authenticity: Use real experiences from profile.md only
- Keywords: Incorporate naturally from job description
- Personalization: Reference company-specific insights
## Impact
### Benefits
- **Time savings**: Reduce cover letter writing from 1-2 hours to 10-15 minutes (review/refinement)
- **Consistency**: Ensures cover letter aligns with application strategy
- **Quality**: Leverages strategic analysis already done in application.md
- **Personalization**: Each cover letter tailored to specific job and company
- **Completeness**: Addresses all key messages identified in planning phase
- **ATS optimization**: Natural incorporation of keywords from job description
### Changes Required
- New slash command: `/write-cover-letter`
- Documentation updates in `src/CLAUDE.md`
- No changes to existing commands or templates
### User Workflow Impact
**Updated workflow:**
```
1. Validate profile (/validate-profile)
2. Initialize application (/new-application)
3. Add documents to input/ folder
4. Populate application (/populate-application)
5. Validate application (/validate-application)
6. **Generate cover letter (/write-cover-letter)** ← NEW
7. Review and refine cover-letter.md manually
8. Generate CV (future: /write-cv)
9. Generate email (future: /write-email)
```
### Risks & Mitigations
**Risk**: Generated cover letters may sound generic or AI-written
**Mitigation**:
- Use authentic experiences from profile.md only
- Incorporate company-specific research from application.md
- Apply appropriate tone from tone assessment
- Encourage manual review and personalization
**Risk**: Overwriting existing work
**Mitigation**:
- Check for existing cover-letter.md and stop
- Require explicit `--force` flag to overwrite
- Warn user about overwrite consequences
**Risk**: Generating from incomplete application
**Mitigation**:
- Auto-run /validate-application before generation
- Stop if validation fails (unless `--skip-validation`)
- Clear error messages about what needs to be fixed
## Implementation Approach
**Pattern consistency:**
- Follow same location detection as `/validate-application`
- Match command structure and error handling patterns
- Use consistent validation and safety check patterns
**Data sources:**
- Primary: application.md (match strategy, key messages, tone, research)
- Secondary: profile.md (experience, skills, achievements)
- Tertiary: Job description from input/ (if needed for additional context)
**Generation approach:**
- Use Claude to generate human-quality prose
- Maintain factual accuracy (no hallucination)
- Balance structure with natural flow
- Target specific word count (300-400 words)
**Future integration:**
- Cover letter generation is first of three document commands
- Pattern will be reused for `/write-cv` and `/write-email`
- Consider unified template system for all document types
@@ -0,0 +1,343 @@
# Cover Letter Generation
## ADDED Requirements
### Requirement: Cover Letter Generation Command
The system SHALL provide a `/write-cover-letter` slash command that generates tailored cover letters based on application strategy and profile information.
#### Scenario: Generate from current directory
- **WHEN** user runs `/write-cover-letter` from inside an application folder
- **THEN** system generates cover letter for the application in current directory
#### Scenario: Generate with explicit application name
- **WHEN** user runs `/write-cover-letter 2025-11-02-TechCorp-Developer`
- **THEN** system generates cover letter for that specific application
#### Scenario: Handle unclear location
- **WHEN** user runs `/write-cover-letter` from a directory that is not an application folder and no parameter is provided
- **THEN** system lists all applications in `applications/pending/` and asks user to specify which one
#### Scenario: Handle non-existent application
- **WHEN** user provides application name that doesn't exist
- **THEN** system shows error and lists available applications
### Requirement: Automatic Validation Check
The system SHALL automatically validate the application before generating a cover letter.
#### Scenario: Validation passes automatically
- **WHEN** user runs `/write-cover-letter` and application validation passes
- **THEN** system proceeds with cover letter generation
#### Scenario: Validation fails automatically
- **WHEN** user runs `/write-cover-letter` and application validation fails
- **THEN** system shows validation errors and stops generation (does not create cover-letter.md)
#### Scenario: Skip validation with flag
- **WHEN** user runs `/write-cover-letter --skip-validation` and application has incomplete sections
- **THEN** system shows warning but proceeds with generation anyway
#### Scenario: Show validation progress
- **WHEN** validation is running
- **THEN** system shows progress: "🔍 Validating application..." followed by result
### Requirement: Existing File Protection
The system SHALL check if cover-letter.md already exists and prevent overwriting without explicit permission.
#### Scenario: Cover letter already exists
- **WHEN** user runs `/write-cover-letter` and `cover-letter.md` already exists in application folder
- **THEN** system stops and shows error: "Cover letter already exists. Use --force to overwrite."
#### Scenario: Force overwrite with flag
- **WHEN** user runs `/write-cover-letter --force` and cover-letter.md exists
- **THEN** system shows warning and overwrites the file
#### Scenario: No existing file
- **WHEN** user runs `/write-cover-letter` and no cover-letter.md exists
- **THEN** system proceeds with generation without prompting
### Requirement: Multi-Source Data Reading
The system SHALL read both profile.md and application.md to gather information for the cover letter.
#### Scenario: Read profile for applicant background
- **WHEN** generating cover letter
- **THEN** system reads `profile.md` to extract:
- Personal information (name, contact)
- Professional summary
- Relevant work experiences (as identified in match strategy)
- Key skills and achievements
- Projects to highlight
#### Scenario: Read application for job strategy
- **WHEN** generating cover letter
- **THEN** system reads `application.md` to extract:
- Organization name and job title
- Match strategy (which experiences to emphasize)
- Key messages to convey
- Tone assessment (Formal/Balanced/Casual)
- Company research and culture insights
- Job requirements and keywords
#### Scenario: Handle missing profile.md
- **WHEN** profile.md doesn't exist or is unreadable
- **THEN** system shows error: "profile.md not found. Please create your profile first." and stops
#### Scenario: Cross-reference match strategy
- **WHEN** application.md has match strategy section with specific experiences to emphasize
- **THEN** system prioritizes those experiences from profile.md in the cover letter content
### Requirement: Standard Structure Generation
The system SHALL generate cover letters with a standard 1-page structure.
#### Scenario: Opening paragraph with hook
- **WHEN** generating cover letter
- **THEN** opening paragraph includes:
- Specific job title and company name
- Brief statement of interest
- One compelling reason for applying (from key messages or research)
#### Scenario: Why this role paragraph
- **WHEN** generating cover letter
- **THEN** "why this role" section includes:
- Connection to company mission/values
- Reference to company research insights
- Genuine interest in the position
#### Scenario: What you bring paragraphs
- **WHEN** generating cover letter
- **THEN** "what you bring" sections include:
- 2-3 most relevant experiences from match strategy
- Specific achievements from profile.md
- Connection to job requirements
- Natural incorporation of keywords
#### Scenario: Cultural fit paragraph
- **WHEN** generating cover letter
- **THEN** cultural fit section includes:
- Alignment of personal values with company culture
- Reference to soft skills that match company culture indicators
- Enthusiasm for work environment
#### Scenario: Closing paragraph
- **WHEN** generating cover letter
- **THEN** closing includes:
- Strong statement of interest
- Availability for interview
- Professional thank you
- Call to action
### Requirement: Length and Formatting
The system SHALL generate cover letters with appropriate length and formatting.
#### Scenario: Target word count
- **WHEN** generating cover letter
- **THEN** system aims for 300-400 words total (approximately 1 page)
#### Scenario: Paragraph structure
- **WHEN** generating cover letter
- **THEN** system creates 4-5 distinct paragraphs (Opening, Why role, What you bring 1-2 paragraphs, Cultural fit, Closing)
#### Scenario: Professional formatting
- **WHEN** cover letter is generated
- **THEN** format includes:
- Applicant contact information header (from profile.md)
- Date
- Company/recruiter address (from application.md)
- Professional salutation
- Body paragraphs
- Professional sign-off
### Requirement: Tone and Language
The system SHALL apply appropriate tone and language based on application.md guidance.
#### Scenario: Apply tone from application.md
- **WHEN** application.md has tone assessment of "Formal"
- **THEN** cover letter uses formal language, professional vocabulary, traditional business letter tone
#### Scenario: Apply balanced tone
- **WHEN** application.md has tone assessment of "Balanced"
- **THEN** cover letter uses professional but approachable language, moderate formality
#### Scenario: Apply casual tone
- **WHEN** application.md has tone assessment of "Casual"
- **THEN** cover letter uses conversational yet professional language, more personal voice
#### Scenario: Infer language from context
- **WHEN** job posting, company information, or application.md content suggests German language
- **THEN** cover letter is generated in German
#### Scenario: Default to English
- **WHEN** language cannot be clearly determined from context
- **THEN** cover letter is generated in English
### Requirement: Content Quality and Authenticity
The system SHALL ensure generated content is authentic, factual, and high-quality.
#### Scenario: Use only real information
- **WHEN** generating cover letter content
- **THEN** system uses ONLY experiences, skills, and achievements documented in profile.md (no hallucination)
#### Scenario: Natural keyword incorporation
- **WHEN** job description has specific keywords or required skills
- **THEN** system incorporates them naturally in context (not as a list)
#### Scenario: Company-specific personalization
- **WHEN** application.md has research notes about company
- **THEN** cover letter references specific company initiatives, values, or news
#### Scenario: Authentic voice
- **WHEN** generating prose
- **THEN** system creates natural, human-sounding text (not obviously AI-generated)
### Requirement: Success and Progress Reporting
The system SHALL provide clear feedback during the generation process.
#### Scenario: Show generation steps
- **WHEN** cover letter is being generated
- **THEN** system shows progress:
- "🔍 Validating application..."
- "📝 Generating cover letter..."
- "✓ Read profile.md"
- "✓ Read application.md"
- "✓ Analyzed match strategy"
- "✓ Generated [N] words"
#### Scenario: Success message
- **WHEN** cover letter generation completes successfully
- **THEN** system shows:
- ✅ emoji and "Cover letter saved: cover-letter.md"
- Summary (word count, tone, language, key experiences used)
- Next steps (review, personalize, generate CV)
#### Scenario: Include file location
- **WHEN** showing success message
- **THEN** system includes full or relative path to cover-letter.md file
### Requirement: Error Handling
The system SHALL handle errors gracefully with helpful messages.
#### Scenario: Missing application.md
- **WHEN** application folder has no application.md file
- **THEN** system shows error: "No application.md found. Please create application first with /new-application"
#### Scenario: Validation failure stops generation
- **WHEN** /validate-application fails with incomplete sections
- **THEN** system shows specific validation errors and suggests: "Fix issues or use --skip-validation to proceed anyway"
#### Scenario: Existing cover letter blocks generation
- **WHEN** cover-letter.md already exists
- **THEN** system shows: "Cover letter already exists. Use --force to overwrite. Warning: This will replace your existing cover letter."
#### Scenario: File write errors
- **WHEN** cover-letter.md cannot be written (permissions, disk full, etc.)
- **THEN** system shows clear error: "Could not save cover-letter.md: [reason]"
### Requirement: Flags and Options
The system SHALL support command flags for advanced usage.
#### Scenario: Skip validation flag
- **WHEN** user provides `--skip-validation` flag
- **THEN** system skips /validate-application check and generates anyway
#### Scenario: Force overwrite flag
- **WHEN** user provides `--force` or `--overwrite` flag
- **THEN** system overwrites existing cover-letter.md without prompting
#### Scenario: Combined flags
- **WHEN** user provides multiple flags: `/write-cover-letter --skip-validation --force`
- **THEN** system applies both: skips validation AND overwrites existing file
#### Scenario: Help flag
- **WHEN** user runs `/write-cover-letter --help`
- **THEN** system shows usage information, available flags, and examples
### Requirement: Post-Generation Guidance
The system SHALL provide clear next steps after generation.
#### Scenario: Review guidance
- **WHEN** cover letter is generated
- **THEN** system suggests: "Review cover-letter.md for accuracy and authenticity"
#### Scenario: Personalization guidance
- **WHEN** cover letter is generated
- **THEN** system suggests: "Add any additional personal insights or connections to the role"
#### Scenario: Next command suggestion
- **WHEN** cover letter is generated
- **THEN** system suggests next step: "Generate CV: /write-cv (coming soon)"
### Requirement: Integration with Workflow
The system SHALL integrate seamlessly with existing application workflow.
#### Scenario: Workflow step documentation
- **WHEN** user checks workflow in CLAUDE.md
- **THEN** cover letter generation appears as Step 6 after validation
#### Scenario: Command availability
- **WHEN** user lists available commands
- **THEN** `/write-cover-letter` is documented with description and usage examples
#### Scenario: Consistent patterns
- **WHEN** using `/write-cover-letter`
- **THEN** location detection, error handling, and output format match patterns from other commands (/validate-application, /populate-application)
@@ -0,0 +1,315 @@
# Implementation Tasks
## 1. Design Cover Letter Structure
- [x] 1.1 Define standard cover letter sections and order
- [x] 1.2 Determine word count targets for each section
- [x] 1.3 Design template structure for German vs English letters
- [x] 1.4 Define tone variations (Formal/Balanced/Casual) and language patterns
- [x] 1.5 Create examples of good opening hooks, closing statements
## 2. Implement Location Detection
- [x] 2.1 Reuse location detection pattern from `/validate-application`
- Check current directory for application folder pattern
- Accept optional application name parameter
- Resolve parameter to full application path
- [x] 2.2 Handle missing or unclear location
- Show error message
- List available applications in `applications/pending/`
- Provide usage examples
- [x] 2.3 Verify application.md exists in target location
## 3. Implement Validation Gate
- [x] 3.1 Auto-run `/validate-application` before generation
- Execute validation command programmatically
- Capture validation result (pass/fail)
- Show validation progress: "🔍 Validating application..."
- [x] 3.2 Handle validation failure
- Stop generation if validation fails
- Show validation error details
- Suggest fixing issues or using `--skip-validation` flag
- [x] 3.3 Implement `--skip-validation` flag
- Parse flag from command arguments
- Skip validation check if flag present
- Show warning: "Skipping validation (not recommended)"
- [x] 3.4 Handle validation success
- Show success message: "✅ Application validation passed"
- Proceed to generation
## 4. Implement Existing File Check
- [x] 4.1 Check if `cover-letter.md` exists in application folder
- [x] 4.2 Handle existing file (stop generation)
- Show error: "Cover letter already exists"
- Suggest using `--force` flag to overwrite
- Include file path in error message
- [x] 4.3 Implement `--force` / `--overwrite` flag
- Parse flag from command arguments
- Skip existing file check if flag present
- Show warning: "Overwriting existing cover-letter.md"
- [x] 4.4 Proceed if no existing file
## 5. Implement Data Reading
- [x] 5.1 Read profile.md
- Check if profile.md exists
- Parse personal information section
- Parse professional summary
- Parse work experience entries
- Parse skills and achievements
- Parse projects section
- Handle missing or corrupted profile.md (error and stop)
- [x] 5.2 Read application.md
- Check if application.md exists
- Parse organization information (company name, location)
- Parse job information (job title, level)
- Parse job description summary (requirements, responsibilities)
- Parse match strategy section
- Parse key messages section
- Parse tone of voice section
- Parse research notes section
- Handle missing or corrupted application.md (error and stop)
- [x] 5.3 Cross-reference match strategy with profile
- Identify experiences to emphasize from match strategy
- Extract those specific experiences from profile.md
- Identify skills to highlight
- Identify projects to mention
## 6. Implement Tone and Language Detection
- [x] 6.1 Extract tone assessment from application.md
- Find "Tone of Voice" section
- Parse tone value (Formal/Balanced/Casual)
- Default to "Balanced" if not specified
- [x] 6.2 Infer language from context
- Check job posting language indicators
- Check company location (German companies likely want German)
- Check if application.md is written in German
- Default to English if unclear
- [x] 6.3 Define language-specific formatting
- German: "Sehr geehrte Damen und Herren" / "Mit freundlichen Grüßen"
- English: "Dear Hiring Manager" / "Sincerely"
- Date formats (DE: DD.MM.YYYY, EN: Month DD, YYYY)
## 7. Implement Content Generation
- [x] 7.1 Generate contact header
- Use applicant name, email, phone from profile.md
- Format address block
- Add date (current date)
- Add company address (from application.md)
- [x] 7.2 Generate salutation
- Use recruiter name if available in application.md
- Otherwise: "Dear Hiring Manager" (EN) or "Sehr geehrte Damen und Herren" (DE)
- [x] 7.3 Generate opening paragraph (50-70 words)
- Reference job title and company name
- State interest in the position
- Include one compelling hook (from key messages or research)
- Maintain appropriate tone
- [x] 7.4 Generate "why this role" paragraph (70-90 words)
- Reference company research insights
- Connect to company values or mission
- Show genuine interest based on key messages
- Reference company-specific news or initiatives if available
- [x] 7.5 Generate "what you bring" content (120-150 words, 1-2 paragraphs)
- Highlight 2-3 experiences from match strategy
- Use specific achievements from profile.md
- Connect experiences to job requirements
- Incorporate keywords naturally
- Use quantifiable results when available
- [x] 7.6 Generate cultural fit paragraph (50-70 words)
- Reference company culture insights from research notes
- Align personal values with company values
- Mention relevant soft skills
- Show enthusiasm for work environment
- [x] 7.7 Generate closing paragraph (40-50 words)
- Strong statement of interest
- Availability for interview/discussion
- Thank hiring manager
- Professional call to action
- [x] 7.8 Generate sign-off
- Use appropriate closing based on language and tone
- Include applicant name from profile.md
## 8. Implement Quality Checks
- [x] 8.1 Verify word count (target: 300-400 words)
- Count words in generated content
- Adjust if too short (<280) or too long (>420)
- [x] 8.2 Verify factual accuracy
- Ensure all experiences mentioned exist in profile.md
- Ensure all company information matches application.md
- No hallucinated facts or achievements
- [x] 8.3 Verify tone consistency
- Check language matches tone assessment
- Formal: professional vocabulary, traditional structure
- Balanced: mix of professional and approachable
- Casual: conversational but still professional
- [x] 8.4 Verify keyword incorporation
- Check that key job requirements are mentioned
- Ensure keywords flow naturally (not listed)
- [x] 8.5 Verify personalization
- Check company-specific references are included
- Verify it doesn't sound generic
## 9. Implement File Writing
- [x] 9.1 Format cover letter as markdown
- Use proper heading hierarchy
- Format contact information block
- Format body paragraphs with spacing
- Include metadata comment (generated date, sources)
- [x] 9.2 Write to cover-letter.md in application folder
- Create file with proper path
- Handle write permissions errors
- Verify file was written successfully
- [x] 9.3 Add metadata comment at top
- Include generation date/time
- Note sources used (profile.md, application.md)
- Include word count
- Note tone and language used
## 10. Implement Progress Reporting
- [x] 10.1 Show validation progress
- Display: "🔍 Validating application..."
- Show validation result
- [x] 10.2 Show generation progress
- Display: "📝 Generating cover letter..."
- Show steps: "✓ Read profile.md", "✓ Read application.md", etc.
- [x] 10.3 Show completion status
- Display: "✓ Analyzed match strategy ([N] key experiences identified)"
- Display: "✓ Incorporated key messages"
- Display: "✓ Applied tone: [tone]"
- Display: "✓ Language: [language]"
- Display: "✓ Generated [N] words (target: 300-400)"
## 11. Implement Success Output
- [x] 11.1 Design success message format
- ✅ emoji and title
- Summary of generation (word count, tone, language, experiences used)
- File location
- Next steps
- [x] 11.2 Generate detailed summary
- Word count achieved
- Tone applied
- Language used
- Number of experiences highlighted
- Number of key messages incorporated
- [x] 11.3 Provide next steps
- Suggest reviewing cover-letter.md
- Suggest personalizing with additional insights
- Suggest next command (generate CV when available)
## 12. Implement Error Handling
- [x] 12.1 Handle missing profile.md
- Show error: "profile.md not found"
- Suggest running /validate-profile first
- Stop generation
- [x] 12.2 Handle missing application.md
- Show error: "No application.md found"
- Suggest creating application with /new-application
- Stop generation
- [x] 12.3 Handle validation failure
- Show validation errors
- Stop generation unless --skip-validation
- Provide guidance on fixing issues
- [x] 12.4 Handle existing cover-letter.md
- Show error with file path
- Suggest --force flag to overwrite
- Stop generation unless --force provided
- [x] 12.5 Handle file write errors
- Show clear error message with reason
- Suggest checking permissions or disk space
- [x] 12.6 Handle corrupted data files
- Catch parsing errors
- Show helpful error message
- Identify which file is corrupted
## 13. Implement Command Flags
- [x] 13.1 Parse --skip-validation flag
- Check command arguments for flag
- Set validation skip flag if present
- [x] 13.2 Parse --force / --overwrite flag
- Check command arguments for flag
- Set overwrite flag if present
- [x] 13.3 Parse --help flag
- Check for --help flag
- Show usage information, available flags, examples
- Exit without generating
- [x] 13.4 Handle combined flags
- Support multiple flags in single command
- Process each flag appropriately
## 14. Create Slash Command File
- [x] 14.1 Create `src/.claude/commands/write-cover-letter.md`
- [x] 14.2 Document location detection logic
- [x] 14.3 Document validation gate behavior
- [x] 14.4 Document existing file check
- [x] 14.5 Document data reading from profile.md and application.md
- [x] 14.6 Document content generation strategy
- Opening paragraph structure
- Why this role paragraph
- What you bring paragraphs
- Cultural fit paragraph
- Closing paragraph
- [x] 14.7 Document tone and language handling
- [x] 14.8 Document word count targets and quality checks
- [x] 14.9 Document available flags (--skip-validation, --force, --help)
- [x] 14.10 Include output format examples (success, errors)
- [x] 14.11 Document edge cases and error handling
## 15. Update Framework Documentation
- [x] 15.1 Update `src/CLAUDE.md` - Add `/write-cover-letter` to Available Commands
- [x] 15.2 Update workflow section
- Change Step 6 from "Content Generation (FUTURE)" to actual cover letter generation
- Add detailed workflow step for cover letter generation
- [x] 15.3 Add usage examples
- Generate from current directory
- Generate with application parameter
- Using flags (--skip-validation, --force)
- [x] 15.4 Update "Document Standards" section
- Add cover letter standards (structure, length, tone)
- [x] 15.5 Add example interaction showing cover letter generation
## 16. Integration and Testing
- [x] 16.1 Test from inside application folder (no parameter)
- [x] 16.2 Test with application name parameter
- [x] 16.3 Test from wrong location (should list applications)
- [x] 16.4 Test automatic validation (passing)
- [x] 16.5 Test automatic validation (failing) - should stop
- [x] 16.6 Test --skip-validation flag
- [x] 16.7 Test existing cover-letter.md (should stop)
- [x] 16.8 Test --force flag to overwrite
- [x] 16.9 Test with complete application (should generate successfully)
- [x] 16.10 Test tone variations (Formal, Balanced, Casual)
- [x] 16.11 Test language detection (German vs English)
- [x] 16.12 Test word count (should be 300-400 words)
- [x] 16.13 Test personalization (company-specific references)
- [x] 16.14 Test factual accuracy (only uses profile.md info)
- [x] 16.15 Test missing profile.md
- [x] 16.16 Test missing application.md
- [x] 16.17 Validate proposal: `openspec validate add-cover-letter-generation --strict`
## 17. Update Test Environment
- [x] 17.1 Copy new `/write-cover-letter` command to test directory
- [x] 17.2 Update `CLAUDE.md` in test directory
- [x] 17.3 Preserve test directory's `profile.md` and `applications/` folder
- [x] 17.4 Test in actual test environment with real application
## 18. Git Workflow
- [x] 18.1 Verify all changes are on feature branch `feature/cover-letter-generation`
- [x] 18.2 Stage all files (OpenSpec proposal, slash command, documentation updates)
- [x] 18.3 Create descriptive commit message following conventional commits format
- [x] 18.4 Merge feature branch into main
- [x] 18.5 Verify final state
+705
View File
@@ -0,0 +1,705 @@
Generate a tailored cover letter based on application strategy and profile information.
# Instructions
You are generating a professional cover letter for a job application. This letter must be authentic, well-structured, and personalized based on the applicant's profile and application strategy.
## Step 1: Parse Command Arguments
Check for optional flags and parameters:
**Flags:**
- `--skip-validation`: Skip automatic validation check
- `--force` or `--overwrite`: Overwrite existing cover-letter.md if it exists
- `--help`: Show usage information and exit
**Parameter:**
- Application folder name (optional): e.g., `2025-11-02-TechCorp-Developer`
If `--help` flag is present, show usage and exit:
```
Usage: /write-cover-letter [application-name] [flags]
Generates a tailored cover letter for a job application.
Options:
[application-name] Optional. Name of application folder.
If omitted, uses current directory.
--skip-validation Skip automatic validation check (not recommended)
--force, --overwrite Overwrite existing cover-letter.md
--help Show this help message
Examples:
/write-cover-letter
/write-cover-letter 2025-11-02-TechCorp-Developer
/write-cover-letter --force
/write-cover-letter --skip-validation --force
The command will:
1. Validate the application (unless --skip-validation)
2. Check if cover letter already exists (unless --force)
3. Read profile.md and application.md
4. Generate a tailored 300-400 word cover letter
5. Save to cover-letter.md in the application folder
```
## Step 2: Location Detection
### Determine Target Application
**If NO parameter provided:**
1. Check current working directory
2. Verify if inside an application folder:
- Path pattern: ends with `applications/pending/[folder-name]/`
- File existence: `application.md` exists in current directory
3. If yes → use this application
4. If no → show error with available applications
**If parameter PROVIDED:**
1. Resolve to application folder: `applications/pending/[folder-name]/`
2. Check if `application.md` exists in that location
3. If yes → use that application
4. If no → show error with available applications
### Error: Location Unclear
```
❌ Not in an application folder
Please either:
1. Navigate to an application folder:
cd applications/pending/[application-folder]/
/write-cover-letter
2. Or provide the application folder name:
/write-cover-letter [application-folder-name]
Available applications:
[List output of: ls applications/pending/]
Example:
/write-cover-letter 2025-11-02-TechCorp-Developer
```
### Error: Application Not Found
```
❌ Application not found: [provided-name]
Available applications:
[List output of: ls applications/pending/]
```
## Step 3: Automatic Validation Check
**Unless `--skip-validation` flag is present**, run validation before generating.
### Run Validation
1. Show progress: `🔍 Validating application...`
2. Execute `/validate-application` for the target application
3. Capture result (pass/fail)
### Handle Validation Result
**If validation PASSES:**
```
✅ Application validation passed
```
Proceed to Step 4.
**If validation FAILS:**
```
❌ Application validation failed
Your application has incomplete sections. Please fix these issues first:
[Show validation error details]
Options:
1. Fix the issues in application.md and try again
2. Run /validate-application for full details
3. Use --skip-validation to proceed anyway (not recommended)
Example:
/write-cover-letter --skip-validation
```
STOP. Do not generate cover letter.
### Skip Validation Warning
**If `--skip-validation` flag is present:**
```
⚠️ Skipping validation check (not recommended)
Proceeding with cover letter generation. The application may have incomplete sections.
```
Proceed to Step 4.
## Step 4: Check for Existing Cover Letter
Check if `cover-letter.md` exists in the application folder.
### If File Exists (and --force NOT present)
```
❌ Cover letter already exists
File: [path-to-cover-letter.md]
To regenerate, use:
/write-cover-letter --force
⚠️ Warning: This will overwrite your existing cover letter.
If you've made manual edits, they will be lost.
```
STOP. Do not overwrite.
### If File Exists (and --force IS present)
```
⚠️ Overwriting existing cover letter
File: [path-to-cover-letter.md]
Your previous cover letter will be replaced.
```
Proceed to Step 5.
### If File Does Not Exist
Proceed to Step 5 (no message needed).
## Step 5: Read Data Sources
Show progress: `📝 Generating cover letter...`
### Read profile.md
1. Check if `profile.md` exists in framework root
2. Read entire file
3. Parse and extract:
- **Personal Information**: Full name, email, phone, location, address
- **Professional Summary**: For potential reference
- **Work Experience**: All entries (job titles, companies, dates, responsibilities, achievements)
- **Skills**: Technical and soft skills
- **Projects**: Notable projects
- **Education**: Degrees and certifications
**If profile.md is missing or unreadable:**
```
❌ Profile not found
Could not read profile.md. Please create and validate your profile first.
Steps:
1. Fill out profile.md with your information
2. Run /validate-profile to check completeness
3. Try /write-cover-letter again
```
STOP.
Show progress: `✓ Read profile.md (applicant background)`
### Read application.md
1. Check if `application.md` exists in application folder
2. Read entire file
3. Parse and extract:
- **Metadata**: Application status, deadlines
- **Organization Information**: Company name, industry, location, website, contact person name
- **Job Information**: Job title, level, department, employment type, remote status
- **Job Description Summary**: Responsibilities, required skills, preferred skills, keywords
- **Research Notes**: Company culture, values, recent news, competitive landscape
- **Match Strategy**: Experiences to emphasize, skills to highlight, projects to mention, gaps and how to address
- **Key Messages**: Main points to convey (usually 3-5 bullet points)
- **Tone of Voice**: Tone assessment (Formal/Balanced/Casual) and reasoning
**If application.md is missing or unreadable:**
```
❌ Application not found
Could not read application.md in [path].
This doesn't appear to be a valid application folder.
Did you create this application with /new-application?
```
STOP.
Show progress: `✓ Read application.md (job strategy)`
### Cross-Reference Match Strategy
1. Identify which specific experiences from profile.md are mentioned in Match Strategy section
2. Extract those full experience entries from profile.md
3. Identify which skills to emphasize
4. Identify which projects to mention
5. Note any gaps mentioned and how to address them
Show progress: `✓ Analyzed match strategy ([N] key experiences identified)`
## Step 6: Determine Language and Tone
### Detect Language
Check these indicators in order:
1. **Job posting language** (if job description in input/ was in German)
2. **Company location** (if Germany/Austria/Switzerland → likely German)
3. **Application.md language** (if written in German → use German)
4. **Default**: English if unclear
### Extract Tone
From application.md "Tone of Voice" section:
- Look for: "Formal", "Balanced", or "Casual"
- Default to "Balanced" if not specified
Show progress: `✓ Applied tone: [Formal/Balanced/Casual]`
Show progress: `✓ Language: [German/English]`
## Step 7: Generate Cover Letter Content
Generate a professional cover letter with the following structure. Target: **300-400 words total**.
### Structure Overview
1. Contact Header (applicant + company addresses, date)
2. Salutation
3. Opening Paragraph (50-70 words)
4. Why This Role Paragraph (70-90 words)
5. What You Bring (120-150 words, split into 1-2 paragraphs)
6. Cultural Fit Paragraph (50-70 words)
7. Closing Paragraph (40-50 words)
8. Sign-off
---
### Contact Header
**Format for German:**
```
[Applicant Full Name]
[Applicant Street Address]
[Applicant ZIP] [Applicant City]
[Applicant Email] | [Applicant Phone]
[Current Date in DD.MM.YYYY format]
[Company Name]
[Contact Person Name if available, otherwise "Personalabteilung"]
[Company Street Address if available]
[Company ZIP] [Company City]
```
**Format for English:**
```
[Applicant Full Name]
[Applicant Street Address]
[Applicant City], [State/Country] [ZIP]
[Applicant Email] | [Applicant Phone]
[Current Date in Month DD, YYYY format]
[Hiring Manager Name if available]
[Company Name]
[Company Street Address if available]
[Company City], [State/Country] [ZIP]
```
Use information from profile.md and application.md. If address details are missing, use what's available (at minimum: name, email, phone).
---
### Salutation
**If contact person name is available in application.md:**
- German: `Sehr geehrte/r [Herr/Frau] [Last Name],` or `Liebe/r [First Name],` (Casual tone only)
- English: `Dear [Mr./Ms./Dr.] [Last Name],` or `Dear [First Name],` (Casual tone only)
**If no contact person:**
- German: `Sehr geehrte Damen und Herren,`
- English: `Dear Hiring Manager,`
---
### Opening Paragraph (50-70 words)
**Purpose**: Hook the reader, state the position, show genuine interest.
**Elements to include:**
1. Reference to the specific job title
2. Reference to company name
3. Brief statement of interest
4. One compelling hook from:
- Key messages (why you're excited about this role)
- Research notes (something specific about the company)
- Relevant achievement that positions you well
**Tone guidance:**
- **Formal**: Professional, respectful, traditional
- **Balanced**: Professional but warm, approachable
- **Casual**: Conversational, enthusiastic, personal
**Example (Balanced, English):**
> I am writing to express my strong interest in the Senior Software Engineer position at TechCorp. With over eight years of experience in scalable backend development and a passion for building robust distributed systems, I am excited about the opportunity to contribute to your team's mission of revolutionizing cloud infrastructure for enterprise clients.
**Example (Formal, German):**
> Mit großem Interesse habe ich Ihre Stellenausschreibung für die Position als Senior Software Engineer bei TechCorp gelesen. Mit über acht Jahren Erfahrung in der Entwicklung skalierbarer Backend-Systeme und einer ausgeprägten Begeisterung für robuste verteilte Architekturen möchte ich mich bei Ihnen bewerben und zum Erfolg Ihres Teams beitragen.
---
### Why This Role Paragraph (70-90 words)
**Purpose**: Show you've researched the company and explain why this specific role/company appeals to you.
**Elements to include:**
1. Reference to company research (values, mission, recent news, products)
2. Connection between your interests/values and the company's
3. Specific reasons you're drawn to this role (not just any job)
4. Demonstrate understanding of the company's work and challenges
**Sources:**
- Research Notes section from application.md
- Key Messages section
- Company culture insights
**Example (Balanced, English):**
> What particularly draws me to TechCorp is your commitment to open-source contributions and your recent launch of the CloudScale platform. I've followed your engineering blog for over a year and am impressed by your team's innovative approaches to solving complex distributed systems challenges. The opportunity to work on infrastructure that directly impacts thousands of enterprise customers aligns perfectly with my career goals and passion for meaningful, large-scale technical work.
---
### What You Bring Paragraphs (120-150 words total, 1-2 paragraphs)
**Purpose**: Demonstrate you're qualified by highlighting relevant experiences, skills, and achievements.
**Elements to include:**
1. 2-3 specific experiences from Match Strategy
2. Concrete achievements with quantifiable results (from profile.md)
3. Relevant skills that match job requirements
4. Natural incorporation of keywords from job description
5. Connection between your experience and their needs
6. Mention of 1-2 relevant projects if applicable
**Structure:**
- If 2 experiences: One paragraph covering both
- If 3 experiences: Split into 2 paragraphs (2 experiences in first, 1 in second)
**Sources:**
- Match Strategy section (which experiences to emphasize)
- Profile.md work experience and projects
- Job Description Summary (requirements to address)
**Important:**
- Use ONLY real experiences and achievements from profile.md
- Include specific metrics when available (e.g., "reduced latency by 40%", "managed team of 5")
- Don't list skills demonstrate them through experiences
- Make clear connections to job requirements
**Example (Balanced, English, 2 experiences):**
> In my current role as Lead Backend Engineer at DataFlow Systems, I architected and led the development of a microservices platform handling over 10 million requests per day, reducing system latency by 45% while improving reliability to 99.95% uptime. I've extensive experience with the technologies mentioned in your job posting, including Kubernetes, Go, and PostgreSQL, having used them to build production systems serving enterprise clients across multiple regions.
> Previously at CloudNet Solutions, I designed and implemented a distributed caching layer that decreased API response times by 60% and reduced infrastructure costs by $50,000 annually. I also mentored a team of three junior engineers, fostering a culture of code quality and continuous learning. These experiences have prepared me well for the technical challenges and leadership opportunities inherent in this role at TechCorp.
---
### Cultural Fit Paragraph (50-70 words)
**Purpose**: Show you'd be a good culture match and would thrive in their environment.
**Elements to include:**
1. Reference to company culture insights from Research Notes
2. Alignment of personal values with company values
3. Relevant soft skills that match company culture indicators
4. Enthusiasm for the work environment, team, or company approach
5. Mention of collaboration style if company emphasizes teamwork
**Sources:**
- Research Notes (company culture observations)
- Company values mentioned in job description
- Your soft skills from profile.md
**Example (Balanced, English):**
> I'm particularly excited about TechCorp's emphasis on collaborative problem-solving and continuous learning. Your company's commitment to innovation, combined with a supportive team environment where engineers are encouraged to experiment and share knowledge, resonates strongly with my own values. I thrive in environments that balance technical excellence with strong team dynamics, and I look forward to contributing not just code, but also ideas and mentorship to your engineering culture.
---
### Closing Paragraph (40-50 words)
**Purpose**: Strong finish with call to action and expression of enthusiasm.
**Elements to include:**
1. Reiterate strong interest in the position
2. State availability for interview/discussion
3. Thank the hiring manager
4. Professional call to action
**Tone guidance:**
- **Formal**: Respectful, measured enthusiasm
- **Balanced**: Warm confidence
- **Casual**: Eager but professional
**Example (Balanced, English):**
> I would welcome the opportunity to discuss how my experience in scalable backend systems and distributed architectures can contribute to TechCorp's continued success. I am available for an interview at your convenience and look forward to learning more about this exciting opportunity. Thank you for considering my application.
**Example (Formal, German):**
> Über die Möglichkeit eines persönlichen Gesprächs würde ich mich sehr freuen. Gerne stehe ich Ihnen für ein Interview zur Verfügung und freue mich darauf, mehr über diese spannende Position zu erfahren. Für Ihre Aufmerksamkeit und Ihr Interesse an meiner Bewerbung danke ich Ihnen herzlich.
---
### Sign-off
**German:**
- Formal: `Mit freundlichen Grüßen,`
- Balanced: `Mit freundlichen Grüßen,`
- Casual: `Herzliche Grüße,` or `Viele Grüße,`
**English:**
- Formal: `Sincerely,` or `Respectfully,`
- Balanced: `Sincerely,` or `Best regards,`
- Casual: `Best regards,` or `Warm regards,`
Follow with applicant's full name from profile.md.
---
## Step 8: Quality Checks
Before writing the file, verify:
### Word Count Check
- Count total words in body (excluding header and sign-off)
- Target: 300-400 words
- If < 280 words: Too short, add more detail to experiences or cultural fit
- If > 420 words: Too long, tighten prose and remove redundancy
Show progress: `✓ Generated [N] words (target: 300-400)`
### Factual Accuracy Check
- Every experience mentioned must exist in profile.md
- Every achievement must be from profile.md (no hallucinations)
- Company information must match application.md
- Job title and company name must be correct
### Tone Consistency Check
- Language level matches tone (Formal = elevated, Balanced = professional, Casual = conversational)
- Sentence structure matches tone (Formal = complex, Balanced = varied, Casual = simpler)
- Vocabulary matches tone
### Personalization Check
- At least 2 company-specific references (research, values, products, news)
- Keywords from job description incorporated naturally
- Connection to match strategy is clear
### Authenticity Check
- Sounds human, not AI-generated
- Natural flow between paragraphs
- Specific rather than generic
- Shows genuine enthusiasm
## Step 9: Format and Write File
### Format as Markdown
```markdown
<!--
Cover Letter
Generated: [YYYY-MM-DD HH:MM]
Sources: profile.md, application.md
Word count: [N] words
Tone: [Formal/Balanced/Casual]
Language: [German/English]
-->
[Applicant Full Name]
[Applicant Address Block]
[Applicant Email] | [Applicant Phone]
[Date]
[Company Name]
[Contact Person / Hiring Manager]
[Company Address if available]
[Salutation]
[Opening Paragraph]
[Why This Role Paragraph]
[What You Bring Paragraph 1]
[What You Bring Paragraph 2 if applicable]
[Cultural Fit Paragraph]
[Closing Paragraph]
[Sign-off]
[Applicant Full Name]
```
### Write to File
1. Write content to `cover-letter.md` in the application folder
2. Handle write errors gracefully:
- Permission denied: "Could not save cover-letter.md. Check write permissions."
- Disk full: "Could not save cover-letter.md. Check available disk space."
- Other errors: "Could not save cover-letter.md: [error details]"
## Step 10: Success Output
Display success message:
```
✅ Cover letter saved: cover-letter.md
## Generation Summary:
📊 Statistics:
- Word count: [N] words
- Tone: [Formal/Balanced/Casual]
- Language: [German/English]
- Experiences highlighted: [N]
- Key messages incorporated: [N]
📍 Location:
[full or relative path to cover-letter.md]
## Content Included:
✓ Personalized opening with company-specific hook
✓ Research-backed explanation of interest in role
✓ [List 2-3 key experiences emphasized, e.g.:]
- Lead Backend Engineer role at DataFlow Systems
- Distributed caching project at CloudNet Solutions
✓ Cultural fit based on company values
✓ Professional closing with call to action
## Next Steps:
1. **Review cover-letter.md**:
Open and read the generated letter carefully. Check for:
- Factual accuracy (names, dates, achievements)
- Natural tone and flow
- Authentic representation of your interest
2. **Personalize further** (recommended):
Add any additional personal connections:
- Specific conversations with employees
- Personal anecdotes relevant to the role
- Unique insights about the company
3. **Generate CV** (coming soon):
/write-cv
4. **Proofread before sending**:
- Check for typos or grammar issues
- Ensure company name and job title are correct
- Verify contact information is up to date
---
**Tip**: This cover letter was generated based on your application strategy.
The more detailed your application.md (especially Match Strategy and Key Messages),
the more personalized and compelling your cover letter will be.
```
## Error Handling Reference
### Missing profile.md
```
❌ Profile not found
Could not read profile.md. Please create and validate your profile first.
Steps:
1. Fill out profile.md with your information
2. Run /validate-profile to check completeness
3. Try /write-cover-letter again
```
### Missing application.md
```
❌ Application not found
Could not read application.md in [path].
This doesn't appear to be a valid application folder.
Did you create this application with /new-application?
```
### Validation Failed (no --skip-validation)
```
❌ Application validation failed
[Validation error details]
Options:
1. Fix issues in application.md
2. Run /validate-application for full details
3. Use --skip-validation to proceed (not recommended)
```
### Cover Letter Exists (no --force)
```
❌ Cover letter already exists
File: [path]
Use --force to overwrite:
/write-cover-letter --force
⚠️ This will replace your existing cover letter.
```
### File Write Error
```
❌ Could not save cover letter
Error: [specific error message]
Possible causes:
- Insufficient write permissions
- Disk space full
- Path too long
Please check the issue and try again.
```
## Important Notes
### Authenticity is Critical
- Use ONLY information from profile.md (no fabrication)
- Keep experiences and achievements factual
- If profile.md lacks information for a job requirement, acknowledge the gap or focus on related transferable skills
- Better to be honest about limitations than to invent experience
### Personalization Matters
- Generic cover letters are obvious and ineffective
- Leverage research notes from application.md to make company-specific references
- Connect applicant's genuine interests (from key messages) to the role
- Show real understanding of the company and position
### Tone Appropriateness
- Formal: Traditional companies, conservative industries, senior positions, German Mittelstand
- Balanced: Most tech companies, modern corporations, professional services
- Casual: Startups, creative agencies, developer-focused roles, flat hierarchies
- When in doubt, err on the side of "Balanced"
### Quality Over Speed
- Take time to craft well-structured paragraphs
- Ensure smooth transitions between sections
- Avoid repetition and clichés
- Make every sentence count toward the 300-400 word target
### The Cover Letter's Role
- Complements the CV by adding personality and narrative
- Explains the "why" behind the "what" on the CV
- Demonstrates written communication skills
- Shows genuine interest and research effort
- Provides context for career transitions or gaps
---
**Remember**: This cover letter represents the applicant in their first impression.
Quality, authenticity, and personalization are paramount.
+75 -15
View File
@@ -194,14 +194,34 @@ When helping with job applications, follow this comprehensive workflow:
- Get warnings if input/ folder is empty or application seems unpopulated
- **Must pass before document generation**
### 6. Content Generation (FUTURE)
- Generate CV/cover letter/email based on `application.md` strategy
- Emphasize relevant experience from `profile.md`
- Incorporate keywords from the job description naturally
- Maintain factual accuracy - use only verified information from `profile.md`
- **Note**: Document generation will be implemented in a future update
### 6. Generate Cover Letter
- Run `/write-cover-letter` to generate a tailored cover letter
- System automatically validates application first (stops if incomplete)
- Checks if cover-letter.md already exists (prevents overwriting)
- Generates 300-400 word cover letter using:
- Profile.md for applicant background and achievements
- Application.md for job strategy, key messages, and tone
- Standard structure: Opening → Why this role → What you bring → Cultural fit → Closing
- Applies appropriate tone (Formal/Balanced/Casual) from application.md
- Saves to `cover-letter.md` in application folder
- Flags available: `--skip-validation`, `--force` (overwrite existing)
### 7. Quality Assurance
### 7. Review and Refine Cover Letter
- Read generated cover-letter.md carefully
- Verify factual accuracy (names, dates, achievements)
- Add personal touches or additional insights
- Ensure authentic voice and genuine enthusiasm
- Proofread for typos and flow
### 8. Generate CV (FUTURE)
- Generate tailored CV based on application.md strategy (coming soon)
- Emphasize relevant experience from profile.md
- Incorporate keywords naturally
### 9. Generate Application Email (FUTURE)
- Create professional application email (coming soon)
### 10. Quality Assurance
- Verify all company names, dates, and facts are correct
- Ensure consistency between all documents (CV ↔ cover letter ↔ email)
- Check that tone matches the target company culture
@@ -216,12 +236,22 @@ When helping with job applications, follow this comprehensive workflow:
- Keep formatting simple and ATS-friendly
- Use quantifiable achievements when available
### Cover Letter
- Structure: Opening → Why this role → What you bring → Cultural fit → Closing
- Length: Aim for 1 page (3-4 paragraphs)
- Tone: Match company culture (formal/balanced/casual)
- Personalize: Reference specific aspects of the job/company
- Connect: Link applicant's experience to job requirements
### Cover Letter (Generated by `/write-cover-letter`)
- **Structure**: Opening → Why this role → What you bring → Cultural fit → Closing
- **Length**: 300-400 words (approximately 1 page)
- **Tone**: Applied from application.md tone assessment (Formal/Balanced/Casual)
- **Language**: Inferred from job posting context (German/English)
- **Content**:
- Use ONLY authentic information from profile.md (no fabrication)
- Incorporate 2-3 key experiences from match strategy
- Reference company research and culture insights from application.md
- Natural incorporation of keywords from job description
- Company-specific personalization (values, news, projects)
- **Quality checks**:
- Automatic validation before generation
- Protection against overwriting existing work
- Word count target enforcement (300-400 words)
- Factual accuracy verification
### Application Email
- Keep it short (3-4 sentences maximum)
@@ -263,6 +293,7 @@ Adjust recommendations based on the target market if the user specifies a differ
- `/new-application "Company - Job Title"` - Create a new application workspace with organized folder structure
- `/populate-application` - Analyze input documents and populate application.md with job info, research, and strategy
- `/validate-application [optional-app-name]` - Validate that application.md is complete before document generation
- `/write-cover-letter [optional-app-name] [--skip-validation] [--force]` - Generate a tailored cover letter based on application strategy
## Example Usage
@@ -277,8 +308,9 @@ Adjust recommendations based on the target market if the user specifies a differ
4. When user has added documents: "Navigate to the application folder and run `/populate-application`"
5. After population completes: "Review `application.md` to see the analysis and strategy"
6. Validation step: "Run `/validate-application` to ensure the application is complete"
7. If validation passes: Ready for document generation
8. Future: Generate tailored CV, cover letter, and email based on `application.md`
7. If validation passes: "Generate cover letter with `/write-cover-letter`"
8. After generation: "Review cover-letter.md and personalize as needed"
9. Future: Generate tailored CV and application email
### Example 2: Quick Document Request (Legacy Flow)
@@ -304,6 +336,34 @@ Adjust recommendations based on the target market if the user specifies a differ
4. If validation fails (❌): Show specific issues like "Organization Name: Contains placeholder '[To be filled]'" and suggest "Please update application.md or run `/populate-application` if you have documents in input/"
5. Provide clear next steps based on validation result
### Example 4: Generating a Cover Letter
**User**: "Generate cover letter for my TechCorp application"
**Claude Code should**:
1. If user is in application folder: Run `/write-cover-letter` (auto-detects location)
2. If user is elsewhere: Run `/write-cover-letter 2025-11-02-TechCorp-Software-Engineer`
3. System automatically validates application first:
- If validation fails: Stop and show errors, suggest fixing or using `--skip-validation`
- If validation passes: Proceed to generation
4. Check for existing cover-letter.md:
- If exists: Stop and suggest using `--force` flag to overwrite
- If doesn't exist: Proceed to generation
5. Generate cover letter:
- Read profile.md for applicant background
- Read application.md for job strategy and tone
- Generate 300-400 word tailored cover letter
- Save to cover-letter.md
6. Show success: "✅ Cover letter saved: cover-letter.md. Generated 376 words. Next: Review and personalize."
**User**: "Regenerate the cover letter with different approach"
**Claude Code should**:
1. Run `/write-cover-letter --force` to overwrite existing file
2. System warns: "⚠️ Overwriting existing cover letter"
3. Proceeds with generation
4. Suggests: "Review the new version and keep whichever you prefer"
## Updating the Profile
If you notice missing or outdated information during application preparation: