# How the Drafter-Reviewer Multi-Agent System Powers AI-Generated Job Applications

> Discover how the drafter-reviewer multi-agent system uses two Claude agents to create and refine AI-generated job applications, improving your CV and cover letter content.

- Repository: [Mads Lorentzen/ai-job-search](https://github.com/MadsLorentzen/ai-job-search)
- Tags: internals
- Published: 2026-08-28

---

**The drafter-reviewer multi-agent system splits job application creation into two independent Claude agents where one drafts CV and cover letter content while a second reviewer agent critiques the output and returns structured JSON edits for the drafter to apply.**

The drafter-reviewer multi-agent system in the `MadsLorentzen/ai-job-search` repository automates high-quality job application creation through a peer-review pipeline defined in [`.claude/commands/apply.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/.claude/commands/apply.md). This architecture mimics human editorial workflows by separating content generation from critical review, ensuring each application passes both creative validation and technical verification before submission.

## The Two-Agent Architecture

The system implements a strict separation of concerns between generation and validation. According to the skill definition in [`.claude/skills/job-application-assistant/SKILL.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/.claude/skills/job-application-assistant/SKILL.md), the workflow relies on two distinct Claude contexts that cannot contaminate each other’s reasoning.

### The Drafter Agent

The **Drafter** initializes with candidate profile data, job posting text, and template instructions. It performs the initial content generation by:

- Rendering templates from [`.claude/skills/job-application-assistant/05-cv-templates.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/.claude/skills/job-application-assistant/05-cv-templates.md) and [`06-cover-letter-templates.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/06-cover-letter-templates.md)
- Filling placeholders with structured candidate data and parsed job requirements
- Generating raw LaTeX or Typst content for both the CV and cover letter
- Optionally drafting answers to application form questions

The drafter works from a fresh context and does not perform self-editing; instead, it delegates critical analysis to the reviewer agent via the **Agent tool**.

### The Reviewer Agent

The **Reviewer** is spawned by the drafter specifically to audit the drafts. Because it receives a fresh Claude context, it cannot be biased by the drafter’s earlier reasoning steps or assumptions. The reviewer executes two primary responsibilities:

1. **Company Research Checklist** – The reviewer independently looks up the employer, validates the role details, and gathers missing facts according to [`.claude/skills/job-application-assistant/04-company-research.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/.claude/skills/job-application-assistant/04-company-research.md)
2. **Content Critique** – It audits the drafts against the style rules in [`03-writing-style.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/03-writing-style.md), checking for missing keywords, weak framing, generic phrasing, and tone alignment

Unlike the drafter, the reviewer never modifies files directly. Instead, it returns a structured edit list that the drafter parses and applies programmatically.

## The Edit Exchange Protocol

Communication between agents follows a strict JSON protocol defined in [`apply.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/apply.md) step 5. The reviewer returns an array of edit objects specifying precise line-by-line replacements:

```json
[
  {
    "file": "cv.tex",
    "line": 12,
    "replace": "Led a team of 5 engineers to deliver a 30% faster pipeline."
  },
  {
    "file": "cover.tex",
    "line": 7,
    "replace": "I am particularly excited about your focus on renewable-energy data."
  }
]

```

The drafter applies these edits without re-reading the source files, minimizing token consumption and avoiding context window limitations. This exchange format ensures that the reviewer can suggest granular changes—such as replacing specific bullet points or adjusting opening paragraphs—while the drafter maintains control over file system operations.

## PDF Verification and Iteration

After applying reviewer edits, the drafter enters the **PDF verification loop** to ensure the final document meets technical standards:

```bash

# Compile LaTeX (or Typst) and verify ATS compatibility

bun run compile && python tools/verify_pdf.py output.pdf

```

The verification process executes multiple validation layers:

- **Layout Fixes** – Automatic insertion of `\needspace` or `\enlargethispage` commands to prevent orphaned sections or page breaks
- **ATS Text-Layer Verification** – The [`tools/verify_pdf.py`](https://github.com/MadsLorentzen/ai-job-search/blob/main/tools/verify_pdf.py) script extracts the text layer to confirm that automated tracking systems can parse the content correctly
- **Visual Rendering Check** – Validation that LaTeX compilation succeeds without errors or warnings

If verification fails, the drafter can re-invoke the reviewer agent for another pass, creating an iterative refinement loop until the PDF passes all checks.

## Workflow Execution and Tracking

The complete `/apply` command workflow orchestrates the drafter-reviewer multi-agent system from initiation to archival:

1. **Draft Generation** – Drafter creates initial CV and cover letter from templates
2. **Review Invocation** – Drafter spawns reviewer via Agent tool with drafts inline
3. **Edit Application** – Drafter parses JSON edits and updates source files
4. **Compilation** – LaTeX/Typst rendering and PDF generation
5. **Verification** – Automated checks via [`verify_pdf.py`](https://github.com/MadsLorentzen/ai-job-search/blob/main/verify_pdf.py) and layout correction
6. **Archival** – Recording the application in `job_search_tracker.csv`, archiving the original posting to `documents/applications/{company}/job_posting.md`, and updating status to *drafted*

This pipeline ensures that every application benefits from independent editorial oversight while maintaining automated throughput.

## Summary

- The **drafter-reviewer multi-agent system** separates content generation from critical review to eliminate bias and improve output quality.
- The **Drafter** generates initial drafts from templates in [`05-cv-templates.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/05-cv-templates.md) and [`06-cover-letter-templates.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/06-cover-letter-templates.md), filling placeholders with candidate and job data.
- The **Reviewer** executes in a fresh Claude context to audit drafts against company research checklists and writing style guides, returning structured JSON edits.
- **JSON edit protocol** enables precise line-by-line revisions without requiring the drafter to re-read source files.
- **PDF verification loop** combines LaTeX compilation, layout fixes, and ATS text-layer validation via [`tools/verify_pdf.py`](https://github.com/MadsLorentzen/ai-job-search/blob/main/tools/verify_pdf.py).
- The workflow iterates until technical validation passes, then archives results to `job_search_tracker.csv` and `documents/applications/`.

## Frequently Asked Questions

### How does the reviewer agent avoid bias from the drafter's reasoning?

The reviewer is spawned via the **Agent tool** with a fresh Claude context that does not inherit the drafter’s chain-of-thought or prior assumptions. The drafter passes the complete drafts inline within the prompt, but the reviewer evaluates this content independently without access to the drafter’s previous tool calls or reasoning steps, ensuring objective critique.

### What specific format does the reviewer use to suggest edits?

The reviewer returns a **JSON array of edit objects**, each containing three fields: `file` (the target filename), `line` (the specific line number to modify), and `replace` (the replacement text string). This structure allows the drafter to apply changes programmatically using simple string operations rather than complex parsing or file re-reading.

### How does the system verify that generated PDFs are ATS-compatible?

After compilation, the drafter runs `python tools/verify_pdf.py output.pdf` to execute the **ATS text-layer verification**. This script extracts the raw text content from the PDF to confirm that parsing systems can accurately read the document structure, checking for encoding issues, missing text layers, or formatting that might confuse applicant tracking systems.

### Can the drafter invoke the reviewer multiple times during a single application?

Yes, the workflow supports **iterative revision**. If the PDF verification loop detects layout issues or ATS compatibility problems after the initial review, the drafter can re-spawn the reviewer agent with updated drafts. This cycle continues until the document passes both visual layout checks and ATS validation, allowing for progressive refinement without manual intervention.