diff --git a/src/.claude/commands/new-application.md b/src/.claude/commands/new-application.md index 1c776d6..4f423ef 100644 --- a/src/.claude/commands/new-application.md +++ b/src/.claude/commands/new-application.md @@ -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 + ``` --- diff --git a/src/.claude/commands/write-application-email.md b/src/.claude/commands/write-application-email.md new file mode 100644 index 0000000..2a513e1 --- /dev/null +++ b/src/.claude/commands/write-application-email.md @@ -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 + + +# 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. diff --git a/src/CLAUDE.md b/src/CLAUDE.md index 8327807..23d8f52 100644 --- a/src/CLAUDE.md +++ b/src/CLAUDE.md @@ -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: