How the Drafter-Reviewer Agent Workflow in /apply Evaluates and Refines Job Applications

The drafter-reviewer agent workflow in the /apply command implements a two-stage pipeline where a drafter agent generates initial LaTeX drafts for CVs and cover letters, while a second, freshly instantiated reviewer agent critiques the content and returns structured JSON edits and narrative suggestions for refinement.

The ai-job-search repository by MadsLorentzen automates job application creation through this specialized drafter-reviewer agent workflow, defined in .claude/commands/apply.md. By separating document generation from content evaluation, the system ensures that Claude Code acts as both a skilled templating engine and a critical editor, producing high-fidelity application materials optimized for ATS compatibility and factual accuracy.

Step 1: Draft Generation by the Drafter Agent

The workflow begins with the drafter agent, which focuses exclusively on structural and template-level concerns.

The drafter loads LaTeX templates from cv/05-cv-templates.md and cover_letters/06-cover-letter-templates.md, then populates them with applicant profile data stored in CLAUDE.md. It produces two draft files: cv/main_<company>.tex and cover_letters/cover_<company>_<role>.tex.

Importantly, the drafter does not perform any content verification during this phase; it concentrates solely on correctly filling template placeholders and maintaining LaTeX syntax integrity.

Step 2: Inline Draft Pass to the Reviewer

Rather than writing drafts to disk and requiring file reads, the drafter keeps the raw draft text in memory and passes it inline to the reviewer agent.

This approach ensures the reviewer sees exactly what the drafter just wrote, eliminating stale context or file system latency issues. The inline transfer includes both the CV draft and cover letter draft as parameters in the spawn call.

Step 3: Reviewer Content Critique with Fresh Context

The reviewer agent is spawned with a clean slate using the general-purpose agent configuration, deliberately starting fresh to avoid inheriting the drafter's templating context.

According to the implementation in .claude/commands/apply.md, the reviewer:

  • Reads only minimal supporting files, such as company-specific research resources
  • Performs a content-only review, checking relevance, tone, keyword coverage, and factual claims
  • Explicitly excludes template files from its context to prevent accidental structural modifications

The reviewer returns feedback in two distinct parts:

  • Part A: A JSON array of structured edits containing file, old_string, and new_string fields
  • Part B: Narrative suggestions describing strategic improvements, such as adding company-specific angles or reframing passive language

Step 4: Applying Structured Edits with the Edit Tool

The drafter consumes Part A and calls the Edit tool for each JSON entry, performing exact text replacements without re-reading the files.

This guarantees edits are applied atomically and traceably. The drafter handles the technical execution of the reviewer's content changes while maintaining responsibility for LaTeX structure.


# Excerpt from .claude/commands/apply.md showing structured edit application

for edit in reviewer_response["part_a"]:
    edit_tool.apply(
        file=edit["file"],
        old_string=edit["old_string"],
        new_string=edit["new_string"]
    )

Step 5: Incorporating Narrative Suggestions

The drafter manually addresses Part B feedback by weaving in researched facts, re-phrasing weak sentences, and handling genuine content gaps.

This step requires human-in-the-loop judgment to verify facts via WebFetch and ensure keyword integration happens naturally rather than through stuffing. The drafter evaluates which narrative suggestions enhance the application authenticity and which might compromise accuracy.

Step 6: Final Verification and PDF Compilation

After all revisions are complete, the drafter runs the mandatory PDF compilation and comprehensive verification checklist exactly once.

The verification, implemented in tools/verify_pdf.py, checks PDF layout, page counts, ATS-readability, spelling, and LaTeX syntax. This final gate ensures that reviewer-suggested changes have not introduced compilation errors or formatting regressions.

Why the Separation Works

The drafter-reviewer pattern provides four distinct architectural advantages:

  • Fresh Context for Research: The reviewer starts with a clean slate, preventing web-fetched company information from leaking into the drafter's earlier reasoning and reducing hallucinations.
  • Focused Expertise: The drafter excels at templating and LaTeX handling, while the reviewer specializes in content critique, keyword matching, and factual validation.
  • Traceability: Structured JSON edits provide a clear, machine-readable diff that can be audited or replayed for debugging purposes.
  • Safety: By limiting the reviewer's file reads (explicitly excluding template files), the system prevents accidental overwriting of structural elements.

Implementation Details and Code Examples

The reviewer spawn call demonstrates the explicit separation of concerns:


# Step 3 – spawning the reviewer (excerpt from .claude/commands/apply.md)

agent_tool.spawn(
    name="general-purpose",
    prompt=f"""
You are a reviewer agent. Here are the drafts:

CV draft:
{cv_draft_text}

Cover letter draft:
{cover_letter_text}

Please critique the content only. Return:
- Part A: a JSON array of { "file": "...", "old_string": "...", "new_string": "..." }
- Part B: narrative suggestions.
"""
)

The structured edit format enables precise, programmatic modifications:

[
  {
    "file": "cv/main_acme.tex",
    "old_string": "Managed a team of 5 engineers.",
    "new_string": "Led a cross‑functional team of 5 engineers, delivering X% growth."
  },
  {
    "file": "cover_letters/cover_acme_engineer.tex",
    "old_string": "I am excited about your product.",
    "new_string": "I am excited about Acme’s AI‑driven analytics platform, which aligns with my work on predictive modeling."
  }
]

Summary

  • The drafter-reviewer agent workflow splits job application creation into distinct generation and evaluation phases.
  • The drafter handles LaTeX templating using files from cv/05-cv-templates.md and cover_letters/06-cover-letter-templates.md populated with data from CLAUDE.md.
  • The reviewer uses a fresh context to evaluate content relevance, tone, and factual accuracy without access to template files.
  • Changes are transmitted via Part A (structured JSON edits) and Part B (narrative suggestions), with the drafter applying edits atomically using the Edit tool.
  • Final verification runs through tools/verify_pdf.py to ensure ATS compatibility and LaTeX integrity before output.

Frequently Asked Questions

What is the difference between Part A and Part B feedback?

Part A consists of a JSON array containing specific string replacements with file, old_string, and new_string fields, which the drafter applies automatically using the Edit tool. Part B contains narrative suggestions describing strategic improvements—such as adding company-specific angles or strengthening weak phrasing—which the drafter evaluates and implements manually based on additional research.

Why does the reviewer agent use a fresh context instead of continuing the same conversation?

The reviewer spawns as a separate general-purpose agent to ensure that web-fetched company research and critical evaluation do not contaminate the drafter's templating context. This separation reduces hallucinations and prevents the reviewer from accidentally modifying LaTeX structural elements that the drafter manages.

How does the drafter apply changes without re-reading the files?

The drafter keeps the draft content in memory during the review process and receives Part A as structured data. It calls the Edit tool using the old_string and new_string parameters for each entry, performing exact text replacements atomically without file system reads, ensuring the changes match exactly what the reviewer specified.

What prevents the reviewer from accidentally breaking LaTeX syntax?

The reviewer explicitly does not read the template files (05-cv-templates.md and 06-cover-letter-templates.md) and is instructed to perform content-only reviews. Additionally, the drafter retains sole responsibility for LaTeX structure, and the final verification step runs tools/verify_pdf.py to catch any syntax errors before generating the final PDFs.

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 →