From go-linter-driven-development
The repo-brain author/maintainer: writes behavior-focused documentation and wires it into the documentation network defined by rules/R9-repo-brain.md. FEATURE mode (default): after feature implementation or bug fixes — invoked by @linter-driven-development (Phase 5) — to document HOW THE PRODUCT BEHAVES and wire it into the network. BOOTSTRAP mode: on request ("set up docs", "create an index", "make this repo AI-navigable", /wire-repo-brain) or when FEATURE mode finds no doc root — discovers the doc root, builds index.md, wires CLAUDE.md, wires missing code→docs edges, reports gaps. NOT a changelog - documents current behavior, not change history.
How this skill is triggered — by the user, by Claude, or both
Slash command
/go-linter-driven-development:documentationThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
<objective>
Behavior over history: document what the product DOES, not what changed. A bug fix updates the affected section to describe correct behavior; it never appends a "Fixed:" entry (worked examples in reference.md, "Bug Fix Documentation").
Conciseness over completeness: a focused doc that gets read beats an exhaustive doc that gets skipped.
Plain words over clever words: everyday English, short sentences, one idea per sentence. Write for a fresh graduate whose first language may not be English — a doc that needs a dictionary fails even when it is true (R9's plain-English/empathy test; applies to godocs and feature docs alike).
Comments stand alone: a reader must understand the comment BEFORE reading the code. If reading the code is required to understand the comment, the comment adds negative value — no decoder-ring IDs, no forward references to other comments (R9's empathy test, second half).
<mode_selection> FEATURE is the default: run it after a feature or bug fix lands (ldd Phase 5). Switch to BOOTSTRAP when the user asks to wire a repo ("set up docs", "create an index", "make this repo AI-navigable") or when FEATURE step 1 finds no doc root. Skip entirely for individual commits and internal refactors that change no behavior — unless an R9 Q6 check shows a doc citing the reshaped code. </mode_selection>
<feature_mode>
../../rules/R9-repo-brain.md, Design guidance). Before writing
any comment, first check whether a rename or extraction makes it unnecessary.See docs/<feature>.md edge wherever a feature doc exists. A package that
earns more moves its godoc to doc.go (R9's ~20–30 line bound). A crossroads
that deserves richer inline godoc stays within budget and gets an expand
recommendation in the report — never extra lines. Add testable examples
(Example_*) for complex/core types.<docroot>/<feature>.md from the
reference.md template: Related edges to sibling docs; key players as
Symbol | Role | Package; entry points cite symbols — never file paths or line
numbers (R9 edge policy). Bug fix → update the existing doc's affected section;
do not create a new doc.index.md; verify root
wiring (@<docroot>/index.md import in CLAUDE.md, AGENTS.md fallback).comment-critic agent (Agent tool) on the full diff —
not just the comments this run wrote; in-body comments left by earlier phases
are in scope too. Its spawn prompt MUST contain: (a) R9's comment-policy
section pasted verbatim (toolbox kinds, three-test standard, tiers, budget
accounting, visibility default); (b) reference.md's Comment Value Toolbox
catalog pasted verbatim; (c) the absolute path to
../../examples/private-comment-noise.md; (d) the diff scope. Apply every non-KEEP verdict (this skill is the rung-1
fixer): DELETE and TRIM as returned; REWRITE using the critic's proposal;
DELETE → route R3 verdicts are deleted here and reported as R3 leads for the
caller — never fixed here (extraction is @refactoring's move). Then re-spawn
the critic ONCE to confirm clean; a still-dirty re-critique is reported as-is,
never looped further.<bootstrap_mode>
.ai/ → .ainav/ → docs/;
create docs/ if none exists). Monorepo → one doc root + index per sub-project.index.md: a short reference guide — grouped by topic, one
line per doc; past ~300 lines it becomes a map of maps with short sub-indexes
(R9 index policy; templates in reference.md).@<docroot>/index.md import to CLAUDE.md (create a
minimal CLAUDE.md section if none exists); AGENTS.md has no import syntax — use
the plain-reference fallback. Snippets in reference.md.// See <docroot>/<file>.md ... — to the front-door anchor's
existing doc comment (anchor heuristic in reference.md), then confirm the package
still vets. Wiring only: never rewrite the comment around it, never wire a stale
doc (its ⚠️ index flag is the finding), and skip — as a reported gap — any doc
whose anchor you cannot identify with confidence.<output_format> FEATURE mode:
DOCUMENTATION COMPLETE — FEATURE mode
Feature: <name>
Artifacts:
- <docroot>/<feature>.md (created/updated)
- godoc: <symbols touched, grouped by package>
- testable examples: <Example_* functions>
- index.md: <line added/refreshed>
Network edges added:
- code→docs: <symbol> → <docroot>/<feature>.md
- docs→code: <doc> → <symbols/packages cited>
- root: @<docroot>/index.md in CLAUDE.md (verified/added)
R9 self-check: Q1–Q3 clean · Q4–Q6 clean over diff
(or per hit: <Qn>: <evidence> — fixed by <R9 fix-pattern move>)
Comment critic: <N> reviewed — <D> deleted · <T> trimmed · <R> rewritten ·
clean on re-critique (or: <remaining verdicts, reported as-is>)
R3 leads (in-body extraction candidates, for the caller): <file:line, ...> (omit when none)
Expand recommendations (optional — omit the section when none):
- <Symbol> — consider expanding its godoc inline beyond the doc reference:
<one-line rationale>
BOOTSTRAP mode:
BOOTSTRAP COMPLETE
Doc root(s): <discovered/created; per sub-project if monorepo>
Index: <docroot>/index.md built — <N> docs, <M> groups; map of maps: <yes/no>
Root wiring: CLAUDE.md @import <added/verified> (or AGENTS.md plain reference)
Upward edges: <K> wired — <doc> ← <anchor symbol> (<package>), ...
Advisory findings (reported, not fixed — FEATURE mode writes content):
- unwired: <doc> — indexed, but no confident front-door anchor; needs a human call
- broken edge: <source> → <target> (unresolved)
- gap: <package> — <dangling code→docs edge | entry points with no citing doc>
- stale: <doc> — indexed with ⚠️ flag; cites unresolved <symbol>; not edge-wired
</output_format>
<success_criteria>
npx claudepluginhub buzzdan/ai-coding-rules --plugin go-linter-driven-developmentCreates, edits, and verifies skills using a test-driven development approach with pressure scenarios and subagents.