Validate that `application.md` is completely filled out and ready for document generation. # Instructions You are validating a job application to ensure it's ready for generating tailored CV, cover letter, and email. ## Step 1: Location Detection ### Determine Which Application to Validate **If NO parameter provided:** 1. Check current working directory 2. Verify if you're inside an application folder by checking: - Path pattern: ends with `applications/pending/[folder-name]/` - File existence: `application.md` exists in current directory 3. If yes → validate this application 4. If no → show error with available applications (see Error Handling section) **If parameter PROVIDED:** 1. Parameter can be: - Folder name: `2025-11-02-TechCorp-Developer` - Relative path: `applications/pending/2025-11-02-TechCorp-Developer` - Absolute path: `/full/path/to/application/folder` 2. Resolve to application folder: `applications/pending/[folder-name]/` 3. Check if `application.md` exists in that location 4. If yes → validate that application 5. If no → show error with available applications ### Error Handling: Wrong Location / Not Found **If running from wrong location without parameter:** ``` ❌ Not in an application folder Please either: 1. Navigate to an application folder: cd applications/pending/[application-folder]/ /validate-application 2. Or provide the application folder name: /validate-application [application-folder-name] Available applications: [List output of: ls applications/pending/] Example: /validate-application 2025-11-02-TechCorp-Developer ``` **If application doesn't exist with parameter:** ``` ❌ Application not found: [provided-name] Available applications: [List output of: ls applications/pending/] Usage: /validate-application [folder-name] ``` **If application.md missing in found folder:** ``` ❌ No application.md found in [path] This doesn't appear to be a valid application folder. Did you create this application with /new-application? ``` ## Step 2: Read application.md Read the entire `application.md` file in the detected/specified application folder. **If file is corrupted or unreadable:** ``` ❌ Could not read application.md The file exists but cannot be read. It may be corrupted or have permission issues. Please check the file: [full-path-to-application.md] ``` ## Step 3: Parse Sections Extract content for each section by markdown headings. Recognize sections case-insensitively: **Required Sections** (validation checks these): - "Organization Information" / "organization information" - "Job Information" / "job information" - "Job Description Summary" / "job description summary" **Optional Sections** (don't cause validation failure): - Match Strategy - Key Messages - Tone of Voice - Research Notes - Document Checklist - Application Strategy Notes - Timeline - Metadata ## Step 4: Detect Placeholders Check for these placeholder patterns that indicate incomplete data: ### Placeholder Patterns **Square brackets:** - `[To be filled]` - `[Organization name]` - `[Job Title]` - `[Company Name]` - `[...]` - `[Any text in brackets]` **Generic template text:** - "Add information here" - "To be filled" - Text that matches the template unchanged ### Context-Aware Detection **DO flag as placeholders:** - `[To be filled]` - `[Company Name]` - `[Job Title]` as the only content - `[Organization name here]` **DON'T flag as placeholders:** - `[PhD]` after a name in context - `[Acquired by Google]` in a company description - `[Remote]` as a job location descriptor - Other brackets used meaningfully in normal text If placeholder text is longer than 100 characters, truncate it in the error message: `"[First 100 chars...]"` ## Step 5: Validate Required Sections ### Organization Information **Must have:** - Organization Name field with real content (not placeholder) **Check:** - Look for "Organization Name:", "Company:", or similar field labels - Extract the value after the label - Check if value contains placeholders - Check if value is empty or only whitespace **If incomplete:** - Flag: `Organization Name: Contains placeholder "[exact-text]"` - Or: `Organization Name: Missing or empty` ### Job Information **Must have:** - Job Title field with real content (not placeholder) **Check:** - Look for "Job Title:", "Position:", or similar field labels - Extract the value after the label - Check if value contains placeholders - Check if value is empty or only whitespace **If incomplete:** - Flag: `Job Title: Contains placeholder "[exact-text]"` - Or: `Job Title: Missing or empty` ### Job Description Summary **Must have:** - At least SOME content in one or more subsections: - Responsibilities / Key Responsibilities - Required Skills / Qualifications - Preferred Skills - Requirements - Keywords **Check:** - Verify section exists - Check if section has any real content (not just placeholders) - Check if at least one subsection has meaningful text **If incomplete:** - Flag: `Job Description Summary: No content found` - Or: `Responsibilities: Contains placeholder "[exact-text]"` - Or: `Required Skills: Missing or empty` ### Missing Sections If an entire required section is missing from the document: - Flag: `Missing required section: [Section Name]` ## Step 6: Check Population Status ### Input Folder Check **Check if `input/` folder exists and has files:** 1. Check for `input/` subfolder in the application directory 2. List files in `input/` folder 3. Count supported files (exclude .gitkeep, .DS_Store, etc.) **Categorize status:** - **Empty**: `input/` doesn't exist or has no files (0 files) - **Populated**: `input/` has 1+ files - **Not applicable**: Required sections are filled (manual population is fine) ### Population Warning Logic **Warn about population IF:** - Input folder is empty (0 files) AND - Multiple required sections still have placeholders **Suggest /populate-application IF:** - Input folder has files (1+ files) AND - Multiple required sections still have placeholders **DON'T warn IF:** - Required sections are filled with real content (manual population is fine, even if input/ is empty) ## Step 7: Generate Validation Report ### Success Format (Validation PASSES) **If all required sections are complete:** ``` ✅ Application Validation: PASSED Your application is complete and ready for document generation! Summary: - Organization: [Extracted Company Name] - Position: [Extracted Job Title] - Job requirements: [N] identified - Input documents: [N] files in input/ folder [If Match Strategy section has content:] - Match strategy: Complete [If Key Messages section has content:] - Key messages: Defined You can now proceed with generating tailored CV, cover letter, and application email. ``` **Extract actual values** from application.md for the summary (organization name, position, count requirements/skills mentioned). ### Failure Format (Validation FAILS) **If any required section is incomplete:** ``` ❌ Application Validation: FAILED Your application has incomplete sections that need attention before document generation. Issues found: [Group errors by section - only show sections with errors] ## Organization Information - [ ] Organization Name: Contains placeholder "[To be filled]" ## Job Information - [ ] Job Title: Missing or empty ## Job Description Summary - [ ] Responsibilities: Contains placeholder "[List key responsibilities]" - [ ] Required Skills: No content found [If population warning applies:] ## Population Status ⚠️ Input folder appears empty. Consider: 1. Adding job posting and related documents to input/ 2. Running /populate-application to extract information [Or if input has files but sections empty:] ## Population Status ⚠️ Input folder has [N] documents but application seems unpopulated. Consider running: /populate-application This will analyze your input documents and populate the sections above. [End with guidance:] Please update application.md to fill in these sections, then run /validate-application again. [Alternative if only placeholders:] Or manually edit application.md to add the missing information, then run /validate-application again. ``` ### Error Details Format **For each issue, use checkbox format:** ``` - [ ] Field Name: Issue description ``` **Quote exact placeholder text:** ``` - [ ] Organization Name: Contains placeholder "[To be filled]" ``` **Group by section:** ``` ## Organization Information - [ ] Organization Name: Issue - [ ] Location: Issue ## Job Description Summary - [ ] Responsibilities: Issue ``` ## Step 8: Provide Clear Next Steps ### After Success ``` You can now proceed with generating tailored CV, cover letter, and application email. ``` ### After Failure ``` Please update application.md to fill in these sections, then run /validate-application again. ``` Or if they should run population: ``` Add documents to input/ folder and run /populate-application to analyze and populate application.md. Then run /validate-application again to confirm completeness. ``` ## Important Notes ### Tone - Be encouraging - validation is a positive quality check - Be specific about what's missing - Provide actionable guidance - Don't be judgmental about incomplete applications ### Flexibility - Optional sections can remain incomplete - Manual population is perfectly fine (don't require /populate-application if sections are filled) - Input folder can be empty if user manually populated - Focus on required information only ### Accuracy - Quote exact placeholder text when reporting issues - Extract real values from application.md for success summary - Count actual items (requirements, skills, documents) - Be precise about what's missing vs what's present ### Integration - This is a quality gate before document generation - Match the pattern of `/validate-profile` for consistency - User can explicitly skip validation if they want (with warning) - Default behavior: validate before generating any documents ## Edge Cases ### Legitimate Brackets - `[PhD]` or `[MBA]` in credentials → not a placeholder - `[Remote]` as location descriptor → not a placeholder - `[Acquired]` in company history → not a placeholder - Check surrounding context to distinguish ### Partial Completion - If Organization Name is filled but Job Title has placeholder → only flag Job Title - If some job description subsections are filled → validation can pass - Don't require ALL subsections, just SOME content ### Very Long Placeholders - Truncate to 100 characters: `"[First 100 characters...]"` - Still quote them to show what was found ### Multiple Issues in Same Field - List each issue separately - Be clear about what specifically is wrong ### Application Already Has Some Content - Focus error messages only on what's still missing - Acknowledge what's already complete in summary (if desired) - Be constructive about gaps