doc-review
Skill0 starsChanged 8 months agoCC0-1.0View on GitHub
Automated Codex review loop for design proposals and implementation plans. Warms a single Codex session across iterations, applies edits directly to the doc without touching git, and converges on `VERDICT NO_MAJOR_ISSUES`. Git is only touched if the user opts in (pre-flight warning + optional single post-loop commit). Invoke as `/doc-review <doc-path> [focus]`.
9 other projects use a version of this.
Adopted by
Most recently taken up by
- sd0xdev/sd0x-harnesstheir own version, first seen Sep 26, 2026
- ffroliva/gflow-clitheir own version, first seen Sep 14, 2026
- JingHao-Leon/fde-case-labtheir own version, first seen Sep 13, 2026
- tlzmw001/aitest-kittheir own version, first seen Aug 13, 2026
- ichangting/taotao-skillstheir own version, first seen Jul 28, 2026
- momentmaker/kaijutsutheir own version, first seen May 20, 2026
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- ffroliva/gflow-cli★ 256same name
- sd0xdev/sd0x-harness★ 191same name
- tlzmw001/aitest-kit★ 13same name
- ichangting/taotao-skills★ 12same name
- momentmaker/kaijutsu★ 3same name
- clearsmog/claude-skills★ 2same name
- andrewclark88/skills★ 1same name
- JingHao-Leon/fde-case-lab★ 0same name
- Saiki77/surfacer-kb-mcp★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- attio-cliSkill
- close-crmSkill
- context7Skill
- gpt-image-1-5Skill
- imagemagickSkill
- markdown-converterSkill
- nano-banana-2Skill
- nano-banana-proSkill
- notion-apiSkill
- tavilySkill
- todoist-apiSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
26 rules. 0 are common, 14 are distinctive, and 12 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
14
Distinctive
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 35
If a doc doesn't fit cleanly into either bucket, pass --type explicitly to pick the lens you want.
- Very specific: line 37
All state and reports land in .codex-review/<doc-slug>/ in the working directory where Claude Code is running (not in the plugin/skill …
- Distinctive: line 41
The sidecar NEVER touches git: No stage, no commit, no diff, no show.
- Very specific: line 43
Pre-flight (Step 0): if <doc-path> has uncommitted changes going into the review, warn the user and offer to commit them first — so the …
- Distinctive: line 44
Post-loop (Step 4): after the loop exits, ask the user whether to stage and commit the accumulated doc edits as a single commit.
- Distinctive: line 45
If the user declines either prompt, the skill proceeds without touching git.
- Distinctive: line 46
If the working directory is not a git repo, both prompts are skipped silently.
- Distinctive: line 66
Before invoking the sidecar for iteration 1 (skip entirely on resume — pre-flight was handled on the original run):
- Distinctive: line 68
If not inside a git repo (git rev-parse --is-inside-work-tree fails), skip this step silently.
- Distinctive: line 70
If the doc is dirty (staged or unstaged changes), tell the user:
- Very specific: line 76
If other unrelated paths are dirty in the working tree, ignore them — this step cares only about <doc-path>.
- Very specific: line 80
If invoked with --status, run node ...
- Very specific: line 81
If invoked with --reset, run node ...
- Very specific: line 83
If state.json already exists for this doc and --reset was not used, announce "Resuming from iteration <last-completed + 1>." Skip Step 0.
- Distinctive: line 117
Read only the affected sections of the doc itself to confirm the finding makes sense.
- Distinctive: line 121
If a finding is clearly wrong (e.g., names a function that doesn't exist and the recommendation depends on it existing), reject it and …
- Distinctive: line 126
Do not expand scope, refactor unrelated sections, or rewrite the doc from scratch.
- Very specific: line 137
If you made no edits this round (every finding was a nit or rejected), pass --no-changes (and optionally a --note="..." describing why).
- Distinctive: line 139
Keep notes tight and user-facing — they get printed verbatim in the final report.
- Very specific: line 149
If the sidecar reported converged: true → go to Step 3 with reason converged.
- Very specific: line 150
If iter >= max → go to Step 3 with reason cap-hit.
- Distinctive: line 182
Keep each line to one sentence.
- Distinctive: line 191
If not a git repo, or the doc has no unstaged edits (e.g., the loop made zero changes), skip the commit prompt.
- Distinctive: line 207
Never begin implementation: after the loop. The output is an improved doc.
- Very specific: line 210
If codex is not available or returns auth errors, tell the user to run codex login or /codex:setup and stop.
- Very specific: line 217
Pre-flight commit conflicts: if Step 0's commit fails (e.g., a pre-commit hook rejects it), surface the error and stop — let the user …
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Doc Review Loop
FOR CLAUDE CODE ONLY. Automate the iterative review workflow for markdown design docs and implementation plans. A sidecar CLI owns the Codex session lifecycle and state; this skill drives the loop, classifies findings, edits the doc, and handles the two optional git touch-points (pre-flight warn, post-loop single commit). The sidecar itself never runs git commands that mutate state.
Invocation
/doc-review <doc-path> [focus phrase...]
/doc-review --type=plan|design <doc-path>
/doc-review --max=N <doc-path>
/doc-review --timeout=<minutes> <doc-path>
/doc-review --resume <doc-path> # default behavior when state already exists
/doc-review --reset <doc-path> # archive prior loop and start fresh
/doc-review --status <doc-path> # print state.json and exit, no iteration<doc-path>(required): path to the markdown file. If missing, stop immediately and ask the user to provide it — never guess.--type=<plan|design>(optional): selects the review lens. Auto-detects from path when omitted — common conventions like/plans/are treated as plan;/design-docs/,/design/,/proposals/as design; fallback is plan. Pass explicitly when the project uses different conventions or when the heuristic is likely wrong for this doc.--max=N(optional): hard iteration cap. Default 6. Maximum 10. Sidecar refuses further iterations past the cap.--timeout=<minutes>(optional): per-iteration Codex timeout. Default 20. Max 60. Bump when reviewing dense plans; xhigh review of a big plan can take longer.- Remaining text (optional): focus comment passed to every iteration (e.g., "pay attention to error handling around retries").
Review lens: design doc vs. implementation plan
The two doc types get meaningfully different prompts:
- Design doc (principles, UX, architecture): review lens is coherence and cross-doc referential integrity. Codex verifies citations against the docs they point at, checks that illustrated flows map cleanly to the named decisions, and flags unacknowledged trade-offs, blurry scope boundaries, and over-specification that leaks code-level detail belonging in a plan.
- Implementation plan (concrete work for a coding agent): review lens is claim accuracy against the actual code. Codex opens the source files the plan names and verifies every function / type / column / config reference; checks step ordering and commit boundaries; validates the testing strategy against whatever testing conventions the project encodes; and flags ambiguities a fresh coding agent would resolve wrong.
If a doc doesn't fit cleanly into either bucket, pass --type explicitly to pick the lens you want.
All state and reports land in .codex-review/<doc-slug>/ in the working directory where Claude Code is running (not in the plugin/skill directory). The sidecar adds .codex-review/ to .gitignore on first run if not present.
Git discipline
- The sidecar NEVER touches git. No stage, no commit, no diff, no show. The review loop is a pure sequence of doc edits.
- Git is touched only at two optional user-consented points, both driven by this skill via plain Bash
gitcalls:- Pre-flight (Step 0): if
<doc-path>has uncommitted changes going into the review, warn the user and offer to commit them first — so the review's edits can be cleanly reviewed as a separate diff at the end. - Post-loop (Step 4): after the loop exits, ask the user whether to stage and commit the accumulated doc edits as a single commit.
- Pre-flight (Step 0): if
- If the user declines either prompt, the skill proceeds without touching git. The doc ends the loop with whatever uncommitted edits the review applied — the user reviews and commits on their own time.
- If the working directory is not a git repo, both prompts are skipped silently.
Sidecar CLI
The sidecar lives at ${CLAUDE_PLUGIN_ROOT}/scripts/doc-review.mjs — invoke it via node. It is pure plumbing: it owns the Codex process lifecycle, session-id capture, prompt substitution, and state persistence. It does not reason about findings — that's this skill's job — and it does not touch git.
node "${CLAUDE_PLUGIN_ROOT}/scripts/doc-review.mjs" status <doc-path>
node "${CLAUDE_PLUGIN_ROOT}/scripts/doc-review.mjs" next <doc-path> [--max=N] [--timeout=<minutes>] [--effort=xhigh] [--model=gpt-5.4] [--focus="..."]
node "${CLAUDE_PLUGIN_ROOT}/scripts/doc-review.mjs" record-iteration <doc-path> --note="<one-line summary>" [--no-changes]
node "${CLAUDE_PLUGIN_ROOT}/scripts/doc-review.mjs" finish <doc-path> --reason=converged|cap-hit|aborted
node "${CLAUDE_PLUGIN_ROOT}/scripts/doc-review.mjs" reset <doc-path>next prints a single JSON line on stdout with the fields {iter, report_path, status_path, converged, blocking_count, total_count, verdict}. Parse it and act on verdict / converged. Exit code is non-zero if Codex errored — read the printed hint (e.g., "run codex login") and stop.
Execution contract
Step 0 — Pre-flight git check
Before invoking the sidecar for iteration 1 (skip entirely on resume — pre-flight was handled on the original run):
- If not inside a git repo (
git rev-parse --is-inside-work-treefails), skip this step silently. - Otherwise, run
git status --porcelain -- <doc-path>. If the output is empty, skip. - If the doc is dirty (staged or unstaged changes), tell the user:
<doc-path>has uncommitted changes. Committing them first keeps the review's edits reviewable as a separate diff. Options:yes(I commit them now),no(proceed with them included — review edits will mix with your existing changes),abort. - On
yes: stage only<doc-path>, commit with messagepre-doc-review: save existing edits to <doc-slug>+ Claude co-author footer. Confirm the SHA to the user, then proceed. - On
no: proceed. - On
abort: stop; do not initialize the loop.
If other unrelated paths are dirty in the working tree, ignore them — this step cares only about <doc-path>.
Step 1 — Initialize
- If invoked with
--status, runnode ... status <doc-path>, print the JSON, stop. - If invoked with
--reset, runnode ... reset <doc-path>first, then proceed with a fresh loop (re-run Step 0). - Announce to the user: "Starting
/doc-reviewon<doc-path>— max=N iterations, focus=<focus or 'none'>. State and reports:.codex-review/<doc-slug>/." - If state.json already exists for this doc and
--resetwas not used, announce "Resuming from iteration<last-completed + 1>." Skip Step 0.
Step 2 — Review loop
Repeat until a stop condition fires. For each iteration:
2a. Call the sidecar to run Codex
node "${CLAUDE_PLUGIN_ROOT}/scripts/doc-review.mjs" next <doc-path> [--max=N] [--focus="..."]- Iteration 1: the sidecar runs
codex exec --json --output-last-message iter-1-report.md -m gpt-5.4 -c model_reasoning_effort=xhigh "<initial-prompt>"and captures the session id from the JSONL event stream. - Iteration N>1: the sidecar runs
codex exec resume <session-id> --json --output-last-message iter-N-report.md -m gpt-5.4 -c model_reasoning_effort=xhigh "<followup-prompt>", reusing the same Codex thread (warm context). The followup prompt tells Codex the doc was revised and to re-read it with fresh eyes — Codex uses its warm-context memory of the prior version to spot what changed. No diffs or snapshots are fed in.
Tell the user: "Iteration N — Codex running (warm context, session <id-prefix>)…"
Timeout per iteration is 20 minutes (override with --timeout=<minutes>, hard cap 60). On timeout the sidecar leaves pending_iter set and the session resumable — re-run next to retry.
2b. Read the report
Open .codex-review/<slug>/iter-N-report.md. It contains Codex's full review followed by a single VERDICT: line (NO_MAJOR_ISSUES or ISSUES_REMAIN). The sidecar already parsed the verdict and reported it in the JSON stdout — trust that for loop control, but read the report for the findings.
2c. Classify findings
For each finding in the report:
- Blocking:
criticalorhighseverity — logical errors, incorrect file/API references, missing steps, architectural issues, dangerous ambiguity. - Nit:
mediumorlowseverity — wording tweaks, style preferences, optional enhancements. Default to skip; note them in the per-iteration report for the user.
2d. Validation discipline (lightweight)
For each blocking finding:
- Read only the affected sections of the doc itself to confirm the finding makes sense.
- Spot-check one or two source-code references only if a finding looks self-contradictory, names a surprising path/function, or contradicts your prior knowledge of the code.
- Trust the rest — Codex was run with
xhigheffort and the rigorous prompt. Exhaustively re-verifying every finding is the credit-burning anti-pattern this skill is meant to avoid.
If a finding is clearly wrong (e.g., names a function that doesn't exist and the recommendation depends on it existing), reject it and record the one-line reason.
2e. Apply fixes
- One
Editper finding, scoped to the flagged section. - Do not expand scope, refactor unrelated sections, or rewrite the doc from scratch.
- Preserve the doc's existing format and structure.
2f. Record the iteration
node "${CLAUDE_PLUGIN_ROOT}/scripts/doc-review.mjs" record-iteration <doc-path> --note="<2-line summary of what changed this round>"The sidecar writes iter-N-applied.md with the note and appends the note to state.iter_notes. No staging, no commit, no git interaction.
If you made no edits this round (every finding was a nit or rejected), pass --no-changes (and optionally a --note="..." describing why). The sidecar records that no edits happened — the next iteration's prompt will reflect this.
Keep notes tight and user-facing — they get printed verbatim in the final report.
2g. Report inline to the user
One compact line:
Iteration N: M findings → A applied, S skipped (nits), R rejected (reason). Verdict:
NO_MAJOR_ISSUES|ISSUES_REMAIN.
2h. Iterate or stop
- If the sidecar reported
converged: true→ go to Step 3 with reasonconverged. - If
iter >= max→ go to Step 3 with reasoncap-hit. - Else → back to 2a.
Step 3 — Finalize sidecar state
node "${CLAUDE_PLUGIN_ROOT}/scripts/doc-review.mjs" finish <doc-path> --reason=converged|cap-hit|abortedThe sidecar writes .codex-review/<slug>/final-summary.md aggregating: doc path, iterations run, terminal reason, per-iteration applied notes, last Codex verdict, any remaining medium/low findings worth considering.
Step 4 — Report to the user and offer commit
Print a compact report to chat in this shape (adapt to actual findings; keep it tight):
Doc review on <doc-path>: <status> after N/M iterations.
Per-iteration findings:
- iter 1: <one-line summary of blocking findings>.
- iter 2: <one-line summary>.
- ...
- iter N: <one-line summary OR "clean — VERDICT: NO_MAJOR_ISSUES">.
Edits applied:
- iter 1: <note from record-iteration>.
- iter 2: <note>.
- ...
Full reports: <final-summary-path>Keep each line to one sentence. The user reads this to quickly sanity-check whether anything went off the rails — do not include raw severity counts, Codex quotes, or long excerpts.
Then, if inside a git repo and the doc has unstaged edits (git status --porcelain -- <doc-path> non-empty), ask:
Doc review made edits across N iterations, currently uncommitted. Commit as a single commit? Options:
yes(stage and commit<doc-path>only, message:doc-review: <terminal-reason> after N iterations (<doc-slug>)),no(leave uncommitted for you to review/stage manually).
- On
yes:git add -- <doc-path>,git commit -m "<message with Claude co-author footer>", confirm SHA to user. - On
no: print the exact command the user can run themselves and stop.
If not a git repo, or the doc has no unstaged edits (e.g., the loop made zero changes), skip the commit prompt.
Do NOT begin implementation. The terminal state is "doc is ready for your review."
Stop conditions (any one triggers terminal state)
- Codex returns
VERDICT: NO_MAJOR_ISSUES. iter == max(default 6).- Sidecar reports an unrecoverable error after one retry (e.g.,
codexauth dead, disk full). - User Ctrl-C — state survives, next
/doc-review <same-path>resumes from the last completed iteration without re-running it.
Important constraints
- Codex never edits the doc. The sidecar does not pass
--writeor--dangerously-bypass-approvals-and-sandbox. All edits happen via Claude Code'sEdittool — the human-in-the-loop safety net against Codex hallucination. - Sidecar never touches git. Git is only touched via explicit Bash calls in Step 0 and Step 4, with user consent each time.
- Never rewrite the doc from scratch. Each iteration makes targeted, validated fixes to flagged sections only.
- Never begin implementation after the loop. The output is an improved doc.
- Always verify a blocking finding before applying it if the recommendation names a surprising path/function or contradicts your prior knowledge — but do not exhaustively second-guess every finding.
- State lives in the CWD, not the skill.
.codex-review/<slug>/is written relative to the working directory Claude Code was launched in. The sidecar refuses to write outside CWD. - If
codexis not available or returns auth errors, tell the user to runcodex loginor/codex:setupand stop.
Troubleshooting
- "state dir locked": another
doc-review nextis running on the same doc. Wait or inspect.codex-review/<slug>/.lock. - Resume after crash: just re-run
/doc-review <same-doc-path>. The sidecar detects dirty state, re-runs the incomplete iteration cleanly using the stored session id (no fresh thread, no re-exploration). - Session id missing: rare; sidecar falls back to scanning
~/.codex/sessions/for the newest file written during the run. If still missing,resetand start a fresh session. - Pre-flight commit conflicts: if Step 0's commit fails (e.g., a pre-commit hook rejects it), surface the error and stop — let the user resolve before re-running
/doc-review. Don't bypass hooks. - Post-loop commit conflicts: same — if the final commit fails, tell the user and leave the doc edits in place. Don't retry destructively.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

