Merge branch 'feature/add-application-email'

This commit is contained in:
2025-11-03 16:58:55 +01:00
7 changed files with 1086 additions and 16 deletions
@@ -0,0 +1,28 @@
# Add Application Email Generation
## Why
Users need a simple, automated way to compose professional application emails with proper subject lines and document references. Manually crafting these emails for every application is time-consuming and error-prone.
## What Changes
- Add `/write-application-email` command that generates email content and subject line
- Command verifies required documents exist in `attachments/` folder before generation
- Email references CV, cover letter, and optionally certificates/diplomas
- Update `/new-application` command to create `attachments/` subfolder with `.keep` file
- Follow similar implementation pattern to `/write-cover-letter` command
## Impact
**Affected specs:**
- `application-email` (new capability)
- `application-management` (modification to folder structure)
**Affected code:**
- `src/.claude/commands/new-application.md` - Add attachments folder creation
- `src/.claude/commands/write-application-email.md` - New command file
- `src/.claude/templates/` - Potentially new email template (if needed)
**Out of scope:**
- Creating or generating documents (CV, certificates) - must exist beforehand
- Attachment handling beyond verification
@@ -0,0 +1,176 @@
# Application Email Generation Specification
## ADDED Requirements
### Requirement: Email Command Invocation
The system SHALL provide a `/write-application-email` command that generates professional application emails with subject lines based on application context and profile information.
#### Scenario: Command executed in application folder
- **WHEN** user runs `/write-application-email` while in an application folder
- **THEN** the system detects the current application automatically
- **AND** generates email based on that application's data
#### Scenario: Command executed with application name parameter
- **WHEN** user runs `/write-application-email [application-name]` from any location
- **THEN** the system locates the specified application folder
- **AND** generates email based on that application's data
#### Scenario: Command executed with --help flag
- **WHEN** user runs `/write-application-email --help`
- **THEN** the system displays usage information with examples
- **AND** does not generate any email
### Requirement: Document Verification
The system SHALL verify that all required documents exist in the `attachments/` folder before generating the application email.
#### Scenario: All required documents present
- **WHEN** CV and cover letter files exist in `attachments/` folder
- **THEN** the system proceeds with email generation
- **AND** includes references to these documents in the email body
#### Scenario: Required documents missing
- **WHEN** CV or cover letter files are missing from `attachments/` folder
- **THEN** the system displays a clear error message listing missing documents
- **AND** does not generate the email
- **AND** provides guidance on where to place documents
#### Scenario: Optional certificates present
- **WHEN** certificate or diploma files exist in `attachments/` folder
- **THEN** the system includes references to these documents in the email
- **AND** mentions them in the document list
### Requirement: Email Content Generation
The system SHALL generate email content with appropriate subject line, greeting, body, and closing based on application strategy and profile information.
#### Scenario: Subject line generation
- **WHEN** generating email for an application
- **THEN** the subject line includes job title and applicant name
- **AND** follows professional email conventions
- **AND** matches the target language (German/English)
#### Scenario: Email body with document references
- **WHEN** generating email body
- **THEN** the email includes a brief introduction
- **AND** explicitly references attached documents (CV, cover letter)
- **AND** mentions certificates/diplomas if present in attachments folder
- **AND** expresses interest in the position
- **AND** includes professional closing with contact information
#### Scenario: Tone adaptation
- **WHEN** application.md specifies tone (Formal/Balanced/Casual)
- **THEN** the email adopts the appropriate language level
- **AND** matches formality to company culture
### Requirement: Language Detection
The system SHALL detect and apply the appropriate language (German or English) for the email based on application context.
#### Scenario: German language application
- **WHEN** job posting or application context indicates German
- **THEN** the email is generated in German
- **AND** uses appropriate German business email conventions
- **AND** uses formal German addressing (Sie, Herr/Frau)
#### Scenario: English language application
- **WHEN** job posting or application context indicates English
- **THEN** the email is generated in English
- **AND** uses professional English business email conventions
### Requirement: File Management
The system SHALL save generated email content to a markdown file in the application folder and handle file conflicts appropriately.
#### Scenario: New email generation
- **WHEN** `application-email.md` does not exist in application folder
- **THEN** the system creates the file with generated content
- **AND** displays success message with file location
#### Scenario: Email already exists without force flag
- **WHEN** `application-email.md` already exists
- **AND** user did not provide `--force` flag
- **THEN** the system displays error message
- **AND** does not overwrite existing file
- **AND** suggests using `--force` flag to overwrite
#### Scenario: Email overwrite with force flag
- **WHEN** `application-email.md` already exists
- **AND** user provides `--force` or `--overwrite` flag
- **THEN** the system overwrites the existing file
- **AND** displays warning about overwriting
- **AND** creates new email with generated content
### Requirement: Error Handling
The system SHALL provide clear, actionable error messages when email generation cannot proceed.
#### Scenario: Application folder not found
- **WHEN** specified application folder does not exist
- **THEN** the system displays error with list of available applications
- **AND** provides example command syntax
#### Scenario: Application data incomplete
- **WHEN** application.md is missing required fields
- **THEN** the system displays error indicating incomplete sections
- **AND** suggests running `/populate-application` or manual completion
#### Scenario: Profile data missing
- **WHEN** profile.md cannot be read or is incomplete
- **THEN** the system displays error message
- **AND** suggests running `/validate-profile`
- **AND** does not proceed with generation
### Requirement: Integration with Workflow
The system SHALL integrate seamlessly with existing application workflow commands and validation.
#### Scenario: Reads application strategy
- **WHEN** generating email
- **THEN** the system reads application.md for job details, company info, and tone
- **AND** reads profile.md for applicant contact information
- **AND** incorporates key messages from application strategy
#### Scenario: References cover letter context
- **WHEN** cover-letter.md exists in application folder
- **THEN** the system ensures email tone and messaging align with cover letter
- **AND** maintains consistency across all application documents
### Requirement: Output Format
The system SHALL generate email in markdown format with metadata and clear structure.
#### Scenario: Email file structure
- **WHEN** email is generated
- **THEN** the file includes metadata comment block (generation date, sources, language, tone)
- **AND** contains subject line as heading
- **AND** contains email body with proper paragraphs
- **AND** includes signature block with applicant information
#### Scenario: Email brevity
- **WHEN** generating email body
- **THEN** the content is concise (3-4 sentences maximum)
- **AND** mentions attached documents explicitly
- **AND** avoids redundancy with cover letter content
@@ -0,0 +1,63 @@
# Application Management Specification
## ADDED Requirements
### Requirement: Attachments Folder Creation
The system SHALL create an `attachments/` subfolder with a `.keep` file when initializing new applications to support document organization for email generation.
#### Scenario: Application folder creation includes attachments directory
- **WHEN** user runs `/new-application "Company - Job Title"`
- **THEN** the system creates folder structure: `applications/pending/[folder-name]/attachments/`
- **AND** creates an empty `.keep` file inside `attachments/` folder
- **AND** the attachments folder is ready for user to add documents
#### Scenario: Version control compatibility
- **WHEN** attachments folder is created with `.keep` file
- **THEN** the empty folder can be tracked in version control systems
- **AND** the folder structure is preserved even when empty
#### Scenario: Success message includes attachments folder
- **WHEN** new application is created successfully
- **THEN** the success message mentions the attachments folder
- **AND** provides guidance on what documents to place there
- **AND** indicates this folder is for CV, cover letter, certificates
### Requirement: Application Folder Structure
The system SHALL create a complete folder structure for each new application including metadata, input documents, and attachments.
#### Scenario: Complete folder structure created
- **WHEN** `/new-application` command is executed
- **THEN** the following structure is created:
```
applications/pending/[YYYY-MM-DD-Company-JobTitle]/
├── application.md
├── input/
└── attachments/
└── .keep
```
- **AND** application.md contains the template with metadata
- **AND** input/ folder is empty and ready for job posting documents
- **AND** attachments/ folder contains .keep file for version control
### Requirement: User Guidance for Attachments
The system SHALL provide clear guidance on the purpose and usage of the attachments folder.
#### Scenario: Attachments folder purpose explained
- **WHEN** new application is created
- **THEN** the success message explains attachments folder is for "final documents ready to send"
- **AND** distinguishes it from input/ folder (which is for "source materials and research")
- **AND** lists expected document types (CV, cover letter, certificates, diplomas)
#### Scenario: Workflow guidance includes attachments
- **WHEN** user views success message after creating application
- **THEN** the workflow guidance mentions adding documents to attachments/ after generation
- **AND** indicates attachments/ folder is checked by `/write-application-email` command
@@ -0,0 +1,58 @@
# Implementation Tasks
## 1. Update Application Folder Structure
- [ ] 1.1 Modify `src/.claude/commands/new-application.md` to create `attachments/` subfolder
- [ ] 1.2 Add creation of `.keep` file inside `attachments/` folder for version control
- [ ] 1.3 Update success message in new-application to mention attachments folder
- [ ] 1.4 Update test framework at `~/workspace/test-bewerbungen/` with new application structure
## 2. Create Email Generation Command
- [ ] 2.1 Create `src/.claude/commands/write-application-email.md` command file
- [ ] 2.2 Implement command argument parsing (application name, flags: --force, --help)
- [ ] 2.3 Implement location detection (current directory or parameter-based)
- [ ] 2.4 Add document verification logic (check for CV, cover letter, certificates in attachments/)
- [ ] 2.5 Implement email subject line generation based on job title and company
- [ ] 2.6 Implement email body generation with document references
- [ ] 2.7 Add language detection (German/English) similar to cover letter
- [ ] 2.8 Add tone adaptation (Formal/Balanced/Casual) from application.md
- [ ] 2.9 Implement file existence checks and user-friendly error messages
- [ ] 2.10 Write generated email to `application-email.md` in application folder
## 3. Testing & Quality Assurance
- [ ] 3.1 Test new-application creates attachments folder correctly
- [ ] 3.2 Test write-application-email with all required documents present
- [ ] 3.3 Test write-application-email with missing documents (error handling)
- [ ] 3.4 Test --force flag to overwrite existing email
- [ ] 3.5 Test language detection (German/English)
- [ ] 3.6 Test tone variations (Formal/Balanced/Casual)
- [ ] 3.7 Verify error messages are clear and actionable
## 4. Documentation
- [ ] 4.1 Update main CLAUDE.md with write-application-email command reference
- [ ] 4.2 Add email generation step to workflow documentation
- [ ] 4.3 Update example usage sections with email generation examples
- [ ] 4.4 Document attachments folder structure and purpose
## 5. Integration
- [ ] 5.1 Ensure email command integrates with existing validation workflow
- [ ] 5.2 Verify consistency with write-cover-letter command pattern
- [ ] 5.3 Test end-to-end workflow: new-application → populate → validate → cover-letter → email
## Dependencies
- Tasks 2.x depend on 1.x (attachments folder must exist)
- Tasks 3.x depend on 1.x and 2.x (implementation must be complete)
- Tasks 5.x depend on all previous tasks
## Verification Criteria
Each task is considered complete when:
- Code is written and tested
- Error cases are handled gracefully
- User-facing messages are clear and helpful
- Functionality matches specification
+26 -6
View File
@@ -63,13 +63,17 @@ Create the following structure in `applications/pending/`:
```
applications/pending/[generated-folder-name]/
├── application.md
── input/
── input/
└── attachments/
└── .keep
```
Use these steps:
1. Create the application folder: `applications/pending/[generated-folder-name]/`
2. Create the `input/` subfolder inside it
3. Create `application.md` from the template
3. Create the `attachments/` subfolder inside it
4. Create an empty `.keep` file inside `attachments/` folder for version control
5. Create `application.md` from the template
### 5. Create application.md
@@ -111,7 +115,19 @@ After successfully creating the application, provide this output:
- Company research notes
- Any other relevant context
2. **Populate the application**:
2. **Prepare attachments folder** (for later use):
```
applications/pending/[folder-name]/attachments/
```
This folder is for final documents ready to send:
- CV/Resume (PDF)
- Cover letter (PDF)
- Certificates and diplomas (PDF)
Note: Documents will be generated first, then you add them here before creating the application email.
3. **Populate the application**:
Once you've added your documents, run:
```
/populate-application
@@ -122,11 +138,15 @@ After successfully creating the application, provide this output:
- Match strategy (your relevant skills/experience)
- Suggested tone and key messages
3. **Review and refine**:
4. **Review and refine**:
After population, review `application.md` and add your own insights.
4. **Generate documents** (coming soon):
Use the populated application to generate tailored CV, cover letter, and email.
5. **Generate documents**:
Use the populated application to generate tailored cover letter and email:
```
/write-cover-letter
/write-application-email
```
---
@@ -0,0 +1,648 @@
Generate a professional application email with subject line and document references.
# Instructions
You are generating a professional application email for a job application. This email must be brief, professional, and include proper references to attached documents.
## Step 1: Parse Command Arguments
Check for optional flags and parameters:
**Flags:**
- `--skip-validation`: Skip automatic validation check
- `--force` or `--overwrite`: Overwrite existing application-email.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-application-email [application-name] [flags]
Generates a professional application email with document references.
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 application-email.md
--help Show this help message
Examples:
/write-application-email
/write-application-email 2025-11-02-TechCorp-Developer
/write-application-email --force
/write-application-email --skip-validation --force
The command will:
1. Validate the application (unless --skip-validation)
2. Check if email already exists (unless --force)
3. Verify required documents exist in attachments/ folder
4. Read profile.md and application.md
5. Generate a brief professional email with subject line
6. Save to application-email.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-application-email
2. Or provide the application folder name:
/write-application-email [application-folder-name]
Available applications:
[List output of: ls applications/pending/]
Example:
/write-application-email 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-application-email --skip-validation
```
STOP. Do not generate email.
### Skip Validation Warning
**If `--skip-validation` flag is present:**
```
⚠️ Skipping validation check (not recommended)
Proceeding with email generation. The application may have incomplete sections.
```
Proceed to Step 4.
## Step 4: Check for Existing Email
Check if `application-email.md` exists in the application folder.
### If File Exists (and --force NOT present)
```
❌ Application email already exists
File: [path-to-application-email.md]
To regenerate, use:
/write-application-email --force
⚠️ Warning: This will overwrite your existing email.
If you've made manual edits, they will be lost.
```
STOP. Do not overwrite.
### If File Exists (and --force IS present)
```
⚠️ Overwriting existing application email
File: [path-to-application-email.md]
Your previous email will be replaced.
```
Proceed to Step 5.
### If File Does Not Exist
Proceed to Step 5 (no message needed).
## Step 5: Verify Documents in Attachments Folder
**CRITICAL**: The email will reference attached documents. Verify they exist in the `attachments/` folder.
Show progress: `📎 Verifying attachments...`
### Check Attachments Folder
1. Verify `attachments/` folder exists in application directory
2. List all files in `attachments/` folder (excluding `.keep`)
3. Categorize files by type:
- **CV/Resume**: Files containing "cv", "resume", "lebenslauf" in filename (case-insensitive)
- **Cover Letter**: Files containing "cover", "letter", "anschreiben", "motivationsschreiben" in filename (case-insensitive)
- **Certificates**: Files containing "certificate", "diploma", "zeugnis", "zertifikat" in filename (case-insensitive)
- **Other**: Any other PDF or document files
### Required Documents Check
**Minimum requirements:**
- At least one CV/Resume file
- At least one Cover Letter file
**If attachments/ folder doesn't exist:**
```
❌ Attachments folder not found
The attachments/ folder is missing. This might be an old application.
To fix:
1. Create the folder: mkdir attachments
2. Add your documents (CV, cover letter, certificates)
3. Try again
Expected location: [application-path]/attachments/
```
STOP.
**If folder is empty (only .keep file or no files):**
```
❌ No documents found in attachments folder
The attachments/ folder is empty. You need to add documents before generating the email.
Required documents:
- ✗ CV/Resume (PDF) - Not found
- ✗ Cover letter (PDF) - Not found
Optional documents:
- Certificates/Diplomas (PDF)
Location: [application-path]/attachments/
Please add your documents and try again.
```
STOP.
**If CV is missing:**
```
❌ CV/Resume not found in attachments folder
Required documents:
- ✗ CV/Resume (PDF) - Not found
- ✓ Cover letter - Found: [filename]
Please add your CV to:
[application-path]/attachments/
Tip: Filename should contain "cv", "resume", or "lebenslauf"
Example: John_Doe_CV.pdf
```
STOP.
**If Cover Letter is missing:**
```
❌ Cover letter not found in attachments folder
Required documents:
- ✓ CV/Resume - Found: [filename]
- ✗ Cover letter (PDF) - Not found
Please add your cover letter to:
[application-path]/attachments/
Tip: Filename should contain "cover-letter" or "anschreiben"
Example: John_Doe_Cover_Letter.pdf
```
STOP.
**If all required documents found:**
```
✓ Found attachments:
- CV: [filename]
- Cover Letter: [filename]
[- Certificates: [filename(s)] (if any)]
```
Proceed to Step 6.
## Step 6: Read Data Sources
Show progress: `📝 Generating application email...`
### 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
- For email signature and sender information
**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-application-email again
```
STOP.
Show progress: `✓ Read profile.md (applicant info)`
### Read application.md
1. Check if `application.md` exists in application folder
2. Read entire file
3. Parse and extract:
- **Organization Information**: Company name, contact person name, contact email
- **Job Information**: Job title, job level
- **Tone of Voice**: Tone assessment (Formal/Balanced/Casual)
- **Key Messages**: Main points (for reference, though email is brief)
**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 details)`
## Step 7: 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 8: Generate Email Content
Generate a professional application email. Target: **Brief and concise (3-4 sentences in body)**.
### Structure Overview
1. Subject Line
2. Greeting/Salutation
3. Email Body (3-4 sentences)
4. Sign-off and Signature
---
### Subject Line
**Purpose**: Clear, professional, immediately conveys the purpose.
**Format for German:**
```
Bewerbung als [Job Title] - [Applicant Full Name]
```
**Format for English:**
```
Application for [Job Title] - [Applicant Full Name]
```
**Examples:**
- German: `Bewerbung als Senior Software Engineer - Max Mustermann`
- English: `Application for Senior Software Engineer - John Doe`
---
### Greeting/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,`
---
### Email Body (3-4 sentences maximum)
**Purpose**: Brief introduction, state purpose, reference documents, express interest.
**Content elements:**
1. **Opening**: State you're applying for the specific position
2. **Documents**: Explicitly mention attached documents (CV, cover letter, and certificates if present)
3. **Brief interest**: One sentence showing genuine interest or fit
4. **Availability**: Mention availability for interview/discussion
**Tone guidance:**
- **Formal**: Professional and respectful, traditional business language
- **Balanced**: Professional but warm, straightforward
- **Casual**: Friendly and approachable, but still professional
**IMPORTANT**: Keep it concise. The cover letter contains the details; the email is just a brief cover message.
**Example (Balanced, English):**
> I am writing to apply for the Senior Software Engineer position at TechCorp. Please find attached my CV, cover letter, and relevant certificates for your review. I have eight years of experience in backend development and am particularly interested in your work on cloud infrastructure. I am available for an interview at your convenience.
**Example (Formal, German):**
> hiermit bewerbe ich mich um die Position als Senior Software Engineer bei TechCorp. Im Anhang finden Sie meinen Lebenslauf, mein Anschreiben sowie relevante Zeugnisse. Mit acht Jahren Erfahrung in der Backend-Entwicklung interessiere ich mich besonders für Ihre Arbeit im Bereich Cloud-Infrastruktur. Für ein Vorstellungsgespräch stehe ich Ihnen gerne zur Verfügung.
**Example (Casual, English):**
> I'm applying for the Senior Software Engineer position at TechCorp. I've attached my CV, cover letter, and certificates for you to review. I've been working in backend development for about eight years and find your cloud infrastructure work really interesting. I'm happy to chat whenever works for you.
**Document Reference Variations:**
*If CV and Cover Letter only:*
- German: `Im Anhang finden Sie meinen Lebenslauf und mein Anschreiben.`
- English: `Please find attached my CV and cover letter.`
*If CV, Cover Letter, and Certificates:*
- German: `Im Anhang finden Sie meinen Lebenslauf, mein Anschreiben sowie relevante Zeugnisse.`
- English: `Please find attached my CV, cover letter, and relevant certificates.`
---
### Sign-off and Signature
**German:**
- Formal: `Mit freundlichen Grüßen,`
- Balanced: `Mit freundlichen Grüßen,`
- Casual: `Viele Grüße,`
**English:**
- Formal: `Sincerely,` or `Best regards,`
- Balanced: `Best regards,`
- Casual: `Best regards,` or `Kind regards,`
Follow with applicant's full name and contact information from profile.md:
```
[Applicant Full Name]
[Email]
[Phone]
```
---
## Step 9: Format and Write File
### Format as Markdown
```markdown
<!--
Application Email
Generated: [YYYY-MM-DD HH:MM]
Sources: profile.md, application.md, attachments/
Language: [German/English]
Tone: [Formal/Balanced/Casual]
-->
# Subject
[Subject Line]
---
[Greeting]
[Email Body - 3-4 sentences]
[Sign-off]
[Applicant Full Name]
[Email]
[Phone]
---
## Attachments
[List of files in attachments/ folder to be sent:]
- [CV filename]
- [Cover letter filename]
- [Certificate filename(s)] (if any)
```
### Write to File
1. Write content to `application-email.md` in the application folder
2. Handle write errors gracefully:
- Permission denied: "Could not save application-email.md. Check write permissions."
- Disk full: "Could not save application-email.md. Check available disk space."
- Other errors: "Could not save application-email.md: [error details]"
## Step 10: Success Output
Display success message:
```
✅ Application email saved: application-email.md
## Generation Summary:
📊 Email Details:
- Language: [German/English]
- Tone: [Formal/Balanced/Casual]
- Subject: [Generated subject line]
- Attachments referenced: [N] files
📍 Location:
[full or relative path to application-email.md]
📎 Attachments Ready:
- ✓ [CV filename]
- ✓ [Cover letter filename]
[- ✓ [Certificate filename(s)]] (if any)
## Next Steps:
1. **Review application-email.md**:
Open and read the email. Verify:
- Subject line is appropriate
- All attachments are correctly listed
- Tone matches the company culture
- Contact information is correct
2. **Prepare email in your client**:
- Copy subject line from the file
- Copy email body
- Attach the documents from attachments/ folder:
[List each file with checkboxes]
□ [CV filename]
□ [Cover letter filename]
[□ [Certificate filename(s)]] (if any)
3. **Final checks before sending**:
- Verify recipient email address
- Double-check all attachments are included
- Proofread one last time
- Ensure file names are professional
---
**Tip**: This email is intentionally brief. The cover letter contains the detailed information about your qualifications and interest in the role.
```
## 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-application-email 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)
```
### Email Exists (no --force)
```
❌ Application email already exists
File: [path]
Use --force to overwrite:
/write-application-email --force
⚠️ This will replace your existing email.
```
### Attachments Missing
```
❌ Required documents not found
The attachments/ folder is missing required documents:
[Show which documents are missing]
Please add your documents and try again.
```
### File Write Error
```
❌ Could not save application email
Error: [specific error message]
Possible causes:
- Insufficient write permissions
- Disk space full
- Path too long
Please check the issue and try again.
```
## Important Notes
### Email Purpose
The application email is a **brief cover message** for your attachments, not a replacement for the cover letter:
- Email: 3-4 sentences, mentions documents, shows interest
- Cover Letter: Detailed explanation of qualifications and fit
### Document References
- Always explicitly list what documents are attached
- Use the actual filenames from the attachments/ folder
- Make it easy for the recipient to know what they're receiving
### Professional Tone
- Even "Casual" tone should remain professional
- This is a first impression - clarity and professionalism are key
- Brief doesn't mean informal or sloppy
### Attachment Verification is Critical
- Never generate an email claiming documents are attached if they don't exist
- Always verify before generation
- Provide clear guidance on what's missing and where to add files
---
**Remember**: This email represents the first direct communication with the hiring manager. It should be professional, clear, and make it easy for them to review your application materials.
+87 -10
View File
@@ -218,10 +218,37 @@ When helping with job applications, follow this comprehensive workflow:
- Emphasize relevant experience from profile.md
- Incorporate keywords naturally
### 9. Generate Application Email (FUTURE)
- Create professional application email (coming soon)
### 9. Prepare Attachments
- Convert generated documents to PDF if needed
- Add final documents to `attachments/` folder:
- CV/Resume (PDF)
- Cover letter (PDF) - convert from cover-letter.md
- Certificates and diplomas (PDF) if required by job posting
### 10. Quality Assurance
### 10. Generate Application Email
- Run `/write-application-email` to generate professional email with document references
- System automatically:
- Validates application first (stops if incomplete)
- Verifies required documents exist in attachments/ folder (CV and cover letter minimum)
- Checks if application-email.md already exists (prevents overwriting)
- Generates brief email (3-4 sentences) including:
- Professional subject line (format: "Application for [Job Title] - [Your Name]")
- Brief introduction and interest statement
- Explicit reference to all attached documents
- Contact information and availability statement
- Applies appropriate tone (Formal/Balanced/Casual) from application.md
- Detects and applies correct language (German/English)
- Saves to `application-email.md` in application folder
- Flags available: `--skip-validation`, `--force` (overwrite existing)
### 11. Review Application Email
- Read generated application-email.md
- Verify all attachments are correctly listed
- Ensure subject line is appropriate
- Check contact information is current
- Confirm tone matches company culture
### 12. 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
@@ -253,11 +280,25 @@ When helping with job applications, follow this comprehensive workflow:
- Word count target enforcement (300-400 words)
- Factual accuracy verification
### Application Email
- Keep it short (3-4 sentences maximum)
- Subject line: Clear and professional
- Body: Brief introduction, reference to attached documents, expression of interest
- Professional signature using contact info from `profile.md`
### Application Email (Generated by `/write-application-email`)
- **Structure**: Subject → Greeting → Brief body (3-4 sentences) → Sign-off with contact info
- **Length**: 3-4 sentences maximum (the cover letter contains the details)
- **Tone**: Applied from application.md tone assessment (Formal/Balanced/Casual)
- **Language**: Inferred from job posting context (German/English)
- **Content**:
- Professional subject line: "Application for [Job Title] - [Your Name]"
- Brief statement of purpose (applying for the position)
- Explicit reference to attached documents (CV, cover letter, certificates)
- One sentence showing interest or fit
- Availability for interview/discussion
- **Document Verification**:
- Automatic check that CV and cover letter exist in attachments/ folder
- Lists all documents that will be attached
- Stops generation if required documents are missing
- **Quality checks**:
- Automatic validation before generation
- Protection against overwriting existing work
- Verification that attachments folder contains required documents
## Cultural Considerations
@@ -290,10 +331,11 @@ Adjust recommendations based on the target market if the user specifies a differ
## Available Commands
- `/validate-profile` - Validate that `profile.md` is complete and ready for application generation
- `/new-application "Company - Job Title"` - Create a new application workspace with organized folder structure
- `/new-application "Company - Job Title"` - Create a new application workspace with organized folder structure (includes attachments/ folder)
- `/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
- `/write-application-email [optional-app-name] [--skip-validation] [--force]` - Generate a professional application email with document references
## Example Usage
@@ -310,7 +352,9 @@ Adjust recommendations based on the target market if the user specifies a differ
6. Validation step: "Run `/validate-application` to ensure the application is complete"
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
9. Document preparation: "Convert cover-letter.md to PDF and add it along with your CV to the `attachments/` folder"
10. Email generation: "Generate application email with `/write-application-email`"
11. Final review: "Review application-email.md, verify all documents are listed correctly, and you're ready to send!"
### Example 2: Quick Document Request (Legacy Flow)
@@ -364,6 +408,39 @@ Adjust recommendations based on the target market if the user specifies a differ
3. Proceeds with generation
4. Suggests: "Review the new version and keep whichever you prefer"
### Example 5: Generating an Application Email
**User**: "Generate application email for my TechCorp application"
**Claude Code should**:
1. If user is in application folder: Run `/write-application-email` (auto-detects location)
2. If user is elsewhere: Run `/write-application-email 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 document verification
4. System verifies documents in attachments/ folder:
- Check for CV/Resume file
- Check for cover letter file
- Check for optional certificates
- If required documents missing: Stop and show clear error with guidance
- If documents found: Proceed to generation
5. Generate application email:
- Read profile.md for applicant contact information
- Read application.md for job details and tone
- Generate brief email (3-4 sentences) with professional subject line
- Include explicit references to all attached documents
- Save to application-email.md
6. Show success: "✅ Application email saved: application-email.md. Attachments ready: CV.pdf, Cover_Letter.pdf. Next: Review and send."
**User**: "There's no CV in attachments folder"
**Claude Code should**:
1. System detects missing CV during verification step
2. Show error: "❌ CV/Resume not found in attachments folder"
3. List what was found and what's missing
4. Provide guidance: "Please add your CV to: applications/pending/[folder]/attachments/"
5. Suggest filename conventions: "Tip: Filename should contain 'cv', 'resume', or 'lebenslauf'"
## Updating the Profile
If you notice missing or outdated information during application preparation: