Files
holocron/plugins/bin/.apm/skills/write-docs/SKILL.md
Claude Code AI - Gitea MCP 598a7c326a refactor(skills): retrofit the corpus to the ADR-0020 context contract (#129)
Retrofits all 39 skills to ADR-0020's description/body context contract, then fixes what six rounds of independent review found in that retrofit — including four ways the hot gate itself failed open.

Closes #99, #107, #108, #110, #111, #114, #115, #120.

## The retrofit (waves 1-5)

| | Start | Now |
|---|---|---|
| Description FAILs (>400 chars) | 26 | **0** |
| Body FAILs (>900 words, body-only) | 9 | **0** |
| Dangling routing targets | 2 | **0** |
| `Kyberforge.CompositionNote` | 10 | **0** |
| Preload tax | 21,005 chars | **~10,500** |

Under the 12,000-char success criterion. Per-wave detail is on #99.

## The review fixes

**The gate failed open four ways, three of them found after the retrofit shipped.** An unrecognised follower token made a dangling target vanish. A skill directory with no `SKILL.md` resolved as a valid target, so a commit could be green locally and red in a fresh clone — three existing fixtures were relying on that, one of which made the install-leak A/B pass vacuously. Then the free-standing `/name` sweep turned out to be gated on the sentence carrying a boundary marker, so route notation in any other sentence was invisible — not an ERROR, not a SUGGESTION, not an INFO — which left the documented "`/name` always blocks" promise false from a second direction. All four fixed and pinned.

**Two checks were silently not running.** `validate-provenance.sh` checks 7-8 were dead across nine skills. Waking them exposed a deeper problem: they assume `Research doc:` names a source index, but 30 of 121 entries point at topic content documents, so every new check-7 INFO was a false positive and check 8 was saved from a false-FAIL flood only by an *unannounced* skip. Checks 7/8 are now scoped to source indexes and every skip announces itself (#121).

**The retrofit's own anti-goal, four times.** ADR-0020 warns that a blunt gate gets satisfied by deleting content rather than relocating it. `diagnose` and `skill-audit` relocated prose and then read it unconditionally; `prototype` and `vale-config` deleted rules outright that survived nowhere. All four addressed.

## Verification

- `bash tests/run-tests.sh --strict` — 24 suites, 0 skipped, 0 failed
- `bash tests/run-bats.sh` — 325 tests, 0 failures
- `pre-commit run --all-files` — 17/17
- `pre-commit run --hook-stage pre-push --all-files` — 16/16, with `apm marketplace check` and `apm pack --check-clean` run against the remote, not skipped
- `scripts/skill-size-check.sh` over all 39 skills — rc 0, 0 ERROR/FAIL, SUGGESTION-only
- Preload tax measured at **10,498 chars**, max description 390 — both inside budget
- Every new test proven non-vacuous by a deliberate mutation of the behaviour it covers

**Per-commit sync, stated accurately:** the ten commits from the latest review round each pass `check-plugin-content-sync` in isolation, verified by checking each out in a detached worktree with a clean between. The earlier gitea window (`dfacf05..bedbd1d`, nine commits) does **not** — its mirror was regenerated in one batch at `bbc7300`. An earlier revision of this description claimed the property held for every commit; it does not, and a bisect through that window lands on a red commit. **Squash-merge** to collapse it, or accept that this range is not bisectable.

## Version bump

Six plugins and the catalog take a **patch**, not a minor. The branch is **89 commits — 40 `fix` / 30 `refactor` / 12 `docs` / 5 `chore` / 2 `test` — zero `feat`, zero `!`, zero `BREAKING CHANGE`** — and adds no skill, agent, command or hook. (Two earlier revisions of this section cited a stale histogram, most recently 78 commits; the figures above are measured at HEAD.) Both rules this repo ships (`forge/references/version-bump.md`, landing in this PR, and `git-commits/references/conventional-commits-spec.md`) make that a patch, and the catalog set is unchanged at 7 entries.

Not settled by that: four published files were removed from the installed tree, three moved, and `caveman` gained `disable-model-invocation`, retiring its old triggers. Under a strict reading those are major-class and currently ship under `refactor:` with no marker. Whether the deployed skill surface is a public contract is written down nowhere — worth deciding, but it outlives this PR.

## Deliberately not in scope

#112 (cherry-pick ownership, now resolved in favour of `git-commits`), #113 (`rtk git` normalisation), #116 (research fan-out), #101 (audit-skill merge), #122 (non-spec skill-root files), #123 (no PRD producer) stay open. #117 is the one worth reading: the contract's remedy is to move prose into `references/`, which is exactly where neither the size gate nor Vale looks — and the blind spot is wider than #117 currently records, since there is no root `.vale.ini` at all, so every ADR, `CONTEXT.md` and `README.md` is unlinted too.

That blind spot let this branch carry two `level: error` `Kyberforge.SentenceOpenerThereIs` violations into `references/` files it created — `provider-adapter-author/references/provider-matrix.md:31` and `agent-audit/references/finding-criteria.md:95`. Both are reworded in `afadaae`, confirmed by routing each file through the audit's own `vale-wrap.sh` (1 error each before, 0 after). Five further occurrences sit in `references/` files already on `main`; those are the pre-existing corpus and stay with #117, which is the real fix.

Also unfixed and not this PR's: `apm install` appends a duplicate `SessionStart` entry to `.claude/settings.json`, so a fresh clone cannot get pre-push green without an edit AGENTS.md warns against. Reproduces identically on `main`.

Co-authored-by: Defame1297 <gitea@rkdr.net>
Reviewed-on: https://git.dev.rkdr.net/Defame1297/holocron/pulls/129
Co-authored-by: Claude Code AI - Gitea MCP <claude@noreply.git.dev.rkdr.net>
Co-committed-by: Claude Code AI - Gitea MCP <claude@noreply.git.dev.rkdr.net>
2026-09-01 13:47:46 +00:00

6.1 KiB
Raw Blame History

name, description, version, updated, when, metadata, source
name description version updated when metadata source
write-docs Use when the user wants technical documentation produced or updated from code or spec, every claim traced to a source — "write docs for X", "document this module", "create docs for this feature", "write a README for this". Not an ADR or other decision record -> `grill-with-docs`. Not an external tool researched from its docs -> `research`. 1.0 2026-05-17 invoked by explicit trigger ("write docs for X", "document this module", "create docs for this feature") or implicit request to produce technical documentation from code or spec
category
implement
repo commit files updated
anthropics/skills f458cee31a7577a47ba0c9a101976fa599385174
skills/doc-coauthoring/SKILL.md
2026-05-17
repo commit files updated
mattpocock/skills e74f0061bb67222181640effa98c675bdb2fdaa7
skills/productivity/write-a-skill/SKILL.md
2026-05-17
repo commit files updated
bmad-code-org/BMAD-METHOD 71136bc6af77cbf507d3768494311d5b6ca95cc5
src/core-skills/bmad-advanced-elicitation/SKILL.md
2026-05-17

Role

You are a technical writer that produces documentation by reading code and spec — you derive every claim from a source file or explicit user input and never invent behaviour.

When to use / When not to use

Use when:

  • User wants to document a module, class, function, feature, CLI flag, API endpoint, config file, or README section
  • User says "write docs for X", "document this", "create docs for this feature", "write a README for this"

Do not use when:

  • User wants an ADR, decision doc, or architecture proposal → grill-with-docs, which writes ADRs
  • User wants a PRD → no skill in this set produces one; say so rather than redirecting
  • User wants to document a skill file (skill files are self-describing)
  • User wants marketing or blog copy
  • Documentation requires tacit organisational knowledge that cannot be read from code or spec

Required inputs

  • Specific file(s) or module(s) to document, or enough description to propose candidates
  • Target audience: developer / user / contributor / internal
  • Documentation type: reference, guide, README section, inline comment, changelog entry

Constraints

  • Every claim must be traceable to a source file line, spec section, or explicit user statement — never invent behaviour
  • User must approve specific files before the skill reads them; skill may propose candidates but waits for approval
  • Stage skipping is allowed only with an explicit user request and a one-sentence logged reason
  • Show the full revised section before each confirmation gate — never gate on output the user has not seen
  • Never reprint the whole document; all edits are surgical
  • Produce a one-line delta summary after each refinement round
  • Reader Testing sub-agent receives only the finished doc and the question list — no source files
  • Write summary and overview sections last, after all detail sections are stable

Process

  1. Identify scope. User names specific files or sections. If not provided, propose candidates based on the description — wait for explicit approval before reading.

  2. Read and extract. Read approved files. Extract: public API surface, described behaviour, visible constraints, non-obvious invariants. Note what the code does NOT explain (caller intent, error handling rationale, non-obvious side effects).

  3. Gap check. Present extracted behaviour to the user. Ask them to fill only the gaps — what the code does not explain. Log any explicitly deferred gaps. If the user requests to skip this step, log the reason and proceed.

  4. Draft section by section. For each section: state the proposed content and its source (code line / spec section / user input). Show; confirm before moving to the next section.

  5. Confirmation gate. Before finalising any section, show the full revised section. Wait for explicit confirmation or correction — never apply changes the user has not seen.

  6. Delta summary. After each round of revisions: "Round N: changed [sections], added [X], removed [Y]."

  7. Reader Testing. Predict 5–10 questions a target reader would ask. Spawn a scoped sub-agent that receives only the finished doc and the questions — no source files. Report its answers. If any answers fail, loop back to step 4.

  8. Finalise. Write summary and overview sections last. Prompt the user to review the complete document before committing.

Output format

  • Markdown artifact with section headers; produced one section at a time — never as a single large dump
  • Delta summary after each refinement round: "Round N: [what changed]"
  • Reader Testing report: numbered question list with sub-agent answers
  • Final doc at the user-specified or conventionally appropriate path

Failure handling

  • Files not named and description too vague to propose candidates → ask for specific names before reading
  • Stage skipped without a logged reason → flag and require the one-sentence log before continuing
  • Code behaviour is undocumentable (internal implementation detail, no public spec) → note as out-of-scope in the doc; do not invent an explanation
  • Reader Testing sub-agent fails on multiple questions → surface the failures, return to step 4; do not mark complete
  • Requested output is an ADR, decision doc, or architecture proposal → redirect to grill-with-docs; for a PRD, say no skill here produces one instead of redirecting

Self-check

  • All claims traceable to a source file or explicit user input
  • No invented behaviour — unverifiable claims removed
  • User approved specific files before reading
  • Any stage skips logged with reason
  • Full revised section shown before each confirmation gate
  • Delta summary produced after each refinement round
  • Reader Testing completed with scoped sub-agent (doc + questions only)
  • Summary/overview written last
  • User prompted to review before committing