agentleFS
Coding9GmbHCoding9GmbH/agentic-docs/skill/SKILL.md

agentic-documentation

Skill2 starsChanged 7 months agoMITView on GitHub

Consult and maintain the agent-facing documentation tree at .claude-docs/. ALWAYS invoke — not optional. (1) BEFORE any non-trivial task — read .claude-docs/README.md + .claude-docs/LOOKUP.md + the topic file for the area you are touching. This replaces blind greping and gets you to the answer 5–10× faster. Skip ONLY for trivial one-line localised fixes (typos, renames, whitespace). (2) AFTER any change that adds, renames, or deletes a module / feature / endpoint / DB model / enum / UI primitive / shared hook / store / event / queue / pattern / security rule / workflow — update the affected catalog file IN THE SAME COMMIT as the code change. Not updating is a correctness bug, not a style preference. (3) When the user says "init / regenerate / rebuild / resync claude-docs" — do a full regeneration. Also triggered by /agentic-documentation.

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. About 0 are common, 9 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Default posture: read the docs first, ship the change, update the docs in the same commit.

    line 10
  2. Very specific:

    Non-negotiable for non-trivial tasks: Before you call Grep, Glob, or spawn an Explore agent, you must have read at least …

    line 56
  3. Distinctive:

    CHECK should cost ≤ 60 seconds of reading for most tasks.

    line 73
  4. Distinctive:

    Before declaring a task finished, ask yourself: did any of these change?

    line 91
  5. Distinctive:

    If yes to any, UPDATE is required — no exceptions.

    line 95
  6. Very specific:

    If unsure where a thing lives: grep -l "<keyword>" .claude-docs/ finds the existing home.

    line 116
  7. Distinctive:

    Keep entries short (1–5 lines per module / permission / hook).

    line 122
  8. Distinctive:

    If a catalog grows past ~400 lines, split it into a dedicated file and update README.md.

    line 123
  9. Very specific:

    Commit with message prefix docs(.claude-docs): ….

    line 125
  10. Distinctive:

    Before marking UPDATE done, verify:

    line 129
  11. Distinctive:

    Capture the structural snapshot: Run the commands appropriate for the repo.

    line 145
  12. Distinctive:

    Agent-only tone: No human-facing intros. No "in this document we will explore …".

    line 176
  13. Very specific:

    Every entry ≤ 5 lines: If more is needed, link to the source file with path/to/file.ts:NN.

    line 178
  14. Very specific:

    Use relative links between docs (./PATTERNS.md), not absolute paths.

    line 191
  15. Very specific:

    After UPDATE, ls .claude-docs//*.md and grep -l "TODO\|FIXME\|XXX" .claude-docs/ should surface no accidental markers.

    line 193
  16. Very specific:

    If you're invoked in a repo that has no .claude-docs/ tree:

    line 200
  17. Distinctive:

    Run INIT (Mode 3) to bootstrap the tree.

    line 203
  18. Very specific:

    After init, commit it as docs(.claude-docs): initial structural map.

    line 204
  19. Very specific:

    If the user only asks for a single task and not full init, do the task — but if it touches an area that would have been documented, suggest …

    line 206

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

agentic-documentation — you must use this every task

.claude-docs/ is the structural map of this repo. It exists so you don't waste turns re-discovering what's already written down. Using it is not optional.

Default posture: read the docs first, ship the change, update the docs in the same commit. If you didn't touch .claude-docs/ on a non-trivial change, you almost certainly broke the map — go back and fix it before handing off.

The three modes

ModeWhenWhat
CHECKBefore every non-trivial taskRead .claude-docs/README.md, .claude-docs/LOOKUP.md, and the topic file for the area you're touching. Use the "I want to …" tables instead of greping.
UPDATEAfter every change that invalidates a catalog entryEdit the affected doc(s) in the same commit as the code. See the change-matrix below.
INITOn explicit user request onlyFull regeneration from scratch. See procedure at the end.

Why this is worth it

A single CHECK pass on .claude-docs/LOOKUP.md + one topic file typically answers questions that would otherwise cost:

  • 3–10 grep / find rounds to locate the right file,
  • 1–3 Reads to understand conventions already captured in CONVENTIONS.md / PATTERNS.md / SECURITY.md,
  • an occasional wrong-module refactor because you didn't know the helper existed.

One minute of reading saves most of the turn. If you find yourself reaching for Grep or Explore early, stop and check the docs first.


The tree you're maintaining

The exact files depend on the project. A typical layout:

.claude-docs/
├── README.md              Master index + read order
├── OVERVIEW.md            Stack, layout, top-level architecture
├── LOOKUP.md              "I want to X → look here" table
├── CONVENTIONS.md         Naming, imports, formatting rules
├── PATTERNS.md            Copy-paste skeletons for common code shapes
├── SECURITY.md            Non-negotiable security rules
├── WORKFLOWS.md           Step-by-step recipes for recurring tasks
├── TESTING.md             Test runners, helpers, fixtures
├── DESIGN-SYSTEM.md       (frontends) Tokens, typography, component rules
└── <area>/                One subfolder per logical area of the repo
    └── README.md          Catalog of modules/features in that area

Adapt to the repo: if there is no backend, drop api/; if there is no UI, drop DESIGN-SYSTEM.md and web/. The shape is a guideline, not a contract — what matters is that the tree mirrors the repo's logical layout and every catalog entry is short, structural, and current.


Mode 1: CHECK — always run before coding

Non-negotiable for non-trivial tasks. Before you call Grep, Glob, or spawn an Explore agent, you must have read at least .claude-docs/LOOKUP.md and the topic file for the area you're touching.

Procedure

  1. Open .claude-docs/README.md — scan the Index table, identify which topic file maps to the change.
  2. Open .claude-docs/LOOKUP.md — search for the "I want to …" row that matches the task. It usually names the exact file and helper.
  3. Open the topic file(s) for the area you're touching — backend module, frontend feature, schema, routing, design system, etc.
  4. Read the relevant cross-cutting doc(s) the task touches:
    • Architectural patterns / DTOs / error handling → PATTERNS.md
    • Auth / secrets / permissions / rate limits → SECURITY.md
    • Naming / imports / i18n → CONVENTIONS.md
    • Tests → TESTING.md
    • Recipes / migrations / new endpoint / new page → WORKFLOWS.md
  5. Only now fall back to Grep / Explore — and only for questions the docs explicitly defer (see path/to/file) or clearly don't cover.

Time budget

CHECK should cost ≤ 60 seconds of reading for most tasks. If you're reading more than four files, the task is bigger than you thought — pause and reconsider scope.

Skip CHECK only when

  • The task is a trivial one-line localised fix (typo, rename, whitespace).
  • The user explicitly says "don't read the docs, just do X".
  • You're already deep in a verified area from an earlier turn this session.

In all three cases, you still must run UPDATE afterwards if the change invalidates a catalog entry.


Mode 2: UPDATE — always run after a catalog-invalidating change

The map and the code change together, in the same commit. A code commit that invalidates .claude-docs/ without updating it is an incomplete change. Future sessions will waste turns on the stale map.

Trigger check — run this before you think the task is done

Before declaring a task finished, ask yourself: did any of these change?

module · feature folder · public endpoint · DB model · enum · UI primitive · shared hook · shared store · realtime hook · emitted event · queue / job · security rule · cross-cutting pattern · workflow recipe · global guard/decorator/middleware/exception · bootstrap entrypoint · routing config · API client.

If yes to any, UPDATE is required — no exceptions.

How to decide which docs to update

A change affects a .claude-docs/ file when that file contains a list, table, or rule that names the thing you changed. The general mapping:

You changed …Which doc(s) name it
Added/renamed/deleted a module or feature folderThe catalog README.md for that area + the layout mirror in the top-level README.md
Added a new permission / role / capabilityThe permissions doc (often <area>/PERMISSIONS.md)
Added/renamed a DB model or enumThe schema doc (often <area>/README.md for the DB layer)
Added a global guard / decorator / middleware / exceptionThe common.md (or equivalent) for that area + the bootstrap doc if registered globally
Added a route or pageThe routing doc
Added a UI primitiveDESIGN-SYSTEM.md + the components doc
Added a shared store / hook / utilThe frontend lib.md (or equivalent)
Added an event emitted, queue, or jobThe module's catalog entry (under "emits" / "queues") + PATTERNS.md if a new shape
Changed bootstrap / entrypoint / middleware orderThe bootstrap doc
Added a security ruleSECURITY.md
Added a new workflow / recipeWORKFLOWS.md
Added a reusable code shapePATTERNS.md + one-line entry in LOOKUP.md

If unsure where a thing lives: grep -l "<keyword>" .claude-docs/ finds the existing home. If no hit, add to the doc whose topic fits best.

Update procedure

  1. Identify which docs are affected.
  2. Open each affected doc, find the existing entry / table row, update it. Don't duplicate — if a rule is in SECURITY.md, link to it from elsewhere rather than restate it.
  3. Keep entries short (1–5 lines per module / permission / hook). Prefer tables over prose.
  4. If a catalog grows past ~400 lines, split it into a dedicated file and update README.md.
  5. Sanity check cross-refs: grep -rn "missing-cross-ref" .claude-docs/ should return nothing — stale cross-references are worse than no cross-references.
  6. Commit with message prefix docs(.claude-docs): ….

Update completeness checklist

Before marking UPDATE done, verify:

  • LOOKUP.md still points to a real location for every entry that relates to the change.
  • README.md index table still lists every file that exists.
  • Any module/feature/model count mentioned in prose still matches reality.
  • New cross-reference links actually exist.
  • No human-facing fluff added. Keep it tight.

Mode 3: INIT (regenerate from scratch — use sparingly)

Goal: rebuild the tree when it has drifted too far to patch incrementally, or the user explicitly asks.

Steps

  1. Capture the structural snapshot. Run the commands appropriate for the repo. Typical examples (adapt to the actual layout):
    # Top-level shape
    ls -la
    # Source tree shape — adapt paths
    find <src-roots> -maxdepth 2 -type d
    # Entrypoints / config
    cat <bootstrap files>
    # Schema / models
    cat <schema files>
    # Public surface
    cat <route table or api index>
    # Build / scripts
    cat package.json Makefile pyproject.toml 2>/dev/null
    Goal: gather the shape and entrypoints, not the full contents.
  2. Launch parallel Explore subagents for heavy catalogs (modules, features, models, patterns). Don't try to read every source file yourself — delegate breadth, then synthesize.
  3. Write files in this order (each depends on the previous):
    1. OVERVIEW.md — stack + layout + top-level architecture.
    2. CONVENTIONS.md, PATTERNS.md, SECURITY.md — cross-cutting rules.
    3. WORKFLOWS.md, TESTING.md, DESIGN-SYSTEM.md (if relevant).
    4. Per-area docs (bootstrap, common utilities, schema, routing, etc.).
    5. Area catalogs (<area>/README.md) — these depend on everything else.
    6. LOOKUP.md, README.md — index files last so cross-refs resolve.
  4. Commit in one shot: docs(.claude-docs): regenerate from scratch.

Quality bar for generated docs

  • Agent-only tone. No human-facing intros. No "in this document we will explore …". Direct, imperative.
  • Tables over prose for catalogs and lookups.
  • Every entry ≤ 5 lines. If more is needed, link to the source file with path/to/file.ts:NN.
  • No fluff. Cut "it's important to note that", "please remember", emojis, rhetorical questions.
  • Every file ends with either:
    • a "How to extend / update" section (so a future update knows what to edit), OR
    • a "find-it-fast" grep snippet section.
  • No duplicates. A rule belongs in one doc; others link to it.

Conventions for ALL modes

  • This tree is for AI agents only. Never use emojis unless the user explicitly asks. Never add greetings, congratulations, or summary fluff.
  • Match the language of the existing content. If the project is multi-language, default to English unless the user says otherwise.
  • Use relative links between docs (./PATTERNS.md), not absolute paths.
  • File paths in prose use backticks: src/foo/bar.ts.
  • After UPDATE, ls .claude-docs/**/*.md and grep -l "TODO\|FIXME\|XXX" .claude-docs/ should surface no accidental markers.
  • Commit style: docs(.claude-docs): <short verb phrase>. Keep doc commits focused — don't bundle with feature code unless the change is small and the doc update is the natural part of the same diff.

When .claude-docs/ doesn't exist yet

If you're invoked in a repo that has no .claude-docs/ tree:

  1. Confirm with the user that they want one initialised.
  2. Run INIT (Mode 3) to bootstrap the tree.
  3. After init, commit it as docs(.claude-docs): initial structural map.

If the user only asks for a single task and not full init, do the task — but if it touches an area that would have been documented, suggest at the end that initialising .claude-docs/ would save tokens on future tasks.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.