@erclx/canon 5.35.0 → 5.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -11
- package/claude/.claude-plugin/plugin.json +1 -1
- package/claude/skills/api-design/SKILL.md +6 -0
- package/claude/skills/backlog-triage/SKILL.md +7 -7
- package/claude/skills/build-in-slices/SKILL.md +6 -0
- package/claude/skills/build-in-slices/references/adopted.md +3 -0
- package/claude/skills/canon-cli/REQUIREMENT.md +2 -2
- package/claude/skills/canon-cli/SKILL.md +5 -1
- package/claude/skills/canon-feedback/SKILL.md +5 -0
- package/claude/skills/canon-feedback-triage/SKILL.md +3 -0
- package/claude/skills/canvas-board/REQUIREMENT.md +1 -1
- package/claude/skills/canvas-board/SKILL.md +5 -2
- package/claude/skills/canvas-board/references/canvas.md +12 -0
- package/claude/skills/canvas-board/references/design.md +53 -36
- package/claude/skills/ci-workflow/SKILL.md +5 -0
- package/claude/skills/code-craft/SKILL.md +6 -0
- package/claude/skills/codebase-layout/REQUIREMENT.md +1 -1
- package/claude/skills/codebase-layout/SKILL.md +2 -2
- package/claude/skills/context-fold/references/context.md +48 -34
- package/claude/skills/create-rule/REQUIREMENT.md +6 -8
- package/claude/skills/create-rule/SKILL.md +19 -17
- package/claude/skills/create-rule/references/rule.md +17 -23
- package/claude/skills/create-skill/SKILL.md +11 -2
- package/claude/skills/create-skill/references/skill-disclosure.md +26 -0
- package/claude/skills/create-skill/references/skill-paths.md +3 -0
- package/claude/skills/create-skill/references/skill-reference.md +12 -0
- package/claude/skills/create-skill/references/skill.md +26 -25
- package/claude/skills/deprecation-migration/SKILL.md +6 -0
- package/claude/skills/deprecation-migration/references/adopted.md +3 -0
- package/claude/skills/design-taste/REQUIREMENT.md +6 -6
- package/claude/skills/design-taste/SKILL.md +8 -2
- package/claude/skills/design-taste/references/craft.md +4 -1
- package/claude/skills/design-taste/references/preflight.md +18 -2
- package/claude/skills/design-taste/references/tells.md +1 -1
- package/claude/skills/docs-sync/references/docs.md +6 -0
- package/claude/skills/docs-sync/references/readme.md +15 -0
- package/claude/skills/draft-and-pick/SKILL.md +12 -0
- package/claude/skills/draft-doc/references/context.md +1 -1
- package/claude/skills/draft-doc/references/readme.md +3 -0
- package/claude/skills/draft-figure/references/mermaid.md +6 -0
- package/claude/skills/draft-identity/SKILL.md +3 -2
- package/claude/skills/draft-slides/SKILL.md +3 -0
- package/claude/skills/git-branch/references/branch.md +16 -11
- package/claude/skills/git-commit/references/commit.md +19 -11
- package/claude/skills/git-commit/references/versioning.md +9 -0
- package/claude/skills/git-issue/references/issue.md +12 -9
- package/claude/skills/git-pr/SKILL.md +5 -0
- package/claude/skills/git-pr/references/pr.md +24 -6
- package/claude/skills/git-ship/SKILL.md +3 -0
- package/claude/skills/git-split/SKILL.md +6 -0
- package/claude/skills/git-stage/SKILL.md +3 -0
- package/claude/skills/git-worktree/SKILL.md +6 -6
- package/claude/skills/markdown-craft/references/markdown.md +27 -8
- package/claude/skills/plan-feature/SKILL.md +10 -1
- package/claude/skills/plan-feature/references/plan.md +20 -8
- package/claude/skills/plan-groundwork/SKILL.md +6 -0
- package/claude/skills/plan-groundwork/references/groundwork.md +10 -7
- package/claude/skills/plan-intake/references/intake.md +6 -6
- package/claude/skills/read-frames/SKILL.md +3 -0
- package/claude/skills/review-craft/SKILL.md +3 -0
- package/claude/skills/review-craft/references/ui.md +1 -1
- package/claude/skills/review-ui/SKILL.md +6 -3
- package/claude/skills/role-orchestrator/SKILL.md +3 -0
- package/claude/skills/role-orchestrator/references/orchestrator-dispatch.md +7 -4
- package/claude/skills/role-orchestrator/references/orchestrator-refill.md +3 -0
- package/claude/skills/role-planner/SKILL.md +3 -0
- package/claude/skills/role-worker/SKILL.md +12 -0
- package/claude/skills/search-craft/SKILL.md +3 -0
- package/claude/skills/systematic-debugging/SKILL.md +6 -0
- package/claude/skills/target-check/references/domains.md +5 -0
- package/claude/skills/target-setup/SKILL.md +5 -0
- package/claude/skills/task-board/references/tasks.md +9 -6
- package/claude/skills/task-complete/references/archive.md +3 -0
- package/claude/skills/teach-workspace/SKILL.md +3 -0
- package/claude/skills/teach-workspace/references/glossary.md +3 -0
- package/claude/skills/teach-workspace/references/lesson-build.md +3 -0
- package/claude/skills/teach-workspace/references/lesson-craft.md +3 -0
- package/claude/skills/teach-workspace/references/teach.md +8 -8
- package/claude/skills/test-craft/SKILL.md +7 -2
- package/claude/skills/ux-audit/REQUIREMENT.md +1 -1
- package/claude/skills/ux-audit/SKILL.md +2 -2
- package/claude/skills/ux-measure/REQUIREMENT.md +1 -1
- package/claude/skills/video-craft/SKILL.md +6 -0
- package/claude/skills/write-human/SKILL.md +9 -0
- package/claude/skills/write-human/references/machine-tells.md +12 -0
- package/docs/agents/capture.md +2 -0
- package/docs/agents/commands.md +59 -56
- package/docs/agents/comments.md +1 -1
- package/docs/agents/context-audit-checks.md +6 -0
- package/docs/agents/context-audit.md +8 -8
- package/docs/agents/context-classify.md +2 -0
- package/docs/agents/drift-surfaces.md +5 -5
- package/docs/agents/gate.md +6 -7
- package/docs/agents/gov-detect.md +1 -1
- package/docs/agents/index.md +2 -2
- package/docs/agents/install-and-sync.md +6 -6
- package/docs/agents/markdown-audit-weight.md +11 -3
- package/docs/agents/markdown-audit.md +14 -2
- package/docs/agents/output-shape.md +1 -1
- package/docs/agents/overview.md +2 -2
- package/docs/agents/pr-frames.md +17 -3
- package/docs/agents/rule-citations.md +5 -10
- package/docs/agents/scripting.md +1 -1
- package/docs/agents/sessions-transfer.md +8 -6
- package/docs/agents/skills-audit.md +9 -1
- package/docs/target/projects.md +2 -2
- package/docs/target/scenarios.md +5 -5
- package/docs/target/standards-moved.md +20 -18
- package/docs/workflow/ai-workflow.md +4 -1
- package/docs/workflow/visual-design-workflow.md +8 -3
- package/governance/detect.toml +32 -32
- package/governance/renames.toml +44 -0
- package/governance/rules/lib/{305-e2e-reliability.md → e2e-reliability.md} +1 -1
- package/governance/rules/lib/{306-test-scope.md → test-scope.md} +2 -2
- package/governance/rules/ui/{410-a11y.md → a11y.md} +1 -1
- package/governance/rules/ui/{440-surface-capture.md → surface-capture.md} +3 -3
- package/governance/stacks/base.toml +6 -6
- package/governance/stacks/go.toml +1 -1
- package/governance/stacks/node.toml +1 -1
- package/governance/stacks/php.toml +1 -1
- package/governance/stacks/python.toml +1 -1
- package/package.json +2 -2
- package/scripts/core/install-check.sh +2 -7
- package/src/capture/frame-values.ts +3 -6
- package/src/cli/help-all.ts +96 -0
- package/src/cli/help.ts +28 -27
- package/src/cli.ts +8 -1
- package/src/commands/claude.ts +29 -0
- package/src/commands/context.ts +29 -4
- package/src/commands/design.ts +22 -1
- package/src/commands/gate.ts +1 -8
- package/src/commands/gov.ts +25 -3
- package/src/commands/init.ts +10 -1
- package/src/commands/markdown.ts +148 -3
- package/src/commands/pr.ts +17 -10
- package/src/commands/records.ts +1 -1
- package/src/commands/sync.ts +11 -0
- package/src/commands/tooling.ts +8 -0
- package/src/context/audit.ts +83 -0
- package/src/context/classify/prompts.ts +6 -1
- package/src/context/gate.ts +6 -3
- package/src/design/budget.ts +14 -10
- package/src/design/document.ts +5 -5
- package/src/design/parse.ts +21 -4
- package/src/design/render.ts +3 -3
- package/src/gate/measures.ts +187 -2
- package/src/gate/sequencer.ts +0 -4
- package/src/gate/stages.ts +32 -27
- package/src/git/files.ts +30 -0
- package/src/gov/adapter.ts +2 -2
- package/src/gov/citations.ts +10 -33
- package/src/gov/install.ts +2 -2
- package/src/gov/list.ts +1 -1
- package/src/gov/payload.ts +1 -1
- package/src/gov/stacks.ts +4 -4
- package/src/inventory/subjects.ts +1 -1
- package/src/markdown/ceiling.ts +6 -1
- package/src/markdown/colons.ts +86 -0
- package/src/markdown/gate.ts +25 -0
- package/src/markdown/growth.ts +43 -0
- package/src/markdown/heading-case.ts +74 -0
- package/src/markdown/stacks.ts +74 -0
- package/src/markdown/structure.ts +72 -4
- package/src/migrate/rule-layout.ts +12 -12
- package/src/pr/frames.ts +66 -1
- package/src/shipped/references.ts +14 -14
- package/src/sync/check.ts +23 -23
- package/src/sync/copy.ts +4 -5
- package/tooling/astro/configs/tsconfig.json +1 -1
- package/tooling/astro/manifest.toml +0 -1
- package/tooling/astro/reference.md +2 -10
- package/tooling/base/configs/scripts/verify.json +1 -1
- package/tooling/base/configs/scripts/verify.ts +23 -13
- package/tooling/base/manifest.toml +6 -5
- package/tooling/base/reference.md +15 -22
- package/tooling/base/seeds/.github/workflows/verify.yml +0 -6
- package/tooling/base/seeds/.lintstagedrc +1 -2
- package/tooling/base/seeds/canon/context/ci.md +7 -8
- package/tooling/base/seeds/canon/context/development.md +10 -10
- package/tooling/claude/seeds/.claude/hooks/scratch-guard.sh +9 -1
- package/tooling/claude/seeds/.claude/hooks/standards-audit.sh +27 -2
- package/tooling/claude/seeds/CLAUDE.md +1 -1
- package/tooling/claude/seeds/canon/DESIGN.md +24 -37
- package/tooling/shell/configs/.github/workflows/shell.yml +30 -0
- package/tooling/shell/manifest.toml +12 -0
- package/tooling/shell/reference.md +46 -0
- package/tooling/vite-react/configs/tsconfig.json +1 -1
- package/tooling/vite-react/configs/vitest.config.ts +1 -1
- package/tooling/vite-react/manifest.toml +0 -1
- package/tooling/vite-react/reference.md +2 -10
- package/tooling/web/configs/.github/workflows/readme-screenshot.yml +3 -5
- package/tooling/web/configs/.github/workflows/verify.yml +0 -6
- package/tooling/web/configs/src/test/setup.ts +1 -1
- package/tooling/web/manifest.toml +4 -4
- package/tooling/web/reference.md +4 -4
- package/tooling/base/configs/scripts/verify.sh +0 -2
- /package/governance/rules/canon/{606-git.md → git.md} +0 -0
- /package/governance/rules/canon/{611-indexes.md → indexes.md} +0 -0
- /package/governance/rules/canon/{604-scratch.md → scratch.md} +0 -0
- /package/governance/rules/canon/{602-tasks.md → task-scope.md} +0 -0
- /package/governance/rules/canon/{605-worktrees.md → worktrees.md} +0 -0
- /package/governance/rules/claude/{566-output.md → output.md} +0 -0
- /package/governance/rules/code/{000-code.md → routing.md} +0 -0
- /package/governance/rules/code/{010-testing.md → testing.md} +0 -0
- /package/governance/rules/framework/{210-astro.md → astro.md} +0 -0
- /package/governance/rules/framework/{220-fastapi.md → fastapi.md} +0 -0
- /package/governance/rules/framework/{230-nextjs.md → nextjs.md} +0 -0
- /package/governance/rules/framework/{200-react.md → react.md} +0 -0
- /package/governance/rules/framework/{260-shadcn.md → shadcn.md} +0 -0
- /package/governance/rules/framework/{250-tailwind.md → tailwind.md} +0 -0
- /package/governance/rules/lang/{130-go.md → go.md} +0 -0
- /package/governance/rules/lang/{140-php.md → php.md} +0 -0
- /package/governance/rules/lang/{110-python.md → python.md} +0 -0
- /package/governance/rules/lang/{100-typescript.md → typescript.md} +0 -0
- /package/governance/rules/lib/{370-database.md → database.md} +0 -0
- /package/governance/rules/lib/{340-pydantic.md → pydantic.md} +0 -0
- /package/governance/rules/lib/{360-security-server.md → security-server.md} +0 -0
- /package/governance/rules/lib/{350-security-web.md → security-web.md} +0 -0
- /package/governance/rules/lib/{320-tanstack-query.md → tanstack-query.md} +0 -0
- /package/governance/rules/lib/{335-testing-go.md → testing-go.md} +0 -0
- /package/governance/rules/lib/{336-testing-php.md → testing-php.md} +0 -0
- /package/governance/rules/lib/{330-testing-py.md → testing-py.md} +0 -0
- /package/governance/rules/lib/{300-testing-ts.md → testing-ts.md} +0 -0
- /package/governance/rules/lib/{310-zod.md → zod.md} +0 -0
- /package/governance/rules/tooling/{700-ci-workflow.md → ci-workflow.md} +0 -0
- /package/governance/rules/tooling/{790-code-comments.md → code-comments.md} +0 -0
- /package/governance/rules/tooling/{780-config-comments.md → config-comments.md} +0 -0
- /package/governance/rules/tooling/{775-dependencies.md → dependencies.md} +0 -0
- /package/governance/rules/ui/{480-canvas.md → canvas.md} +0 -0
- /package/governance/rules/ui/{400-ui.md → copy.md} +0 -0
- /package/governance/rules/ui/{460-design-taste.md → design-taste.md} +0 -0
- /package/governance/rules/ui/{420-forms.md → forms.md} +0 -0
- /package/governance/rules/ui/{465-interface-casing.md → interface-casing.md} +0 -0
- /package/governance/rules/ui/{450-link-behavior.md → link-behavior.md} +0 -0
- /package/governance/rules/ui/{470-motion.md → motion.md} +0 -0
- /package/governance/rules/ui/{430-ux-completeness.md → ux-completeness.md} +0 -0
- /package/tooling/{base → shell}/configs/.editorconfig +0 -0
- /package/tooling/{base → shell}/configs/.shellcheckrc +0 -0
|
@@ -13,10 +13,7 @@ Applies to per-domain narrative entries under `canon/context/`. Skip for `index.
|
|
|
13
13
|
- [Organizing principle](#organizing-principle)
|
|
14
14
|
- [What a working entry looks like](#what-a-working-entry-looks-like)
|
|
15
15
|
- [Frontmatter](#frontmatter)
|
|
16
|
-
- [
|
|
17
|
-
- [Expected sections](#expected-sections)
|
|
18
|
-
- [Optional sections](#optional-sections)
|
|
19
|
-
- [Ordering](#ordering)
|
|
16
|
+
- [The closed set](#the-closed-set)
|
|
20
17
|
- [The development entry](#the-development-entry)
|
|
21
18
|
- [What goes in](#what-goes-in)
|
|
22
19
|
- [What does not go in](#what-does-not-go-in)
|
|
@@ -59,40 +56,33 @@ An entry that fails these is non-conforming regardless of whether it satisfies e
|
|
|
59
56
|
|
|
60
57
|
Both fields feed `canon/context/index.md` when regenerated.
|
|
61
58
|
|
|
62
|
-
##
|
|
59
|
+
## The closed set
|
|
63
60
|
|
|
64
|
-
|
|
65
|
-
- `## Layout`: one line per folder in owns-X form. Folders only, never files.
|
|
66
|
-
- Form: ``- `scripts/lib/` owns shared bash functions sourced by domain scripts``. Do not list every file under that folder with a description each.
|
|
67
|
-
- Implementation detail moves to `## Decisions`, `## Hidden contracts`, or `## Gotchas`.
|
|
68
|
-
- Omit the section when the domain owns no paths in the repo, as with a domain covering external tools. Inventing a line to satisfy the heading is the padding banned below.
|
|
61
|
+
An entry carries four H2 sections and no other, in this order: `Overview`, `Layout`, `Decisions`, `Gotchas`. `canon context audit` reports any other H2 and `--gate` fails it. A topic of the domain's own, such as `Cache` or `Workflow`, is an H3 under one of the four, which is where a reader scanning the entry looks for it.
|
|
69
62
|
|
|
70
|
-
|
|
63
|
+
- `## Overview`: two to four lines. What the domain owns and where its boundary sits. Required.
|
|
64
|
+
- `## Layout`: one line per folder in owns-X form, folders only and never files. Required, and omitted where the domain owns no paths in the repo, as with a domain covering external tools. Inventing a line to satisfy the heading is the padding banned below.
|
|
65
|
+
- `## Decisions`: non-obvious choices and the reasoning behind them, each as an H3 or a bullet. The highest-value section in the folder and the one most often missing. A decision resting on how an outside tool, an installer, or the model behaves may close with one `Revisit when <finding>.` sentence naming the harm the decision prevents, and a decision resting on the project's own code takes none.
|
|
66
|
+
- `## Gotchas`: workarounds, things tried and rejected, and invariants the code does not self-document, such as shape constraints, skip rules, and header semantics. Use `## Decisions` when the reader needs the reasoning rather than the invariant itself.
|
|
71
67
|
|
|
72
|
-
Include whenever the domain has content for them
|
|
68
|
+
Include `Decisions` and `Gotchas` whenever the domain has content for them, and never pad an entry with an empty heading.
|
|
73
69
|
|
|
74
|
-
|
|
75
|
-
- `## Gotchas`: workarounds, things tried and rejected, scar tissue worth preserving.
|
|
70
|
+
### Where an extra topic goes
|
|
76
71
|
|
|
77
|
-
|
|
72
|
+
- A command surface goes under `## Layout` as an H3, only when the domain has one, and only as a list of what each verb does. Flags and JSON shapes stay in the CLI reference under `docs/`, linked rather than restated.
|
|
73
|
+
- The procedure for the domain's most common task goes under `## Layout` as an H3 such as `### Adding a <thing>`, since most sessions arrive asking how to add one more of the thing the domain holds.
|
|
74
|
+
- Implementation detail that the one-line owns-X form cannot carry moves to `## Decisions` or `## Gotchas`.
|
|
78
75
|
|
|
79
|
-
|
|
76
|
+
### Ordering and headings
|
|
80
77
|
|
|
81
|
-
-
|
|
82
|
-
- `## Workflow` or `## Adding a <thing>`: the procedure for the domain's most common task. Most sessions arrive asking how to add one more of the thing the domain holds.
|
|
83
|
-
- `## Hidden contracts`: invariants the code does not self-document (shape constraints, skip rules, header semantics). Use `## Decisions` when the reader needs the reasoning rather than the invariant itself.
|
|
84
|
-
|
|
85
|
-
## Ordering
|
|
86
|
-
|
|
87
|
-
- Order sections `Overview`, `Layout`, `Decisions`, `Gotchas`, then everything else.
|
|
88
|
-
- Name a heading for its subject as it stands (`## Cache`), never for the event that shaped it (`## The cache was the untested part, and the test moved it`). A heading is what a scan reads, so a narrating heading turns the table of contents into a changelog.
|
|
78
|
+
- Name a heading for its subject as it stands (`### Cache`), never for the event that shaped it (`### The cache was the untested part, and the test moved it`). A heading is what a scan reads, so a narrating heading turns the table of contents into a changelog.
|
|
89
79
|
- Entries get read top-down and often partially, so irreducible content sits above recoverable content.
|
|
90
80
|
|
|
91
81
|
## The development entry
|
|
92
82
|
|
|
93
|
-
Only the `development` entry carries this section
|
|
83
|
+
Only the `development` entry carries this section, as an H3 under `## Layout`. It is not a general-purpose heading for other domains.
|
|
94
84
|
|
|
95
|
-
-
|
|
85
|
+
- `### Scripts`: a table of run commands (command plus purpose). The single discoverable surface for how to run the project. Keep run commands here, not scattered across `CLAUDE.md`.
|
|
96
86
|
|
|
97
87
|
## What goes in
|
|
98
88
|
|
|
@@ -100,6 +90,9 @@ Only the `development` entry carries this section. It is not a general-purpose h
|
|
|
100
90
|
- Decisions that constrain the domain, whether or not their reasoning touches another one. A decision lives in the entry of the domain it constrains.
|
|
101
91
|
- Constraints, gotchas, things tried and rejected
|
|
102
92
|
- Domain-specific conventions that do not fit a `paths:`-scoped rule
|
|
93
|
+
|
|
94
|
+
### Figures and references
|
|
95
|
+
|
|
103
96
|
- A measured figure, closed with a trailing `Measured at <short-sha> on <YYYY-MM-DD>.` naming a commit rather than a pull request number or a branch. Carry one anchor per figure and rewrite it in place when the number is re-read, whether or not it moved. An absent anchor reads as unchecked.
|
|
104
97
|
- A reference to another entry, spelled as the path that entry sits at rather than as its bare filename. A bare name resolves against whichever folder the reader is already in, so a domain that splits into subfolders strands every inbound reference and the break surfaces nowhere. A reference to a seed, a standard, or a file the project owns elsewhere keeps the form its own surface uses.
|
|
105
98
|
|
|
@@ -109,10 +102,16 @@ Only the `development` entry carries this section. It is not a general-purpose h
|
|
|
109
102
|
- Restated `--help` output, flag tables, or JSON shapes.
|
|
110
103
|
- A catalog a `list` command already returns. Link the command instead, so the entry cannot drift from it.
|
|
111
104
|
- Function-level documentation for implementation modules. Read the code. The exception is the public surface of a shared utility module, where the entry is how a session finds an existing helper instead of duplicating it.
|
|
105
|
+
|
|
106
|
+
### Elsewhere
|
|
107
|
+
|
|
112
108
|
- Rules. Those go in `.claude/rules/<scope>.md` with a `paths:` glob.
|
|
113
109
|
- Tutorials or human onboarding. Those go in `docs/` if a public audience exists.
|
|
114
110
|
- Generated content (API references). Generate, do not write by hand.
|
|
115
111
|
- Anything already in `canon/REQUIREMENTS.md`.
|
|
112
|
+
|
|
113
|
+
### History and results
|
|
114
|
+
|
|
116
115
|
- The history of how the domain reached its current shape. An entry describes the repository as it stands, so a change number, release label, or date attached to a change goes wherever the project tracks work.
|
|
117
116
|
- A rejected alternative's provenance, which is the same rule at the one place the section above admits history. Keep what was tried and why it lost. Cut who tried it and when.
|
|
118
117
|
- The route to a decision: the rounds of candidates, the tuning steps a threshold passed through, the review pass that caught a miss. State the decision, what lost, and why, once and in the present tense. Cut the route. Git and the change that introduced it keep it.
|
|
@@ -122,9 +121,15 @@ Only the `development` entry carries this section. It is not a general-purpose h
|
|
|
122
121
|
|
|
123
122
|
- Aim for one entry per domain. Length is a symptom, not the defect, and the one hard cap is the whole-document ceiling `markdown.md` states.
|
|
124
123
|
- Past roughly 150 rendered lines, check three things before adding more: whether the entry still covers a single domain, whether it has filled with content `ls` or `--help` reproduces, and whether it has accumulated the history of its own changes. Fix whichever is true rather than trimming to hit a number. The 150 is a diagnostic checkpoint and never gates. Rendered lines count as `markdown.md` defines them.
|
|
125
|
-
- Never cut a `## Decisions` or `## Gotchas` entry to shorten a file. Cut a `## Layout` or
|
|
124
|
+
- Never cut a `## Decisions` or `## Gotchas` entry to shorten a file. Cut a `## Layout` section or an H3 under it instead.
|
|
125
|
+
|
|
126
|
+
### Retiring and rewriting
|
|
127
|
+
|
|
126
128
|
- Retire a decision or gotcha once its subject is gone, rewriting the bullet to state the current design rather than leaving the narration of what it replaced beside it. A rejected alternative is not a retired one, so what was tried and why it lost stays whatever its age. The rule above protects content whose subject is live, and this one releases content whose subject is not.
|
|
127
129
|
- Rewrite a decision a later one replaced rather than appending the replacement beside it. The subject is still live, so the rule above does not reach it, and two bullets on one subject leave a reader to work out which of them is current. State the design that stands and keep the superseded reasoning only where it is the alternative that lost.
|
|
130
|
+
|
|
131
|
+
### Splitting and naming
|
|
132
|
+
|
|
128
133
|
- Split into a folder (`canon/context/<domain>/<sub-area>.md`) when a domain has three or more sub-areas that do not fit cleanly in one file. That split is the natural ceiling.
|
|
129
134
|
- Group whole single-file entries of two or more small domains into one folder when they share a kind, such as small feature domains that each own a verb. Each entry still covers one domain, and the folder's generated `index.md` carries a `subtitle` naming the kind. It names an entry to start with only when that entry frames the others. A grouping folder is not a split, so no entry inside it is a sub-area of another.
|
|
130
135
|
- Name an entry inside a split or grouping folder per the `codebase-layout` skill, which never repeats the folder's name as the entry's stem or prefix.
|
|
@@ -157,16 +162,25 @@ never the reverse.
|
|
|
157
162
|
|
|
158
163
|
## Decisions
|
|
159
164
|
|
|
160
|
-
|
|
161
|
-
|
|
165
|
+
### Validation at the route boundary
|
|
166
|
+
|
|
167
|
+
Validation happens at the route boundary using a schema library. Services trust their inputs.
|
|
168
|
+
|
|
169
|
+
### Opaque pagination cursors
|
|
170
|
+
|
|
171
|
+
Pagination uses opaque cursor tokens, never offset+limit. Cursor format stays opaque to clients, which is why any handler that issues a cursor uses the shared encoder.
|
|
162
172
|
|
|
163
173
|
## Gotchas
|
|
164
174
|
|
|
165
|
-
|
|
166
|
-
|
|
175
|
+
### The health endpoint skips auth
|
|
176
|
+
|
|
177
|
+
The `/health` endpoint skips auth middleware. Liveness probes from the orchestrator do not carry tokens.
|
|
178
|
+
|
|
179
|
+
### The connection pool caps at 50
|
|
180
|
+
|
|
181
|
+
Concurrent requests over that block until a connection frees.
|
|
167
182
|
|
|
168
|
-
|
|
183
|
+
### Handlers never wrap their return
|
|
169
184
|
|
|
170
|
-
|
|
171
|
-
- Cursor tokens are base64-encoded JSON of `{ id, sort }`. Any handler that issues a cursor must use the shared encoder.
|
|
185
|
+
Route handlers return a plain object, and the serializer wraps it in `{ data, meta }`.
|
|
172
186
|
```
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: create-rule
|
|
3
|
-
description: Why a project-local rule needs a subdir, a
|
|
3
|
+
description: Why a project-local rule needs a subdir, a slug free in it, and a scope key that decides when it fires
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Create rule requirement
|
|
7
7
|
|
|
8
8
|
## Gap
|
|
9
9
|
|
|
10
|
-
Without this skill, a project rule is written straight into the rules folder
|
|
11
|
-
|
|
12
|
-
Numbering in `900-999` closes the other half. A number scanned against today's toolkit catalog goes stale on the next release, and a reserved band does not.
|
|
10
|
+
Without this skill, a project rule is written straight into the rules folder under a name already taken, so two rules collide and one loses. The subtler collision was with the toolkit itself: a name free in the target today could be the name a shipped rule landed on tomorrow, so a rule the project wrote got overwritten by one it never chose. Writing under `.claude/rules/project/` closes that collision whatever the name, since the sync engine orphans the file by location before it ever compares names, and leaves only a slug taken in the same project subdir to check.
|
|
13
11
|
|
|
14
12
|
The subdir gets picked by feel, so a UI copy rule lands in the always-on folder and loads on every session for the rest of the project's life. The scope key fails in both directions. An always-on rule carrying a path scope fires only on files it was never about, and a path-scoped rule missing it loads constantly. Written from memory rather than from the rule standard, the body comes out in a shape the rest of the catalog does not share.
|
|
15
13
|
|
|
@@ -18,24 +16,24 @@ The subdir gets picked by feel, so a UI copy rule lands in the always-on folder
|
|
|
18
16
|
- Resolve what the rule enforces and where it applies, asking only for what the request leaves missing
|
|
19
17
|
- Pick the subdir from the topic and take the folder from that choice
|
|
20
18
|
- Write under `.claude/rules/project/`, the subfolder the sync engine reads as project-authored by location
|
|
21
|
-
- Take
|
|
19
|
+
- Take a slug no rule in the chosen project subdir uses and that equals no subdir name
|
|
22
20
|
- Read the rule standard before writing the body
|
|
23
21
|
- Emit the path scope for a path-scoped rule and omit the key entirely for an always-on one
|
|
24
|
-
- Preview the resolved path, subdir,
|
|
22
|
+
- Preview the resolved path, subdir, slug, and frontmatter, then write without pausing
|
|
25
23
|
- Say when the rule loads, since path-scoped and always-on rules behave differently
|
|
26
24
|
|
|
27
25
|
## Must not
|
|
28
26
|
|
|
29
27
|
- Edit a toolkit source rule, which is authored in the toolkit and would be overwritten here
|
|
30
28
|
- Work the body shape or the frontmatter from memory
|
|
31
|
-
-
|
|
29
|
+
- Overwrite a project rule already holding the slug
|
|
32
30
|
- Write more than one topic into a single rule
|
|
33
31
|
|
|
34
32
|
## Guards
|
|
35
33
|
|
|
36
34
|
- No project Claude directory: stop, since there is nowhere for the rule to live
|
|
37
35
|
- The request names no behavior to enforce: stop rather than inventing one
|
|
38
|
-
- The
|
|
36
|
+
- The topic's slug is taken in the chosen subdir: stop and propose a narrower one
|
|
39
37
|
|
|
40
38
|
## Out of scope
|
|
41
39
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: create-rule
|
|
3
|
-
description: Scaffolds a project-specific governance rule into `.claude/rules/project/<subdir>/<
|
|
3
|
+
description: Scaffolds a project-specific governance rule into `.claude/rules/project/<subdir>/<slug>.md` with correct frontmatter and a slug no other rule in that subdir takes. Use when asked to "add a rule", "create a governance rule", "write a project rule", or when a project needs a coding rule the toolkit does not ship. Do NOT use to edit toolkit source rules under `governance/rules/`.
|
|
4
4
|
metadata:
|
|
5
5
|
family: generate
|
|
6
6
|
---
|
|
@@ -25,29 +25,31 @@ Resolve both from the request, and ask only for what is missing. Attach a propos
|
|
|
25
25
|
|
|
26
26
|
Pick the subdir from the topic. It sits under `.claude/rules/project/` and names the rule's domain:
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
| Subdir | Holds |
|
|
29
|
+
| ------------- | ---------------------------------------------------------- |
|
|
30
|
+
| `code/`: | code placement, errors, naming, testing. |
|
|
31
|
+
| `lang/`: | one programming language. |
|
|
32
|
+
| `framework/`: | one framework. |
|
|
33
|
+
| `lib/`: | one library or tool. |
|
|
34
|
+
| `ui/`: | UI copy, accessibility, forms. |
|
|
35
|
+
| `claude/`: | session conduct and `.claude/` authoring surfaces. |
|
|
36
|
+
| `canon/`: | the toolkit workflow and its record folders. |
|
|
37
|
+
| `tooling/`: | dev setup, such as CI workflows, dependencies, and config. |
|
|
38
|
+
| `writing/`: | prose and document shape. |
|
|
37
39
|
|
|
38
|
-
## Step 3: pick a free
|
|
40
|
+
## Step 3: pick a free slug
|
|
39
41
|
|
|
40
|
-
A
|
|
42
|
+
A rule's filename is its slug alone, a one-to-three-word kebab topic with no number in front. A slug the toolkit ships is no collision, since `canon/` and `project/` install side by side and a sync never reads the second.
|
|
41
43
|
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
- Stop and say so
|
|
44
|
+
- Take a slug no file in the chosen `.claude/rules/project/<subdir>/` already uses.
|
|
45
|
+
- Never take a slug equal to a subdir name from Step 2, since a stack entry naming that word reads it as the folder.
|
|
46
|
+
- Stop and say so when the topic's natural slug is taken, and propose a narrower one rather than overwriting the file.
|
|
45
47
|
|
|
46
48
|
## Step 4: write the rule
|
|
47
49
|
|
|
48
50
|
Read `${CLAUDE_SKILL_DIR}/references/rule.md` for frontmatter, body shape, and voice before writing the body. Do not work the shape from memory.
|
|
49
51
|
|
|
50
|
-
Write `.claude/rules/project/<subdir>/<
|
|
52
|
+
Write `.claude/rules/project/<subdir>/<slug>.md`. Preview the resolved path, subdir, slug, and frontmatter, then write immediately. The tool permission dialog is the confirmation gate.
|
|
51
53
|
|
|
52
54
|
Frontmatter carries the Claude shape. Path-scoped rules emit one `paths:` entry per glob. Always-on rules omit `paths:` entirely.
|
|
53
55
|
|
|
@@ -70,4 +72,4 @@ Title casing is sentence case, with proper nouns keeping their own casing (`# Ty
|
|
|
70
72
|
|
|
71
73
|
## After writing
|
|
72
74
|
|
|
73
|
-
Emit the full path on its own line: `.claude/rules/project/<subdir>/<
|
|
75
|
+
Emit the full path on its own line: `.claude/rules/project/<subdir>/<slug>.md`. Remind the user that Claude Code loads path-scoped rules when it reads or writes a matching file, and always-on rules every session.
|
|
@@ -11,8 +11,7 @@ description: Rule frontmatter, body shape, and voice for .claude/rules files
|
|
|
11
11
|
- [Scope](#scope)
|
|
12
12
|
- [Whether a skill belongs behind the rule](#whether-a-skill-belongs-behind-the-rule)
|
|
13
13
|
- [Location](#location)
|
|
14
|
-
- [
|
|
15
|
-
- [Two sources numbering into one folder](#two-sources-numbering-into-one-folder)
|
|
14
|
+
- [Names](#names)
|
|
16
15
|
- [Frontmatter](#frontmatter)
|
|
17
16
|
- [Body](#body)
|
|
18
17
|
- [Examples](#examples)
|
|
@@ -27,7 +26,7 @@ A rule with `paths:` loads on a read or a write of a matching file, inside a lin
|
|
|
27
26
|
|
|
28
27
|
## Scope
|
|
29
28
|
|
|
30
|
-
Governs governance rules under `.claude/rules/`: their location,
|
|
29
|
+
Governs governance rules under `.claude/rules/`: their location, names, frontmatter, and body shape.
|
|
31
30
|
|
|
32
31
|
Does not govern:
|
|
33
32
|
|
|
@@ -45,33 +44,22 @@ Write both when both apply. A rule stating the directive and a skill stating how
|
|
|
45
44
|
|
|
46
45
|
## Location
|
|
47
46
|
|
|
48
|
-
- A toolkit-shipped rule lives at `.claude/rules/canon/<subdirectory>/<
|
|
47
|
+
- A toolkit-shipped rule lives at `.claude/rules/canon/<subdirectory>/<slug>.md`. The wrapper marks the file as toolkit-owned and replaced on sync, so a reader still knows not to edit it.
|
|
49
48
|
- Subdirectories group by domain or audience: `code/`, `lang/`, `framework/`, `lib/`, `ui/`, `claude/`, `canon/`, `tooling/`, `writing/`
|
|
50
|
-
- `<
|
|
51
|
-
- A rule the project authored itself lives at `.claude/rules/project/<subdirectory>/<
|
|
52
|
-
- This repository's own toolkit-only rules, which never ship to a target, live at `.claude/rules/internal/<subdirectory>/<
|
|
53
|
-
- Give every authored rule a numeric prefix. A bare-word filename reads as a folder name where a stack names its rules, so a rule without one is unreachable from a stack entry.
|
|
49
|
+
- `<slug>` is a one-to-three-word kebab topic
|
|
50
|
+
- A rule the project authored itself lives at `.claude/rules/project/<subdirectory>/<slug>.md`, a sibling of `canon/` rather than nested inside it, keeping the same subdirectory names
|
|
51
|
+
- This repository's own toolkit-only rules, which never ship to a target, live at `.claude/rules/internal/<subdirectory>/<slug>.md`, a second sibling of `canon/`.
|
|
54
52
|
|
|
55
|
-
##
|
|
53
|
+
## Names
|
|
56
54
|
|
|
57
|
-
|
|
55
|
+
A rule's filename is its slug, with no number in front. Nothing orders rules at load, and the folder already names the domain.
|
|
58
56
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
- Keep every basename unique across a rule set, internal rules included, since `canon gov` resolves a stack entry and a rename by basename alone.
|
|
58
|
+
- Never name a rule after a subdirectory. A stack entry naming that word expands to the whole folder, so the rule becomes unreachable on its own.
|
|
59
|
+
- A project-authored rule needs its slug free only inside its own subdirectory under `.claude/rules/project/`. A slug the toolkit ships collides with nothing there, since `canon/` and `project/` install side by side.
|
|
62
60
|
|
|
63
61
|
`canon gov sync` walks only `.claude/rules/canon/`, so `.claude/rules/project/` sits outside the walk by location and is never matched, read, or reported on. A file under `.claude/rules/canon/` itself that no toolkit source names is still reported orphaned, but with no destination offered: the toolkit cannot tell a rule the project dropped there from one it shipped and later renamed, and a destination nested inside `canon/` would be wrong for the first case regardless, since that folder is toolkit-owned and replaced on sync. Nothing is moved either way, since a rule's installed path is one the project's own rules, skills, and docs may cite.
|
|
64
62
|
|
|
65
|
-
## Two sources numbering into one folder
|
|
66
|
-
|
|
67
|
-
The reservation above divides one pair, being a shipped set against the rules a project wrote for itself. A third source, a rule set held back from targets and installed only where it was authored, needs its own division too. This repository is the one place all three sources exist at once, and it divides the third pair two ways at once rather than one: `canon/` and `internal/` separate a shipped rule from an internal one by location, the same way `project/` separates a project-authored one, and within each subdirectory the numbering still divides by source as well, one source taking the top of the band and the other the gaps between the tens.
|
|
68
|
-
|
|
69
|
-
The numbering half stays because location alone does not carry to a reader who only sees the number, such as one comparing `claude/566-output.md` against a citation written before the rules moved into `canon/`.
|
|
70
|
-
|
|
71
|
-
The collision this prevents is silent. Two rules that resolve to the same `<n>-<slug>` path leave one file in the installed folder, and neither the install nor the session that reads it reports which source lost. Nothing checks a division outside the reserved bands, so it holds only while both sources follow it. Separating `canon/` from `internal/` by folder removes the filename-collision case specifically, since the two no longer install to the same directory, but the number still carries the source signal for a reader who has only the number in view.
|
|
72
|
-
|
|
73
|
-
State that division where the rule sources are described, not inside the rules it divides. A rule states its own topic, and a numbering convention spanning two sources belongs to whatever documents the pair.
|
|
74
|
-
|
|
75
63
|
## Frontmatter
|
|
76
64
|
|
|
77
65
|
- `description` (required): one line naming what the rule enforces and where
|
|
@@ -93,9 +81,15 @@ paths:
|
|
|
93
81
|
- Use imperative voice for every rule (`Prefix booleans with is`, not `Booleans should be prefixed`)
|
|
94
82
|
- State one rule per bullet as a single directive line
|
|
95
83
|
- State what to do and what not to do. Do not explain the reasoning behind a rule.
|
|
84
|
+
|
|
85
|
+
### Phrasing
|
|
86
|
+
|
|
96
87
|
- End the directive line of a ban asserting how the model or a tool behaves with one `Revisit when <finding>.` sentence, which states a condition rather than the reasoning. A style, safety, or consistency ban takes none.
|
|
97
88
|
- Phrase a rule as a ban on the forbidden shape when it could otherwise enumerate allowed options, so it stays stable as categories grow
|
|
98
89
|
- Cut any rule that resists crisp one-line phrasing. Vague guidance is worse than none.
|
|
90
|
+
|
|
91
|
+
### Scope of a rule file
|
|
92
|
+
|
|
99
93
|
- Keep the file to one topic. A second topic is a second rule file.
|
|
100
94
|
- Do not restate a rule that a sibling rule or `CLAUDE.md` already owns. Point once, never duplicate.
|
|
101
95
|
- Name the current layout only, in a glob and in the body alike. A layout change ships a migration verb, as `canon migrate surface-roots` and `canon migrate records` did, rather than a rule line or a glob that keeps the old spelling loading.
|
|
@@ -12,11 +12,20 @@ Read these files in parallel:
|
|
|
12
12
|
- `${CLAUDE_SKILL_DIR}/references/skill.md`: skill structure, skill types, frontmatter fields, invocation rules
|
|
13
13
|
- `${CLAUDE_SKILL_DIR}/references/skill-requirement.md`: what `REQUIREMENT.md` must answer, its sections, and its template
|
|
14
14
|
- `${CLAUDE_SKILL_DIR}/references/skill-paths.md`: which root a path in the body resolves against, and how the body cites another skill's reference
|
|
15
|
-
- `${CLAUDE_SKILL_DIR}/references/skill-
|
|
15
|
+
- `${CLAUDE_SKILL_DIR}/references/skill-disclosure.md`: the rules that bind a skill of any size, being where each reference is named, the contents block, the trigger and guard that stay in the body, and what moves to `references/`
|
|
16
|
+
|
|
17
|
+
### Writing standards
|
|
18
|
+
|
|
19
|
+
Read these in the same pass:
|
|
20
|
+
|
|
16
21
|
- `${CLAUDE_SKILL_DIR}/../markdown-craft/references/markdown.md`: punctuation and formatting for skill body text
|
|
17
|
-
- `${CLAUDE_SKILL_DIR}/references/skill-practice.md`, when the skill carries engineering practice: the closing sections a practice skill owes and the anatomy behind them
|
|
18
22
|
- The `write-human` skill: voice, rhythm, and sentence construction for skill body text
|
|
19
23
|
|
|
24
|
+
## Further references
|
|
25
|
+
|
|
26
|
+
- `${CLAUDE_SKILL_DIR}/references/skill-reference.md`, when the skill carries a reference setting the shape of one artifact: its scope, success criterion, frontmatter, and rule phrasing
|
|
27
|
+
- `${CLAUDE_SKILL_DIR}/references/skill-practice.md`, when the skill carries engineering practice: the closing sections a practice skill owes and the anatomy behind them
|
|
28
|
+
|
|
20
29
|
## Guards
|
|
21
30
|
|
|
22
31
|
- If `${CLAUDE_SKILL_DIR}/references/skill.md` is not present, stop: `❌ skill.md standard not found. Reinstall the canon plugin.`
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Skill disclosure reference
|
|
3
|
+
description: Keeping a skill body and its references under the ceiling, what moves to references and what stays in the body, and how the body names a reference
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill disclosure reference
|
|
7
|
+
|
|
8
|
+
Applies to the size and split of every `SKILL.md` and every file under a skill's `references/`.
|
|
9
|
+
|
|
10
|
+
## Rules
|
|
11
|
+
|
|
12
|
+
- Keep `SKILL.md` and each file under `references/` at or under the 300 rendered line ceiling `markdown.md` sets for a whole document. The ceiling binds procedure as much as reference material.
|
|
13
|
+
- Look at a body once it passes 150 lines. That number prompts a look and gates nothing.
|
|
14
|
+
- Move a catalog, a table of cases, or a format spec running past roughly 15 lines to `references/` at any body length.
|
|
15
|
+
- Below the ceiling, name the branch that skips a block before moving it. A block every run dereferences costs a read and saves nothing.
|
|
16
|
+
|
|
17
|
+
### Moving a step
|
|
18
|
+
|
|
19
|
+
- Past the ceiling, move a whole step to a reference, preferring a step a named branch skips. Keep the step heading in the body with one line naming the file to read on reaching it, so the body still shows every step in order.
|
|
20
|
+
- Name every file under `references/` in the body at the point a session reads it, since an unnamed reference is never loaded.
|
|
21
|
+
|
|
22
|
+
### Contents, triggers, and citations
|
|
23
|
+
|
|
24
|
+
- Open a file under `references/` running over 100 lines with a `## Contents` H2 of anchor links after its H1 and intro, so a session that reads only the top of the file still sees everything it holds.
|
|
25
|
+
- Keep the trigger, the skip condition, and the guard in the body. A run that never reaches the block has to decide that without opening the reference.
|
|
26
|
+
- Point one skill at a sibling skill's reference by the form `skill-paths.md` states, `${CLAUDE_SKILL_DIR}/../<skill>/references/<name>.md`, and name the owner rather than copying the file.
|
|
@@ -43,6 +43,9 @@ A reference shared across skills lives in the `references/` of the skill that ow
|
|
|
43
43
|
- Cite another skill's reference as `${CLAUDE_SKILL_DIR}/../<skill>/references/<name>.md`. The plugin ships the skills side by side, so the sibling path resolves in every install. Name the owner skill rather than copying the file.
|
|
44
44
|
- State the path once per body, at the site that reads the reference. A later mention of a reference the body already read stays bare, since repeating the path at every mention is noise rather than instruction.
|
|
45
45
|
- A guard on a reference's presence names the file rather than the folder holding it, since a folder test answers for a sibling that happens to be there.
|
|
46
|
+
|
|
47
|
+
### Form and ownership
|
|
48
|
+
|
|
46
49
|
- Use `${CLAUDE_SKILL_DIR}`, never a bare `../../` and never `${CLAUDE_PLUGIN_ROOT}`, since only the first expands before the body reaches the model.
|
|
47
50
|
- Cite a shared procedure, never restate it. A procedure two or more skills execute gets one definition in its owner's reference and a citation in each body.
|
|
48
51
|
- Keep the trigger in the body and the procedure in the reference. The citing skill states when the procedure runs and what it runs against, since that varies per skill and the reference cannot know it.
|
|
@@ -50,10 +50,16 @@ A reference failing these questions is non-conforming even when it satisfies eve
|
|
|
50
50
|
- Govern one document type per reference, or one attribute across every document. Split unrelated conventions into separate files.
|
|
51
51
|
- Open with a `## Scope` section stating what the reference governs and what it does not, placed above the shape rules. A reference that specifies shape exhaustively and jurisdiction nowhere cannot refuse a rule, so the rule with no obvious owner lands in whichever reference sits nearest.
|
|
52
52
|
- Write it as one line naming the artifact or attribute and where it applies, then a `Does not govern:` list. Give each entry the excluded concern and the owner it goes to.
|
|
53
|
+
|
|
54
|
+
#### The path and owners
|
|
55
|
+
|
|
53
56
|
- Name an owner in the same `references/` folder by bare filename and one in another skill by its sibling path, `../<skill>/references/<name>.md`. Name the surface instead where the owner is one, such as a coding rule, a project policy, or the code.
|
|
54
57
|
- Put the governed path in backticks inside the first sentence of that line, anchored deep enough to resolve from a project root. A bare folder name matches a same-named folder elsewhere in the tree, and a path held back until a later sentence sits beside every other path the statement mentions, including the ones it excludes.
|
|
55
58
|
- Say in that same sentence when the reference governs an attribute rather than a document type. An attribute is written across every document and has no path to name, so the silence reads as an omission unless the sentence claims it.
|
|
56
59
|
- Cut an entry that names no owner at all. It is either excluding something nothing was going to claim, or it is a content exclusion, which the rule below sends to the shape rules instead.
|
|
60
|
+
|
|
61
|
+
#### Boundaries
|
|
62
|
+
|
|
57
63
|
- Declare a boundary from both sides. A yield, an exemption, or a handoff stated in one reference alone is never checked against the reference on the other side of it, which is how two files come to claim the same rule or neither does.
|
|
58
64
|
- Separate a jurisdiction exclusion from a content exclusion. The first names a concern another reference owns and belongs in `## Scope`. The second names what does not belong inside the document and stays with the shape rules. Merging them puts a boundary claim where no sibling will read it.
|
|
59
65
|
- Stay silent on a section the reference holds today but should not own. Claiming it makes the scope statement false the moment it moves, and the mismatch is the evidence that moves it.
|
|
@@ -125,9 +131,15 @@ Answer all four before editing, and carry the answers into wherever the change i
|
|
|
125
131
|
- Carry one fenced template of the document the reference governs, so an author copies a shape instead of reconstructing it from prose.
|
|
126
132
|
- Bind this to a reference governing a document type. An attribute reference governs a scan, a string, or a label rather than a file, so it has no document to template and carries none. State that exemption in the sentence declaring it an attribute reference.
|
|
127
133
|
- Place the template below the rules it satisfies, under a `## Template` heading or inside the section holding those rules.
|
|
134
|
+
|
|
135
|
+
### What the template shows
|
|
136
|
+
|
|
128
137
|
- Show the skeleton alone: every required section, one placeholder line for what each holds. A full worked document is a second document to maintain.
|
|
129
138
|
- Write placeholders in angle brackets rather than copying a real document. A copied file goes stale, and its backticked filenames read as citations to anything parsing the reference.
|
|
130
139
|
- Switch to a bare word where the fenced language reads `<` as syntax of its own, as Mermaid and HTML do, and say in the line above the fence that the names are placeholders.
|
|
140
|
+
|
|
141
|
+
### Load-bearing text
|
|
142
|
+
|
|
131
143
|
- Carry any header, key, or label a consuming tool parses verbatim. The template is the only place an author learns which strings are load-bearing.
|
|
132
144
|
- Treat the template as authoritative where it and the prose disagree. An author copies the block, so a contradiction ships as the block.
|
|
133
145
|
|
|
@@ -30,15 +30,15 @@ Governs a skill folder under `skills/` as one artifact: `SKILL.md`, its siblings
|
|
|
30
30
|
|
|
31
31
|
Does not govern:
|
|
32
32
|
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
33
|
+
- **`skill-requirement.md`**: what a `REQUIREMENT.md` must answer, its sections, and its template
|
|
34
|
+
- **`skill-practice.md`**: a practice skill's closing sections and ledger
|
|
35
|
+
- **`skill-paths.md`**: which root a path in a body resolves against, and how a body cites another skill's reference
|
|
36
|
+
- **`skill-reference.md`**: the jurisdiction, success criterion, and rule phrasing of a reference setting one artifact's shape
|
|
37
|
+
- **`rule.md`**: path-scoped coding rules, which load on a file match rather than on a request match
|
|
38
|
+
- **the `write-human` skill**: voice, rhythm, and sentence construction in a skill body
|
|
39
|
+
- **`markdown.md`**: punctuation, formatting, and word choice in a skill body
|
|
40
|
+
- **`slug.md`**: the transform from a branch name to a slug a skill carries in a filename
|
|
41
|
+
- **the `create-skill` skill and the creation-time bullet in the `skill` governance rule**: whether a new skill earns its place, by the three-question test
|
|
42
42
|
|
|
43
43
|
## Changing a skill
|
|
44
44
|
|
|
@@ -93,18 +93,21 @@ allowed-tools: <tools required>
|
|
|
93
93
|
- Create a new skill with its `REQUIREMENT.md` beside it, even where nobody contests its scope. A requirement present for some skills and absent for others cannot be scanned, since an absence reads as a gap rather than as a verdict
|
|
94
94
|
- Name a file sitting directly in the skill folder in capitals and a bundled folder in lowercase, so the parts a reader opens are distinct from the ones a skill loads
|
|
95
95
|
- `EVAL.md` holds prompts and a judging rubric a person runs by hand, since the automated `claude plugin eval` runner is gated in early access
|
|
96
|
+
|
|
97
|
+
### Folder and file rules
|
|
98
|
+
|
|
96
99
|
- `SKILL.md` must start with YAML frontmatter between `---` delimiters
|
|
97
100
|
- No `README.md` inside the skill folder
|
|
98
101
|
- No spaces, capitals, or underscores in folder or skill name
|
|
99
102
|
|
|
100
103
|
## Frontmatter
|
|
101
104
|
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
-
|
|
106
|
-
-
|
|
107
|
-
-
|
|
105
|
+
- **`name`** (required): kebab-case, matches folder name, no spaces or capitals
|
|
106
|
+
- **`description`** (required): what it does + when to use it, under 1024 chars, no XML tags
|
|
107
|
+
- **`disable-model-invocation: true`**: user-invoked only, Claude will not auto-trigger. Set it on a skill that starts a process the operator owns, never on one reachable by a matched trigger.
|
|
108
|
+
- **`allowed-tools`**: restrict tool access when the skill is active
|
|
109
|
+
- **`metadata`**: optional key-value pairs (`author`, `version`, `mcp-server`)
|
|
110
|
+
- **`metadata.family`** (required on a skill under `claude/skills/`): the skill map group the skill's row sits under, as one key from `families` in `canon claude skills list --json`. A skill under `.claude/skills/` takes none.
|
|
108
111
|
|
|
109
112
|
## Description
|
|
110
113
|
|
|
@@ -120,24 +123,22 @@ allowed-tools: <tools required>
|
|
|
120
123
|
- Front-load critical instructions
|
|
121
124
|
- Contain only behavioral rules (what to do, what not to do) and pointers to reference docs. Narrative descriptions of what files are or how the system works belong in `docs/`, not in the skill body.
|
|
122
125
|
- State rules, not inventories. Reference docs for lists that change, and phrase a rule as a ban on the forbidden shape rather than an enumeration of allowed options, so it stays stable as categories change.
|
|
126
|
+
|
|
127
|
+
#### Current rule and grouping
|
|
128
|
+
|
|
123
129
|
- Cut any rule that resists crisp one-line phrasing. Vague guidance is worse than none.
|
|
124
130
|
- State the current rule only, in the body and in every file under `references/`. The incident and the date that earned a rule go in `REQUIREMENT.md` under `Gap`, or stay in git. A date inside a fence or a code span is example data and stays.
|
|
125
131
|
- Group bullets under H2 headings by domain concern. Keep dos and don'ts together under the topic they belong to rather than splitting them into flat rules and constraints sections.
|
|
126
132
|
- One actionable constraint per bullet. Prefer the `X over Y` form for preferences.
|
|
133
|
+
|
|
134
|
+
#### Examples and density
|
|
135
|
+
|
|
127
136
|
- Do not include code examples unless a one to three line inline snippet captures a pattern the model cannot infer.
|
|
128
137
|
- Keep a statement only when removing it would change what the agent does, naming a principle as a few-word handle rather than explaining it. Revisit when a run shows the model ignoring a principle named only as a handle.
|
|
129
138
|
|
|
130
139
|
### Progressive disclosure
|
|
131
140
|
|
|
132
|
-
|
|
133
|
-
- Look at a body once it passes 150 lines. That number prompts a look and gates nothing.
|
|
134
|
-
- Move a catalog, a table of cases, or a format spec running past roughly 15 lines to `references/` at any body length.
|
|
135
|
-
- Below the ceiling, name the branch that skips a block before moving it. A block every run dereferences costs a read and saves nothing.
|
|
136
|
-
- Past the ceiling, move a whole step to a reference, preferring a step a named branch skips. Keep the step heading in the body with one line naming the file to read on reaching it, so the body still shows every step in order.
|
|
137
|
-
- Name every file under `references/` in the body at the point a session reads it, since an unnamed reference is never loaded.
|
|
138
|
-
- Open a file under `references/` running over 100 lines with a `## Contents` H2 of anchor links after its H1 and intro, so a session that reads only the top of the file still sees everything it holds.
|
|
139
|
-
- Keep the trigger, the skip condition, and the guard in the body. A run that never reaches the block has to decide that without opening the reference.
|
|
140
|
-
- Point one skill at a sibling skill's reference by the form `skill-paths.md` states, `${CLAUDE_SKILL_DIR}/../<skill>/references/<name>.md`, and name the owner rather than copying the file.
|
|
141
|
+
Keeping a body and its references under the ceiling, what moves to `references/` and what stays, and how a body names a reference are in `skill-disclosure.md`.
|
|
141
142
|
|
|
142
143
|
### Reading and running commands
|
|
143
144
|
|
|
@@ -162,7 +163,7 @@ allowed-tools: <tools required>
|
|
|
162
163
|
|
|
163
164
|
- Use `scripts/` for operations that must be deterministic or repetitive
|
|
164
165
|
- Ask whether a CLI verb the project already has does the job before writing a script. A verb is already installed and tested, and a script beside it is a second copy that drifts
|
|
165
|
-
- Write a script in TypeScript and run it as `bun ${CLAUDE_SKILL_DIR}/scripts/<name>.ts`. Keep bash for a few lines that start one command
|
|
166
|
+
- Write a script in TypeScript and run it as `bun ${CLAUDE_SKILL_DIR}/scripts/<name>.ts`. Keep bash for a few lines that start one command. The rule governs a new script, so bash kept by decision is no breach and is not ported unasked, such as `review-ui`'s `scripts/pw.sh` as glue and the shell scripts the web tooling stacks ship, whose port was deferred
|
|
166
167
|
- Import no package. A plugin loads from a cache that carries no `node_modules`, so only `node:` built-ins and the CLIs the skill already requires resolve
|
|
167
168
|
- Use XML tags in script output for reliable parsing: `<SECTION>content</SECTION>`
|
|
168
169
|
|
|
@@ -93,6 +93,9 @@ Read `${CLAUDE_SKILL_DIR}/references/adopted.md` only when extending this guidan
|
|
|
93
93
|
- A deprecation notice names no replacement or no removal date.
|
|
94
94
|
- The diff adds a replacement and deletes the original in the same change.
|
|
95
95
|
- A fallback or compatibility path has no stated condition for its removal.
|
|
96
|
+
|
|
97
|
+
### Behavior and callers
|
|
98
|
+
|
|
96
99
|
- You are adding behavior to the surface being deprecated.
|
|
97
100
|
- Your report says "no callers" without naming the caller kinds the search could not reach.
|
|
98
101
|
- A caller outside the repository was found and the plan still deletes the original.
|
|
@@ -104,6 +107,9 @@ Check each line against what the change produced. A line answering no is fixed o
|
|
|
104
107
|
- The surface is deprecated only if it has a stated cost, a shipped replacement, and a named owner.
|
|
105
108
|
- Every compulsory deprecation states its removal date where a caller looks.
|
|
106
109
|
- Every caller reachable in the repository was migrated, or is named with the reason it was not.
|
|
110
|
+
|
|
111
|
+
### Checks and fallbacks
|
|
112
|
+
|
|
107
113
|
- The zero-consumers check covered every caller kind, and the report names the kinds it could not reach.
|
|
108
114
|
- No change both adds the replacement and removes the original.
|
|
109
115
|
- Every fallback left in place states when it goes and who removes it.
|
|
@@ -27,6 +27,9 @@ External sources were read and filtered rather than imported. This file is the r
|
|
|
27
27
|
- The five-question deprecation decision, cut to four. Its unique-value and maintenance-cost questions merge into one question about what keeping the surface costs. Its per-consumer migration-cost question drops, since the Churn Rule puts that cost on the owner rather than weighing it per caller. The owner question from the book takes the freed place.
|
|
28
28
|
- The rule never to deprecate without a replacement, as the third decision question.
|
|
29
29
|
- The strangler and adapter patterns, stated as when each fits rather than as worked code tied to one stack.
|
|
30
|
+
|
|
31
|
+
#### Migration, zombie code, and red flags
|
|
32
|
+
|
|
30
33
|
- Expand, migrate, contract, lifted out of its schema section and stated for any surface as three separate changes.
|
|
31
34
|
- Zombie code, narrowed to code that is unowned, uncalled, and still built, and settled by the same zero-consumers check rather than a list of staleness signals.
|
|
32
35
|
- The rationalizations and red flags that carry across stacks, reworded for any surface rather than a service or a column. Two excuse rows come from here:
|