一键导入
doc-review
Comprehensive markdown document review - anchors, accuracy, SSOT, cross-references, and redundancy analysis.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Comprehensive markdown document review - anchors, accuracy, SSOT, cross-references, and redundancy analysis.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Clean up merged and stale branches from local and remote repositories. Use when branch list is cluttered or after merging PRs.
Generate document index files (manifest, bundles, graph, router) for project documentation. Creates docs/.index/ with searchable registry, feature-grouped bundles, cross-reference dependency graph, and query routing. Supports flat mode (generic projects, script-driven) and grouped mode (projects with doc_id frontmatter, Claude-curated).
Enforce complete implementation of all tiers/difficulty levels for tiered features. Prevents partial implementations.
Create well-structured GitHub issues using the 5W1H framework with proper labels and acceptance criteria.
Automate GitHub issue workflow - select issue, create branch, implement, build, test, and create PR.
Interactive review of stale, flagged, and duplicate memories from the latest audit report. Walks entries one at a time with verify / quarantine / edit / skip choices.
基于 SOC 职业分类
| name | doc-review |
| description | Comprehensive markdown document review - anchors, accuracy, SSOT, cross-references, and redundancy analysis. |
| argument-hint | [docs-directory] [--scope anchors|accuracy|ssot|all] [--fix] [--solo|--team] |
| user-invocable | true |
| disable-model-invocation | true |
| allowed-tools | Bash(git *) |
| context | fork |
| agent | general-purpose |
| loop_safe | true |
| halt_conditions | [{"type":"success","expr":"review report emitted with all in-scope findings"},{"type":"failure","expr":"fatal error reading the docs directory or scope cannot be resolved"}] |
| on_halt | Emit partial report listing what was reviewed and what was skipped |
| iso_class | none |
Comprehensive markdown document review with parallel agent analysis.
/doc-review # Review all docs (auto-detect directory)
/doc-review docs/reference # Specify docs directory
/doc-review --scope anchors # Anchor validation only
/doc-review --scope accuracy # Accuracy/consistency only
/doc-review --scope ssot # SSOT/redundancy only
/doc-review --scope all --fix # Full review with auto-fix
/doc-review --solo # Force solo mode (subagents)
/doc-review --team # Force team mode (Agent Teams)
/doc-review docs/ --scope all --fix --team # Full review, team mode, auto-fix
[docs-directory]: Path to documentation directory (optional)
docs/reference/ → docs/ → ./.md files are analyzed[--scope <phase>]: Limit review to a specific phase (optional)
anchors — Phase 1 only (anchor/link validation)accuracy — Phase 2 only (accuracy/consistency)ssot — Phase 3 only (SSOT/redundancy)all — All phases (default)[--fix]: Automatically apply fixes and commit (optional)
--fix: Report-only mode (no file modifications)--fix: Apply fixes → re-validate → commit[--solo|--team]: Execution mode override (optional)
--solo — Force solo mode (independent subagents, no coordination)--team — Force team mode (Agent Teams with shared task list)Parse $ARGUMENTS and extract directory, scope, and fix flag:
ARGS="$ARGUMENTS"
DOCS_DIR=""
SCOPE="all"
FIX_MODE=false
EXEC_MODE=""
# Extract flags
if [[ "$ARGS" == *"--fix"* ]]; then
FIX_MODE=true
ARGS=$(echo "$ARGS" | sed 's/--fix//g')
fi
if [[ "$ARGS" == *"--solo"* ]]; then
EXEC_MODE="solo"
ARGS=$(echo "$ARGS" | sed 's/--solo//g')
elif [[ "$ARGS" == *"--team"* ]]; then
EXEC_MODE="team"
ARGS=$(echo "$ARGS" | sed 's/--team//g')
fi
if [[ "$ARGS" =~ --scope[[:space:]]+([a-z]+) ]]; then
SCOPE="${BASH_REMATCH[1]}"
ARGS=$(echo "$ARGS" | sed -E 's/--scope[[:space:]]+[a-z]+//g')
fi
# Remaining argument is docs directory
DOCS_DIR=$(echo "$ARGS" | xargs)
# Auto-detect if not specified
if [ -z "$DOCS_DIR" ]; then
if [ -d "docs/reference" ]; then
DOCS_DIR="docs/reference"
elif [ -d "docs" ]; then
DOCS_DIR="docs"
else
DOCS_DIR="."
fi
fi
Determine whether to run in Solo mode (independent subagents) or Team mode (coordinated Agent Teams).
FILE_COUNT=$(find "$DOCS_DIR" -name "*.md" -type f | wc -l | xargs)
--solo or --team flag was providedSkip mode selection — use $EXEC_MODE directly.
Auto-recommend based on file count, then ask the user:
| File Count | Recommended Mode | Reason |
|---|---|---|
| 1-10 | Solo | Low coordination overhead |
| 11+ | Team | Benefit from shared findings and coordinated review |
Decisive count → apply silently. The file count is a single unambiguous signal: when it is clear of the boundary (1-10 → solo, 11+ → team), set $EXEC_MODE to the recommended mode WITHOUT asking and print a one-line notice, e.g. [Mode: solo — $FILE_COUNT files; pass --team to override] (or [Mode: team — $FILE_COUNT files; pass --solo to override]). The user can still override with the --solo/--team flags handled in 0-2.
Borderline only → ask. Only when the count sits right on the boundary (9-12 files, where coordination overhead vs. benefit is genuinely close) use AskUserQuestion to present the choice:
$DOCS_DIR (borderline). Which execution mode?"Store the result in $EXEC_MODE (solo | team).
$EXEC_MODE == "solo" → Execute Solo Mode (subagent-based parallelism)$EXEC_MODE == "team" → Execute Team Mode (Agent Teams with coordination)Execute the document review workflow using independent subagents. Split files equally among agents based on file count.
Determine the number of parallel agents based on file count:
| File Count | Agents | Strategy |
|---|---|---|
| 1-5 | 1 | Single agent, all phases sequentially |
| 6-15 | 2 | Split files evenly between 2 agents |
| 16-30 | 4 | Split files evenly among 4 agents |
| 31+ | 6 | Split files evenly among 6 agents |
Each agent receives its assigned file list and runs all applicable phases on those files. Use the Agent tool with subagent_type=general-purpose for each partition.
Scope: anchors or all
For each markdown file in the assigned partition:
Build anchor registry: Parse all headings to generate GitHub-style anchors
-1, -2 suffixes)Validate intra-file references: Check all ](#anchor) links against the file's own anchors
Validate inter-file references: Check all ](./file.md#anchor) and ](file.md#anchor) links
:)Report findings: For each broken reference, record:
Scope: accuracy or all
For each markdown file in the assigned partition:
Terminology consistency: Identify inconsistent use of key terms across documents
Fact checking: Flag statements that may be outdated or incorrect
Report findings: Classify each finding:
Scope: ssot or all
For each markdown file in the assigned partition:
SSOT declaration detection: Find explicit SSOT declarations
Redundancy detection: Find content that appears to duplicate another document's SSOT
Cross-reference completeness: Verify bidirectional cross-references
Report findings: Classify each finding:
Prerequisite: --fix flag must be set. If not set, skip this phase and output report only.
Edit tool
docs: fix N broken anchors, M cross-references, K redundancies
After all agents complete, aggregate results into a unified report.
See reference/team-mode.md for the complete team mode workflow with parallel agent analysis, including team architecture, task creation, teammate spawning (Analyzer/Fixer/Validator), workflow phases, cleanup, and fallback handling.
See _policy.md for common rules.
| Item | Rule |
|---|---|
| Scope | Only analyze .md files in the specified directory (recursive) |
| Code blocks | Always skip content inside fenced code blocks |
| Anchors | Use GitHub-compatible slug algorithm for anchor generation |
| Severity | Every finding must be classified as Must-Fix, Should-Fix, or Nice-to-Have |
| Commits | Commit messages in English, conventional commit format |
This skill runs in a forked context (context: fork) using the general-purpose agent — write access is required for --fix mode. The forked subagent does not see the calling conversation's history; operate entirely from the supplied arguments.
After completion, provide a structured review report:
## Document Review Report
| Metric | Value |
|--------|-------|
| Directory | $DOCS_DIR |
| Files analyzed | N |
| Execution mode | Solo / Team |
| Agents used | M |
| Scope | $SCOPE |
### Findings Summary
| Severity | Phase 1 (Anchors) | Phase 2 (Accuracy) | Phase 3 (SSOT) | Total |
|----------|-------------------|-------------------|----------------|-------|
| Must-Fix | A | B | C | A+B+C |
| Should-Fix | D | E | F | D+E+F |
| Nice-to-Have | G | H | I | G+H+I |
### Must-Fix Items
1. `file.md:42` — broken anchor `#nonexistent` → should be `#existing-heading`
2. ...
### Should-Fix Items
1. ...
### Nice-to-Have Items
1. ...
### Score
Overall: X.X/10 (Anchors: A/10, Accuracy: B/10, SSOT: C/10)
### Files Modified (--fix mode)
- file1.md (+3/-2)
- file2.md (+1/-1)
See reference/error-handling.md for prerequisite checks and runtime error handling.