← All posts

Wiring a Critic-Rewriter Agent Loop Into Your Developer Content Stack

Three roles, structured critiques, and hard stops keep AI rewrites honest.

November 24, 2026

Cover illustration for “Wiring a Critic-Rewriter Agent Loop Into Your Developer Content Stack”

Recursive AI writing pipelines refine content through repeated generation, structured critique, and controlled revision. To wire a critic-rewriter agent loop into a developer content stack, the team needs three separate roles, machine-readable feedback, clear exit conditions, and a way to work with repository constraints and CI. The production distinction is not how often the system rewrites, but whether it can identify defects, verify corrections, and stop safely.

Why a single-model, single-pass content workflow breaks under production conditions

A long, carefully crafted prompt still produces an article that reads like a marketing brochure. The facts may look plausible, the structure may satisfy the outline, and the voice may miss the publication entirely. More instructions do not reliably prevent this failure. A single generation moves forward, so an early factual or structural error can propagate uncorrected through everything that follows.

Production workloads compound that weakness through context saturation. An agent that works across several domains over many turns must keep track of research, constraints, structure, and voice as it writes. Those responsibilities compete for attention as the context grows. Separating generation from evaluation gives defects a review path, though the extra calls increase latency and cost. That overhead earns its place only when inconsistent quality is expensive.

The three roles every critic-rewriter loop must assign before any code is written

The generator writes the initial version and subsequent revisions, but does not approve its own work. The critic evaluates the current version and returns specific, structured feedback, but does not control execution. The loop controller’s role is limited to routing revisions, approvals, and escalations, and these boundaries prevent responsibility from becoming conversational guesswork. There are two active language-model roles and a separate control role.

Anthropic’s agent engineering guidance calls the generation-and-evaluation pattern an evaluator-optimizer loop. Its effectiveness depends on a critic constrained to find mistakes. Agreement is not evidence of a successful review. Letterwrite illustrates this separation through adversarial writing kernels, with one agent drafting, several others critiquing, and a convergence step deciding when the council’s voting is complete.

What the generator and critic roles need to produce for the loop to be deterministic

The generator gets locked research facts in structured JSON with key claims and source URLs, along with a constraint stack and the critic’s previous structured feedback. The constraint stack includes a voice file, a guardrail file, and a style reference. Separating research from composition reduces opportunities for invention, although locked inputs do not themselves guarantee factual output. The critic still has to detect departures from those inputs.

The critic returns a machine-readable object with ratings for accuracy, completeness, clarity, and conciseness, each marked PASS, WARN, or FAIL. It also returns specific suggestions and an approved boolean, which becomes true only when every dimension passes or has minor warnings. For example, an invented numerical claim warrants an accuracy failure and a suggestion identifying the unsupported claim. A fabricated attribution requires a similarly traceable correction tied to the named source.

The content-pipeline implementation described in the notes uses a validated Pydantic object in strict JSON-schema mode, with automatic retries. That avoids extracting scores from prose with regex. The generator may use different words on each run, but the controller gets an interface it can count on. Voice files define the target in the generator’s input, while the critic flags deviations from that target. This division prevents an evaluator from inventing new style requirements during revision.

How the loop controller decides when to stop, and what happens when it cannot

Diagram: The Critic-Rewriter Loop: Four Stages to a Stop Decision. Visualizes: Show a deterministic loop with four named stages in sequence: (1) Generator produces a draft using locked JSON research, a constraint stack (voice file, guardrail file…

Google ADK’s LoopAgent documentation makes termination an explicit developer responsibility. The loop does not inherently know when to stop. A hard iteration cap limits expenditure, while a sub-agent can signal satisfactory completion through EventActions(escalate=True) or the built-in exit_loop tool. Approval stops the loop when the work passes, while the cap stops it when the work has not converged.

A production path must distinguish those outcomes. The content-pipeline implementation routes articles that remain below its threshold after three drafts to a needs-review/ directory for human review. Reaching the limit is not approval by exhaustion. Conditional edges that return to earlier nodes also need recursion limits well below framework defaults in cost-sensitive workflows, because a broken condition can otherwise repeat hundreds of times.

The generator’s claim that it applied feedback needs verification. A separate LLM call compares the original, the rewrite, and each feedback item, returning an item-level verdict of applied with evidence or missed. This catches a deceptively quiet failure. The generator can say it made every requested change while leaving the defect in place. Without verification, the controller may treat messages that passed back and forth as proof that the rewrite worked.

Where the loop plugs into an existing developer content stack

The orchestrator is the first integration point. LangGraph provides explicit state graphs for deterministic control flow, while AutoGen is an alternative for multi-model debate patterns. Both make routing explicit and inspectable. Both approaches need the same contracts and rules for when to stop.

Repository constraints supply the next layer of control. CLAUDE.md and .cursor/rules/, which replaces the deprecated .cursorrules format, can define voice guidelines, banned phrases, naming conventions, frontmatter requirements, and protected files. The writing-loop example separates these concerns into a voice file, a fabrication guardrail file, and a style reference drawn from published work. These constraints are executable. Version control lets the team review changes to the writing rules with the same discipline as changes to code.

CI then separates deterministic checks from semantic review. Vale, ESLint, and Prettier run first to catch applicable style and formatting violations, followed by an LLM layer that receives the PR diff and style rules and returns structured review comments. The prose rules in Vale’s configuration apply to writing by humans and models alike. For interoperability, MCP tool servers can expose constraint files and critic rubrics across models. A content store with stable identifiers, upsert-by-ID support, and updates that do not require a deploy provides the final integration point and allows the loop to compare current and previous versions.

Voice fidelity as a loop constraint, not a prompt instruction

A factually correct loop can still converge on generic writing. Model defaults such as passive voice, corporate jargon, and hedged phrasing do not reliably disappear after a few style examples. Voice therefore needs a measurable representation. A Linguistic Fingerprint Index can encode sentence-length distribution, paragraph rhythm, lexical-diversity targets, and hedge and booster counts per hundred words. Those constraints give the generator something more precise than a request to sound authoritative.

A substantial, curated collection of human-written work represents actual patterns more reliably than a handful of examples or a list of aspirations. A dedicated tone-consistency critic can compare revisions against those guidelines and the existing content library. Its rubric also needs explicit avoidance rules. Otherwise, familiar model habits may pass review simply because they appear polished.

This architectural approach is illustrated by Letterwrite’s post-trainable kernels, which can ingest a team’s corpus so that voice informs generation. Its critics return verdicts with scores and a set structure, which keeps writing and evaluation tied to the same contract. Corpus-driven generation and adversarial review address different problems. The former defines the intended voice, while the latter tests whether a particular version respects it.

What watermarking and model fingerprinting mean for teams running critic-rewriter loops

A text watermark can live in generation-time word choices rather than removable metadata, so rewriting does not establish that the output is unmarked. Model variety is not a compliance guarantee. When teams choose the models that generate, revise, and evaluate content, they therefore need to think about how the text might be detected later.

The regulatory and provider claims in the supplied material require separate treatment from the architecture. The material identifies August 2, 2026 and December 2, 2026 as relevant compliance dates, and describes provider announcements in August 2026 and on 5 October 2026. Those dates and claims should not be treated as verified legal or product guidance here. In particular, a blanket exclusion of generated text from watermarking requirements is not a sound basis for compliance planning. Teams need to check what the law covers and what providers do before relying on either in production.

The technical concern also needs a careful distinction. Research on watermark radioactivity concerns models inheriting patterns through training on watermarked output, which is not the same operation as revising text through successive inference calls. Neither mechanism makes detection a simple authorship test. Entropy, burstiness, and stylometric patterns can occur naturally in highly edited technical writing. The practical response is to track which models touch each article, audit their watermark compatibility, and include detection risk in the quality gate without treating detector scores as proof.

The honest case against loops, and when a simpler architecture wins

A critic-rewriter loop can be slower, more expensive, and harder to operate than the content warrants. Each rewrite needs more generation and evaluation, and verification takes another call. For short changelog posts or API tutorials with a narrow scope, a well-built single-model prompt with hard constraints can give better quality for the cost. More agents do not automatically improve the result. Infrastructure and engineering costs also need modeling before the pattern is applied to high-frequency, low-stakes publishing.

Trusted, structured inputs make the simpler approach especially compelling. When the task is to summarize merged PRs, commit messages, or design documents, most of the work may be to reshape what is there. A full adversarial loop may add little beyond checking the text against those fixed inputs. Long-form technical articles carry different risks because the facts, the public voice, and trust all have to hold up together. In those cases, reducing quality variance can justify the extra work.

The decision rule is the cost of establishing confidence. If a team can check whether the output invented anything against fixed inputs in seconds, a loop is probably unnecessary. If a team needs claims it can trace, a voice it recognizes, and confidence that the work is ready to publish, there is more reason to use structured critique.

The minimum viable loop a developer content team can wire this week

Start with three Python scripts or a Node.js loop separating generator, critic, and orchestrator, with structured JSON passed between them. A heavy framework is not a prerequisite. The critic needs per-dimension ratings, specific suggestions, and an approval boolean so that routing never depends on interpreting conversational feedback. The generator needs a corpus-derived voice file and a guardrail file defining what it cannot fabricate, both version-controlled with the code.

Cap the workflow at three drafts and route unresolved articles to a human review queue. Include verification of requested corrections rather than accepting the generator’s account of its changes. Wire Vale checks into every PR diff before the LLM critic layer, reserving model review for semantic and voice issues that deterministic rules cannot encode. Constraints guide what gets written, critique finds defects, verification checks the fixes, and escalation handles work the system cannot finish.

Graduate to a full orchestration layer when branching, inspectable state, or volume makes custom control code difficult to manage. Research, writing, critique, and verification then become clear stages, with calls linked through the orchestration layer. At the fuller end of this spectrum, Letterwrite combines adversarial multi-model review, recursive convergence, and corpus-based post-training capabilities. Its separate shredding step distributes produced writing across dozens of models to reduce single-model reliance, accepting additional runtime in pursuit of lower quality variance. This expanded version of the same engineering choice includes built-in orchestration, model routing, and voice infrastructure.

Developer Content Workflows

Sources