generate-variant
Generate Variant
<when_to_activate> Activate when the user:
- Provides a job description or job URL
- Asks to create a variant for a specific company/role
- Says "generate variant", "create variant", "tailor CV for [company]"
- Wants to apply for a specific position
Trigger phrases: "variant", "tailor", "customize CV", "apply for [company]", "job application" </when_to_activate>
<critical_principles>
Critical Design Principles
From Galaxy Variant Exercise:
- Signature headline stays — "Building at the edge of trust" is the brand
- companyAccent is REQUIRED — Add inline company name (
— with {Company}) - Existing connections are gold — Lead with what you've already proven
- Stats must be verifiable — Every metric traced to knowledge base
- Pause between phases — Get user approval before proceeding </critical_principles>
Phase 1: JD Analysis & Must-Have Extraction
Goal: Extract NON-GENERIC requirements using the deterministic analyze:jd script.
Step 1.1: Save JD to File
If user provides JD text, save it first:
# Save JD to source-data/jd-{company}.txt
echo "[JD TEXT]" > source-data/jd-{company}.txt
Step 1.2: Run Deterministic JD Analysis
USE THE SCRIPT — it automatically filters 47+ generic phrases and extracts specific requirements:
npm run analyze:jd -- --file source-data/jd-{company}.txt --save
This outputs to capstone/develop/jd-analysis/{slug}.yaml with:
extracted.company,extracted.role,extracted.yearsRequiredmustHaves[]with category and specificity (high/medium/low)niceToHaves[]ignoredGeneric[]— what was filtered outdomainKeywords[]— crypto, fintech, developer_tools, etc.searchTerms[]— ready for knowledge base search
What the script filters automatically:
- "Team player", "excellent communicator", "fast-paced environment"
- "Passionate about [X]", "self-starter", "attention to detail"
- "Proven track record", "data-driven", "results-oriented"
- 40+ more generic phrases (see
scripts/analyze-jd.ts:GENERIC_PHRASES)
Step 1.3: Review Analysis Output
# Read the generated analysis
cat capstone/develop/jd-analysis/{slug}.yaml
Check for:
- Correct company/role extraction
- Meaningful must-haves (not generic)
- Appropriate domain keywords
Step 1.4: Check for Existing Variants
ls content/variants/ | grep -i {company}
Output: JD analysis summary to user for confirmation before proceeding.
Phase 1.5: Alignment Gate (GO/NO-GO)
Goal: Score alignment BEFORE investing time in content generation using the search:evidence script.
Run Evidence Search
USE THE SCRIPT — it searches the knowledge base and generates an alignment report:
npm run search:evidence -- --jd-analysis capstone/develop/jd-analysis/{slug}.yaml --save
This outputs to capstone/develop/alignment/{slug}.yaml with:
summary.alignmentScore— 0.0 to 1.0summary.recommendation— PROCEED | REVIEW | SKIPsummary.strongMatches— count of high-relevance matches (≥70%)summary.moderateMatches— count of medium-relevance matches (40-70%)matches[]— sorted by relevance with evidence snippetsgaps[]— search terms with no matches
Alternative: Manual Search Terms
If you have specific terms not from JD analysis:
npm run search:evidence -- --terms "crypto,staking,infrastructure,api" --threshold 0.5 --save
Review Alignment Report
cat capstone/develop/alignment/{slug}.yaml
Decision Framework
| Score | Recommendation | Action |
|---|---|---|
| ≥ 0.50 + 2 strong | PROCEED | Generate variant |
| ≥ 0.30 or 1 strong | REVIEW | Show gaps, ask user if worth pursuing |
| < 0.30 and 0 strong | SKIP | Recommend not applying, show why |
Honesty Check
For REVIEW/SKIP cases, the script surfaces:
gaps[]— terms with no matching evidence- Low relevance matches that may be stretches
Surface honestly:
- Which must-haves have no evidence
- Whether gaps are addressable (transferable skills) or hard blockers
- Honest assessment: "This role requires X, which isn't in your background"
PAUSE: Show alignment score and recommendation. Get explicit GO/NO-GO from user.
Phase 2: Knowledge Base Query
Goal: Find matching achievements and stories.
-
Search achievements:
ls content/knowledge/achievements/ -
Read relevant achievement files matching JD requirements
-
Look for existing client relationships:
- Search for company name in achievements/stories
- Example: Galaxy was already an Anchorage client (ETH staking)
-
Rank matches by relevance (0.0-1.0):
- Direct skill match: 0.9-1.0
- Related experience: 0.7-0.9
- Transferable skills: 0.5-0.7
Output: List of relevant achievements with relevance scores.
Phase 2.5: Bullet Coverage Check
Goal: Ensure experience highlights cover all 7 PM competency bundles using the check:coverage script.
Run Coverage Check
USE THE SCRIPT — it automatically categorizes bullets into the 7 PM competency bundles:
npm run check:coverage
For JSON output (easier to process):
npm run check:coverage -- --json
To save report:
npm run check:coverage -- --save
The 7 Competency Bundles (Automated)
The script categorizes based on keywords (see scripts/check-coverage.ts:BUNDLES):
| Bundle | Keywords Detected |
|---|---|
| 1. Product Design | shipped, launched, built, designed, UX, prototyped, improved |
| 2. Leadership | led, managed, coordinated, E2E, cross-functional, stakeholders |
| 3. Strategy | strategy, vision, roadmap, prioritized, market analysis |
| 4. Business | revenue, ARR, GTM, partnerships, growth, B2B, pricing |
| 5. Project Mgmt | delivered, timeline, Agile, risk, milestones, on-time |
| 6. Technical | architecture, API, SDK, data, metrics, trade-offs, system |
| 7. Communication | presented, documented, collaborated, aligned, storytelling |
Review Coverage Output
The script outputs:
- Count per bundle
- Examples of bullets in each bundle
gaps[]— bundles with <2 bulletsoverweight[]— bundles with 5+ bullets- Overall balance assessment
Interpretation
| Gap Level | Action |
|---|---|
| 0 gaps | Proceed — well-rounded |
| 1-2 gaps | Surface gaps to user — may want to emphasize in bio/tagline |
| 3+ gaps | Warning — resume may appear unbalanced |
Using Coverage for This Variant
Cross-reference gaps with JD must-haves:
- Does this role care about the gap? (Check Phase 1 analysis)
- Can the bio/tagline emphasize this competency?
- Are there achievements in knowledge base that weren't surfaced?
Note: Not all variants need all 7 bundles. A technical PM role may not care about "Business & Marketing." Use the JD must-haves to determine which gaps matter.
Phase 3: Content Generation
IMPORTANT: Invoke dmitrii-writing-style skill before writing bio content.
Hero Section
hero:
status: "Open to Product Roles" # Keep simple
headline:
- text: "Building"
style: "italic"
- text: "at the edge of"
style: "muted"
- text: "trust"
style: "accent"
companyAccent: # REQUIRED
- text: "with"
style: "muted"
- text: "{Company}"
style: "accent"
subheadline: >
[Tailored elevator pitch mentioning company connection]
About Section
about:
tagline: >
[One-line positioning statement]
bio:
- >
[Paragraph 1: Recent experience, relevant achievements, company connection]
- >
[Paragraph 2: Career arc leading to this opportunity + vision]
stats:
- value: "[X]+"
label: "[Relevant metric]"
- value: "[Y]"
label: "[Relevant metric]"
- value: "[Z]"
label: "[Relevant metric]"
Relevance Scoring
relevance:
caseStudies:
- slug: "[most-relevant]"
relevanceScore: 1.0
reasoning: "[Why this matches JD]"
# ... ranked list
skills:
- category: "[Top category]"
relevanceScore: 1.0
# ... ranked list
PAUSE: Show generated content to user for review before proceeding.
Phase 4: Variant File Creation
-
Create variant YAML:
# Write to content/variants/{slug}.yaml -
Sync to JSON:
npm run variants:sync -- --slug {slug} -
Verify JSON created:
ls content/variants/{slug}.json
Phase 5: Evaluation Pipeline
-
Run evaluation:
npm run eval:variant -- --slug {slug} -
Review extracted claims (metrics with anchors)
-
For each unverified claim, verify against knowledge base:
npm run eval:variant -- --slug {slug} --verify {claim-id}={source-path} -
Target: 100% claims verified
PAUSE: Show claims status to user before proceeding.
Phase 6: Red Team Pipeline
-
Run red team scan:
npm run redteam:variant -- --slug {slug} -
Review findings:
- FAIL — Must fix before publishing
- WARN — Review and decide
-
Common issues and fixes:
Check Issue Fix RT-ACC-CLAIMS Unverified claims Run Phase 5 verification RT-SEC-SECRETS Tokens in content Remove sensitive data RT-TONE-SYCOPHANCY Flattery detected Rewrite objectively RT-PRIV-JD Long JD exposed Truncate in YAML
PAUSE: Show redteam results to user for approval.
Phase 7: Final Review
-
Start dev server if not running:
npm run dev -
Open variant in browser:
http://localhost:5173/{company}/{role} -
Visual checklist:
- companyAccent renders inline after "trust"
- Stats are visible and accurate
- Bio reads naturally
- Case studies are relevant
-
Offer to commit if approved.
Phase 8: Resume Generation
Goal: Generate a variant-specific resume PDF and link it to the variant.
-
Generate variant resume:
npm run generate:resume -- --variant {slug}This will:
- Render the resume at
/{company}/{role}/resume - Output PDF to
public/resumes/{slug}.pdf - Auto-update variant YAML with
resumePath: /resumes/{slug}.pdf
- Render the resume at
-
Sync the updated variant:
npm run variants:sync -- --slug {slug} -
Verify resume was generated:
ls -la public/resumes/{slug}.pdf
Note: The variant resume uses the merged profile/experience data, so it reflects the tailored content (bio, stats, tagline) specific to this role.
Phase 9: Dashboard Update
Goal: Regenerate the CV dashboard to include the new variant.
-
Regenerate dashboard HTML:
DASHBOARD_PASSWORD=<password> npm run generate:dashboardOr use the combined command (syncs variants AND regenerates dashboard):
DASHBOARD_PASSWORD=<password> npm run variants:sync:dashboard -
Verify the new variant appears in the dashboard output:
- Check the console shows the new variant in the list
- Dashboard HTML is updated at
public/cv-dashboard/index.html
-
Commit the updated dashboard:
git add public/cv-dashboard/index.html
Note: The dashboard is password-protected. The DASHBOARD_PASSWORD env var is required. Check .env.local or ask the user for the password.
Quality Checklist
Before marking variant complete:
- All claims verified against knowledge base
- No hallucinated achievements
- Company connection established (existing client? industry overlap?)
- Signature headline preserved with companyAccent (REQUIRED)
- Stats are verifiable and impactful
- Red team passes (0 FAIL, minimal WARN)
- Would defend every claim in an interview
- Writing style matches dmitrii-writing-style
- Resume PDF generated and linked (
resumePathin variant metadata) - Dashboard regenerated with new variant visible
File Locations Reference
| File | Purpose |
|---|---|
content/variants/{slug}.yaml |
Variant source (canonical) |
content/variants/{slug}.json |
Runtime artifact |
content/variants/_template.yaml |
Template reference |
capstone/develop/evals/{slug}.claims.yaml |
Claims ledger |
capstone/develop/evals/{slug}.eval.md |
Eval report |
capstone/develop/redteam/{slug}.redteam.md |
Redteam report |
content/knowledge/achievements/*.yaml |
Achievement sources |
content/knowledge/stories/*.yaml |
Story sources |
public/resumes/{slug}.pdf |
Variant-specific resume PDF |
public/cv-dashboard/index.html |
Dashboard HTML (password-protected) |
public/cv-dashboard/variants-manifest.json |
Dashboard data source |
Commands Reference
# ═══════════════════════════════════════════════════════════════
# PHASE 1: JD Analysis (deterministic)
# ═══════════════════════════════════════════════════════════════
npm run analyze:jd -- --file source-data/jd-{company}.txt --save
npm run analyze:jd -- --file jd.txt --json # JSON output
# ═══════════════════════════════════════════════════════════════
# PHASE 1.5: Evidence Search (deterministic)
# ═══════════════════════════════════════════════════════════════
npm run search:evidence -- --jd-analysis capstone/develop/jd-analysis/{slug}.yaml --save
npm run search:evidence -- --terms "crypto,staking,api" --threshold 0.5
# ═══════════════════════════════════════════════════════════════
# PHASE 2.5: Coverage Check (deterministic)
# ═══════════════════════════════════════════════════════════════
npm run check:coverage
npm run check:coverage -- --json
npm run check:coverage -- --save
# ═══════════════════════════════════════════════════════════════
# PHASE 4-6: Variant Pipeline
# ═══════════════════════════════════════════════════════════════
npm run variants:sync -- --slug {slug}
npm run eval:variant -- --slug {slug}
npm run eval:variant -- --slug {slug} --verify {id}={path}
npm run redteam:variant -- --slug {slug}
# ═══════════════════════════════════════════════════════════════
# PHASE 8: Resume Generation
# ═══════════════════════════════════════════════════════════════
npm run generate:resume -- --variant {slug}
npm run variants:sync -- --slug {slug} # Sync after resume path update
# ═══════════════════════════════════════════════════════════════
# PHASE 9: Dashboard Update
# ═══════════════════════════════════════════════════════════════
DASHBOARD_PASSWORD=<password> npm run generate:dashboard
# Or combined sync + dashboard:
DASHBOARD_PASSWORD=<password> npm run variants:sync:dashboard
# ═══════════════════════════════════════════════════════════════
# PREVIEW
# ═══════════════════════════════════════════════════════════════
npm run dev
open "http://localhost:5173/{company}/{role}"
open "http://localhost:5173/{company}/{role}/resume" # Preview resume page
Example: Galaxy PM Variant
Job: Director, Technical Program Manager at Galaxy
Key Learnings Applied:
- Found existing connection: Galaxy was already an Anchorage client (ETH staking)
- Matched L2 integration framework to "cross-functional" TPM requirement
- Used punchy stats: "8+", "7+", "Zero" (all verified)
- companyAccent:
trust — with Galaxy(inline, subtle) - Status: "Open to Product Roles" (simple, not desperate)
Result: All 6 claims verified, redteam passed, variant shipped.
<quality_gate>
Quality Gate
See Quality Gate Template for universal checks.
Variant-specific:
- All claims verified against knowledge base
- companyAccent is set (REQUIRED)
- Red team passes (0 FAIL findings)
- Would defend every claim in an interview </quality_gate>
<skill_compositions>
Works Well With
- dmitrii-writing-style — MUST invoke before writing bio content
- cv-knowledge-query — Search evidence before generating
- ultrathink — For complex alignment decisions
- generate-resume — Generate variant-specific resume after variant </skill_compositions>
More from fotescodev/portfolio
ultrathink
Elevates thinking for complex problems with intellectual honesty. Activates deep analysis while avoiding performative contrarianism. Use when facing decisions that deserve more than the first answer, require trade-off evaluation, or benefit from rigorous self-checking before responding.
4linkedin
Create LinkedIn content using service-based authority principles. Use when drafting posts, profile sections, or comments that build trust through teaching rather than self-promotion.
3sprint-sync
Multi-perspective project onboarding and sprint briefing. Simulates a cross-functional leadership team (PM, Designer, Architect, Engineer) ramping up on project status. Updates the Current Status section in PROJECT_STATE.md.
2run-tests
Run the test suite and identify new tests needed for recent code changes. Use when verifying changes work correctly or when asked to run tests.
2technical-writer
User documentation technical writer focused on user and developer experience, code examples, and 2025 best practices. Use when creating README files, API docs, getting started guides, tutorials, or any technical documentation intended for developers or end users.
2generate-resume
Generate a print-optimized, ATS-friendly single-page resume PDF from portfolio content. Use when user wants to create or regenerate their resume. (project)
2