# CLAUDE.md

- Write every skill instruction as an atomic `-` bullet, one condition and one action each, except
  the paragraph case below; a step's body is instructions too.
- Write an ordered sequence as a numbered list, one action per number.
- A paragraph may state a section's intent or reason.
- A paragraph may carry an instruction on how the output reads, with its reason; never one that
  branches on the run's state (who asked, what a step found).
- Invariant for reviews: a diff to a `SKILL.md`, its reference files or an `agents/*.md` prompt
  holds every rule-authoring line of this file; a reviewer cites the line a change breaks.
- Add a skill or agent rule only for a failure seen in a real run or eval; never for a
  hypothetical one.
- Prefer editing or deleting an existing rule over adding a new one.
- Before editing a `SKILL.md` or `agents/*.md` `description:`, apply each of these:
  - Write it in the third person: "Writes …", not "Write …".
  - Say what it does first, then when to use it.
  - Name the key terms a request or command for it would contain.
  - Keep it to 1,024 characters, with no XML tags.
- Before adding a skill or agent, or changing a `SKILL.md`'s other sections or files or an
  `agents/*.md` prompt, read
  https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices.md and follow it.
- Fix one failure with one rule; never add a rule for adjacent cases the issue did not hit.
- Keep rules out of `README.md`; it points at the skills instead of restating them.
- Keep standing contributor facts the code and paths don't show in `MAINTAINING.md`, one home
  each.
- Update a `MAINTAINING.md` fact in the MR that changes it.
- Update the `skills/ask-team/WORKFLOW.md` diagram in the same MR as a change to the flow it draws.
- Put a change's detail the code doesn't show in the commit, a spec or a topic doc, never in a
  `SKILL.md` or agent prompt.
- Name a milestone `YY.MM`, its target month.
- Version milestones release in flow mode.
- From 2026-12-15 to the 26.12 due date, merge only `bug` issues and changes that do not
  alter skill or agent behaviour (docs, evals, CI).
- Run a `skills/*/evals/` runner with `--plugin-dir .`; without the flag it measures the installed
  plugin cache, not the working tree.
- Judge a `scope-mr` change on in-repo runs too (`REPO=<checkout>` in `run_baseline.sh`);
  diff-only runs lack the context real sessions read and hide what the skill does there.
- Run the hook and skill script tests as `python3 <file>` each, never `python3 -m unittest`;
  they are plain scripts and unittest exits 5 with NO TESTS RAN.
- Call a plugin workflow by its prefixed name (`dream-team:<name>`), never by `scriptPath`; skill
  text does not expand `${CLAUDE_PLUGIN_ROOT}`; a plugin agent body does.
- Before editing `CHANGELOG.md`, read `references/changelog-style.md`.
- Fence a chat-output layout in a skill, so the model reproduces its markdown; show example
  skill output in docs or evals as rendered markdown, where a fence hides the bold labels judged.
- Lay out a skill's chat output for a monospace terminal: tight `- **Label:**` bullets, no blank
  lines between items; paragraph spacing wastes fixed-height lines.
- Commit `skills/*/evals/` (cases, fixtures, runner) except `skills/scope-*/evals/`; those and
  `runs/` are ignored.
- Commit top-level `evals/` except `evals/results/`.
- Run the top-level `evals/` cases with
  `claude plugin eval . --trust-plugin --model opus --threshold 0.8 --ablation none`.
- In a top-level `evals/` case with five or more graders, give the key grader `weight: 2`.
- Give a small or pass-through skill or workflow phase stub-agent tests only; add a paid
  headless-claude eval runner only for a large skill or a failure seen in a real run.
- Before changing who does a step in a skill, read the skill's top-level role rules (e.g.
  craft-it's "You do not write the change" edit list) and update them in the same change.
- A change to a `SKILL.md`, its reference files or an `agents/*.md` prompt → check every
  other line of those files for a contradiction with the change.
- A new skill, step or workflow that takes over a behaviour → grep the other skills,
  `WORKFLOW.md` and `README.md` for that behaviour, and update or cut each line that still
  describes it (#567: craft-it kept its Meta child pick after assemble-meta shipped).
- Check skill triggering with `skills/scope-commit/evals/run_trigger.sh` (unnamed prompts); the
  other evals name the skill in the prompt and cannot see a description change. Keep its fixture
  repo consistent with each prompt, or the agent stops before loading any skill.
- In a headless `claude -p` run, pipe the prompt on stdin or put it before `--allowed-tools`; that
  flag is variadic and swallows a trailing prompt ("Input must be provided").
- Keep research findings mined from local session data (workflow journals, run counts) out of the
  repo and its issues; report them in chat only, even when craft-it's research tier says to
  post a findings comment.
- Delegate grading of eval reports against a ledger to a subagent (Agent tool); the main session
  only reads the scores and the marks file.
- Cite an outside pull request in commits, PRs, issues and notes in plain words ("unbound pull
  request 1525"), never `#1525`; GitHub links `#N` to this repo.
- Before filing a follow-up issue, list the milestone's open issues; a matching one gets a comment
  with the new evidence, not a new issue (#231 duplicated #226).
- Start an interactive session in this repo without `--plugin-dir .`; with it, every Write and
  Edit here prompts even in accept-edits mode. Keep the flag for headless evals.
- Give a headless `pi -p` run without piped input `< /dev/null`; under a Claude Bash call it
  waits forever on the harness stdin socket, 0% CPU, empty output.

## Doc conventions

Decision records, specs, ROADMAP: `docs/CONVENTIONS.md`. Read the records touching your area first.
