skills/document/SKILL.md
Generate world-class, source-verified reference documentation for a codebase: a multi-agent loop that surveys the repo, plans the information architecture, writes facet-scoped pages, and adversarially verifies every claim against live source before committing markdown + HTML + diagrams to docs/. Always runs the full verify loop; scope is incremental by provenance. Use when: "document this codebase", "generate the docs", "build a codebase wiki", "write architecture docs", "onboarding docs", "documentation site", "keep the docs in sync", "world-class docs". Trigger: /document, /docs, /wiki.
npx skillsauth add phrazzld/agent-skills documentInstall 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.
Documentation that earns trust because every claim is verified against live source — not a plausible summary that drifts.
This skill owns the gap between "the code exists" and "a new contributor or
maintainer can navigate, understand, and safely change this system from the
docs." It is committed, human-facing reference documentation living in docs/,
rendered to markdown + HTML + diagrams from one source. The wedge over every
auto-wiki product (Factory AutoWiki, Cognition DeepWiki) is the one thing they
skip: adversarial, source-grounded verification of each claim — the antidote
to authoritative-looking lies committed into the repo.
The named phases (survey → plan → write → critique → iterate) are SDLC the model already knows. Do not narrate them. The skill's value is the oracles, the IA taste, the provenance contract, and the orchestration discipline below.
| Need | Load |
|---|---|
| The verification system — how "comprehensive / accurate / well-organized" become falsifiers | references/oracles.md |
| Information architecture — Diátaxis mapping, page taxonomy, which diagrams earn their place | references/information-architecture.md |
| Committed-docs provenance, freshness falsifier, incremental scope, Mode B handoff | references/provenance-and-freshness.md |
| The multi-agent loop topology, lane cards, build-order discipline | references/orchestration.md |
| Output surfaces: md source → HTML + mermaid, "synced across surfaces", publish target | references/render-contract.md |
| Per-page provenance front-matter + world-class page skeleton | templates/page.md |
| Freshness oracle driver (stale-page detector) | scripts/freshness.py |
--check runs only the freshness + render oracles against existing docs/ (no
generation). --full forces full-repo regeneration instead of incremental scope.
A table of lanes, not a procedure. Each lane is outcome-shaped; the lead owns
decomposition. Detail and lane cards in references/orchestration.md.
| Lane | Non-obvious judgment | Oracle it feeds | |---|---|---| | Recon swarm | lens-blind agents (entry-points / data-flow / dep-graph / config+infra / tests-as-spec / git-why); each blind to the others so no single search angle bounds coverage | — | | IA plan | structure adapts to the system — a CLI ≠ a service ≠ a library; pick pages and diagrams from what recon found, not a fixed template | coverage | | Generation | one agent per page/facet, just-enough context, dependency order (overview before deep-dives); pipeline, not barrier | — | | Verify | adversarial skeptics on a decorrelated model family refute each claim against source; cold-reader proves navigability | accuracy, navigability | | Iterate | loop-until-dry: regenerate flagged pages until K consecutive rounds raise no blocking oracle failure | all | | Render + stamp | one generation → md + HTML + diagrams; stamp provenance; commit | render, freshness |
Build-order discipline: model-driven ad-hoc fan-out first. Do not pre-author a deterministic orchestration-workflow template — by the harness-engineering contract, crystallize that asset only once telemetry shows the pattern recurring. Standing up the machinery on day one is the deterministic-scaffold failure mode.
generated-at-sha and
covers: globs (templates/page.md). This makes drift detectable instead
of silent — the load-bearing mitigation for committing docs into the repo./design +
anthropic-frontend-design; publish machinery via /showcase; recon muscle
via /groom's investigation bench. This skill owns the oracles and IA taste.scripts/freshness.py is the driver; a page
covering changed files past its stamped SHA is stale, full stop./orient owns ephemeral, live-evidence
session grounding. Agents read source, not a possibly-stale wiki about
source. These docs are for humans./showcase owns external proof and launch copy. This
is technical reference.deepwiki skill queries
third-party OSS wikis. This documents your repo.harnesses/shared/references/loop-readiness.md.Delegate per the shared Roster contract in harnesses/shared/AGENTS.md
(Roster). This skill is parallel-by-default and a heavy token spender; route
heavy/long runs to /sprites. Lanes:
/groom's bench).docs/, is worse than no doc — it carries the repo's authority.
The accuracy oracle is not optional; it is the whole reason to build this./orient keeps agents on live source. Do not repurpose this output
as the agent's primary context feed.log what it skipped.See harnesses/shared/AGENTS.md (Completion Evidence) for the shared core.
/document adds:
## Document Gate
- Coverage: real export/route/entry surface vs documented surface; named gaps or waiver.
- Accuracy: each architectural claim source-grounded by a fresh-context skeptic; refuted/flagged claims listed.
- Navigability: cold-reader landed on the right files for the test task(s), or where it failed.
- Render: HTML built, mermaid parsed, zero broken internal links — command + result.
- Provenance: every committed page stamped with generated-at-sha + covers globs.
- Freshness: scripts/freshness.py result against HEAD; stale pages or clean.
- Scope: full vs incremental, and what was intentionally not regenerated.
- Publish: where HTML renders, or that it stayed local pending operator choice.
testing
Capture one compounding repo-technical learning while a solved problem is still fresh. Use when: after a bug fix, diagnosis, delivery, review, or incident reveals a reusable pattern worth adding to `docs/solutions/`. Trigger: /compound, /capture-learning, /learning.
testing
Route Misty Step factory application capabilities. Use when choosing, auditing, integrating, or operating Canary, Powder, Landmark, Aesthetic, or Bitterblossom: production observability, incidents, health checks, error logging, backlog/work-card state, release intelligence, UI/UX system adoption, or supervised/unsupervised agent dispatch. Trigger: /factory-apps, /factory-stack.
testing
Prove a skill beats no-skill with a falsifiable A/B eval, or retire it. Design, generate, run, and maintain a skill-specific eval: name the one claim the skill must earn, run it skill-on vs raw same-model, grade blind with objective checks first, return a keep/adapt/cut verdict. Use when: "eval this skill", "does this skill help", "prove the skill beats no skill", "write an eval for", "benchmark a skill", "is this skill worth it", "skill A/B", "skill regression test", "generate skill evals". Trigger: /skill-eval, /eval-skill, /prove-skill.
tools
> Template. Copy to `<target-repo>/.agents/skills/<repo>-<domain>/SKILL.md` > and fill every bracketed placeholder from the live target repo. Delete this > line and every other `> ` guidance line before committing. See > `../../references/repo-local-skill-generation.md` for the full process. --- name: <repo>-<domain> description: | [One paragraph: what this skill verifies/runs/operates for <repo>, stated in terms of the repo's real shape (service/CLI/library/etc.), not generic process. En