@erclx/canon 5.41.0 → 5.43.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/claude/.claude-plugin/plugin.json +1 -1
- package/claude/skills/api-design/references/adopted.md +34 -14
- package/claude/skills/auto-ship/REQUIREMENT.md +1 -0
- package/claude/skills/auto-ship/SKILL.md +24 -4
- package/claude/skills/auto-ship/references/draft-mark.md +32 -6
- package/claude/skills/auto-ship/references/failure-recovery.md +15 -13
- package/claude/skills/auto-ship/references/tier-failures.md +31 -10
- package/claude/skills/auto-ship/references/ui-checklist.md +9 -4
- package/claude/skills/auto-ship/references/worktree-name.md +9 -3
- package/claude/skills/build-in-slices/references/adopted.md +35 -21
- package/claude/skills/canvas-board/references/canvas.md +17 -6
- package/claude/skills/canvas-board/references/design.md +26 -7
- package/claude/skills/ci-workflow/REQUIREMENT.md +2 -1
- package/claude/skills/ci-workflow/SKILL.md +12 -2
- package/claude/skills/ci-workflow/references/workflows.md +12 -9
- package/claude/skills/code-craft/references/adopted.md +58 -20
- package/claude/skills/codebase-layout/references/adopted.md +49 -16
- package/claude/skills/codebase-layout/references/frontend.md +11 -4
- package/claude/skills/codebase-layout/references/tests.md +4 -2
- package/claude/skills/context-fold/references/classify.md +10 -15
- package/claude/skills/context-fold/references/completion-report.md +11 -9
- package/claude/skills/context-fold/references/context-refresh.md +26 -9
- package/claude/skills/context-fold/references/unusable-baseline.md +5 -3
- package/claude/skills/create-rule/REQUIREMENT.md +5 -0
- package/claude/skills/create-rule/SKILL.md +10 -1
- package/claude/skills/create-rule/references/checklist.md +26 -0
- package/claude/skills/create-rule/references/rule.md +98 -20
- package/claude/skills/create-skill/SKILL.md +1 -0
- package/claude/skills/create-skill/references/skill-disclosure.md +10 -2
- package/claude/skills/create-skill/references/skill-frontmatter.md +43 -0
- package/claude/skills/create-skill/references/skill-paths.md +7 -4
- package/claude/skills/create-skill/references/skill-practice.md +6 -3
- package/claude/skills/create-skill/references/skill-requirement.md +4 -2
- package/claude/skills/create-skill/references/skill.md +67 -44
- package/claude/skills/decision-escalate/SKILL.md +1 -2
- package/claude/skills/deploy-app/references/vercel.md +2 -1
- package/claude/skills/deprecation-migration/references/adopted.md +44 -25
- package/claude/skills/design-taste/references/adopted.md +9 -1
- package/claude/skills/design-taste/references/craft.md +3 -1
- package/claude/skills/design-taste/references/kinds.md +8 -7
- package/claude/skills/design-taste/references/preflight.md +12 -0
- package/claude/skills/design-taste/references/systems.md +7 -6
- package/claude/skills/design-taste/references/tells.md +24 -25
- package/claude/skills/design-taste/references/vocabulary.md +7 -5
- package/claude/skills/document-health/references/axes.md +55 -30
- package/claude/skills/draft-and-pick/references/live-arms.md +2 -2
- package/claude/skills/draft-doc/references/context.md +4 -3
- package/claude/skills/draft-doc/references/docs.md +6 -3
- package/claude/skills/draft-doc/references/readme/agent-facing.md +6 -0
- package/claude/skills/draft-doc/references/readme/application.md +8 -2
- package/claude/skills/draft-doc/references/readme/cli.md +5 -1
- package/claude/skills/draft-doc/references/readme/library.md +4 -0
- package/claude/skills/draft-doc/references/readme/plugin.md +9 -1
- package/claude/skills/draft-doc/references/readme.md +30 -13
- package/claude/skills/draft-doc/references/requirements.md +17 -4
- package/claude/skills/draft-doc/references/wiki-kind.md +20 -10
- package/claude/skills/draft-doc/references/wiki.md +1 -1
- package/claude/skills/draft-figure/references/architecture-set.md +7 -3
- package/claude/skills/draft-figure/references/figures.md +8 -6
- package/claude/skills/draft-figure/references/hand-drawn.md +3 -1
- package/claude/skills/draft-figure/references/mermaid-path.md +19 -9
- package/claude/skills/draft-figure/references/mermaid.md +10 -5
- package/claude/skills/draft-ready/references/ready.md +22 -15
- package/claude/skills/git-branch/references/branch.md +11 -1
- package/claude/skills/git-branch/references/slug.md +17 -5
- package/claude/skills/git-commit/references/commit.md +9 -5
- package/claude/skills/git-commit/references/versioning.md +23 -17
- package/claude/skills/git-followup/REQUIREMENT.md +1 -1
- package/claude/skills/git-followup/SKILL.md +5 -6
- package/claude/skills/git-issue/references/issue.md +29 -16
- package/claude/skills/git-pr/REQUIREMENT.md +1 -5
- package/claude/skills/git-pr/SKILL.md +11 -22
- package/claude/skills/git-pr/references/final-command.md +21 -8
- package/claude/skills/git-pr/references/labels.md +45 -28
- package/claude/skills/git-pr/references/pr.md +29 -9
- package/claude/skills/git-pr/references/publish.md +42 -28
- package/claude/skills/git-pr/references/task-number.md +20 -8
- package/claude/skills/git-ship/SKILL.md +1 -1
- package/claude/skills/plan-feature/SKILL.md +1 -1
- package/claude/skills/plan-feature/references/plan-lifecycle.md +10 -3
- package/claude/skills/plan-feature/references/plan.md +58 -21
- package/claude/skills/plan-groundwork/references/groundwork-spikes.md +4 -1
- package/claude/skills/plan-groundwork/references/groundwork.md +14 -16
- package/claude/skills/plan-intake/references/intake.md +29 -24
- package/claude/skills/pr-evidence/REQUIREMENT.md +40 -0
- package/claude/skills/pr-evidence/SKILL.md +53 -0
- package/claude/skills/pr-evidence/references/evidence.md +150 -0
- package/claude/skills/review-address/references/post-review-findings.md +10 -3
- package/claude/skills/review-address/references/rebase-conflicts.md +15 -7
- package/claude/skills/review-address/references/rest-reads.md +3 -1
- package/claude/skills/review-craft/references/adopted.md +35 -18
- package/claude/skills/review-craft/references/security.md +42 -7
- package/claude/skills/review-craft/references/ui.md +23 -8
- package/claude/skills/review-pr/SKILL.md +6 -6
- package/claude/skills/review-pr/references/body-variants.md +29 -9
- package/claude/skills/review-pr/references/close-out.md +20 -5
- package/claude/skills/review-pr/references/key-changes.md +27 -3
- package/claude/skills/review-pr/references/post.md +83 -31
- package/claude/skills/review-pr/references/scope.md +54 -19
- package/claude/skills/review-ui/references/close-out.md +7 -5
- package/claude/skills/review-ui/references/driving.md +24 -4
- package/claude/skills/review-ui/references/post.md +43 -15
- package/claude/skills/role-orchestrator/SKILL.md +2 -0
- package/claude/skills/role-orchestrator/references/orchestrator-cloud-launch.md +67 -17
- package/claude/skills/role-orchestrator/references/orchestrator-dispatch.md +80 -40
- package/claude/skills/role-orchestrator/references/orchestrator-handback.md +52 -15
- package/claude/skills/role-orchestrator/references/orchestrator-handoff.md +48 -26
- package/claude/skills/role-orchestrator/references/orchestrator-inbound.md +12 -13
- package/claude/skills/role-orchestrator/references/orchestrator-launch.md +72 -36
- package/claude/skills/role-orchestrator/references/orchestrator-output.md +16 -4
- package/claude/skills/role-orchestrator/references/orchestrator-parked.md +64 -24
- package/claude/skills/role-orchestrator/references/orchestrator-poll.md +80 -26
- package/claude/skills/role-orchestrator/references/orchestrator-refill.md +41 -18
- package/claude/skills/role-orchestrator/references/orchestrator-resume.md +19 -7
- package/claude/skills/role-orchestrator/references/orchestrator-review-dispatch.md +22 -12
- package/claude/skills/role-orchestrator/references/orchestrator-reviewer-launch.md +15 -6
- package/claude/skills/role-orchestrator/references/orchestrator-sweep.md +25 -7
- package/claude/skills/role-orchestrator/references/orchestrator-watch.md +34 -8
- package/claude/skills/role-orchestrator/scripts/poll.ts +16 -24
- package/claude/skills/role-planner/REQUIREMENT.md +1 -1
- package/claude/skills/role-planner/SKILL.md +3 -3
- package/claude/skills/role-worker/REQUIREMENT.md +3 -0
- package/claude/skills/role-worker/SKILL.md +34 -2
- package/claude/skills/search-craft/REQUIREMENT.md +1 -1
- package/claude/skills/search-craft/SKILL.md +2 -2
- package/claude/skills/search-craft/references/adopted.md +18 -6
- package/claude/skills/session-map/references/session.md +26 -7
- package/claude/skills/session-worktree/references/main-root-writes.md +25 -8
- package/claude/skills/systematic-debugging/references/adopted.md +30 -16
- package/claude/skills/target-check/references/domains.md +39 -11
- package/claude/skills/target-setup/references/detect.md +80 -65
- package/claude/skills/target-setup/references/indexes.md +8 -6
- package/claude/skills/task-board/references/board.md +86 -30
- package/claude/skills/task-board/references/decline.md +29 -13
- package/claude/skills/task-board/references/tasks-decline.md +12 -5
- package/claude/skills/task-board/references/tasks.md +65 -33
- package/claude/skills/task-complete/references/archive.md +41 -17
- package/claude/skills/task-complete/references/receipt-sweep.md +23 -9
- package/claude/skills/task-complete/references/unusable-baseline.md +10 -3
- package/claude/skills/teach-workspace/references/glossary.md +6 -2
- package/claude/skills/teach-workspace/references/lesson-build.md +44 -16
- package/claude/skills/teach-workspace/references/lesson-craft.md +12 -7
- package/claude/skills/teach-workspace/references/pedagogy.md +6 -3
- package/claude/skills/teach-workspace/references/promotion-fold.md +17 -11
- package/claude/skills/teach-workspace/references/promotion.md +31 -8
- package/claude/skills/teach-workspace/references/revisit.md +8 -2
- package/claude/skills/teach-workspace/references/teach.md +17 -9
- package/claude/skills/test-craft/references/adopted.md +48 -14
- package/claude/skills/test-craft/references/component.md +7 -4
- package/claude/skills/test-craft/references/e2e.md +25 -7
- package/claude/skills/test-craft/references/unit.md +3 -1
- package/claude/skills/test-first/references/adopted.md +12 -4
- package/claude/skills/ui-checklist/REQUIREMENT.md +1 -1
- package/claude/skills/ui-checklist/SKILL.md +1 -1
- package/claude/skills/video-craft/references/adopted.md +62 -18
- package/claude/skills/write-human/references/adopted.md +21 -8
- package/docs/agents/audits.md +1 -0
- package/docs/agents/migrate.md +11 -8
- package/docs/target/migrations.md +11 -0
- package/docs/workflow/parallel-features.md +1 -1
- package/docs/workflow/skill-map.md +1 -0
- package/governance/detect.toml +4 -0
- package/governance/rules/canon/context.md +2 -1
- package/governance/rules/canon/plan.md +3 -5
- package/governance/rules/canon/scratch.md +3 -1
- package/governance/rules/canon/task-scope.md +2 -1
- package/governance/rules/canon/tasks.md +2 -1
- package/governance/rules/canon/worktrees.md +5 -2
- package/governance/rules/claude/output.md +7 -4
- package/governance/rules/claude/skill.md +6 -4
- package/governance/rules/tooling/ci-workflow.md +6 -39
- package/governance/rules/ui/design-reference.md +37 -0
- package/governance/rules/writing/markdown.md +2 -1
- package/package.json +6 -6
- package/src/audits/catalog.ts +42 -0
- package/src/claude/cases/workflow.ts +5 -0
- package/src/claude/settings.ts +8 -4
- package/src/commands/claude.ts +11 -1
- package/src/commands/gov.ts +198 -0
- package/src/commands/migrate.ts +121 -2
- package/src/commands/pr.ts +146 -105
- package/src/commands/tooling.ts +3 -3
- package/src/commands/worktrees.ts +49 -0
- package/src/gate/stages.ts +15 -0
- package/src/gov/audit.ts +440 -0
- package/src/listeners/belongs.ts +21 -0
- package/src/listeners/machine.ts +93 -0
- package/src/listeners/parse.ts +41 -0
- package/src/markdown/scope.ts +144 -0
- package/src/migrate/session-defaults.ts +138 -0
- package/src/pr/lift.ts +6 -3
- package/src/pr/local.ts +4 -69
- package/src/pr/review-state.ts +182 -0
- package/src/sync/check.ts +15 -0
- package/src/tooling/stamp.ts +56 -12
- package/src/worktrees/stop.ts +92 -0
- package/tooling/base/configs/.github/workflows/phase-label-gate.yml +6 -2
- package/tooling/base/configs/commitlint.config.js +0 -20
- package/tooling/base/reference.md +1 -1
- package/tooling/base/seeds/.github/workflows/verify.yml +4 -1
- package/tooling/claude/reference.md +13 -7
- package/tooling/claude/seeds/.claude/settings.json +4 -0
- package/tooling/claude/user/settings.template.json +0 -4
- package/tooling/cloudflare/configs/.github/workflows/deploy.yml +5 -5
- package/tooling/public/configs/.github/dependabot.yml +12 -0
- package/tooling/public/configs/.github/workflows/release-please.yml +30 -0
- package/tooling/public/manifest.toml +8 -0
- package/tooling/public/reference.md +53 -0
- package/tooling/public/seeds/.github/ISSUE_TEMPLATE/bug.yml +48 -0
- package/tooling/public/seeds/.github/ISSUE_TEMPLATE/config.yml +5 -0
- package/tooling/public/seeds/.github/ISSUE_TEMPLATE/feature.yml +16 -0
- package/tooling/public/seeds/.release-please-manifest.json +3 -0
- package/tooling/public/seeds/CONTRIBUTING.md +50 -0
- package/tooling/public/seeds/LICENSE +21 -0
- package/tooling/public/seeds/SECURITY.md +13 -0
- package/tooling/public/seeds/release-please-config.json +12 -0
- package/tooling/shell/configs/.github/workflows/shell.yml +4 -1
- package/tooling/web/configs/.github/workflows/readme-screenshot.yml +6 -3
- package/tooling/web/configs/.github/workflows/verify.yml +15 -12
- package/claude/skills/git-pr/references/evidence.md +0 -124
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Rule bullet checklist
|
|
3
|
+
description: Criteria a session runs over each bullet of a rule it just wrote or revised, and the verdict shape it returns
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Rule bullet checklist
|
|
7
|
+
|
|
8
|
+
A session reads this after writing or revising a rule, once the body holds its bullets. `rule.md` sets the shape before writing, and this list judges each bullet after.
|
|
9
|
+
|
|
10
|
+
For each bullet in the rule under audit, return `✅ keep`, `⚠️ revise`, or `❌ drop` with a one-line reason.
|
|
11
|
+
|
|
12
|
+
## Criteria
|
|
13
|
+
|
|
14
|
+
1. **Concrete enough to verify.** A reviewer can read a line of code and say whether it complies. "Prefer `pathlib.Path` over `os.path`" passes, since it names both sides.
|
|
15
|
+
2. **Catches a real footgun or a project convention.** A violation produces a bug class, such as blocking I/O in async, or departs from a convention the content test admits. Drop it otherwise.
|
|
16
|
+
3. **Not redundant with the toolchain.** Skip anything the project's formatter, linter, type checker, or spell checker already enforces. Rules cover what tools cannot.
|
|
17
|
+
4. **Uncontested.** When the community is split, drop the bullet or pick a side with a short reason tied to the stack.
|
|
18
|
+
5. **Inside the shape.** At most 200 characters and 2 sentences, one directive plus at most one exception, condition, or short reason, per `## Shape` in `rule.md`.
|
|
19
|
+
6. **Passes the content test.** Claude could not guess it, and it is not a standard convention or information that changes often, per `## Content` in `rule.md`.
|
|
20
|
+
7. **Frontmatter integrity.** `description` names one concern in one line, and a path-scoped rule carries one `paths:` entry per glob.
|
|
21
|
+
8. **Retired keys and names.** An always-on rule omits `paths:`, and no rule carries `globs:`, `alwaysApply:`, or `priority:`. The basename names no folder.
|
|
22
|
+
9. **Template precedent.** H1 and H2 in sentence case and imperative bullets, matching `## Body` in `rule.md`.
|
|
23
|
+
|
|
24
|
+
## Output shape
|
|
25
|
+
|
|
26
|
+
Group findings by file. Lead each file block with the per-file verdict count.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Governance rule reference
|
|
3
|
-
description: Rule frontmatter, body shape, and voice for .claude/rules files
|
|
3
|
+
description: Rule frontmatter, shape limits, content test, sources, body shape, and voice for .claude/rules files
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Governance rule reference
|
|
@@ -9,7 +9,10 @@ description: Rule frontmatter, body shape, and voice for .claude/rules files
|
|
|
9
9
|
|
|
10
10
|
- [Overview](#overview)
|
|
11
11
|
- [Scope](#scope)
|
|
12
|
+
- [Shape](#shape)
|
|
13
|
+
- [Content](#content)
|
|
12
14
|
- [Whether a skill belongs behind the rule](#whether-a-skill-belongs-behind-the-rule)
|
|
15
|
+
- [Sources](#sources)
|
|
13
16
|
- [Location](#location)
|
|
14
17
|
- [Names](#names)
|
|
15
18
|
- [Frontmatter](#frontmatter)
|
|
@@ -18,29 +21,84 @@ description: Rule frontmatter, body shape, and voice for .claude/rules files
|
|
|
18
21
|
|
|
19
22
|
## Overview
|
|
20
23
|
|
|
21
|
-
Rules give Claude Code coding constraints scoped to file paths. Claude Code discovers `.claude/rules/**/*.md` at session start.
|
|
24
|
+
Rules give Claude Code coding constraints scoped to file paths. Claude Code discovers `.claude/rules/**/*.md` at session start, and a rule in `~/.claude/rules/` applies to every project on the machine.
|
|
22
25
|
|
|
23
26
|
A rule with no `paths:` field always applies, at the same priority as `CLAUDE.md`. A rule with `paths:` applies when Claude reads or writes a file matching the glob. Author one rule per topic so the scope stays precise.
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
### When a path-scoped rule loads
|
|
29
|
+
|
|
30
|
+
A rule with `paths:` loads on a read or a write of a matching file, inside a linked worktree as in the main one. A session creating the first matching file gets the rule only after that write lands.
|
|
31
|
+
|
|
32
|
+
- The first write's floor therefore belongs to the skill that creates the file, per `## Whether a skill belongs behind the rule`
|
|
33
|
+
- Measured again on Claude Code 2.1.302, when the rule attached after the first write to a new file and before the second
|
|
34
|
+
- Revisit when Claude Code loads a path-scoped rule before a write to a matching path
|
|
35
|
+
- Re-measure with two headless `claude -p` runs, one writing a new matching file and one reading a matching file first, each read for when the rule attached
|
|
26
36
|
|
|
27
37
|
## Scope
|
|
28
38
|
|
|
29
|
-
Governs governance rules under `.claude/rules
|
|
39
|
+
Governs governance rules under `.claude/rules/`, being their shape, content, sources, location, names, frontmatter, and body.
|
|
30
40
|
|
|
31
41
|
Does not govern:
|
|
32
42
|
|
|
33
43
|
- Authoring conventions for a document type, which are standards rather than rules. A rule points at the standard that owns one and never restates it.
|
|
34
44
|
- Skill folders and skill frontmatter: `skill.md`
|
|
35
45
|
- Cross-domain behavior rules, which live in `CLAUDE.md` at the project root
|
|
46
|
+
- Judging each bullet after writing, which is `checklist.md`
|
|
47
|
+
|
|
48
|
+
## Shape
|
|
49
|
+
|
|
50
|
+
Every limit is a count a reviewer can take, so a rule passes or fails it without judgment.
|
|
51
|
+
|
|
52
|
+
| Limit | Value |
|
|
53
|
+
| -------------------- | --------------------------------------------------------------- |
|
|
54
|
+
| Words in the body | 300 |
|
|
55
|
+
| Bullets per file | 15 |
|
|
56
|
+
| H2s per file | 6 |
|
|
57
|
+
| Bullets per H2 | 7 |
|
|
58
|
+
| Bullet length | 200 characters |
|
|
59
|
+
| Sentences per bullet | 2, one directive plus one exception, condition, or short reason |
|
|
60
|
+
|
|
61
|
+
- Name one concern in `description`. A rule needing a seventh H2 holds two concerns and splits into two files.
|
|
62
|
+
- Keep a reason to the why of its directive, never a paragraph of background
|
|
63
|
+
|
|
64
|
+
## Content
|
|
65
|
+
|
|
66
|
+
A bullet loads on every matching edit, so it earns its place only when removing it would cause a mistake.
|
|
67
|
+
|
|
68
|
+
| Put in a rule | Leave out |
|
|
69
|
+
| ------------------------------------------ | -------------------------------------------------------- |
|
|
70
|
+
| What Claude cannot guess | Standard language conventions Claude already knows |
|
|
71
|
+
| A convention that differs from the default | Anything the linter, formatter, or type checker enforces |
|
|
72
|
+
| A footgun that ships silently | Information that changes often |
|
|
73
|
+
|
|
74
|
+
- Write every bullet concrete enough to verify against a line of code. "Prefer `pathlib.Path` over `os.path`" passes, since it names both sides.
|
|
75
|
+
- Pair a ban with the alternative to take, unless the ban or a neighbor bullet already names it
|
|
76
|
+
- Use no emphasis words such as "CRITICAL" or "You MUST", which newer models overtrigger on
|
|
36
77
|
|
|
37
78
|
## Whether a skill belongs behind the rule
|
|
38
79
|
|
|
39
|
-
A rule fires on a path match with no decision from the session, which is what makes it a floor.
|
|
80
|
+
A rule fires on a path match with no decision from the session, which is what makes it a floor. Procedure, worked cases, and a branch on project state have no room in its bullets, so they belong to a skill.
|
|
81
|
+
|
|
82
|
+
Each invariant has one copy, in either the rule or the skill. `skill.md` carries the same test for a session arriving from the other side.
|
|
83
|
+
|
|
84
|
+
- A skill that creates the file the rule globs owns the floor, since the rule loads only after the first write. The rule keeps the edit-time bullets and a pointer.
|
|
85
|
+
- A skill that edits existing files points at the rule, and the rule owns the floor
|
|
86
|
+
- A pointer bullet earns its load only when the skill's description does not already fire on the same edit
|
|
87
|
+
- Keep at most five directives beside a pointer
|
|
88
|
+
- A rule that grows a procedure has become a skill body wearing rule frontmatter
|
|
40
89
|
|
|
41
|
-
|
|
90
|
+
### Checking the installed skills
|
|
42
91
|
|
|
43
|
-
|
|
92
|
+
Before writing, read the descriptions of the skills in the session's listing and stop at one that names the topic. Point the rule at that skill rather than restating it, and skip the check when the listing holds no skills.
|
|
93
|
+
|
|
94
|
+
## Sources
|
|
95
|
+
|
|
96
|
+
A bullet claiming outside practice, such as a language idiom or a library's correct use, rests on a primary source. Unsourced practice drifts, and the bullet goes on loading after it turns wrong.
|
|
97
|
+
|
|
98
|
+
- Cite the source in the commit that adds the rule, naming a primary page or the bug class the bullet prevents
|
|
99
|
+
- Cut a bullet that has neither a source nor a bug class behind it
|
|
100
|
+
- The toolkit holds its outside-practice rules to a source ledger kept outside the installed tree, so the citation costs no load
|
|
101
|
+
- A bullet resting on how Claude Code behaves ends with a `Revisit when` sentence, per `### Phrasing`
|
|
44
102
|
|
|
45
103
|
## Location
|
|
46
104
|
|
|
@@ -56,14 +114,20 @@ A rule's filename is its slug, with no number in front. Nothing orders rules at
|
|
|
56
114
|
|
|
57
115
|
- 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
116
|
- 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
|
|
117
|
+
- A project-authored rule needs its slug free only inside its own subdirectory under `.claude/rules/project/`, since `canon/` and `project/` install side by side
|
|
60
118
|
|
|
61
|
-
|
|
119
|
+
### What sync reads
|
|
120
|
+
|
|
121
|
+
`canon gov sync` walks only `.claude/rules/canon/`, so `.claude/rules/project/` is never matched, read, or reported on. A file under `.claude/rules/canon/` that no toolkit source names is reported orphaned, with no destination offered.
|
|
122
|
+
|
|
123
|
+
- The toolkit cannot tell a rule the project dropped there from one it shipped and later renamed
|
|
124
|
+
- A destination inside `canon/` would be wrong for the first case anyway, since that folder is toolkit-owned and replaced on sync
|
|
125
|
+
- Nothing is moved either way, since the project's own rules, skills, and docs may cite a rule's installed path
|
|
62
126
|
|
|
63
127
|
## Frontmatter
|
|
64
128
|
|
|
65
|
-
- `description` (required): one line naming what the rule enforces and where
|
|
66
|
-
- `paths` (optional): one glob per entry, for a rule scoped to a file set
|
|
129
|
+
- `description` (required): one line naming what the rule enforces and where. It is canon's own field, read by `canon gov list`.
|
|
130
|
+
- `paths` (optional): one glob per entry, for a rule scoped to a file set. It is the only field Claude Code reads.
|
|
67
131
|
- Omit `paths` for an always-on rule that states a global principle with no file scope
|
|
68
132
|
- Do not emit the legacy Cursor keys `globs`, `alwaysApply`, or `priority`. They are not read.
|
|
69
133
|
|
|
@@ -75,47 +139,61 @@ paths:
|
|
|
75
139
|
---
|
|
76
140
|
```
|
|
77
141
|
|
|
142
|
+
Frontmatter that fails to parse loads the rule as if it had no `paths`, so a broken glob turns a scoped rule always-on. Quote every glob that opens with `*` or `{`.
|
|
143
|
+
|
|
78
144
|
## Body
|
|
79
145
|
|
|
80
146
|
- Open with an H1 `# <Topic> standards` in sentence case, then group rules under H2 sections. Proper nouns keep their casing (`# TypeScript standards`, `# Next.js standards`).
|
|
81
147
|
- Use imperative voice for every rule (`Prefix booleans with is`, not `Booleans should be prefixed`)
|
|
82
148
|
- State one rule per bullet as a single directive line
|
|
83
|
-
- State what to do and what not to do.
|
|
149
|
+
- State what to do and what not to do. Add one short reason when the why is not obvious, inside the limits in `## Shape`.
|
|
84
150
|
|
|
85
151
|
### Phrasing
|
|
86
152
|
|
|
87
|
-
|
|
153
|
+
A ban asserting how the model or a tool behaves ends its directive line with one `Revisit when <finding>.` sentence, which states a condition rather than the reasoning. A style, safety, or consistency ban takes none.
|
|
154
|
+
|
|
88
155
|
- Phrase a rule as a ban on the forbidden shape when it could otherwise enumerate allowed options, so it stays stable as categories grow
|
|
89
156
|
- Cut any rule that resists crisp one-line phrasing. Vague guidance is worse than none.
|
|
90
157
|
|
|
91
158
|
### Scope of a rule file
|
|
92
159
|
|
|
160
|
+
A rule file holds one topic in its current shape.
|
|
161
|
+
|
|
93
162
|
- Keep the file to one topic. A second topic is a second rule file.
|
|
94
163
|
- Do not restate a rule that a sibling rule or `CLAUDE.md` already owns. Point once, never duplicate.
|
|
95
|
-
- Name the current layout only, in a glob and in the body alike
|
|
164
|
+
- Name the current layout only, in a glob and in the body alike
|
|
165
|
+
- A layout change ships a migration verb, such as `canon migrate records`, rather than a line or a glob that keeps the old spelling loading
|
|
96
166
|
|
|
97
167
|
## Examples
|
|
98
168
|
|
|
99
169
|
### Correct
|
|
100
170
|
|
|
171
|
+
A scoped description, a `paths` list, and one directive per bullet, one of them carrying a short reason.
|
|
172
|
+
|
|
101
173
|
```markdown
|
|
102
174
|
---
|
|
103
|
-
description: Enforce
|
|
175
|
+
description: Enforce migrations, bound queries, and transaction ownership for persistence code
|
|
104
176
|
paths:
|
|
105
177
|
- '**/*.ts'
|
|
106
178
|
---
|
|
107
179
|
|
|
108
|
-
#
|
|
180
|
+
# Persistence standards
|
|
109
181
|
|
|
110
|
-
##
|
|
182
|
+
## Schema changes
|
|
111
183
|
|
|
112
|
-
-
|
|
113
|
-
-
|
|
114
|
-
|
|
184
|
+
- Express every schema change as a migration file committed to version control.
|
|
185
|
+
- Never edit a migration that has run in a shared environment. Add a new one.
|
|
186
|
+
|
|
187
|
+
## Query construction
|
|
188
|
+
|
|
189
|
+
- Pass every runtime value as a bound parameter.
|
|
190
|
+
- Map a table name or sort direction through an allow-list, since neither can be bound.
|
|
115
191
|
```
|
|
116
192
|
|
|
117
193
|
### Incorrect
|
|
118
194
|
|
|
195
|
+
A vague description, legacy Cursor keys, and a paragraph of reasoning in place of directives.
|
|
196
|
+
|
|
119
197
|
```markdown
|
|
120
198
|
---
|
|
121
199
|
description: Naming
|
|
@@ -13,6 +13,7 @@ Read these files in parallel:
|
|
|
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
15
|
- `${CLAUDE_SKILL_DIR}/references/skill-disclosure.md`: where each reference is named, the contents block, the trigger and guard that stay in the body, and what moves to `references/`
|
|
16
|
+
- `${CLAUDE_SKILL_DIR}/references/skill-frontmatter.md`: the frontmatter fields, their limits, and which keys an upload accepts
|
|
16
17
|
|
|
17
18
|
### Writing standards
|
|
18
19
|
|
|
@@ -5,22 +5,30 @@ description: Keeping a skill body and its references under the ceiling, what mov
|
|
|
5
5
|
|
|
6
6
|
# Skill disclosure reference
|
|
7
7
|
|
|
8
|
+
Checked against the [skill authoring best practices](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices) page on `2026-10-18`.
|
|
9
|
+
|
|
8
10
|
Applies to the size and split of every `SKILL.md` and every file under a skill's `references/`.
|
|
9
11
|
|
|
10
12
|
## Rules
|
|
11
13
|
|
|
12
14
|
- 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.
|
|
15
|
+
- Treat the 300 as canon's own choice, stricter than the 500 lines Anthropic sets for a `SKILL.md`.
|
|
13
16
|
- Look at a body once it passes 150 lines. That number prompts a look and gates nothing.
|
|
14
17
|
- Move a catalog, a table of cases, or a format spec running past roughly 15 lines to `references/` at any body length.
|
|
15
18
|
- 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
19
|
|
|
17
20
|
### Moving a step
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
Past the ceiling, move a whole step to a reference, preferring a step a named branch skips.
|
|
23
|
+
|
|
24
|
+
- 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
|
|
25
|
+
- Name every file under `references/` in the body at the point a session reads it, since an unnamed reference is never loaded
|
|
21
26
|
|
|
22
27
|
### Contents, triggers, and citations
|
|
23
28
|
|
|
29
|
+
A reference is read from the top, and only when the body sends a session to it.
|
|
30
|
+
|
|
24
31
|
- 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
32
|
- 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.
|
|
33
|
+
- Keep references one level deep from `SKILL.md`. A file linked from a reference gets a partial read.
|
|
26
34
|
- 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.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Skill frontmatter reference
|
|
3
|
+
description: The frontmatter fields a skill carries, their limits, and which keys a claude.ai upload accepts
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill frontmatter reference
|
|
7
|
+
|
|
8
|
+
Checked against the [Claude Code skills](https://code.claude.com/docs/en/skills) and [skill authoring best practices](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices) pages on `2026-10-18`.
|
|
9
|
+
|
|
10
|
+
## Fields
|
|
11
|
+
|
|
12
|
+
- **`name`** (required): kebab-case, matches folder name, no spaces or capitals, and at most 64 characters
|
|
13
|
+
- **Reserved words**: an upload to claude.ai or the API rejects `anthropic` and `claude` in a name, and Claude Code does not.
|
|
14
|
+
- **`description`** (required): what it does + when to use it, under 1024 chars, no XML tags. That is the portable maximum.
|
|
15
|
+
- **Listing cap**: Claude Code truncates `description` plus `when_to_use` at 1,536 characters in its skill listing, so put the key use case first.
|
|
16
|
+
- **`disable-model-invocation: true`**: Claude will not auto-trigger, and the `Skill` tool also refuses the operator's request made in words. Set it only on a skill run by slash command alone.
|
|
17
|
+
- **`allowed-tools`**: tools Claude can use without asking permission during the turn that invokes the skill, cleared at the next message. It grants and never limits the tool set.
|
|
18
|
+
- **`metadata`**: optional key-value pairs (`author`, `version`, `mcp-server`)
|
|
19
|
+
- **`metadata.family`** (required under `claude/skills/`): the skill map group, as one key from `families` in `canon claude skills list --json`. A skill under `.claude/skills/` takes none.
|
|
20
|
+
|
|
21
|
+
Outside Claude Code, only `name`, `description`, `license`, `compatibility`, `metadata`, and `allowed-tools` pass an upload, and any other key is a hard error. Keys nested under `metadata` pass, which is why `family` nests there.
|
|
22
|
+
|
|
23
|
+
### Optional fields
|
|
24
|
+
|
|
25
|
+
Claude Code documents more optional fields. The skills page holds the detail, so this table keeps one line each.
|
|
26
|
+
|
|
27
|
+
| Field | Effect |
|
|
28
|
+
| -------------------------- | ----------------------------------------- |
|
|
29
|
+
| `when_to_use` | Trigger phrases appended to `description` |
|
|
30
|
+
| `argument-hint` | Autocomplete hint for arguments |
|
|
31
|
+
| `arguments` | Named positional arguments |
|
|
32
|
+
| `user-invocable` | `false` leaves it to Claude alone |
|
|
33
|
+
| `disallowed-tools` | Tools removed while it is active |
|
|
34
|
+
| `model`, `effort` | Override both for the turn |
|
|
35
|
+
| `context` | `fork` runs it in a subagent |
|
|
36
|
+
| `agent` | Subagent type for `context: fork` |
|
|
37
|
+
| `background` | Whether a fork runs in the background |
|
|
38
|
+
| `hooks` | Hooks registered for the session |
|
|
39
|
+
| `paths` | Globs limiting automatic loading |
|
|
40
|
+
| `shell` | `bash` or `powershell` |
|
|
41
|
+
| `license`, `compatibility` | Accepted, never acted on |
|
|
42
|
+
|
|
43
|
+
A skill wanting only the no-auto-trigger effect writes `Do NOT auto-trigger` in its description rather than setting `disable-model-invocation`.
|
|
@@ -32,20 +32,23 @@ A body failing any of these is non-conforming even when every path resolves in t
|
|
|
32
32
|
|
|
33
33
|
Know which root a file lives under before referencing it.
|
|
34
34
|
|
|
35
|
-
- Bundled skill assets (`references/`, `scripts/`, `assets/`) resolve against the skill's own directory
|
|
35
|
+
- Bundled skill assets (`references/`, `scripts/`, `assets/`) resolve against the skill's own directory, so reference them with `${CLAUDE_SKILL_DIR}/<path>`
|
|
36
|
+
- Never use a bare relative path for one, which resolves against the session cwd and fails when a plugin skill runs from another project
|
|
36
37
|
- Installed shared docs (`.claude/rules/`, `canon/context/`) resolve against the target project cwd, where install placed them. Reference them by that path.
|
|
37
|
-
- Do not hand-copy another skill's reference
|
|
38
|
+
- Do not hand-copy another skill's reference. A skill that must carry its own copy generates it from the single source and reads it through `${CLAUDE_SKILL_DIR}`.
|
|
38
39
|
|
|
39
40
|
## Citing another skill's reference
|
|
40
41
|
|
|
41
42
|
A reference shared across skills lives in the `references/` of the skill that owns it, so a body cites it by the sibling path.
|
|
42
43
|
|
|
43
|
-
- Cite another skill's reference as `${CLAUDE_SKILL_DIR}/../<skill>/references/<name>.md
|
|
44
|
-
- State the path once per body, at the site that reads the reference. A later mention
|
|
44
|
+
- Cite another skill's reference as `${CLAUDE_SKILL_DIR}/../<skill>/references/<name>.md`, naming the owner. The plugin ships the skills side by side, so the sibling path resolves in every install.
|
|
45
|
+
- State the path once per body, at the site that reads the reference. A later mention stays bare, since repeating the path at every mention is noise.
|
|
45
46
|
- 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
|
|
|
47
48
|
### Form and ownership
|
|
48
49
|
|
|
50
|
+
One variable expands reliably, and one owner holds each procedure.
|
|
51
|
+
|
|
49
52
|
- Use `${CLAUDE_SKILL_DIR}`, never a bare `../../` and never `${CLAUDE_PLUGIN_ROOT}`, since only the first expands before the body reaches the model.
|
|
50
53
|
- 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.
|
|
51
54
|
- 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.
|
|
@@ -31,9 +31,11 @@ A practice skill failing any of these is non-conforming even when every heading
|
|
|
31
31
|
|
|
32
32
|
## Closing sections
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Follow every concern group with `## Excuses and rebuttals`, `## Red flags`, and `## Before handing over`, in that order. Only a section naming what the skill delegates comes after.
|
|
35
|
+
|
|
35
36
|
- Spell each heading exactly. An H3, or a heading carrying more words such as `## Red flags that mean start over`, reads as missing.
|
|
36
|
-
- Write `## Excuses and rebuttals` as a two-column table pairing a reason a session gives to skip or shortcut the practice with the answer to it
|
|
37
|
+
- Write `## Excuses and rebuttals` as a two-column table pairing a reason a session gives to skip or shortcut the practice with the answer to it
|
|
38
|
+
- Never write a row rebutting an objection nobody raised, since that row is ceremony. Revisit when a table is observed failing to stop an excuse it names.
|
|
37
39
|
- Write `## Red flags` as bullets naming signs a session can observe in its own work mid-task, never a restatement of a rule above.
|
|
38
40
|
- Write `## Before handing over` as the exit checklist, each line a check against what the session produced.
|
|
39
41
|
|
|
@@ -47,6 +49,7 @@ A practice skill failing any of these is non-conforming even when every heading
|
|
|
47
49
|
## Which skills are practice skills
|
|
48
50
|
|
|
49
51
|
- `canon claude skills audit` keeps the list of practice skills and checks each listed one for the three closing sections and the ledger.
|
|
50
|
-
- It keeps a wider ledger list beside it,
|
|
52
|
+
- It keeps a wider ledger list beside it, adding the skills that teach a craft drawn from outside sources without a practice's closing shape
|
|
53
|
+
- A skill on the wider list alone owes the ledger and none of the three sections
|
|
51
54
|
- Never mark a skill as a practice skill in its own frontmatter, since a self-declared kind lets a skill exempt itself.
|
|
52
55
|
- Both lists name this toolkit's shipped skills alone, so a project's own practice skill takes this shape with no check behind it.
|
|
@@ -29,9 +29,11 @@ A requirement that leaves any of the three open is non-conforming regardless of
|
|
|
29
29
|
|
|
30
30
|
## Purpose
|
|
31
31
|
|
|
32
|
-
- Treat the file as the compressed statement of what the skill is for. A
|
|
32
|
+
- Treat the file as the compressed statement of what the skill is for. A body is procedural by design, so its purpose sits spread across its steps.
|
|
33
|
+
- A reader gets this file before opening the body, whether or not the skill's scope is contested
|
|
33
34
|
- Read it before editing the skill. When a change closes no gap the requirement states, change the requirement first or drop the change.
|
|
34
|
-
- Write the gaps from what the skill is for, then compare the body against them
|
|
35
|
+
- Write the gaps from what the skill is for, then compare the body against them
|
|
36
|
+
- A requirement derived from the body records the body's accidents as the requirement, and misinforms a reader who reads it in place of the body
|
|
35
37
|
|
|
36
38
|
## Content
|
|
37
39
|
|
|
@@ -5,6 +5,8 @@ description: Skill structure and authoring rules for Claude Code
|
|
|
5
5
|
|
|
6
6
|
# Claude skill reference
|
|
7
7
|
|
|
8
|
+
Checked against the [Claude Code skills](https://code.claude.com/docs/en/skills) and [skill authoring best practices](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices) pages on `2026-10-18`.
|
|
9
|
+
|
|
8
10
|
## Contents
|
|
9
11
|
|
|
10
12
|
- [Overview](#overview)
|
|
@@ -26,7 +28,7 @@ Skills give Claude Code domain-specific constraints and rules inline, so it can
|
|
|
26
28
|
|
|
27
29
|
## Scope
|
|
28
30
|
|
|
29
|
-
Governs a skill folder under `skills/` as one artifact
|
|
31
|
+
Governs a skill folder under `skills/` as one artifact, being `SKILL.md`, its siblings `REQUIREMENT.md` and `EVAL.md`, and the bundled reference, script, and asset folders beside them.
|
|
30
32
|
|
|
31
33
|
Does not govern:
|
|
32
34
|
|
|
@@ -37,7 +39,7 @@ Does not govern:
|
|
|
37
39
|
- **`rule.md`**: path-scoped coding rules, which load on a file match rather than on a request match
|
|
38
40
|
- **the `write-human` skill**: voice, rhythm, and sentence construction in a skill body
|
|
39
41
|
- **`markdown.md`**: punctuation, formatting, and word choice in a skill body
|
|
40
|
-
- **`slug.md`**: the transform from a branch name to a slug
|
|
42
|
+
- **`slug.md`**: the transform from a branch name to a filename slug
|
|
41
43
|
- **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
44
|
|
|
43
45
|
## Changing a skill
|
|
@@ -51,11 +53,13 @@ Answer all four before editing, and carry the answers into wherever the change i
|
|
|
51
53
|
|
|
52
54
|
## Whether a rule belongs beside the skill
|
|
53
55
|
|
|
54
|
-
A skill fires when a session invokes it or its description matches the request. A path-scoped rule fires when a session reads or writes a file matching its glob, with no
|
|
56
|
+
A skill fires when a session invokes it or its description matches the request. A path-scoped rule fires when a session reads or writes a file matching its glob, with no session decision. The rule is the floor and the skill is the depth.
|
|
55
57
|
|
|
56
|
-
Run the two-part test over
|
|
58
|
+
- Run the two-part test over the body before calling the skill done. Does the invariant fire when a specific path is edited, and does violating it ship silently?
|
|
59
|
+
- An invariant passing both halves moves to a rule, since a session that never invoked the skill still edits that path. It stays here when this skill creates the file the rule globs.
|
|
60
|
+
- An invariant failing either half stays here, which is most of a body
|
|
57
61
|
|
|
58
|
-
Write that rule to the shape `rule.md` sets
|
|
62
|
+
Write that rule to the shape `rule.md` sets, keeping one copy of each invariant. A skill that only edits existing files points at the rule.
|
|
59
63
|
|
|
60
64
|
## Skill types
|
|
61
65
|
|
|
@@ -89,87 +93,102 @@ allowed-tools: <tools required>
|
|
|
89
93
|
|
|
90
94
|
## Structure
|
|
91
95
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
-
|
|
96
|
+
A skill is a folder named in kebab-case. It holds `SKILL.md` and `REQUIREMENT.md`, both required, and maybe `EVAL.md`, `scripts/`, `references/`, and `assets/`.
|
|
97
|
+
|
|
98
|
+
- Create a new skill with its `REQUIREMENT.md` beside it, even where nobody contests its scope, since an absence reads as a gap rather than as a verdict
|
|
99
|
+
- Name a file sitting directly in the skill folder in capitals and a bundled folder in lowercase, so the parts a reader opens differ from the ones a skill loads
|
|
95
100
|
- `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
101
|
|
|
97
102
|
### Folder and file rules
|
|
98
103
|
|
|
104
|
+
The loader reads the folder name as the skill name, so the name follows the same casing everywhere.
|
|
105
|
+
|
|
99
106
|
- `SKILL.md` must start with YAML frontmatter between `---` delimiters
|
|
100
107
|
- No `README.md` inside the skill folder
|
|
101
108
|
- No spaces, capitals, or underscores in folder or skill name
|
|
102
109
|
|
|
103
110
|
## Frontmatter
|
|
104
111
|
|
|
105
|
-
-
|
|
106
|
-
- **`description`** (required): what it does + when to use it, under 1024 chars, no XML tags
|
|
107
|
-
- **`disable-model-invocation: true`**: Claude will not auto-trigger, and the `Skill` tool also refuses the operator's own request made in words. Set it only on a skill run by slash command alone. A skill wanting just the first effect writes `Do NOT auto-trigger` in its description.
|
|
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.
|
|
112
|
+
Read `skill-frontmatter.md` for the required and optional fields, their limits, and which keys an upload accepts.
|
|
111
113
|
|
|
112
114
|
## Description
|
|
113
115
|
|
|
114
116
|
- Structure: `[What it does] + [When to use it] + [Key trigger phrases]`, quoting phrases users would say
|
|
115
117
|
- Be specific, not vague. Claude routes based on this field alone.
|
|
116
|
-
-
|
|
118
|
+
- Write in the third person, since the description is injected into the system prompt. Write "Reviews code" over "I review code".
|
|
119
|
+
- Add negative triggers if skill is over-triggering: `Do NOT use for X`. That form is canon's own, and Anthropic's pages do not mention it.
|
|
117
120
|
|
|
118
121
|
## Body
|
|
119
122
|
|
|
120
123
|
### Rule content and scope
|
|
121
124
|
|
|
125
|
+
A body holds behavioral rules and pointers to reference docs, front-loading the critical ones. Narrative about what files are or how the system works belongs in `docs/`.
|
|
126
|
+
|
|
122
127
|
- Use imperative voice throughout, and sentence case for every heading
|
|
123
|
-
-
|
|
124
|
-
-
|
|
125
|
-
-
|
|
128
|
+
- State rules, not inventories. Reference docs for lists that change.
|
|
129
|
+
- Phrase a rule as a ban on the forbidden shape rather than an enumeration of allowed options, so it stays stable as categories change
|
|
130
|
+
- When referencing project files, include "from the project root" in the read instruction
|
|
131
|
+
- Run independent operations, such as file reads and shell commands, in parallel to reduce latency
|
|
126
132
|
|
|
127
|
-
|
|
133
|
+
### Current rule and grouping
|
|
134
|
+
|
|
135
|
+
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, and a date inside a fence or a code span is example data and stays.
|
|
128
136
|
|
|
129
137
|
- Cut any rule that resists crisp one-line phrasing. Vague guidance is worse than none.
|
|
130
|
-
-
|
|
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.
|
|
138
|
+
- Group bullets under H2 headings by concern, keeping dos and don'ts together rather than in flat rules and constraints sections
|
|
132
139
|
- One actionable constraint per bullet. Prefer the `X over Y` form for preferences.
|
|
133
140
|
|
|
134
|
-
|
|
141
|
+
### Examples and density
|
|
142
|
+
|
|
143
|
+
Every statement in a body costs a read on each invocation.
|
|
135
144
|
|
|
136
|
-
- Do not include code examples unless a one to three line inline snippet captures a pattern the model cannot infer
|
|
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
|
|
145
|
+
- Do not include code examples unless a one to three line inline snippet captures a pattern the model cannot infer
|
|
146
|
+
- 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
|
|
147
|
+
- Revisit when a run shows the model ignoring a principle named only as a handle
|
|
138
148
|
|
|
139
149
|
### Progressive disclosure
|
|
140
150
|
|
|
141
151
|
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`.
|
|
142
152
|
|
|
143
|
-
### Reading and running commands
|
|
144
|
-
|
|
145
|
-
- When referencing project files, include "from the project root" in the read instruction
|
|
146
|
-
- When executing multiple independent operations (file reads, shell commands), run them in parallel to reduce latency
|
|
147
|
-
|
|
148
153
|
### Anti-patterns to avoid
|
|
149
154
|
|
|
150
|
-
|
|
155
|
+
Avoid flags that dispatch between alternate flows, since the model misreads them and runs the vanilla path. Dry-run-style toggles are fine, and an alternate flow takes a separate skill or two skills invoked in sequence.
|
|
156
|
+
|
|
151
157
|
- When a skill should fire from multiple callers, rely on description matching with strong trigger phrases. Do not hardcode `Skill` calls in sibling skills that could trigger it naturally.
|
|
152
|
-
- Before collapsing a manual multi-step flow into a skill, ask what the manual pauses do
|
|
158
|
+
- Before collapsing a manual multi-step flow into a skill, ask what the manual pauses do
|
|
159
|
+
- Where a pause carries external timing, error-surfacing, or judgment weight, prefer explicit per-step confirmation
|
|
160
|
+
|
|
161
|
+
### Output paths
|
|
162
|
+
|
|
163
|
+
A success line emits the full relative path from the project root (`<dir>/<file>`) for any file written, updated, or deleted, since a bare filename names a file the reader cannot open. The `## Output` section of the project's instruction file sets the form that path takes, so the body states which path and leaves the form to that section.
|
|
164
|
+
|
|
165
|
+
### Where output lands
|
|
166
|
+
|
|
167
|
+
Before writing, decide whether the output is a deliverable, which lands among the project's tracked files, or a session record. A session record lands under `.canon/` in the named subfolder for its kind, never in a folder the body invents.
|
|
153
168
|
|
|
154
|
-
|
|
169
|
+
- Kinds: `tasks/`, `plans/`, `review/`, `groundwork/`, `intake/`, `proposals/`, `diagrams/`, `teach/`, `ready/`, `feedback/`, `picks/`, `evidence/`, `transcripts/`, `walkthroughs/`
|
|
170
|
+
- `tmp/` takes scratch nothing else claims
|
|
171
|
+
- A `review/` writer names its file `<kind>-<slug>.md` and writes it flat
|
|
172
|
+
- An `evidence/` folder takes the next two-digit ordinal as `<nn>-<slug>/`, numbered in the order the folders first appeared
|
|
155
173
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
-
|
|
174
|
+
### Templates, input, and tuning
|
|
175
|
+
|
|
176
|
+
Codify a skill's posted or generated output as a fenced template, and keep the body consistent with every capability the frontmatter description names.
|
|
177
|
+
|
|
178
|
+
- When a skill gathers input or pre-seeds a template, attach a proposed default derived from project context to every question. Accept "use defaults" as a bulk-confirm.
|
|
179
|
+
- Separate correctness axes (routing, sourcing, escalation, decline) from shape axes (line count, formatting, variant sprawl) when tuning a skill
|
|
180
|
+
- Tighten only on correctness regressions, never turning a soft cap hard for aesthetic drift
|
|
161
181
|
|
|
162
182
|
## Scripts
|
|
163
183
|
|
|
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
|
|
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
|
|
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
|
|
168
|
-
- Use XML tags in script output for reliable parsing: `<SECTION>content</SECTION>`
|
|
184
|
+
Use `scripts/` for operations that must be deterministic or repetitive. First ask whether a CLI verb the project already has does the job, since a verb is installed and tested and a script beside it is a second copy that drifts.
|
|
169
185
|
|
|
170
|
-
|
|
186
|
+
- 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.
|
|
187
|
+
- 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.
|
|
188
|
+
- Use XML tags in script output for parsing: `<SECTION>content</SECTION>`
|
|
189
|
+
- Guard a git or shell command a body runs inline with `2>/dev/null || echo "FALLBACK"`. A TypeScript script uses try and catch instead.
|
|
171
190
|
|
|
172
|
-
|
|
191
|
+
The TypeScript rule governs a new script, so bash kept by decision is no breach and is not ported unasked. Examples are `review-ui`'s `scripts/pw.sh` as glue and the shell scripts the web tooling stacks ship, whose port was deferred.
|
|
173
192
|
|
|
174
193
|
## Invocation
|
|
175
194
|
|
|
@@ -180,10 +199,14 @@ Keeping a body and its references under the ceiling, what moves to `references/`
|
|
|
180
199
|
|
|
181
200
|
### Correct
|
|
182
201
|
|
|
202
|
+
Each line names its reason after the `#`.
|
|
203
|
+
|
|
183
204
|
- `description: Reviews code for bugs and clarity. Use when asked to "review this" or "check the PR".` # names the action, then the trigger phrases
|
|
184
205
|
- `Read ${CLAUDE_SKILL_DIR}/references/post.md on reaching this step.` # a moved step keeps its heading and one load line
|
|
185
206
|
|
|
186
207
|
### Incorrect
|
|
187
208
|
|
|
209
|
+
Each line names its fault after the `#`.
|
|
210
|
+
|
|
188
211
|
- `description: Handles all code tasks in scripts/, src/, and lib/, and any file ending in .ts .js .py .sh.` # path-focused and keyword-stuffed
|
|
189
212
|
- `A good review checks bugs, performance, security, style, naming, coverage, docs, and SOLID...` # dumps everything inline instead of citing a standard
|
|
@@ -70,8 +70,7 @@ Restate each pick in one line, then continue the work.
|
|
|
70
70
|
|
|
71
71
|
A pick that changes a written artifact goes into it under the rule its own standard sets, and a pick that settles nothing written stays in the session.
|
|
72
72
|
|
|
73
|
-
-
|
|
74
|
-
- Leave the `- Answer:` slot blank, since the standard bars a session from filling it, and the blank resolves to the rewritten suggestion
|
|
73
|
+
- Record an answer to an open plan question per `### Overrides and settled questions` in `${CLAUDE_SKILL_DIR}/../plan-feature/references/plan.md`
|
|
75
74
|
|
|
76
75
|
Output after the answers land:
|
|
77
76
|
|