@erclx/canon 5.34.0 → 5.36.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 +15 -17
- package/claude/.claude-plugin/plugin.json +1 -1
- package/claude/skills/api-design/REQUIREMENT.md +1 -1
- package/claude/skills/auto-ship/references/draft-mark.md +1 -1
- package/claude/skills/canon-cli/REQUIREMENT.md +2 -2
- package/claude/skills/canon-cli/SKILL.md +12 -12
- package/claude/skills/canvas-board/REQUIREMENT.md +1 -1
- package/claude/skills/canvas-board/SKILL.md +2 -2
- package/claude/skills/canvas-board/references/design.md +53 -36
- package/claude/skills/codebase-layout/REQUIREMENT.md +1 -1
- package/claude/skills/codebase-layout/SKILL.md +2 -2
- package/claude/skills/create-rule/REQUIREMENT.md +6 -8
- package/claude/skills/create-rule/SKILL.md +8 -8
- package/claude/skills/create-rule/references/rule.md +11 -23
- package/claude/skills/create-skill/SKILL.md +2 -1
- package/claude/skills/create-skill/references/skill-paths.md +12 -15
- package/{standards/standard.md → claude/skills/create-skill/references/skill-reference.md} +50 -45
- package/claude/skills/create-skill/references/skill.md +9 -3
- package/claude/skills/design-taste/REQUIREMENT.md +6 -6
- package/claude/skills/design-taste/SKILL.md +2 -2
- package/claude/skills/design-taste/references/craft.md +1 -1
- package/claude/skills/design-taste/references/preflight.md +2 -2
- package/claude/skills/design-taste/references/tells.md +1 -1
- package/claude/skills/draft-and-pick/SKILL.md +1 -1
- package/claude/skills/draft-identity/SKILL.md +3 -2
- package/claude/skills/git-commit/references/versioning.md +13 -13
- package/claude/skills/git-pr/SKILL.md +1 -1
- package/claude/skills/git-pr/references/publish.md +1 -1
- package/claude/skills/markdown-craft/references/markdown.md +3 -2
- package/claude/skills/plan-feature/SKILL.md +1 -1
- package/claude/skills/review-address/REQUIREMENT.md +1 -1
- package/claude/skills/review-address/SKILL.md +2 -2
- package/claude/skills/review-craft/references/ui.md +1 -1
- package/claude/skills/review-pr/SKILL.md +3 -3
- package/claude/skills/review-pr/references/post.md +1 -1
- package/claude/skills/review-ui/REQUIREMENT.md +1 -1
- package/claude/skills/review-ui/SKILL.md +1 -1
- package/claude/skills/role-orchestrator/REQUIREMENT.md +2 -2
- package/claude/skills/role-orchestrator/SKILL.md +11 -12
- package/claude/skills/role-orchestrator/references/orchestrator-cloud-launch.md +3 -1
- package/claude/skills/role-orchestrator/references/orchestrator-dispatch.md +11 -8
- package/claude/skills/role-orchestrator/references/orchestrator-handback.md +10 -4
- package/claude/skills/role-orchestrator/references/orchestrator-launch.md +2 -2
- package/claude/skills/role-orchestrator/references/orchestrator-poll.md +11 -12
- package/claude/skills/role-orchestrator/references/orchestrator-review-dispatch.md +12 -15
- package/claude/skills/role-orchestrator/references/orchestrator-reviewer-launch.md +6 -4
- package/claude/skills/role-orchestrator/scripts/poll.ts +50 -1
- package/claude/skills/role-reviewer/REQUIREMENT.md +17 -7
- package/claude/skills/role-reviewer/SKILL.md +17 -10
- package/claude/skills/role-worker/REQUIREMENT.md +1 -1
- package/claude/skills/role-worker/SKILL.md +6 -6
- package/claude/skills/session-compact/references/handoff-note.md +1 -1
- package/claude/skills/target-setup/SKILL.md +2 -2
- package/claude/skills/target-setup/references/detect.md +3 -3
- package/claude/skills/test-craft/SKILL.md +2 -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/write-human/references/machine-tells.md +12 -0
- package/docs/agents/audits.md +1 -1
- package/docs/agents/commands.md +14 -13
- package/docs/agents/comments.md +1 -1
- package/docs/agents/counts.md +5 -6
- package/docs/agents/drift-surfaces.md +15 -19
- package/docs/agents/gov-detect.md +1 -1
- package/docs/agents/index.md +2 -3
- package/docs/agents/install-and-sync.md +10 -34
- package/docs/agents/markdown-audit.md +22 -12
- package/docs/agents/migrate.md +1 -1
- package/docs/agents/output-shape.md +1 -1
- package/docs/agents/overview.md +2 -2
- package/docs/agents/records-stale.md +1 -1
- package/docs/agents/records-validate.md +11 -23
- package/docs/agents/records.md +1 -1
- package/docs/agents/routing.md +1 -1
- package/docs/agents/rule-citations.md +9 -17
- package/docs/agents/scripting.md +2 -20
- package/docs/agents/state-scoped-risk.md +1 -1
- package/docs/agents/tasks-validate.md +1 -1
- package/docs/agents/teach.md +1 -1
- package/docs/target/index.md +1 -0
- package/docs/target/migrations.md +4 -0
- package/docs/target/projects.md +10 -10
- package/docs/target/scenarios.md +5 -6
- package/docs/target/standards-moved.md +32 -0
- package/docs/target/sync.md +5 -5
- package/docs/workflow/ai-workflow.md +1 -1
- package/docs/workflow/operating-model.md +16 -18
- package/docs/workflow/skill-map.md +1 -1
- package/docs/workflow/visual-design-workflow.md +3 -3
- package/governance/detect.toml +32 -36
- package/governance/renames.toml +44 -1
- 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 +15 -8
- package/governance/stacks/go.toml +2 -0
- package/governance/stacks/node.toml +1 -1
- package/governance/stacks/php.toml +2 -0
- package/governance/stacks/python.toml +1 -1
- package/package.json +1 -4
- package/scripts/core/install-check.sh +4 -10
- package/src/audits/catalog.ts +0 -9
- package/src/capture/frame-values.ts +3 -6
- package/src/claude/routing.ts +1 -1
- package/src/claude/skills-reach.ts +4 -6
- package/src/cli/help-all.ts +96 -0
- package/src/cli/help.ts +29 -29
- package/src/cli.ts +8 -3
- package/src/commands/claude.ts +29 -0
- package/src/commands/design.ts +22 -1
- package/src/commands/gov.ts +29 -11
- package/src/commands/init.ts +10 -1
- package/src/commands/labels.ts +4 -44
- package/src/commands/markdown.ts +96 -3
- package/src/commands/migrate.ts +1 -1
- package/src/commands/records.ts +5 -21
- package/src/commands/sync.ts +11 -0
- package/src/commands/tooling.ts +10 -4
- package/src/counts/catalogs.ts +0 -6
- 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/boundaries.ts +2 -2
- package/src/gate/measures.ts +7 -29
- package/src/gate/sequencer.ts +51 -2
- package/src/gate/stages.ts +0 -18
- package/src/gov/citations.ts +16 -71
- package/src/gov/stacks.ts +3 -3
- package/src/inventory/subjects.ts +1 -1
- package/src/markdown/bans.ts +1 -1
- package/src/markdown/ceiling.ts +6 -1
- package/src/markdown/colons.ts +86 -0
- package/src/markdown/gate.ts +15 -0
- package/src/markdown/heading-case.ts +74 -0
- package/src/migrate/scratch-evidence.ts +2 -2
- package/src/records/validate.ts +6 -194
- package/src/sandbox/provision.ts +0 -5
- package/src/secrets/shipped.ts +1 -2
- package/src/serve/static.ts +1 -2
- package/src/shipped/references.ts +42 -93
- package/src/sync/check.ts +18 -14
- package/src/sync/copy.ts +4 -5
- package/src/tooling/inject.ts +6 -37
- package/src/tooling/read.ts +2 -3
- package/src/tooling/scan.ts +4 -17
- package/src/tooling/subfolder.ts +2 -66
- package/tooling/astro/manifest.toml +0 -1
- package/tooling/astro/reference.md +0 -8
- package/tooling/base/configs/scripts/verify.json +1 -1
- package/tooling/base/configs/scripts/verify.ts +22 -17
- package/tooling/base/manifest.toml +7 -7
- package/tooling/base/reference.md +19 -32
- package/tooling/base/seeds/.github/workflows/verify.yml +0 -9
- package/tooling/base/seeds/.lintstagedrc +2 -4
- package/tooling/base/seeds/canon/context/ci.md +4 -6
- package/tooling/base/seeds/canon/context/development.md +2 -2
- package/tooling/claude/reference.md +1 -1
- package/tooling/claude/seeds/.claude/hooks/review-post-scan.sh +13 -1
- package/tooling/claude/seeds/.claude/hooks/scratch-guard.sh +1 -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/go/reference.md +1 -1
- package/tooling/php/reference.md +1 -1
- package/tooling/python/reference.md +2 -2
- 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/manifest.toml +0 -1
- package/tooling/vite-react/reference.md +0 -8
- package/tooling/web/configs/.github/workflows/readme-screenshot.yml +3 -5
- package/tooling/web/configs/.github/workflows/verify.yml +0 -9
- package/tooling/web/manifest.toml +1 -2
- package/tooling/web/reference.md +4 -6
- package/docs/agents/standards-audit.md +0 -40
- package/governance/rules/tooling/765-spelling.md +0 -19
- package/governance/stacks/astro.toml +0 -2
- package/governance/stacks/nextjs.toml +0 -2
- package/governance/stacks/node-server.toml +0 -2
- package/governance/stacks/python-fastapi.toml +0 -2
- package/governance/stacks/react.toml +0 -2
- package/src/commands/standards.ts +0 -278
- package/src/labels/spelling.ts +0 -120
- package/src/standards/audit.ts +0 -146
- package/src/standards/list.ts +0 -33
- package/src/standards/read.ts +0 -177
- package/src/standards/scope.ts +0 -56
- package/standards/index.md +0 -10
- package/tooling/base/configs/.vscode/extensions.json +0 -9
- package/tooling/base/configs/.vscode/settings.json +0 -3
- package/tooling/base/configs/scripts/verify.sh +0 -2
- package/tooling/base/seeds/.cspell/project-terms.txt +0 -0
- package/tooling/base/seeds/.cspell/tech-stack.txt +0 -25
- package/tooling/base/seeds/cspell.json +0 -20
- package/tooling/go/seeds/.cspell/tech-stack.txt +0 -16
- package/tooling/nextjs/seeds/.cspell/tech-stack.txt +0 -3
- package/tooling/php/seeds/.cspell/tech-stack.txt +0 -5
- package/tooling/python/seeds/.cspell/tech-stack.txt +0 -18
- package/tooling/vite-react/seeds/.cspell/project-terms.txt +0 -1
- package/tooling/vite-react/seeds/.cspell/tech-stack.txt +0 -2
- package/tooling/web/configs/.vscode/extensions.json +0 -13
- package/tooling/web/configs/.vscode/settings.json +0 -10
- package/tooling/web/seeds/.cspell/tech-stack.txt +0 -21
- /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
package/README.md
CHANGED
|
@@ -61,20 +61,19 @@ bun install --global @erclx/canon
|
|
|
61
61
|
|
|
62
62
|
Each domain has a canonical source in this repo and a thin install or sync CLI on your side. The domains split on one line: some are copied into your project and become yours to edit, and some are never copied at all.
|
|
63
63
|
|
|
64
|
-
| Domain | What it is
|
|
65
|
-
| -------------- |
|
|
66
|
-
| Plugin skills | Skills that plan a feature, review a diff, sync the planning docs, and run the ship chain
|
|
67
|
-
| Governance | Coding and authoring rules that load into a Claude session when a matching path is edited
|
|
68
|
-
|
|
|
69
|
-
|
|
|
70
|
-
|
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
Those domains reach you in three shapes. A tooling stack lands as real files under version control, because a config is something your build reads and your project owns. A standard stays here and is opened by name, so there is no copy in your repo to drift from this one.
|
|
64
|
+
| Domain | What it is | How it reaches you |
|
|
65
|
+
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
|
|
66
|
+
| Plugin skills | Skills that plan a feature, review a diff, sync the planning docs, and run the ship chain | Loaded live from the plugin, never copied |
|
|
67
|
+
| Governance | Coding and authoring rules that load into a Claude session when a matching path is edited | Installed per project by `canon gov install`, refreshed by sync |
|
|
68
|
+
| Tooling stacks | Golden configs, seeds, and a reference per framework | Laid down by `canon init`, reconciled by `canon tooling sync` |
|
|
69
|
+
| Design system | Ships a `DESIGN.md` intent format that points at the project's stylesheet for values, a skill that drafts one from an existing project or from scratch, and a render command | `canon design render` |
|
|
70
|
+
| Slides | A folder of HTML slides per deck, drawn in the project's tokens and rebuilt as editable shapes | `canon slides render` writes PowerPoint |
|
|
71
|
+
| Teach | Lessons, sources, and a glossary in one workspace, rendered to a small site | `canon teach` |
|
|
72
|
+
| Canvas | Pages of HTML frames on a local pan and zoom surface, each frame drawn with the project's tokens | `canon canvas serve` |
|
|
73
|
+
| Transcripts | A YouTube transcript with metadata frontmatter | `canon transcripts <url>` writes it into any repo |
|
|
74
|
+
| Sandbox | Scenario scaffolds that provision an isolated project state for verifying each domain flow | `canon sandbox` |
|
|
75
|
+
|
|
76
|
+
Those domains reach you in three shapes. A tooling stack lands as real files under version control, because a config is something your build reads and your project owns. A plugin skill and the references it carries are never copied, so there is no copy in your repo to drift from this one.
|
|
78
77
|
|
|
79
78
|
Governance is the third shape. A rule with a path glob loads only when a matching path is edited, and a rule with none loads every session. Run `canon gov list` to see the glob beside each rule.
|
|
80
79
|
|
|
@@ -152,9 +151,9 @@ git init
|
|
|
152
151
|
canon init
|
|
153
152
|
```
|
|
154
153
|
|
|
155
|
-
`canon init` installs base tooling configs, Claude seeds, and governance rules in one pass, and scaffolds a `.claude/wiki/` stub for your project's own reference pages. Governance defaults to the `base` stack, so a bare init lands the
|
|
154
|
+
`canon init` installs base tooling configs, Claude seeds, and governance rules in one pass, and scaffolds a `.claude/wiki/` stub for your project's own reference pages. Governance defaults to the `base` stack, so a bare init lands the workflow and doc-authoring rules in `.claude/rules/`. Each rule names the skill it loads, so no corpus is copied into your project.
|
|
156
155
|
|
|
157
|
-
Pass `--stack <name>` for a
|
|
156
|
+
Pass `--stack <name>` for a language stack such as `node` or `python`, or `--skip governance` to leave rules out. Run `canon tooling list --json` to see the catalog.
|
|
158
157
|
|
|
159
158
|
For the full journey from scaffold through adding a domain later to syncing upstream drift, see [target projects](docs/target/projects.md).
|
|
160
159
|
|
|
@@ -164,7 +163,6 @@ Each domain carries an entry written for someone maintaining the toolkit rather
|
|
|
164
163
|
|
|
165
164
|
- [Claude Code plugin](canon/context/claude-plugin/index.md)
|
|
166
165
|
- [Governance rules](canon/context/governance/index.md)
|
|
167
|
-
- [Standards](canon/context/standards/index.md)
|
|
168
166
|
- [Tooling stacks](canon/context/tooling/index.md)
|
|
169
167
|
- [Design system](canon/context/design/index.md)
|
|
170
168
|
- [Slides](canon/context/features/slides.md)
|
|
@@ -9,7 +9,7 @@ description: Why a session changing what a caller can see needs stated rules on
|
|
|
9
9
|
|
|
10
10
|
Without this skill, a session changing a surface a caller depends on has nothing in front of it about what that caller can see or how a change lands without breaking it. It works for the one caller it opened, renames a field in place, returns whatever record it had in hand, and nothing in the toolkit answers before the change ships.
|
|
11
11
|
|
|
12
|
-
The absence is measured across the shipped corpus. No folder under `claude/skills/` matches `api`, `interface`, or `contract`, and no file across `claude
|
|
12
|
+
The absence is measured across the shipped corpus. No folder under `claude/skills/` matches `api`, `interface`, or `contract`, and no file across `claude/` and `governance/` carries `hyrum` or a form of `idempotent`. The only related lines are the two error bullets in the core code rule, which state that errors are structured and hide internals and say nothing about exposure, versioning, or retries.
|
|
13
13
|
|
|
14
14
|
The one skill nearest the subject leaves the pointer open. `codebase-layout` excludes shaping "a module's interface and seams" in its description and names no skill to take it, so a session routed away from layout on that question lands nowhere.
|
|
15
15
|
|
|
@@ -29,4 +29,4 @@ The number crosses from that step's output into a command this session types, wh
|
|
|
29
29
|
|
|
30
30
|
Report what the read returned rather than what the command printed, since the exit says the call ran and says nothing about the state. A `true` reports a draft. A `false` reports the pull request as opened ready and unsupervised, and the chain stops there. Never re-issue the mark on a disagreeing read, which fights whoever readied it instead of guarding anything.
|
|
31
31
|
|
|
32
|
-
Placement is why the call sits ahead of the watch rather than after it. Marking afterwards leaves the pull request unmarked for the whole CI run, which is the stretch an unattended worker's branch is least supervised. What the mark buys is a reader learning the pull request has had no review yet. It buys no bound on that stretch: readying a pull request to merge lifts the mark, GitHub requires it before a merge, and the act
|
|
32
|
+
Placement is why the call sits ahead of the watch rather than after it. Marking afterwards leaves the pull request unmarked for the whole CI run, which is the stretch an unattended worker's branch is least supervised. What the mark buys is a reader learning the pull request has had no review yet. It buys no bound on that stretch: readying a pull request to merge lifts the mark, GitHub requires it before a merge, and the act runs through `canon pr lift`, which a reviewer runs on its close and the controlling session runs as the fallback, or through the operator directly. `role-worker` states the mirroring refusal of an instruction to ready the pull request directly, whoever sends it.
|
|
@@ -13,7 +13,7 @@ The damage lands on the files a project owns. A golden config carrying local edi
|
|
|
13
13
|
|
|
14
14
|
The inverse failure is quieter. A session that assumes a sync will pick up a change edits a seed and waits for an update that never comes, because the seed is copy-once and no sync command writes it again. Both failures are one missing fact available before the command runs.
|
|
15
15
|
|
|
16
|
-
A third gap is the route itself. `canon --help` lists every top-level verb
|
|
16
|
+
A third gap is the route itself. `canon --help` lists every top-level verb by a one-line description, and a session with a job in hand pays a `--help` read per candidate to find the one that does it, or picks by name and lands on the wrong one. The job-to-verb mapping is the fact the session needs and no verb answers.
|
|
17
17
|
|
|
18
18
|
Being reachable is a separate problem from being right. This is a pure reference whose moment happens inside another skill's run, so nothing brings it up unless a body names it. A route lives in a body or it does not exist, and a mention in a sibling's requirement file is not one.
|
|
19
19
|
|
|
@@ -23,7 +23,7 @@ Being reachable is a separate problem from being right. This is a pure reference
|
|
|
23
23
|
- Route an author-and-render verb to the skill that owns it rather than describing it
|
|
24
24
|
- Warn about a verb that can lose the project's edits before it runs, naming what it replaces
|
|
25
25
|
- Point each destructive verb at `canon docs install-and-sync`, which owns the overwrite detail
|
|
26
|
-
- Point to `canon <verb> --help` and `canon docs agents` for subcommands, flags, and the invocation contract
|
|
26
|
+
- Point to `canon <verb> --help --all` and `canon docs agents` for subcommands, flags, and the invocation contract, and have the session read that help before running a verb no skill body spells out, a verb a skill pins in full being exempt
|
|
27
27
|
- Defer to `canon docs install-and-sync` when it and this summary disagree, since the summary is a copy and the doc is the source
|
|
28
28
|
|
|
29
29
|
## Must not
|
|
@@ -12,7 +12,8 @@ Consult to pick the `canon` verb for a job, and before running a verb that write
|
|
|
12
12
|
## Find the verb
|
|
13
13
|
|
|
14
14
|
- Each row below names a verb by its job. Subcommands and flags are not listed here, so read them where they are kept.
|
|
15
|
-
- Run `canon <verb> --help` for a verb's subcommands and
|
|
15
|
+
- Run `canon <verb> --help --all` for a verb's subcommands and every flag in one read, where `canon <verb> --help` alone stops at the subcommand list.
|
|
16
|
+
- Read `canon <verb> --help --all` before running a verb no skill body spells out. A verb a skill gives in full runs as that skill wrote it.
|
|
16
17
|
- Run `canon docs agents` for the invocation contract behind every verb, and `canon docs list` for every other reference doc, then `canon docs <topic>` by name.
|
|
17
18
|
|
|
18
19
|
## Project setup
|
|
@@ -27,15 +28,14 @@ Consult to pick the `canon` verb for a job, and before running a verb that write
|
|
|
27
28
|
|
|
28
29
|
## Domains
|
|
29
30
|
|
|
30
|
-
| Job | Verb
|
|
31
|
-
| --------------------------------------------------------------- |
|
|
32
|
-
| Install or sync governance rules | `canon gov`
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
| Read a toolkit reference doc | `canon docs` |
|
|
31
|
+
| Job | Verb |
|
|
32
|
+
| --------------------------------------------------------------- | --------------- |
|
|
33
|
+
| Install or sync governance rules | `canon gov` |
|
|
34
|
+
| Sync a tooling stack's configs and seeds, or read its reference | `canon tooling` |
|
|
35
|
+
| Set up or sync the Claude workflow | `canon claude` |
|
|
36
|
+
| Scaffold a wiki | `canon wiki` |
|
|
37
|
+
| Regenerate the `index.md` files | `canon indexes` |
|
|
38
|
+
| Read a toolkit reference doc | `canon docs` |
|
|
39
39
|
|
|
40
40
|
## Author and render
|
|
41
41
|
|
|
@@ -84,12 +84,12 @@ Read the doc each line names before running one of these. `canon docs install-an
|
|
|
84
84
|
|
|
85
85
|
- `canon sync` runs every installed domain's sync, so it carries each risk below.
|
|
86
86
|
- `canon gov sync` replaces a rule you edited and deletes a rule the toolkit retired, edited or not.
|
|
87
|
-
- `canon tooling sync --write` replaces every golden config a stack ships. Seeds are copy-once
|
|
87
|
+
- `canon tooling sync --write` replaces every golden config a stack ships. Seeds are copy-once. Nothing writes without the flag. See `canon docs sync`.
|
|
88
88
|
- `canon design sync` replaces the shipped design files and leaves `.claude/design/project/` alone.
|
|
89
89
|
- `canon migrate --write` rewrites files that cite a retired name or layout. It reports and writes nothing without the flag. See `canon docs migrate`.
|
|
90
90
|
- `canon indexes regen` rewrites each generated `index.md` from the folder's current state, so a hand edit there is lost. See `canon docs indexes`.
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
`CLAUDE.md` and the other seed docs are copy-once, and no sync updates them. Merge those by hand against the toolkit copy.
|
|
93
93
|
|
|
94
94
|
## Source of truth
|
|
95
95
|
|
|
@@ -25,7 +25,7 @@ When the operator picks a frame, the session leaves the decision on the canvas a
|
|
|
25
25
|
- Read the operator's selection when they point at something, and treat a stale element pick as unknown
|
|
26
26
|
- Read a frame's inline styles before restyling it, and say which operator edits were kept and which dropped
|
|
27
27
|
- Capture once per finished frame or page rather than after every edit
|
|
28
|
-
- Carry a picked value into the project's design document, and leave a picked layout on the canvas for the plan that builds it
|
|
28
|
+
- Carry a picked value into the project's stylesheet and its intent into the design document, and leave a picked layout on the canvas for the plan that builds it
|
|
29
29
|
|
|
30
30
|
## Must not
|
|
31
31
|
|
|
@@ -105,7 +105,7 @@ The operator restyles elements from the inspector, and each edit lands as inline
|
|
|
105
105
|
|
|
106
106
|
When the operator picks a frame, the decision leaves the canvas.
|
|
107
107
|
|
|
108
|
-
- Carry visual values, being color, type, spacing, and radius, into the
|
|
108
|
+
- Carry visual values, being color, type, spacing, and radius, into the stylesheet the design document's lead names, and the intent behind them into the document's sections under the `design.md` standard. A project with no stylesheet yet takes the values under `.claude/design/project/` after `canon design install`, and the lead names that path. Leave structure and layout on the canvas, and name the frame in the plan that builds it.
|
|
109
109
|
- Name the frame the decision came from in the reply, and leave the frame on the canvas until the operator clears it.
|
|
110
110
|
- Never cite a frame path from a tracked file. The folder is gitignored, so the citation resolves on this machine alone.
|
|
111
111
|
|
|
@@ -116,7 +116,7 @@ When the operator picks a frame, the decision leaves the canvas.
|
|
|
116
116
|
Page: <page>, <n> frames
|
|
117
117
|
Selected: <page>/<frame>, element <index>, or none, or stale
|
|
118
118
|
Capture: <path of each capture written>
|
|
119
|
-
Carried: <the design document the pick went to, the plan that cites the frame, or not yet>
|
|
119
|
+
Carried: <the stylesheet and design document the pick went to, the plan that cites the frame, or not yet>
|
|
120
120
|
```
|
|
121
121
|
|
|
122
122
|
Write the canvas line's URL as a markdown link. Omit the capture line when nothing was captured and the carried line when no direction was picked. Emit every path from the project root.
|
|
@@ -10,104 +10,121 @@ Applies to `canon/DESIGN.md`. Captures visual intent and the decisions behind ho
|
|
|
10
10
|
## Contents
|
|
11
11
|
|
|
12
12
|
- [Scope](#scope)
|
|
13
|
+
- [Two shapes](#two-shapes)
|
|
13
14
|
- [What goes in](#what-goes-in)
|
|
14
15
|
- [What does not go in](#what-does-not-go-in)
|
|
15
16
|
- [Format](#format)
|
|
16
17
|
- [Prose budget](#prose-budget)
|
|
17
|
-
- [The uncertainty tag](#the-uncertainty-tag)
|
|
18
18
|
- [Sections](#sections)
|
|
19
|
+
- [The uncertainty tag](#the-uncertainty-tag)
|
|
19
20
|
- [Template](#template)
|
|
20
21
|
|
|
21
22
|
## Scope
|
|
22
23
|
|
|
23
|
-
Governs the visual-intent document at `canon/DESIGN.md
|
|
24
|
+
Governs the visual-intent document at `canon/DESIGN.md`, being the rules and omissions that keep visual scope closed, the intent behind each role, and the pointer to where the values live.
|
|
24
25
|
|
|
25
26
|
Does not govern:
|
|
26
27
|
|
|
27
28
|
- Per-domain implementation narrative: `context.md`
|
|
29
|
+
- The token values themselves, which live in the project's stylesheet
|
|
30
|
+
|
|
31
|
+
## Two shapes
|
|
32
|
+
|
|
33
|
+
- **An intent record** is the shape a project writes by hand. It carries rules, omissions, and each role's intent, and its lead names the stylesheet the values live in. It carries no value, since a hand-typed copy of the stylesheet drifts from it.
|
|
34
|
+
- **A values record** is generated from a token source and carries the value tables beside the rules. It is never edited by hand, and its lead names the module it is rendered from. The toolkit's own record is one.
|
|
35
|
+
|
|
36
|
+
Everything below applies to both shapes unless it names one.
|
|
28
37
|
|
|
29
38
|
## What goes in
|
|
30
39
|
|
|
31
|
-
-
|
|
32
|
-
-
|
|
40
|
+
- In the lead, the stylesheet a reader takes values from, such as `src/styles/tokens.css` or a Tailwind `@theme` block
|
|
41
|
+
- What each color role and each shape role is for, with the custom property that carries it
|
|
42
|
+
- Layout constraints and sizing rules not obvious from the stylesheet and the code
|
|
33
43
|
- Visual rules a developer could get wrong without guidance
|
|
34
44
|
- Non-obvious omissions ("no motion", "no custom icons") that prevent scope creep
|
|
35
45
|
|
|
36
46
|
## What does not go in
|
|
37
47
|
|
|
48
|
+
- A token's value in an intent record, whether a hex, a font stack, a size, a step, or a radius. The stylesheet the lead names carries it.
|
|
38
49
|
- CSS classes and prop names. Those live in code.
|
|
39
50
|
- Anything that needs updating every time the code is refactored
|
|
40
|
-
- The history of how a value or a mark was chosen
|
|
51
|
+
- The history of how a value or a mark was chosen, being the candidates, the rounds, and the date of a pick. State the rule and cut the trail, since version control keeps it.
|
|
41
52
|
|
|
42
53
|
## Format
|
|
43
54
|
|
|
44
|
-
-
|
|
45
|
-
- Plain English over technical notation. If a section could be removed and the developer would still build correctly from the
|
|
46
|
-
- Keep table headers and role names intact so the
|
|
55
|
+
- Write every rule as a short bullet, one decision per line, within `## Prose budget`.
|
|
56
|
+
- Plain English over technical notation. If a section could be removed and the developer would still build correctly from the stylesheet and code alone, remove it.
|
|
57
|
+
- Keep table headers and role names intact so the parser can read the tables.
|
|
47
58
|
|
|
48
59
|
## Prose budget
|
|
49
60
|
|
|
50
|
-
The record is a lookup, so its prose stays short enough to scan
|
|
61
|
+
The record is a lookup, so its prose stays short enough to scan. Why a rule was chosen belongs in the project's context entry for design, never here.
|
|
51
62
|
|
|
52
|
-
-
|
|
63
|
+
- Overview: one paragraph of at most 60 words
|
|
53
64
|
- Any other section: at most 3 rules beside its table, each at most 25 words. A bullet is one rule, and so is a paragraph.
|
|
54
65
|
- The lead before the first section: at most 40 words
|
|
55
66
|
|
|
56
67
|
Headings and table rows are never counted, and a section holding a table and no rules is within budget. A bullet wrapping over several lines counts as one rule, and a nested bullet counts as its own.
|
|
57
68
|
|
|
58
|
-
##
|
|
69
|
+
## Sections
|
|
59
70
|
|
|
60
|
-
|
|
71
|
+
Use `## Overview`, `## Colors`, `## Typography`, `## Spacing`, `## Shapes`, `## Motion`, and `## Iconography`, in that order, which follows Google's DESIGN.md for the sections the two share. An optional `## Layout` sits between Spacing and Shapes. The parser still reads a record written under the earlier names, `## Personality`, `## Color`, and `## Borders`, as the sections they became.
|
|
61
72
|
|
|
62
|
-
|
|
73
|
+
In an intent record, `## Colors` carries a `Role | Property | Intent` table and `## Shapes` a `Role | Property | When used` table. Each row names the custom property the stylesheet declares for that role, such as `--color-accent`. Typography and Spacing carry rules alone.
|
|
63
74
|
|
|
64
|
-
|
|
75
|
+
Add either optional section when the project has content for it:
|
|
65
76
|
|
|
66
|
-
|
|
77
|
+
- `## Layout`: page width, breakpoints, and grid rules, as current constraints. The surface-capture rule reads the breakpoints from here, so a project with none declared here is captured at the 320 reflow floor alone.
|
|
78
|
+
- `## Mark`: the logo's construction rules and the files that carry it
|
|
67
79
|
|
|
68
|
-
##
|
|
80
|
+
## The uncertainty tag
|
|
69
81
|
|
|
70
|
-
|
|
82
|
+
Applies to a values record alone. An intent record carries no value to tag, and a guessed value is marked where it is written, in the stylesheet.
|
|
71
83
|
|
|
72
|
-
|
|
84
|
+
A cell no source anchors ends in ` ? verify`, written inside the cell rather than as a trailing column, since a trailing marker breaks the table parse. A cell wrapping itself in a code span carries the tag inside the span, as in `` `#ffffff ? verify` ``. Both spellings parse.
|
|
73
85
|
|
|
74
|
-
|
|
75
|
-
|
|
86
|
+
The renderer splits the tag off the value, so a swatch and a font sample are built from the value alone and the marker shows beside it. The preview also reports how many cells are anchored against how many are tagged, which is the reading a reviewer takes the record's overall confidence from.
|
|
87
|
+
|
|
88
|
+
Which columns that ratio reads is fixed by the table rather than by the record. The first column of each table names its row, and `Multiplier` and `When used` restate what the row already carries, so none of them is something a source could anchor and none is counted. That leaves `Intent` and `Value` in Colors, `Family`, `Weight`, `Size`, and `Line height` in Typography, `Value` in Spacing, and `Radius` and `Width` in Shapes. A cell tagged outside that set counts anyway, so a marker the preview draws is never missing from the ratio beside it.
|
|
89
|
+
|
|
90
|
+
A prose section takes its uncertainty inline instead, in a sentence saying what is proposed and what has yet to confirm it. A tag appended to a paragraph renders verbatim.
|
|
76
91
|
|
|
77
92
|
## Template
|
|
78
93
|
|
|
79
|
-
The
|
|
94
|
+
The template is the intent record. The column headers are read by exact key, so they stay verbatim. Row names are not, which leaves a project free to rename a role, add one, or drop one it has no use for.
|
|
80
95
|
|
|
81
96
|
```markdown
|
|
82
97
|
# Design
|
|
83
98
|
|
|
84
|
-
|
|
99
|
+
Values live in `<path to the stylesheet>`. This record holds the intent behind them.
|
|
100
|
+
|
|
101
|
+
## Overview
|
|
85
102
|
|
|
86
103
|
<one paragraph on voice, tone, and the feeling a user should have>
|
|
87
104
|
|
|
88
|
-
##
|
|
105
|
+
## Colors
|
|
106
|
+
|
|
107
|
+
- <a rule a developer could get wrong>
|
|
89
108
|
|
|
90
|
-
| Role | Intent |
|
|
91
|
-
| ------ | ---------------- |
|
|
92
|
-
| <role> | <what it is for> |
|
|
109
|
+
| Role | Property | Intent |
|
|
110
|
+
| ------ | ---------------- | ---------------- |
|
|
111
|
+
| <role> | `--color-<role>` | <what it is for> |
|
|
93
112
|
|
|
94
113
|
## Typography
|
|
95
114
|
|
|
96
|
-
|
|
97
|
-
| ------ | -------- | -------- | ------ | ----------- |
|
|
98
|
-
| <role> | <family> | <weight> | <size> | <height> |
|
|
115
|
+
- <how the roles divide between families, and any role that breaks the pattern>
|
|
99
116
|
|
|
100
117
|
## Spacing
|
|
101
118
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
119
|
+
- <the base unit and how the scale steps>
|
|
120
|
+
|
|
121
|
+
## Shapes
|
|
105
122
|
|
|
106
|
-
|
|
123
|
+
- <a rule about radius or border a developer could get wrong>
|
|
107
124
|
|
|
108
|
-
| Role |
|
|
109
|
-
| ------ |
|
|
110
|
-
| <role> |
|
|
125
|
+
| Role | Property | When used |
|
|
126
|
+
| ------ | ----------------- | ----------- |
|
|
127
|
+
| <role> | `--radius-<role>` | <when used> |
|
|
111
128
|
|
|
112
129
|
## Motion
|
|
113
130
|
|
|
@@ -34,7 +34,7 @@ A placement rule in front of the session is also one it can argue past. Each fla
|
|
|
34
34
|
- Carry a hard file-count threshold. A command folder holding sixty files of one role reads fine flat, and a number would fail it.
|
|
35
35
|
- Restate the layer rule, the layer table, or the final filter `test-craft` owns
|
|
36
36
|
- Mandate one layout across projects, such as a `features/` tree, over the project's own strategy
|
|
37
|
-
- Restate the pointer in `
|
|
37
|
+
- Restate the pointer in `routing`, which loads in code stacks only. The rule points here and this body carries the depth.
|
|
38
38
|
|
|
39
39
|
## Guards
|
|
40
40
|
|
|
@@ -90,5 +90,5 @@ Check every new path the plan or the change names against each line, and fix the
|
|
|
90
90
|
- Which layer a test belongs at: `test-craft`. This skill decides where the test file sits once its layer is chosen.
|
|
91
91
|
- What a module exposes across its boundary, being its exports, flags, output, and errors: `api-design`. This skill decides where the file holding it sits.
|
|
92
92
|
- Where a new path gets written into a plan, and the plan's shape: `plan-feature` and the plan standard
|
|
93
|
-
- The pointer here that every session of a code stack loads: `
|
|
94
|
-
- Runner, suffix, and top-level test folder conventions per language: `
|
|
93
|
+
- The pointer here that every session of a code stack loads: `routing`
|
|
94
|
+
- Runner, suffix, and top-level test folder conventions per language: `testing-ts`, `testing-py`, `testing-go`, and `testing-php`
|
|
@@ -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
|
---
|
|
@@ -35,19 +35,19 @@ Pick the subdir from the topic. It sits under `.claude/rules/project/` and names
|
|
|
35
35
|
- `tooling/`: dev setup, such as CI workflows, dependencies, and config.
|
|
36
36
|
- `writing/`: prose and document shape.
|
|
37
37
|
|
|
38
|
-
## Step 3: pick a free
|
|
38
|
+
## Step 3: pick a free slug
|
|
39
39
|
|
|
40
|
-
A
|
|
40
|
+
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
41
|
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
- Stop and say so
|
|
42
|
+
- Take a slug no file in the chosen `.claude/rules/project/<subdir>/` already uses.
|
|
43
|
+
- Never take a slug equal to a subdir name from Step 2, since a stack entry naming that word reads it as the folder.
|
|
44
|
+
- Stop and say so when the topic's natural slug is taken, and propose a narrower one rather than overwriting the file.
|
|
45
45
|
|
|
46
46
|
## Step 4: write the rule
|
|
47
47
|
|
|
48
48
|
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
49
|
|
|
50
|
-
Write `.claude/rules/project/<subdir>/<
|
|
50
|
+
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
51
|
|
|
52
52
|
Frontmatter carries the Claude shape. Path-scoped rules emit one `paths:` entry per glob. Always-on rules omit `paths:` entirely.
|
|
53
53
|
|
|
@@ -70,4 +70,4 @@ Title casing is sentence case, with proper nouns keeping their own casing (`# Ty
|
|
|
70
70
|
|
|
71
71
|
## After writing
|
|
72
72
|
|
|
73
|
-
Emit the full path on its own line: `.claude/rules/project/<subdir>/<
|
|
73
|
+
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
|
|
@@ -11,7 +11,8 @@ Read these files in parallel:
|
|
|
11
11
|
|
|
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
|
-
- `${CLAUDE_SKILL_DIR}/references/skill-paths.md`: which root a path in the body resolves against, and how the body cites
|
|
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-reference.md`, when the skill carries a reference setting the shape of one artifact: its scope, success criterion, frontmatter, and rule phrasing
|
|
15
16
|
- `${CLAUDE_SKILL_DIR}/../markdown-craft/references/markdown.md`: punctuation and formatting for skill body text
|
|
16
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
|
|
17
18
|
- The `write-human` skill: voice, rhythm, and sentence construction for skill body text
|