skills/writing-review/SKILL.md
Internal skill for hierarchical document review. Called by writing-validate after claim validation passes.
npx skillsauth add edwinhu/workflows writing-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Hierarchical bottom-up review that diagnoses structural problems across a drafted document. Produces .planning/REVIEW.md — a structured diagnosis consumed by /writing-revise.
Prerequisites: PRECIS.md, OUTLINE.md, ACTIVE_WORKFLOW.md, and draft files in drafts/ must exist.
Auto-load all constraints matching applies-to: writing-review:
!uv run python3 ${CLAUDE_SKILL_DIR}/../../scripts/load-constraints.py writing-review
You MUST have these constraints loaded before proceeding. No claiming you "remember" them.
CRITICAL: The constraint-loading-protocol above requires loading the domain skill (writing-legal/econ/general) and ai-anti-patterns before reviewing any prose — see Steps 2 and 2b below.
Before starting, check for an existing handoff:
.planning/HANDOFF.md existsNO REVIEW WITHOUT READING. Every claim in REVIEW.md must cite specific text from the draft. This is not negotiable.
If you find yourself writing a review comment without quoting the draft text it refers to:
A review that says "transitions could be improved" without citing the actual transition text is useless. A review that says "Section III ends with 'The market has spoken.' and Section IV opens with 'Turning to regulatory concerns...' — no bridge connects the market conclusion to the regulatory pivot" is actionable.
The writing-review workflow now enforces this structurally: every reviewer it dispatches must attach a verbatim quote + file:line to each issue, so a review without reading cannot be produced.
</EXTREMELY-IMPORTANT>
NO PASSES WITHOUT EVIDENCE. Checking a box requires quoting the text that satisfies it. This is not negotiable.
If you find yourself marking something as "OK" or "no issues found":
"Transitions are smooth" is a lie unless you can quote adjacent section boundaries and explain why they connect. "No repetition found" is a lie unless you compared the argument summaries across all sections.
Reporting "all checks pass" without evidence for every checkmark is NOT HELPFUL — undetected issues survive into the published document.
The writing-review workflow now enforces this structurally: its reviewers return quoted evidence per finding, and a mechanical Verify stage confirms each quote resolves to the draft — fabricated or misattributed quotes are dropped before they reach REVIEW.md. Evidence-grounding is no longer honor-system; it is built into the workflow. </EXTREMELY-IMPORTANT>
<EXTREMELY-IMPORTANT> ## Iron Law: Structural IndependenceREVIEW MUST BE PERFORMED BY FRESH SUBAGENTS THAT DO NOT SHARE CONTEXT WITH THE DRAFTER. This is not negotiable.
The drafter's context contains intent, shortcuts, and assumptions that bias review. A fresh reader catches what the author cannot see. Reviewing your own draft in the same context is rubber-stamping, not reviewing.
The writing-review workflow now guarantees this by construction: it always dispatches fresh reviewer subagents (structure, prose, fidelity) that read each draft cold. You do not — and must not — review draft prose in the main conversation yourself. </EXTREMELY-IMPORTANT>
If you catch yourself in any of these violations, the review output is contaminated. Delete it and start over:
| Violation | Why Contaminated | Action | |---|---|---| | Reviewed a section without reading its draft file | You fabricated a review from outline knowledge | DELETE REVIEW.md. Read every draft. Start Level 1 over. | | Reviewed your own draft in the same context (no fresh subagent) | Self-review is rubber-stamping — you share the drafter's biases | DELETE the section review. Spawn a fresh subagent. Re-review. | | Wrote REVIEW.md without completing all 3 levels | Partial review misses cross-section issues | DELETE REVIEW.md. Complete all levels. Regenerate. |
Partial fixes to contaminated reviews create worse outcomes than restarting. A review built on fabricated evidence will misdirect writing-revise into "fixing" non-problems while real issues persist.
Read(".planning/ACTIVE_WORKFLOW.md")
Read(".planning/PRECIS.md")
Read(".planning/OUTLINE.md")
Glob("outlines/*.md")
Glob("drafts/*.md")
Verify: every section in OUTLINE.md has both an outline file and a draft file. If any draft is missing, STOP and report — you cannot review what doesn't exist.
Based on style in ACTIVE_WORKFLOW.md:
| Style | Action |
|---|---|
| legal | Read("${CLAUDE_SKILL_DIR}/../../skills/writing-legal/SKILL.md") |
| econ | Read("${CLAUDE_SKILL_DIR}/../../skills/writing-econ/SKILL.md") |
| general | Read("${CLAUDE_SKILL_DIR}/../../skills/writing-general/SKILL.md") |
The domain skill contains style rules that inform your review criteria. You MUST read it before reviewing.
Skill(skill="workflows:ai-anti-patterns")
You MUST load ai-anti-patterns before reviewing. Domain skills inform domain-specific review criteria; ai-anti-patterns catches AI writing smell (hedging, filler, false balance) that domain skills don't cover. Both layers are required — see constraints/constraint-loading-protocol.md.
Before any review work, run all mechanical constraint checks:
uv run --with lxml python3 ${CLAUDE_SKILL_DIR}/../../references/constraints/check-all.py [project-root]
This auto-discovers and runs all writing-*.py constraint scripts (bold-lead, topic sentences, source-anchored citations, etc.). If any check fails, report violations and fix them before proceeding to Level 1.
Constraint checks are Leg 1 of two-leg verification. Leg 2 (convention scoring via reviewer subagents) happens in Level 1.
hooks/writing-mechanical-gate.py re-runs this same check-all when the Workflow spawns moments later — a mandatory gate, not a suggestion you can skip. To avoid running check-all twice on an unchanged draft, that gate (only that gate; the dev/ds mechanical-floor gate always re-runs fresh) caches the last successful verdict in .planning/.checkall-cache.json, keyed on a hash of drafts/*.md + the constraint files, and reuses it when nothing has changed since your Leg-1 run.
Run the corpus-validated AI-prose scorer on every draft. This is not optional — the
review always includes scorer-based AI-ism findings so the de-AI pass in /writing-revise
has spans to act on:
uv run --with pyyaml python3 ${CLAUDE_SKILL_DIR}/../de-ai-revise/scripts/de_ai_audit.py --json drafts/*.md
Carry these into the review:
diction:always_flag spans and tic spans with sev_score >= 4 → AI-ism findings. List them in REVIEW.md (as minor advisory polish, unless several cluster in one section → major). Each carries line, text, and replace_with.composite_human_likeness + tic_density + advisories → record per draft as context for the revise loop.de-ai-revise Iron Law of Goodhart). The substrate gate (critical+major) is unchanged.The fix for these findings is /writing-revise's mandatory de-ai-revise pass — review only surfaces them.
The review is always parallel and is owned by an ultracode workflow script — you do NOT choose a strategy and you do NOT dispatch reviewers yourself. The workflow runs all three levels (per-section structure + prose + fidelity fan-out, mechanical quote-verification, transition analysis, and whole-document checks) in the background and returns structured findings.
1. Resolve the cached workflow path:
WF=$(command ls -d ~/.claude/plugins/cache/*/workflows/*/workflows/writing-review.js 2>/dev/null | sort -V | tail -1)
# Fall back to the in-repo path when running from the plugin source (cache glob empty):
[ -z "$WF" ] && WF="${CLAUDE_SKILL_DIR}/../../workflows/writing-review.js"
2. COMPILE the deterministic section index (the writing analog of ds/dev's compile step — replaces the workflow's LLM Discover with a regex-parse of the approved planning artifacts; the SAME parser the writing-draft skill and the outline-executable guard use, so the section set can't drift between phases):
uv run python3 ${CLAUDE_SKILL_DIR}/../../scripts/writing/writing_section_index.py "<abs project dir>" > .planning/section-index.json
Read .planning/section-index.json. If ok, pass the parsed object as sectionIndex below. If it carries violations / staleApproval (e.g. a *_REVIEWED.md whose claim/Part count disagrees with the live OUTLINE.md — a stale approval after a reframe), surface them — they are spec-integrity failures fixed upstream. On a hard error, omit sectionIndex (the workflow falls back to its LLM Discover).
3. Invoke the workflow:
Workflow({
scriptPath: "<WF>",
args: {
projectDir: "<abs project dir>", // holds .planning/, outlines/, drafts/, references/sources.bib
pluginRoot: "${CLAUDE_SKILL_DIR}/../..", // resolves domain skill + bridge_repetition_check.py
sectionIndex: <parsed .planning/section-index.json, or omit for the LLM Discover fallback>
}
})
The workflow runs Levels 1-3 and returns:
overallPass / substratePass (== critical===0 && major===0 — the blocking gate; minors are advisory, not blocking), verdict (CLEAN | CLEAN (advisory polish notes) | ISSUES FOUND)summary ({ critical, major, minor, total, blocking, advisoryMinors })stylesections[] — per-section issues (each tagged source: structure | prose | fidelity), boundary, argumentSummary, unreliabletransitions[] — adjacent boundary verdictsdocumentLevel — { conceptOrderIssues, repetition, thesisIssues, completeness }unreliableSections — sections where a reviewer returned nothingsectionsThatFlagged — sections to pass as onlyChecks on a re-reviewRe-review (when /writing-revise re-invokes after edits): pass only the changed sections so the workflow re-reviews them and carries the rest forward:
Workflow({
scriptPath: "<WF>",
args: {
projectDir: "<abs project dir>",
pluginRoot: "${CLAUDE_SKILL_DIR}/../..",
onlyChecks: [<changed section names>], // re-review only these
priorReviews: <previous result.sections> // carry the rest forward
}
})
Note:
references/agent-team-workflow.mdandreferences/reviewer-agent-prompt.mdare SUPERSEDED byworkflows/writing-review.js— the script replaces the hand-rolled agent-team orchestration, andreferences/sequential-checklist.md's content now lives in the workflow's structure-reviewer prompt. Those reference files are retained for provenance only; do not follow them to dispatch reviewers.
Write .planning/REVIEW.md from result.* using the template in references/review-template.md:
result.summary (critical, major, minor, total)result.verdictresult.documentLevel (conceptOrderIssues, repetition, thesisIssues, completeness)result.transitions (one block per non-SMOOTH boundary; quote closes/opens)result.sections — list each section's issues sorted by severity; each issue carries source (structure / prose / fidelity), location (file:line), quote, detail, and fixresult.sections[].boundaryIf result.unreliableSections is non-empty, mark those sections UNRELIABLE in REVIEW.md (a reviewer returned nothing for them) — do NOT fabricate findings or a clean verdict for them.
The workflow's reviewers already cite verbatim quotes with file:line and a mechanical Verify stage drops any quote that does not resolve to the draft, so the findings you render are evidence-grounded by construction. Render them faithfully — do not add, invent, or soften.
Full REVIEW.md template: See
references/review-template.md
Before declaring review complete:
.planning/REVIEW.md existshuman-verify — auto-advance to /writing-revise..planning/PHASE_SUMMARY.md (see constraints/phase-summary-frontmatter.md):
If any section is missing from REVIEW.md, the review is incomplete. Go back.
Update .planning/ACTIVE_WORKFLOW.md:
phase: review
review_completed: true
issues_found: [total count]
critical_issues: [critical count]
Review complete. Results written to .planning/REVIEW.md.
Found [N] issues ([critical] critical, [major] major, [minor] minor).
[If issues found]:
Run /writing-revise to fix issues from the review.
[If clean]:
No issues found. Run /writing-revise to complete the workflow.
Tag each reported issue with a confidence level:
| Level | Threshold | Placement | |---|---|---| | HIGH | >= 90% certain this is a real problem | Main report — fix required | | MEDIUM | >= 80% certain | Main report — fix recommended | | LOW | < 80% certain | Separate "Possible Issues" section at end of REVIEW.md |
Only issues at HIGH or MEDIUM confidence appear in the main report. LOW confidence issues go in a separate "Possible Issues" section so they are visible but do not clutter actionable fixes. This prevents false positives from overwhelming /writing-revise.
After review is complete:
Invoke /writing-revise to fix issues identified in .planning/REVIEW.md.
development
Build the meeting-level proxy-voting × ownership panel on the WRDS SGE grid — ISS N-PX fund votes reduced to (item × block) direction cells, joined to institutional and mutual-fund ownership. Use when working with risk.voteanalysis_npx, N-PX fund-level votes, ISS→CRSP fund linking, index/passive/active voting blocks, or a proxy-voting panel that needs ownership attached.
development
Use when "CRSP CIZ", "CRSP v2", "CRSP flat file format 2.0", "crsp.dsf_v2 / msf_v2", "StkDlySecurityData", "StkMthSecurityData", "StkSecurityInfoHist", "stocknames_v2", "DlyRet / MthRet / DlyPrc / MthPrc", "SHRCD or EXCHCD equivalent in new CRSP", "SIZ to CIZ migration", "CRSP data after 2024", "CRSP delisting returns", "CRSP cumulative adjustment factors", "CRSP index INDNO / INDFAM", or any CRSP stock/index query where the legacy SIZ column names no longer exist.
development
Use when linking or deduping datasets by entity name rather than a shared key — 'fuzzy match', 'fuzzy name matching', 'entity resolution', 'record linkage', 'match company/person names', 'dedupe entity names', 'name-based join', 'bridge identifiers' (CIK ↔ permno ↔ gvkey ↔ wficn ↔ EIN ↔ personid), or any use of char n-gram TF-IDF, cosine similarity on names, `sparse_dot_topn`, or RapidFuzz at scale.
development
Use when building a publication-quality table in Python — 'regression table', 'results table', 'summary statistics table', 'etable', 'coefplot', 'great_tables', 'GT', 'gt table', 'format a table for the paper', 'export table to LaTeX/HTML', significance stars, spanners, or column formatting for a table headed into a paper, slide deck, or notebook.