.claude/skills/doc-rigor-verify/SKILL.md
Use when writing or updating documentation that makes API claims, includes command examples, or states platform-specific behavior. Write-then-verify pipeline where a fresh agent checks accuracy against code reality with zero confirmation bias.
npx skillsauth add ahrav/gossip-rs doc-rigor-verifyInstall 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.
An end-to-end documentation pipeline that composes /doc-rigor (write) and
/doc-verify (verify) into a single invocation with enforced agent isolation.
The writer and verifier never share context — the verifier only sees the code
and whatever the writer produced, not what the writer intended.
/doc-rigor then /doc-verify/doc-rigor directly/doc-verify directly/review-dispatch/dist-sys-auditor/doc-rigor-verify [files]
.rs files in that directory| Flag | Effect |
|------|--------|
| --code-only | Passed to the verify phase: skip external claim verification |
| --strict | Passed to the verify phase: promote all WARNs to BLOCKs |
| --summary | Passed to the verify phase: output only the summary table |
| --rigor-only | Run only the doc-rigor phase (equivalent to /doc-rigor) |
| --verify-only | Run only the doc-verify phase (equivalent to /doc-verify) |
This skill enforces a hard separation between writing and verifying:
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]
Why: The verifier must not know what the writer meant to say — only what they did say. This eliminates confirmation bias. A writer who knows they intended "returns None on empty" won't catch that the code actually panics. A fresh verifier will.
Never inline both phases in the same agent context. Always use two separate Task tool agents.
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 and route them to the appropriate phase.
If the project has references/documentation-style.md, read it — it will be
passed to the doc-rigor agent as a style reference.
Launch 1 agent using the Task tool.
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.
- 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
- Runnable command examples only when crate names, package flags, and feature
flags have been verified against the current workspace
- Units, time domains, and ordering assumptions when values are easy to misread
(for example seconds vs ticks, per-step vs cumulative advance)
- Platform scope when behavior is Unix-only, Windows-only, or relies on path
or byte-semantics assumptions
- The exact API, trait, or observation path when docs describe which component
performs a lookup or emits an observation
### Rust-Specific Guidance
- Use `///` for item docs and `//!` for module docs
- For unsafe code, add a `# Safety` section describing required invariants
- Include `# Examples` sections 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 — don't restate what the code already says
- Be factually precise — every claim in a doc comment must be true
- Never overstate API surface usage; if only some observations flow through a
trait or helper, name the exact path instead of saying "all" or "always"
### 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:
Launch 1 agent using the Task tool. This agent receives only the current file contents (post-edit) and verification instructions. It has zero context about what the writer intended.
You are a documentation verification specialist. Your job is to verify that
every claim in the documentation is factually correct against what the code
actually does and what external sources actually say. You have ZERO knowledge
of the author's intent — you can only check what is written against what the
code does. Trust nothing, verify everything.
## Target Files (verify docs in these)
{UPDATED_FULL_FILE_CONTENTS}
## Adjacent Context (for cross-reference only)
{ADJACENT_FILE_CONTENTS}
{FLAGS — e.g., --code-only, --strict, --summary}
## Step A: Extract All Testable Claims
Read every doc comment in the target files. Extract every testable claim —
any statement that can be verified as true or false against the code or an
external source.
Categorize each claim:
| Category | What to look for |
|----------|------------------|
| **Behavioral** | "this function returns X when Y", "panics if Z", "calls W internally" |
| **Invariant** | "this value is always positive", "the list is sorted", "monotonically increasing" |
| **Type/Structural** | "contains N fields", "implements trait T", "generic over X" |
| **Count** | "there are N variants", "supports M strategies", "N phases" |
| **Relationship** | "A calls B", "X depends on Y", "Z wraps W" |
| **Precondition/Postcondition** | "caller must ensure X", "on return, Y holds" |
| **Complexity** | "O(n log n)", "amortized O(1)", "linear in the number of X" |
| **Performance** | "zero-copy", "no allocation", "lock-free", "wait-free" |
| **Safety** | "safe because X", "unsafe requires Y", "SAFETY: Z" |
| **Operational Example** | cargo commands, feature flags, CLI invocations, package names |
| **Unit/Time Domain** | seconds vs ticks, absolute vs cumulative time, ordering assumptions |
| **Platform Scope** | Unix-only, Windows-only, filesystem/path assumptions |
| **External** | "uses algorithm from [paper]", "follows RFC N", "compatible with library X" |
| **Negative** | "does NOT do X", "never Y", "no Z" |
For each claim, record:
- Location: file:line
- Category: from the table above
- Claim text: the exact statement (quoted)
- Testable assertion: rewrite as a concrete true/false statement
## Step B: Verify Code-Level Claims
Always perform these high-risk drift checks when they appear in docs:
- Verify command examples against current crate names, package flags, and
feature gates in `Cargo.toml`
- Verify units and time-domain wording against the implementation and tests
- Verify platform-specific claims against `cfg` gates, path handling, and
safety comments
- Verify trait/API attribution claims against the exact call path in code
For each claim category, verify against the actual code:
**Behavioral**: Trace the code path. Does the function actually return X when Y?
Does it actually panic if Z? Read the implementation, not just the signature.
**Invariant**: Check constructors, mutation methods, and all code paths that
touch the value. Is the invariant enforced everywhere, or only in some paths?
**Type/Structural**: Count the actual fields, variants, or implementations.
Open the struct/enum definition and count.
**Count**: Count the actual items. Off-by-one counts are a WARN, off-by-more
is a BLOCK.
**Relationship**: Verify call graphs. Does A actually call B? Check imports
and usage.
**Precondition/Postcondition**: Check if the precondition is enforced
(assert/debug_assert) or just documented. Check if the postcondition actually
holds by reading the return paths.
**Complexity**: Verify the algorithm matches the claimed complexity. Count
nested loops, check data structure operations.
**Performance**: "Zero-copy" — check for .clone(), .to_vec(), .to_string().
"No allocation" — check for Vec::new(), Box::new(), String::from().
"Lock-free" — check for Mutex, RwLock.
**Safety**: For unsafe blocks, verify the stated safety justification actually
holds.
**Negative**: "Never panics" — check for .unwrap(), .expect(), indexing.
"No allocation" — check for heap allocations. Verify the absence of what
the doc says is absent.
## Step C: Identify External Claims
Extract all references to named algorithms, academic papers, libraries,
standards/RFCs, cryptographic properties, or complexity claims from literature.
## Step D: Verify External Claims
(Skip this step if --code-only flag is active.)
For claims requiring verification, use WebFetch to find authoritative sources.
Record results as: Confirmed, Contradicted (BLOCK), Unverifiable (WARN),
or Partially correct (WARN).
## Step E: Produce Findings
### Severity Classification
**BLOCK — Must Fix**:
- Factually wrong claim (code does X, doc says Y)
- Incorrect safety comment
- False external claim
- Count wrong by more than 1
- Behavioral claim opposite of reality
**WARN — Should Fix**:
- Misleading claim (technically true but creates false impression)
- Stale count (off by 1)
- Stale structural claim
- Unverifiable external claim
- Ambiguous invariant claim
- Precondition documented but not enforced
**INFO — Consider Fixing**:
- Imprecise language
- Slightly stale wording
- Missing doc where one would help
(If --strict flag is active, promote all WARNs to BLOCKs.)
### Output Format
Return this structured report:
# Documentation Verification Report
## Summary
| Metric | Count |
|--------|-------|
| Files verified | N |
| Claims extracted | N |
| Verified correct | N |
| BLOCK | N |
| WARN | N |
| INFO | N |
**Verdict**: PASS / PASS WITH WARNINGS / FAIL
(FAIL if any BLOCKs exist.)
## Findings
| # | Severity | File:Line | Category | Claim | Verdict | Evidence |
|---|----------|-----------|----------|-------|---------|----------|
## Detailed Findings
### BLOCK-N: [title]
- Location: file:line
- Claim: "[quoted]"
- Reality: [what the code actually does]
- Evidence: [specific code reference]
- Suggested fix: [concrete wording correction]
### WARN-N: [title]
(same format)
## External Claims Verification
| # | Claim | Source Checked | Result | Notes |
|---|-------|---------------|--------|-------|
## Verification Coverage
| File | Claims Found | Verified | BLOCK | WARN | INFO |
|------|-------------|----------|-------|------|------|
After both agents complete, present a combined report to the user:
Briefly state what the doc-rigor agent did:
Present the doc-verify agent's findings directly. Do not filter or soften them.
Based on the verification result:
/execute-review-findings to fix BLOCKs, then
re-running /doc-verify to confirm fixes.The write-then-verify pattern is especially good at catching:
try_get and documents "returns None on failure" — but the code actually
panics. The verifier catches this because it traces the actual code path./doc-rigor — the writing half of this pipeline, used standalone/doc-verify — the verification half of this pipeline, used standalone/execute-review-findings — implements fixes for BLOCK findings/review-dispatch — multi-lens code review (broader than docs)/dist-sys-auditor — specialized for distributed systems claimsdevelopment
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.