plugins/compound-engineering/skills/document-review/SKILL.md
Review requirements or plan documents using parallel persona agents that surface role-specific issues. Use when a requirements document or plan document exists and the user wants to improve it.
npx skillsauth add gvkhosla/compound-engineering-pi document-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.
Review requirements or plan documents through multi-persona analysis. Dispatches specialized reviewer agents in parallel, auto-fixes quality issues, and presents strategic questions for user decision.
If a document path is provided: Read it, then proceed.
If no document is specified: Ask which document to review, or find the most recent in docs/brainstorms/ or docs/plans/ using a file-search/glob tool (e.g., Glob in Claude Code).
After reading, classify the document:
docs/brainstorms/, focuses on what to build and whydocs/plans/, focuses on how to build it with implementation detailsAnalyze the document content to determine which conditional personas to activate. Check for these signals:
product-lens -- activate when the document contains:
design-lens -- activate when the document contains:
security-lens -- activate when the document contains:
scope-guardian -- activate when the document contains:
Tell the user which personas will review and why. For conditional personas, include the justification:
Reviewing with:
- coherence-reviewer (always-on)
- feasibility-reviewer (always-on)
- scope-guardian-reviewer -- plan has 12 requirements across 3 priority levels
- security-lens-reviewer -- plan adds API endpoints with auth flow
Always include:
compound-engineering:document-review:coherence-reviewercompound-engineering:document-review:feasibility-reviewerAdd activated conditional personas:
compound-engineering:document-review:product-lens-reviewercompound-engineering:document-review:design-lens-reviewercompound-engineering:document-review:security-lens-reviewercompound-engineering:document-review:scope-guardian-reviewerDispatch all agents in parallel using the platform's task/agent tool (e.g., Agent tool in Claude Code, spawn in Codex). Each agent receives the prompt built from the subagent template with these variables filled:
| Variable | Value |
|----------|-------|
| {persona_file} | Full content of the agent's markdown file |
| {schema} | Content of findings-schema.json |
| {document_type} | "requirements" or "plan" from Phase 1 classification |
| {document_path} | Path to the document |
| {document_content} | Full text of the document |
Pass each agent the full document -- do not split into sections.
Error handling: If an agent fails or times out, proceed with findings from agents that completed. Note the failed agent in the Coverage section. Do not block the entire review on a single agent failure.
Dispatch limit: Even at maximum (6 agents), use parallel dispatch. These are document reviewers with bounded scope reading a single document -- parallel is safe and fast.
Process findings from all agents through this pipeline. Order matters -- each step depends on the previous.
Check each agent's returned JSON against findings-schema.json:
Suppress findings below 0.50 confidence. Store them as residual concerns for potential promotion in step 3.4.
Fingerprint each finding using normalize(section) + normalize(title). Normalization: lowercase, strip punctuation, collapse whitespace.
When fingerprints match across personas:
Scan the residual concerns (findings suppressed in 3.2) for:
When personas disagree on the same section:
autofix_class: presentSpecific conflict patterns:
| Autofix Class | Route |
|---------------|-------|
| auto | Apply automatically -- local deterministic fix (terminology, formatting, cross-references) |
| present | Present to user for judgment |
Demote any auto finding that lacks a suggested_fix to present -- the orchestrator cannot apply a fix without concrete replacement text.
Sort findings for presentation: P0 -> P1 -> P2 -> P3, then by confidence (descending), then by document order (section position).
Apply all auto findings to the document in a single pass:
Present all other findings to the user using the format from review-output-template.md:
Brief summary at the top: "Applied N auto-fixes. M findings to consider (X at P0/P1)."
During synthesis, discard any finding that recommends deleting or removing files in:
docs/brainstorms/docs/plans/docs/solutions/These are pipeline artifacts and must not be flagged for removal.
Use the platform's blocking question tool when available (AskUserQuestion in Claude Code, request_user_input in Codex, ask_user in Gemini). Otherwise present numbered options and wait for the user's reply.
Offer:
After 2 refinement passes, recommend completion -- diminishing returns are likely. But if the user wants to continue, allow it.
Return "Review complete" as the terminal signal for callers.
On subsequent passes, re-dispatch personas and re-synthesize. The auto-fix mechanism and confidence gating prevent the same findings from recurring once fixed. If findings are repetitive across passes, recommend completion.
tools
Triage and categorize findings for the CLI todo system
development
Always-on code-review persona. Reviews code for test coverage gaps, weak assertions, brittle implementation-coupled tests, and missing edge case coverage. Spawned by the ce:review-beta skill as part of a reviewer ensemble.
tools
Build and test iOS apps on simulator using XcodeBuildMCP
testing
Run browser tests on pages affected by current PR or branch