← Systems
Evaluator-optimizer loop prototype updated 2026-06-15

Self-correcting draft loop

A writing harness that drafts, cleans, gates, and reviews until the output passes, then commits.

Most “write with AI” setups stop at the draft. This one treats the draft as the start of a loop. The model generates, a skill cleans, a hook enforces a hard rule the model cannot skip, and a separate reviewer decides whether the work ships. Nothing leaves the loop until it passes.

failpassbelow barpassesOutlineDraft from outline ·promptHumanizer · skillNo em dash gate · hookReviewer · subagentcommit · commandShipped

How it runs

The outline feeds a draft prompt. The draft passes through the humanizer skill, which strips AI tells. A PostToolUse hook then checks the file for em dashes and fails the write if it finds any, which feeds a correction straight back to the model. Only clean text reaches the reviewer subagent, which scores it against fixed criteria in isolation and returns a verdict. A failing score loops back to a fresh draft with the reviewer’s notes attached. A passing score hands off to the commit command.

Why each piece is its own primitive

The skill, hook, subagent, and command are not one big prompt. They are separate because they fail differently. The hook is deterministic, so it belongs in code, not in an instruction the model can rationalize past. The reviewer runs in its own context so its judgment is not anchored by the draft’s reasoning. Keeping them separate is what makes the loop debuggable: when output is wrong, you know which stage to fix.

Composed of