How the Drafter-Reviewer Pipeline Generates Tailored CVs and Cover Letters

The drafter-reviewer pipeline is a six-step, two-agent workflow that automates the creation of job-specific application materials by separating content generation from factual verification and critique.

The MadsLorentzen/ai-job-search repository implements this architecture through the /apply command, orchestrating a Drafter agent that handles creation and compilation, and a Reviewer agent that ensures factual accuracy and strategic alignment. This pipeline transforms raw job postings into polished, PDF-ready CVs and cover letters while maintaining strict traceability to the candidate's verified experience.

Pipeline Architecture Overview

The workflow distributes responsibility between two specialized agents:

  • The Drafter: Manages the full lifecycle from parsing to final compilation, maintaining context across all creation steps.
  • The Reviewer: Spawned as a fresh-context agent via the Agent tool during Step 3, this agent researches the company and performs grounding audits without the Drafter's creative biases.

This separation ensures that verification operates independently from content generation, catching fabrication or drift that might occur during the drafting phase.

The Six-Step Execution Flow

Step 0: Parse Input and Extract Metadata

The Drafter begins by fetching the job posting or processing pasted text. It extracts structured metadata including company name, role, location, deadline, and language, then stores the full posting verbatim in documents/applications/<company>_<role>/job_posting.md for archival and future reference.

Source: .claude/commands/apply.md (lines 21-30)

Step 1: Evaluate Candidate Fit

Before generating content, the Drafter reads .claude/skills/job-application-assistant/04-job-evaluation.md and the candidate profile at .claude/skills/job-application-assistant/01-candidate-profile.md. It scores the posting across skills, experience, culture fit, and salary benchmarks, then presents this evaluation to the user for a continue/abort decision.

Source: .claude/commands/apply.md (lines 33-53)

Step 2: Draft CV and Cover Letter

Using the writing-style guide (03-writing-style.md) and LaTeX template definitions (05-cv-templates.md, 06-cover-letter-templates.md), the Drafter produces initial drafts that address every posting requirement, match the posting's language, and conform to the active template constraints. These drafts remain in .tex source format at this stage.

Source: .claude/commands/apply.md (lines 62-100)

Step 3: Review and Critique (Reviewer Agent)

The Drafter spawns the Reviewer agent via the Agent tool, passing the draft documents inline as raw text rather than file references. This inline hand-off guarantees the Reviewer operates on the exact version produced, eliminating redundant file reads and version drift.

The Reviewer performs two distinct outputs:

  1. Part A: A JSON array of concrete edit actions specifying file path, old string, new string, and reason
  2. Part B: Narrative suggestions covering missing keywords, company-specific angles, tone adjustments, and style improvements

The Reviewer also executes a Factual Grounding Audit, verifying that every date, employer name, metric, and claim traces back to one of three approved sources: 01-candidate-profile.md, cv/main_example.tex, or CLAUDE.md.


# Conceptual Agent invocation structure

Agent tool --name reviewer --role "general-purpose" \
    --prompt "You are a hiring-manager proxy... <INSERT_CV_DRAFT_HERE>... <INSERT_COVER_LETTER_DRAFT_HERE>"

Source: .claude/commands/apply.md (lines 107-180)

Step 4: Revise Drafts

The Drafter applies Part A edits automatically using the Edit tool, then manually incorporates Part B suggestions. All revisions must respect the "no fabrication" rule—any claim without grounding in the three approved source files must be removed or corrected.

Example structured edit from Part A:

{
  "file": "cv/main_Acme_Corp_Software_Engineer.tex",
  "old_string": "Managed a team of 3 engineers.",
  "new_string": "Managed a cross-functional team of 3 engineers, delivering features on time.",
  "reason": "keyword match"
}

Application via Edit tool:

Edit --file cv/main_Acme_Corp_Software_Engineer.tex \
     --old "Managed a team of 3 engineers." \
     --new "Managed a cross-functional team of 3 engineers, delivering features on time."

Source: .claude/commands/apply.md (lines 94-104)

Step 5: Compile and Inspect PDFs

The Drafter compiles LaTeX sources using engine-specific commands (typically lualatex or xelatex), then inspects the output for layout issues including page count violations, orphaned titles, and font consistency.

Mandatory ATS verification occurs via tools/verify_pdf.py, which extracts the text layer to ensure parsing compatibility:

cd cv && lualatex -interaction=nonstopmode main_Acme_Corp_Software_Engineer.tex

# ATS text-layer verification

python tools/verify_pdf.py cv/main_Acme_Corp_Software_Engineer.pdf \
    --dump-text cv/main_Acme_Corp_Software_Engineer.txt

The pipeline iterates on compilation and verification until the PDFs pass all checks.

Source: .claude/commands/apply.md (lines 11-48)

Step 6: Final Output and Recording

The Drafter presents a verification checklist, summarizes tailoring decisions, and lists all created files. It appends a structured row to job_search_tracker.csv containing metadata about the application, ensuring a complete audit trail alongside the archived posting stored in Step 0.

Source: .claude/commands/apply.md (lines 107-133)

Key Technical Mechanisms

Inline Hand-off Strategy

Unlike workflows that rely on file system state, the drafter-reviewer pipeline passes draft content directly within the Agent tool prompt. This eliminates race conditions and guarantees the Reviewer critiques the current in-memory version, not a potentially stale file on disk.

Structured Edit Actions (Part A)

The Reviewer returns machine-parseable JSON arrays rather than free-text diff descriptions. This enables deterministic application via the Edit tool, reducing parsing errors and ensuring precise string replacements in LaTeX source files.

Factual Grounding Audits

Every claim in the final documents must trace to:

The Reviewer flags drift with the reason code "grounding", triggering immediate correction.

ATS-Layer PDF Verification

Generated PDFs undergo mechanical extraction testing using tools/verify_pdf.py before delivery. This ensures that automated applicant tracking systems can parse the text layer correctly, preventing rejection due to image-based or corrupted PDF output.

Critical Source Files

The pipeline relies on these specific files within the MadsLorentzen/ai-job-search repository:

Summary

  • The drafter-reviewer pipeline separates content creation from verification using two distinct agent contexts
  • Six ordered steps progress from parsing to PDF compilation, with mandatory grounding audits at the review stage
  • The Reviewer agent receives drafts inline and returns structured JSON edits plus narrative feedback
  • All factual claims must trace to 01-candidate-profile.md, cv/main_example.tex, or CLAUDE.md
  • Final PDFs undergo mechanical ATS-layer verification using tools/verify_pdf.py before delivery
  • Complete audit trails are maintained via job_search_tracker.csv and archived posting files

Frequently Asked Questions

What triggers the drafter-reviewer pipeline?

Users invoke the pipeline by executing the /apply command within a Claude Code session configured with the ai-job-search repository. This command initiates Step 0, prompting the user for either a job posting URL or raw posting text to begin the automated workflow.

How does the reviewer agent access the drafts without reading files?

The Drafter passes the complete CV and cover letter drafts directly into the Reviewer's prompt as inline text blocks. This design eliminates file I/O latency and guarantees the Reviewer analyzes the exact version produced in Step 2, preventing version skew or cached file issues.

What prevents hallucination or fabrication in the generated documents?

The Factual Grounding Audit requires the Reviewer to verify every claim against three approved source files. Any date, metric, or employer name lacking documentation in .claude/skills/job-application-assistant/01-candidate-profile.md, cv/main_example.tex, or CLAUDE.md must be flagged with a "grounding" reason and corrected during Step 4.

Where are the final application materials stored?

The pipeline writes finalized LaTeX source files and compiled PDFs to the cv/ and cover_letters/ directories, appends application metadata to job_search_tracker.csv in the repository root, and archives the original posting text to documents/applications/<company>_<role>/job_posting.md for future reference.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →