.claude/skills/doc-rigor/SKILL.md
Write-then-verify documentation pipeline. Use when a user asks to improve comments or docs, explain algorithms or design choices, write or upgrade docstrings, or raise documentation quality for a codebase (especially Rust crates). Writes docs, then automatically verifies every claim against code reality using a fresh agent to eliminate confirmation bias.
npx skillsauth add ahrav/gossip-rs doc-rigorInstall 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.
Produce documentation that lets a new reader grok the code without reading every line, then verify every claim against code reality with a fresh agent. Treat comments as first-class: explain intent, invariants, and trade-offs, not syntax. The writer and verifier never share context — the verifier only sees the code and whatever the writer produced, not what the writer intended.
/review-dispatch/dist-sys-auditor/interface-design-review/doc-verify directly/doc-rigor [files]
.rs files in that directory| Flag | Effect |
|------|--------|
| --skip-verify | Skip verification phase (write only, no agent 2) |
| --code-only | Passed to verify phase: skip external claim verification |
| --strict | Passed to verify phase: promote all WARNs to BLOCKs |
| --summary | Passed to verify phase: output only the summary table |
The invoking agent performs these steps before launching subagents:
git diff --name-only HEAD and git diff --cached --name-only
to find recently changed .rs files.rs files onlyExtract any flags from the invocation. Route --skip-verify, --code-only,
--strict, and --summary to the appropriate phase.
If the project has references/documentation-style.md, read it — it will be
passed to the doc-writing agent as a style reference.
Launch 1 agent using the Task tool with subagent_type="general-purpose".
Include in the prompt:
references/documentation-style.md exists)You are a documentation specialist. Your job is to write and improve
documentation for Rust code following the doc-rigor methodology.
## Target Files
{FULL_FILE_CONTENTS}
## Adjacent Context (for reference, do NOT edit these)
{ADJACENT_FILE_CONTENTS}
{STYLE_REFERENCE — include only if references/documentation-style.md exists}
## Your Task
Produce documentation that lets a new reader grok the code without reading
every line. Treat comments as first-class: explain intent, invariants, and
trade-offs, not syntax.
### Workflow
1. **Read for intent** — Identify the core problem, invariants, and boundaries
of each module/type/function. Mark non-obvious logic, algorithms, and design
decisions that need explanation.
2. **Draft a documentation map** — Decide which scopes need docs: module-level,
type-level, function-level, or inline. Prefer fewer, richer comments over
many shallow ones.
3. **Write documentation in layers**:
- Module-level docs: purpose, invariants, high-level algorithm, references.
- Type/function docs: guarantees, preconditions, side effects, errors,
complexity.
- Inline comments only for local, tricky reasoning (why now, why this order,
why this bound).
4. **Enforce rigor**:
- Remove comments that restate code or obvious control flow.
- Check for consistency with code and tests; update docs when behavior
changes.
- Call out any missing context you cannot infer.
### Comment Content Checklist
Every doc you write should cover the applicable items:
- Problem statement and scope
- Invariants and safety/soundness rules
- Algorithm overview with key steps and why they matter
- Design trade-offs (why this approach vs alternatives)
- Edge cases and failure modes
- Complexity or performance constraints when relevant
- Concrete examples when behavior is subtle
### Rust-Specific Guidance
- Use `//!` for module-level docs, `///` for items, `//` for inline reasoning
- For unsafe code, add a `# Safety` section describing required invariants
- Include `# Examples` in public APIs if usage is non-obvious
### Rules
- Edit the target files directly using the Edit tool
- Do NOT edit adjacent context files
- Do NOT add tracking IDs, issue references, or external tracker info in comments
- Do NOT add version suffixes, deprecated annotations, or compatibility shims
- Focus on WHY, not WHAT — do not restate what the code already says
- Be factually precise — every claim in a doc comment must be true
### Output
After editing all files, provide a summary listing:
- Files edited
- Types of docs added/improved (module, type, function, inline)
- Any gaps you could not fill due to missing context
When the writer agent completes:
Skip this entire phase if --skip-verify flag is active.
Invoking Agent (orchestrator)
|
+--> Agent 1: Doc-Rigor Writer (writes/improves docs)
| |
| [docs are written to files]
|
+--> Agent 2: Doc-Verify Checker (verifies docs against code)
|
[verification report]
general-purpose subagent with zero
knowledge of what Agent 1 intended. It receives only the current file
contents (code + docs as they exist on disk after Agent 1's edits) and
verifies every claim against code reality.Include in the prompt:
--code-only, --strict, --summary)references/verification-methodology.mdThe verification agent follows Steps A through E from the methodology reference:
--code-only)See references/verification-methodology.md for the complete procedure,
category definitions, verification steps per category, and output format template.
After both agents complete, present a combined report to the user.
Briefly state what the doc-rigor agent did:
Present the verification agent's findings directly. Do not filter or soften them.
If --skip-verify was active, note that verification was skipped and recommend
running /doc-verify separately.
Based on the verification result:
/execute-review-findings to fix BLOCKs, then
re-running /doc-verify to confirm fixes.references/documentation-style.md for documentation patterns and
templates when the user wants high-rigor style or asks to mirror a
well-documented crate.references/verification-methodology.md for the complete verification
procedure including claim categories, per-category verification steps, severity
definitions, and output format template./doc-verify — standalone verification against code reality. Use when docs
already exist and only need accuracy checking (no writing phase)./execute-review-findings — implements fixes for BLOCK findings from
verification reports./review-dispatch — multi-lens code review (broader than docs)./dist-sys-auditor — specialized for distributed systems claims with
citations.development
Deep first-principles code explanation that builds real understanding through phased walkthroughs with diagrams. Covers algorithms, data structures, memory layout, concurrency patterns, and performance tricks — especially for systems code in Rust. Use whenever the user asks to explain, walk through, break down, deep dive into, or understand code. Trigger on "how does this work", "what's happening here", "teach me about this", "why is it done this way", or when the user references a file with @ and wants to understand it. Proactively use when examining code involving lock-free algorithms, atomics/CAS, memory ordering,
development
Use when creating implementation-ready beads tasks that need testing strategy, optimal implementation approach, and documentation requirements baked in — composes /create-task with parallel enrichment agents that analyze the codebase and produce concrete test specifications, algorithm/data-structure guidance, and doc quality standards so implementing agents don't need to re-research
development
--- name: autoresearch description: Autonomous Goal-directed Iteration. Apply Karpathy's autoresearch principles to ANY task. Loops autonomously — modify, verify, keep/discard, repeat. Supports bounded iteration via Iterations: N inline config. version: 1.9.11 --- # Claude Autoresearch — Autonomous Goal-directed Iteration Inspired by [Karpathy's autoresearch](https://github.com/karpathy/autoresearch). Applies constraint-driven autonomous iteration to ANY work — not just ML research. **Core id
development
Use when implementing a new feature and assessing coverage gaps, during periodic test hygiene, when test suites feel bloated, or before merging code that changes coordination or hot paths. Two-phase assess-then-improve testing pipeline.