@erclx/canon 4.78.0 → 4.80.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 +9 -9
- package/claude/.claude-plugin/plugin.json +1 -1
- package/claude/skills/canon-operator/SKILL.md +1 -1
- package/claude/skills/canon-rollout/SKILL.md +1 -1
- package/claude/skills/create-standard/SKILL.md +1 -1
- package/claude/skills/design-extract/REQUIREMENT.md +4 -4
- package/claude/skills/design-extract/SKILL.md +11 -11
- package/claude/skills/docs-fold/SKILL.md +14 -14
- package/claude/skills/docs-fold/references/anchor-sweep.md +1 -1
- package/claude/skills/docs-fold/references/wireframe-sweep.md +4 -4
- package/claude/skills/draft-context/REQUIREMENT.md +6 -6
- package/claude/skills/draft-context/SKILL.md +8 -6
- package/claude/skills/draft-diagram/SKILL.md +5 -5
- package/claude/skills/draft-identity/SKILL.md +3 -3
- package/claude/skills/draft-readme/REQUIREMENT.md +1 -1
- package/claude/skills/draft-screencast/SKILL.md +1 -1
- package/claude/skills/draft-wireframes/REQUIREMENT.md +7 -7
- package/claude/skills/draft-wireframes/SKILL.md +7 -5
- package/claude/skills/git-pr/SKILL.md +3 -3
- package/claude/skills/git-pr/references/labels.md +1 -1
- package/claude/skills/memory-capture/REQUIREMENT.md +1 -1
- package/claude/skills/memory-capture/SKILL.md +6 -6
- package/claude/skills/memory-review/SKILL.md +1 -1
- package/claude/skills/migration-claude-md/REQUIREMENT.md +3 -3
- package/claude/skills/migration-claude-md/SKILL.md +7 -5
- package/claude/skills/migration-context/REQUIREMENT.md +3 -3
- package/claude/skills/migration-context/SKILL.md +11 -9
- package/claude/skills/plan-feature/SKILL.md +4 -4
- package/claude/skills/plan-groundwork/SKILL.md +2 -2
- package/claude/skills/plan-intake/SKILL.md +2 -2
- package/claude/skills/project-commands/SKILL.md +2 -2
- package/claude/skills/review-branch/SKILL.md +3 -3
- package/claude/skills/review-pr/SKILL.md +2 -2
- package/claude/skills/role-orchestrator/SKILL.md +1 -1
- package/claude/skills/role-planner/SKILL.md +1 -1
- package/claude/skills/session-relay/REQUIREMENT.md +1 -1
- package/claude/skills/session-resume/SKILL.md +1 -1
- package/claude/skills/setup-gov/SKILL.md +1 -1
- package/claude/skills/setup-init/SKILL.md +1 -1
- package/claude/skills/teach-workspace/references/promotion.md +5 -5
- package/claude/skills/ux-audit/SKILL.md +5 -5
- package/claude/skills/ux-measure/SKILL.md +1 -1
- package/docs/agents/audits.md +2 -2
- package/docs/agents/commands.md +7 -2
- package/docs/agents/context-audit-checks.md +3 -3
- package/docs/agents/context-audit.md +2 -2
- package/docs/agents/counts.md +3 -3
- package/docs/agents/design-board.md +3 -3
- package/docs/agents/docs.md +3 -3
- package/docs/agents/indexes.md +1 -1
- package/docs/agents/install-and-sync.md +4 -4
- package/docs/agents/label-coverage.md +1 -1
- package/docs/agents/review-classification.md +1 -1
- package/docs/agents/routing.md +2 -2
- package/docs/agents/rule-citations.md +1 -1
- package/docs/agents/sandbox.md +1 -1
- package/docs/agents/scripting.md +1 -1
- package/docs/agents/skills-audit.md +1 -1
- package/docs/agents/skills-reach.md +4 -4
- package/docs/target-projects.md +11 -11
- package/docs/workflow/ai-workflow.md +15 -13
- package/docs/workflow/operating-model.md +2 -2
- package/docs/workflow/visual-design-workflow.md +8 -8
- package/governance/rules/claude/510-context.md +3 -2
- package/governance/rules/claude/520-wireframes.md +3 -2
- package/governance/rules/claude/530-requirements.md +2 -1
- package/governance/rules/claude/540-architecture.md +2 -1
- package/governance/rules/claude/550-design.md +2 -1
- package/governance/rules/core/025-indexes.md +1 -1
- package/governance/rules/core/045-memory.md +1 -1
- package/package.json +1 -1
- package/scripts/core/check-ignore-parity.sh +1 -1
- package/scripts/core/check-seed-independence.sh +5 -2
- package/scripts/core/install-check.sh +1 -1
- package/scripts/core/list-seed-roots.sh +3 -3
- package/scripts/core/regen-hero.sh +1 -1
- package/scripts/docs/list.sh +3 -3
- package/scripts/lib/sandbox-git.sh +1 -1
- package/scripts/lib/tooling.sh +6 -4
- package/snippets/claude/figma-steps.md +1 -1
- package/src/audits/baseline.ts +17 -5
- package/src/audits/catalog.ts +2 -2
- package/src/autoship/paths.ts +1 -1
- package/src/claude/cases/authoring.ts +2 -2
- package/src/claude/cases/setup.ts +1 -1
- package/src/claude/routing.ts +1 -1
- package/src/claude/seeds-list.ts +1 -1
- package/src/claude/seeds.ts +62 -28
- package/src/claude/skills-reach.ts +3 -3
- package/src/commands/claude.ts +1 -1
- package/src/commands/context.ts +8 -8
- package/src/commands/design.ts +1 -1
- package/src/commands/gov.ts +1 -1
- package/src/commands/migrate.ts +182 -1
- package/src/commands/sync.ts +1 -1
- package/src/context/audit.ts +1 -1
- package/src/context/citations.ts +7 -5
- package/src/context/folders.ts +2 -2
- package/src/counts/scan.ts +4 -4
- package/src/design/board.ts +5 -5
- package/src/design/components.ts +2 -2
- package/src/design/css.ts +1 -1
- package/src/design/document.ts +1 -1
- package/src/design/regen.ts +1 -1
- package/src/design/render.ts +1 -1
- package/src/design/tokens.ts +2 -2
- package/src/docs/read.ts +9 -3
- package/src/gate/measures.ts +14 -11
- package/src/gate/stages.ts +4 -4
- package/src/labels/map.ts +19 -5
- package/src/legacy-path.ts +15 -0
- package/src/markdown/scan.ts +1 -1
- package/src/migrate/plan.ts +1 -0
- package/src/migrate/surface-roots.ts +457 -0
- package/src/record-root.ts +6 -4
- package/src/sandbox/census.ts +1 -1
- package/src/shipped/references.ts +3 -3
- package/src/surface-root.ts +33 -8
- package/src/sync/layout.ts +10 -6
- package/src/sync/reverse.ts +1 -1
- package/src/sync/stamp.ts +22 -17
- package/src/targets/sweep.ts +6 -2
- package/src/tooling/inject.ts +5 -3
- package/src/tooling/scan.ts +4 -1
- package/standards/architecture.md +4 -4
- package/standards/context.md +7 -7
- package/standards/design.md +3 -3
- package/standards/diagrams.md +6 -6
- package/standards/index.md +5 -5
- package/standards/markdown.md +2 -2
- package/standards/publish.md +3 -3
- package/standards/readme.md +1 -1
- package/standards/requirements.md +4 -4
- package/standards/skill.md +2 -2
- package/standards/tasks.md +1 -1
- package/standards/wiki.md +1 -1
- package/standards/wireframes.md +8 -8
- package/tooling/astro/reference.md +3 -3
- package/tooling/base/reference.md +3 -3
- package/tooling/claude/reference.md +7 -3
- package/tooling/claude/seeds/CLAUDE.md +9 -9
- package/tooling/nextjs/reference.md +2 -2
- package/tooling/python/reference.md +1 -1
- package/tooling/vite-react/reference.md +2 -2
- package/tooling/web/reference.md +2 -2
- /package/tooling/base/seeds/{.claude → canon}/context/ci.md +0 -0
- /package/tooling/base/seeds/{.claude → canon}/context/development.md +0 -0
- /package/tooling/base/seeds/{.claude → canon}/context/index.md +0 -0
- /package/tooling/claude/seeds/{.claude → canon}/ARCHITECTURE.md +0 -0
- /package/tooling/claude/seeds/{.claude → canon}/DESIGN.md +0 -0
- /package/tooling/claude/seeds/{.claude → canon}/REQUIREMENTS.md +0 -0
- /package/tooling/claude/seeds/{.claude → canon}/wireframes/index.md +0 -0
|
@@ -11,7 +11,7 @@ Read these files in parallel:
|
|
|
11
11
|
|
|
12
12
|
- `${CLAUDE_SKILL_DIR}/../../standards/branch.md`: branch format, valid types, and constraints
|
|
13
13
|
- `${CLAUDE_SKILL_DIR}/../../standards/pr.md`: structure, rules, and banned phrases
|
|
14
|
-
- `${CLAUDE_SKILL_DIR}/references/labels.md`: label map format, matching, and the missing-label warning. Skip when the project has no `.claude/canon/pr-labels.toml`.
|
|
14
|
+
- `${CLAUDE_SKILL_DIR}/references/labels.md`: label map format, matching, and the missing-label warning. Skip when the project has no `canon/config/pr-labels.toml` and no `.claude/canon/pr-labels.toml`.
|
|
15
15
|
- `${CLAUDE_SKILL_DIR}/../../standards/markdown.md`: banned words, punctuation, and formatting for all generated text
|
|
16
16
|
- The `write-human` skill: voice, rhythm, and sentence construction for all generated text
|
|
17
17
|
- `${CLAUDE_SKILL_DIR}/../../standards/versioning.md`: phase label vs semver discipline
|
|
@@ -119,7 +119,7 @@ A `reason` of `no-map` is the answer that the project declared no map, which ear
|
|
|
119
119
|
|
|
120
120
|
Every other `reason` is a map or a range the verb could not read, which is `unreadable-map`, `no-domains`, `no-base`, and `unreadable-changes`, plus `bad-base` for a ref this skill resolved wrongly. Take the fallback below and warn beside the result line, naming the reason. A map with a typo in it still has rows a prefix match can reach, and reading the refusal as an absence would open the pull request with no labels and nothing said, which is the surface merging bare that the verb exists to name.
|
|
121
121
|
|
|
122
|
-
The fallback is reading `.claude/canon/pr-labels.toml` and matching it against the name-only diff per `${CLAUDE_SKILL_DIR}/references/labels.md`. It also covers no record coming back at all, which is an installed `canon` predating the verb, since a skill reaches a target the moment it merges while the CLI reaches one only when a release publishes. The fallback labels correctly and reports no uncovered path, which is the half only the verb carries.
|
|
122
|
+
The fallback is reading `canon/config/pr-labels.toml`, or `.claude/canon/pr-labels.toml` when the project has not moved, and matching it against the name-only diff per `${CLAUDE_SKILL_DIR}/references/labels.md`. It also covers no record coming back at all, which is an installed `canon` predating the verb, since a skill reaches a target the moment it merges while the CLI reaches one only when a release publishes. Naming both spellings matters exactly here: the binary old enough to need this fallback is the same binary that may predate the move, so the project's map can still sit at the older path. The fallback labels correctly and reports no uncovered path, which is the half only the verb carries.
|
|
123
123
|
|
|
124
124
|
Leave `pr_labels` empty when no map resolves or no prefix matches, which skips the labelling command rather than running it against nothing.
|
|
125
125
|
|
|
@@ -223,7 +223,7 @@ Respond with one line, using the `url` the final command printed:
|
|
|
223
223
|
|
|
224
224
|
Add a line for each `uncovered` path the labels step reported, naming the path and the map it belongs in:
|
|
225
225
|
|
|
226
|
-
`⚠️ No label covers <path>. Add a row to
|
|
226
|
+
`⚠️ No label covers <path>. Add a row to canon/config/pr-labels.toml or a [declined] entry.`
|
|
227
227
|
|
|
228
228
|
Add a further line only when the labelling command printed its warning, quoting the label `gh` refused:
|
|
229
229
|
|
|
@@ -17,7 +17,7 @@ Does not govern:
|
|
|
17
17
|
|
|
18
18
|
## Map format
|
|
19
19
|
|
|
20
|
-
The map lives at
|
|
20
|
+
The map lives at `canon/config/pr-labels.toml` in the project root, or `.claude/canon/pr-labels.toml` for a project that has not moved. Each key under `[domains]` is a label name and its value is the list of path prefixes that earn it.
|
|
21
21
|
|
|
22
22
|
```toml
|
|
23
23
|
[domains]
|
|
@@ -17,7 +17,7 @@ The threshold is what the remaining folder lives or dies on. A first-occurrence
|
|
|
17
17
|
|
|
18
18
|
- Resolve every read and write at the main worktree root, so parallel worktrees write one folder
|
|
19
19
|
- Classify each candidate as feedback, project, user, or reference before routing or writing
|
|
20
|
-
- Route a project candidate whose subject names an entry in
|
|
20
|
+
- Route a project candidate whose subject names an entry in `canon/context/index.md` to that entry, and hand it off as a file rather than an edit
|
|
21
21
|
- Keep a candidate that matches no entry, or two entries with no clear owner, as a memory file
|
|
22
22
|
- Apply the save threshold, firing feedback only on an explicit correction or a pattern that repeated twice
|
|
23
23
|
- Grep the folder for an existing file on the topic and update it in place rather than adding a second
|
|
@@ -26,7 +26,7 @@ Read in parallel, skipping any that do not exist:
|
|
|
26
26
|
- `${CLAUDE_SKILL_DIR}/../../standards/memory.md`: the filename, frontmatter, body shape, and lifecycle every entry follows
|
|
27
27
|
- `CLAUDE.md`: the project's write location and any rule it states over the folder
|
|
28
28
|
- `.canon/memory/index.md`: existing index, to avoid duplicates
|
|
29
|
-
-
|
|
29
|
+
- `canon/context/index.md`: the domain catalog Step 3 routes against, read under `.claude/` instead in a project the surface move has not reached
|
|
30
30
|
- `${CLAUDE_SKILL_DIR}/../../standards/markdown.md`: banned words, punctuation, and formatting applied to memory file bodies
|
|
31
31
|
- The `write-human` skill: voice, rhythm, and sentence construction applied to memory file bodies
|
|
32
32
|
|
|
@@ -40,16 +40,16 @@ Scan the whole session rather than its last exchange. A rule the user stated ear
|
|
|
40
40
|
|
|
41
41
|
Only a **project** candidate is routable. Feedback, user, and reference describe how to work or who to ask rather than how a domain behaves, and no context entry owns them.
|
|
42
42
|
|
|
43
|
-
For each project candidate, match its subject against
|
|
43
|
+
For each project candidate, match its subject against `canon/context/index.md`. The test is a named entry, not a judgment about fit: the fact names a surface that already has an entry in the catalog. Route it to that entry.
|
|
44
44
|
|
|
45
45
|
Fail closed. A project candidate matching no entry stays a memory file, and so does one matching two entries where neither is clearly the owner. The residue is what the folder is for, and a fact filed under the wrong entry is worse than one in memory because a context entry is a surface sessions trust.
|
|
46
46
|
|
|
47
|
-
Do not edit a context entry here. `docs-fold` owns those edits and folds the routed facts in on its own pass, or two skills write one file at the same step. Write each routed fact to `.canon/tmp/memory-routing/<slug>.md` at the main worktree root instead, appending when the file exists. Name the heading with the entry's own path from
|
|
47
|
+
Do not edit a context entry here. `docs-fold` owns those edits and folds the routed facts in on its own pass, or two skills write one file at the same step. Write each routed fact to `.canon/tmp/memory-routing/<slug>.md` at the main worktree root instead, appending when the file exists. Name the heading with the entry's own path from `canon/context/index.md`, flat or the nested `index.md`, since that heading is what tells `docs-fold`'s routed-facts fold which file to open. An append is a whole-file operation the shell does directly, so send it as a plain single `Bash` command carrying a heredoc:
|
|
48
48
|
|
|
49
49
|
A flat domain takes:
|
|
50
50
|
|
|
51
51
|
```markdown
|
|
52
|
-
##
|
|
52
|
+
## canon/context/<domain>.md
|
|
53
53
|
|
|
54
54
|
<the fact in one or two sentences, stated as a fact about the domain rather than as a session narrative>
|
|
55
55
|
```
|
|
@@ -57,7 +57,7 @@ A flat domain takes:
|
|
|
57
57
|
A domain split into a folder takes its own generated index instead:
|
|
58
58
|
|
|
59
59
|
```markdown
|
|
60
|
-
##
|
|
60
|
+
## canon/context/<domain>/index.md
|
|
61
61
|
|
|
62
62
|
<the fact in one or two sentences, stated as a fact about the domain rather than as a session narrative>
|
|
63
63
|
```
|
|
@@ -90,7 +90,7 @@ Run `canon records validate memory` when the writes are done and fix what it nam
|
|
|
90
90
|
|
|
91
91
|
Respond with one line per fact routed, written, or updated:
|
|
92
92
|
|
|
93
|
-
- `➡️ Routed: <fact subject> →
|
|
93
|
+
- `➡️ Routed: <fact subject> → canon/context/<domain>.md` for a flat entry, or `→ canon/context/<domain>/index.md` for a nested one, matching the heading the routing file carries
|
|
94
94
|
- `✅ Wrote: .canon/memory/<file> (<type>)`
|
|
95
95
|
- `✏️ Updated: .canon/memory/<file> (<type>)`
|
|
96
96
|
|
|
@@ -65,7 +65,7 @@ For each in-scope entry (see Scope), pick one action:
|
|
|
65
65
|
- **Promote to `CLAUDE.md`**: the rule is cross-domain behavior or a design principle applied across the whole project.
|
|
66
66
|
- **Promote to a skill body**: the rule fires only when editing a specific path-scoped domain. Name the target skill.
|
|
67
67
|
- **Promote to a standards file**: the rule is an authoring reference that belongs in the project's own standards folder as `<domain>.md`.
|
|
68
|
-
- **Promote to a context entry**: the entry states a fact about a domain carrying an entry in
|
|
68
|
+
- **Promote to a context entry**: the entry states a fact about a domain carrying an entry in `canon/context/index.md`. Append it to `.canon/tmp/memory-routing/<slug>.md` at the main worktree root, in the format `memory-capture` writes, and tell the user to run `/docs-fold` from a branch. Do not edit the context entry here.
|
|
69
69
|
- **Hand off to governance**: the rule is coding-standards class (typescript, testing, naming, error-handling, performance, logging, concurrency, planning). Do not author the rule file inline. Never edit the synced `.claude/rules/` copies of toolkit rules, because `canon gov sync` overwrites them. Stop at handoff.
|
|
70
70
|
- In the toolkit repo, point the user at `internal-governance` and `${CLAUDE_SKILL_DIR}/../../standards/rule.md`, which own the source-of-truth rules under `governance/rules/`.
|
|
71
71
|
- In a target project, point the user at the `create-rule` skill, which scaffolds a project-local rule under `.claude/rules/`.
|
|
@@ -11,7 +11,7 @@ Without this skill, a session asked to slim `CLAUDE.md` deletes sections it judg
|
|
|
11
11
|
|
|
12
12
|
Three more failures share a cause. The session has no baseline for what belongs in `CLAUDE.md`, so it reads toolkit-seeded always-load behavior as bloat and proposes moving it, and the next seed sync puts it back. A section carrying a rule and a narrative together gets sorted whole into one bucket, which loses half of it either way. And a target that already exists gets written over, since a proposal blind to the folder cannot tell a create from a collision.
|
|
13
13
|
|
|
14
|
-
The skill also writes into
|
|
14
|
+
The skill also writes into `canon/context/`, a folder `migration-context` moves files into. A proposal drafted before those moves land cannot see the entries they create, so a move that should have resolved to an append reads as a create.
|
|
15
15
|
|
|
16
16
|
## Must
|
|
17
17
|
|
|
@@ -35,6 +35,6 @@ The skill also writes into `.claude/context/`, a folder `migration-context` move
|
|
|
35
35
|
|
|
36
36
|
## Out of scope
|
|
37
37
|
|
|
38
|
-
- Relocating `docs/` files, which `migration-context` proposes into this same
|
|
38
|
+
- Relocating `docs/` files, which `migration-context` proposes into this same `canon/context/` folder. Run that skill first when both apply, so Step 3 reads a folder its moves have already populated.
|
|
39
39
|
- Scaffolding the rule files it proposes, which `create-rule` does with the numbering and frontmatter
|
|
40
|
-
- Regenerating
|
|
40
|
+
- Regenerating `canon/context/index.md`, which `canon indexes regen` does once the user has applied the moves
|
|
@@ -7,7 +7,9 @@ description: Classifies each section of a target project's bloated `CLAUDE.md` i
|
|
|
7
7
|
|
|
8
8
|
Rebalance a large `CLAUDE.md` so only always-load behavior stays in it, path-scoped behavior becomes a rule, and domain narrative becomes a context entry. Every move is a proposal the user applies by hand.
|
|
9
9
|
|
|
10
|
-
Run `migration-context` first when both apply. Its moves populate
|
|
10
|
+
Run `migration-context` first when both apply. Its moves populate `canon/context/`, and Step 3 has to read the folder those moves left so an existing entry resolves to an append rather than blocking the move that should have created it.
|
|
11
|
+
|
|
12
|
+
A project the surface move has not reached keeps its context folder under `.claude/` rather than `canon/`. Read and propose entries into whichever root already carries the folder, and propose `canon/` only when neither does, since a new `canon/` folder would hide every entry the old one holds.
|
|
11
13
|
|
|
12
14
|
## Guards
|
|
13
15
|
|
|
@@ -20,7 +22,7 @@ Run these in parallel from `pwd`:
|
|
|
20
22
|
|
|
21
23
|
- Read `CLAUDE.md`
|
|
22
24
|
- `ls .claude/rules/ 2>/dev/null`: existing rule subdirs and numbers for placement
|
|
23
|
-
- `ls
|
|
25
|
+
- `ls canon/context/ 2>/dev/null`: existing context entries for conflict checks
|
|
24
26
|
- `canon claude seeds list --json 2>/dev/null`: the base seed set. Read the `CLAUDE.md` entry's `content` as the always-load baseline. Skip this input when `canon` is not installed.
|
|
25
27
|
|
|
26
28
|
## Step 2: classify each section
|
|
@@ -37,7 +39,7 @@ Split `CLAUDE.md` by `##` heading. Score each section against this order:
|
|
|
37
39
|
For each section proposed for a move:
|
|
38
40
|
|
|
39
41
|
- Path-scoped: propose `.claude/rules/<subdir>/<n>-<slug>.md` with a `paths:` glob. Pick the subdir and a free number the way `create-rule` does. If `.claude/rules/<subdir>/` already holds a rule on the topic, mark as "conflict" and skip.
|
|
40
|
-
- Domain narrative: propose
|
|
42
|
+
- Domain narrative: propose `canon/context/<domain>.md`. If the entry already exists, flat or as a same-named `canon/context/<domain>/` folder, propose appending to the file that owns it rather than creating a duplicate flat entry beside a domain already split.
|
|
41
43
|
|
|
42
44
|
## Step 4: output
|
|
43
45
|
|
|
@@ -54,8 +56,8 @@ Print one grouped proposal block. Omit empty groups.
|
|
|
54
56
|
|
|
55
57
|
## Extract to a context entry
|
|
56
58
|
|
|
57
|
-
- `## <heading>` →
|
|
58
|
-
- `## <heading>` →
|
|
59
|
+
- `## <heading>` → `canon/context/<domain>.md` (<reason>)
|
|
60
|
+
- `## <heading>` → `canon/context/<domain>/<sub-area>.md`, appending to the domain's existing sibling file (<reason>)
|
|
59
61
|
|
|
60
62
|
## Needs manual split
|
|
61
63
|
|
|
@@ -11,7 +11,7 @@ Without this skill, a session judges a `docs/` file agent-facing, moves it, and
|
|
|
11
11
|
|
|
12
12
|
Three more failures share a cause. The skill reads a folder two other surfaces also write, and a proposal blind to them destroys work.
|
|
13
13
|
|
|
14
|
-
A seed-derived `development.md` moved out of `docs/` comes back on the next seed sync. A move onto an existing
|
|
14
|
+
A seed-derived `development.md` moved out of `docs/` comes back on the next seed sync. A move onto an existing `canon/context/` filename overwrites the entry sitting there. A proposal drafted while `migration-claude-md` is proposing entries into the same folder cannot see those targets, and running the two in the wrong order turns a legitimate move into a skipped conflict.
|
|
15
15
|
|
|
16
16
|
## Must
|
|
17
17
|
|
|
@@ -32,5 +32,5 @@ A seed-derived `development.md` moved out of `docs/` comes back on the next seed
|
|
|
32
32
|
|
|
33
33
|
## Out of scope
|
|
34
34
|
|
|
35
|
-
- Classifying `CLAUDE.md` sections, which `migration-claude-md` proposes into this same
|
|
36
|
-
- Regenerating
|
|
35
|
+
- Classifying `CLAUDE.md` sections, which `migration-claude-md` proposes into this same `canon/context/` folder. Run this skill first when both apply, so that skill's append-or-create check reads a folder the moves have already populated.
|
|
36
|
+
- Regenerating `canon/context/index.md`, which `canon indexes regen` does once the user has applied the moves
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: migration-context
|
|
3
|
-
description: Classifies markdown files in a target project's `docs/` folder and proposes `git mv` commands to relocate agent-flavored content to
|
|
3
|
+
description: Classifies markdown files in a target project's `docs/` folder and proposes `git mv` commands to relocate agent-flavored content to `canon/context/`. Use when asked to "migrate docs to context", "move docs to context", "split docs", or to align an existing project with the three-tier context model. Do NOT auto-execute moves or rewrite inbound links. Proposal only.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Claude context migrate
|
|
7
7
|
|
|
8
|
-
Run this skill before `migration-claude-md` when both apply. That skill proposes entries into the same
|
|
8
|
+
Run this skill before `migration-claude-md` when both apply. That skill proposes entries into the same `canon/context/` folder, and an entry landing there first makes the corresponding move here read as a conflict and get skipped, which loses the richer `docs/` file.
|
|
9
|
+
|
|
10
|
+
A project the surface move has not reached keeps its context folder under `.claude/` rather than `canon/`. Read and propose moves into whichever root already carries the folder, and propose `canon/` only when neither does, since a new `canon/` folder would hide every entry the old one holds.
|
|
9
11
|
|
|
10
12
|
## Guards
|
|
11
13
|
|
|
@@ -19,7 +21,7 @@ Run these in parallel from `pwd`:
|
|
|
19
21
|
|
|
20
22
|
- `ls docs/*.md 2>/dev/null`: list flat markdown files
|
|
21
23
|
- `ls docs/*/ 2>/dev/null`: detect subfolders for the manual-review note
|
|
22
|
-
- `ls
|
|
24
|
+
- `ls canon/context/ 2>/dev/null`: detect already-migrated content for conflict checks
|
|
23
25
|
- `canon claude seeds list --json 2>/dev/null`: get the canonical seed list to identify seed-derived files
|
|
24
26
|
|
|
25
27
|
Read each discovered `docs/*.md` file in parallel.
|
|
@@ -44,7 +46,7 @@ For each file, score against this rule order:
|
|
|
44
46
|
|
|
45
47
|
For every file proposed for a move:
|
|
46
48
|
|
|
47
|
-
- If
|
|
49
|
+
- If `canon/context/<filename>` already exists, or a same-named folder exists at `canon/context/` with `<filename>`'s `.md` extension dropped, mark as "conflict" and skip the move. A folder of the same name is still a collision, since the domain already lives there split into siblings.
|
|
48
50
|
- Run `git grep -n "docs/<filename>"` (or grep equivalent) to list inbound references in `CLAUDE.md`, `README.md`, and other markdown. Report each as a TODO line. Do not rewrite.
|
|
49
51
|
|
|
50
52
|
## Step 4: output
|
|
@@ -52,9 +54,9 @@ For every file proposed for a move:
|
|
|
52
54
|
Print one grouped proposal block. Omit empty groups.
|
|
53
55
|
|
|
54
56
|
```markdown
|
|
55
|
-
## Move to
|
|
57
|
+
## Move to canon/context/
|
|
56
58
|
|
|
57
|
-
- docs/<file>.md →
|
|
59
|
+
- docs/<file>.md → canon/context/<file>.md (<one-line reason>)
|
|
58
60
|
|
|
59
61
|
## Keep in docs/
|
|
60
62
|
|
|
@@ -70,7 +72,7 @@ Print one grouped proposal block. Omit empty groups.
|
|
|
70
72
|
|
|
71
73
|
## Conflicts
|
|
72
74
|
|
|
73
|
-
- docs/<file>.md →
|
|
75
|
+
- docs/<file>.md → canon/context/<file>.md already exists. Skipping.
|
|
74
76
|
|
|
75
77
|
## Subfolders (manual review)
|
|
76
78
|
|
|
@@ -78,7 +80,7 @@ Print one grouped proposal block. Omit empty groups.
|
|
|
78
80
|
|
|
79
81
|
## Suggested git mv commands
|
|
80
82
|
|
|
81
|
-
git mv docs/<file>.md
|
|
83
|
+
git mv docs/<file>.md canon/context/<file>.md
|
|
82
84
|
|
|
83
85
|
## Inbound links to fix after moves
|
|
84
86
|
|
|
@@ -87,7 +89,7 @@ git mv docs/<file>.md .claude/context/<file>.md
|
|
|
87
89
|
|
|
88
90
|
## Reminder
|
|
89
91
|
|
|
90
|
-
Run canon indexes regen to update
|
|
92
|
+
Run canon indexes regen to update canon/context/index.md.
|
|
91
93
|
```
|
|
92
94
|
|
|
93
95
|
If every file classified as "Keep in docs/", output: `✅ All docs/ content is human-facing. No moves proposed.`
|
|
@@ -16,14 +16,14 @@ description: Plans a feature by reading the project's Claude setup and scanning
|
|
|
16
16
|
Read these in parallel from the project root, skipping any that do not exist:
|
|
17
17
|
|
|
18
18
|
- `CLAUDE.md`: behavior rules, conventions, commands
|
|
19
|
-
-
|
|
20
|
-
-
|
|
19
|
+
- `canon/REQUIREMENTS.md`: feature scope and non-goals
|
|
20
|
+
- `canon/ARCHITECTURE.md`: decisions already made
|
|
21
21
|
- `.canon/tasks/index.md`: current scope and status, then any task file the feature relates to
|
|
22
22
|
|
|
23
23
|
Also read these when the feature touches code or UI. Skip them for prose, docs, catalog, or config-only changes:
|
|
24
24
|
|
|
25
|
-
-
|
|
26
|
-
-
|
|
25
|
+
- `canon/DESIGN.md`: tokens, typography, spacing, and component rules
|
|
26
|
+
- `canon/wireframes/index.md` + the surface files relevant to the feature: intended UI layout and behavior. Read `index.md` first, then follow only the links the feature actually touches, each a flat `canon/wireframes/<surface>.md` or a grouped surface's own `canon/wireframes/<surface>/index.md` and the siblings it lists. Do not read the whole folder speculatively.
|
|
27
27
|
|
|
28
28
|
When the plan adds or revises a surface, the wireframe file follows `${CLAUDE_SKILL_DIR}/../../standards/wireframes.md`.
|
|
29
29
|
|
|
@@ -60,8 +60,8 @@ Detect the mode from the folder. Do not ask which one to run.
|
|
|
60
60
|
Read these in parallel from the project root, skipping any that do not exist:
|
|
61
61
|
|
|
62
62
|
- `CLAUDE.md`: behavior rules, conventions, commands
|
|
63
|
-
-
|
|
64
|
-
-
|
|
63
|
+
- `canon/REQUIREMENTS.md`: scope and non-goals
|
|
64
|
+
- `canon/ARCHITECTURE.md`: decisions already made
|
|
65
65
|
- `.canon/tasks/index.md`: what is already tracked, and what a prior track concluded. Open a task file only when its entry looks related.
|
|
66
66
|
|
|
67
67
|
Then read only what a live question needs. Do not read entire directories speculatively. Where a folder carries an `index.md`, read it first and load only the files it points at.
|
|
@@ -49,8 +49,8 @@ With no match, derive a kebab-case slug named for the subject rather than the ac
|
|
|
49
49
|
Read these in parallel from the project root, skipping any that do not exist:
|
|
50
50
|
|
|
51
51
|
- `CLAUDE.md`: behavior rules, conventions, commands
|
|
52
|
-
-
|
|
53
|
-
-
|
|
52
|
+
- `canon/REQUIREMENTS.md`: scope and non-goals
|
|
53
|
+
- `canon/ARCHITECTURE.md`: decisions already made
|
|
54
54
|
- `.canon/tasks/index.md`: what is already tracked. Open a task file whose entry looks related to an item.
|
|
55
55
|
|
|
56
56
|
Then read only what a live item needs. Do not read entire directories speculatively. Where a folder carries an `index.md`, read it first and load only the files it points at.
|
|
@@ -11,7 +11,7 @@ The value is the stop. A launch that continues into log inspection, browser chec
|
|
|
11
11
|
|
|
12
12
|
## Guards
|
|
13
13
|
|
|
14
|
-
- Resolve the entry before anything else. Take the flat `development.md` under
|
|
14
|
+
- Resolve the entry before anything else. Take the flat `development.md` under `canon/context/` when it exists, and `canon/context/development/overview.md` when the domain outgrew one file and split into a folder, which is where the `## Scripts` table lands in a split. Test both paths, then read one. If neither resolves, stop with the line below and let the user decide.
|
|
15
15
|
- If the entry documents no command matching the request, stop and list what it does document. Do not infer a command from a filename or a framework.
|
|
16
16
|
- If the resolved command has an effect that outlives the process and stopping it does not undo, print it for the user to run and stop. Deploying, publishing, releasing, migrating, and resetting are the common shapes, and the test is the effect rather than the name. A script called `infra:apply` or `promote` qualifies.
|
|
17
17
|
|
|
@@ -20,7 +20,7 @@ Do not read another file to reconstruct an entry that did not resolve, because a
|
|
|
20
20
|
The stop names the flat path in both cases, since a project carrying neither has no entry to point at and the flat one is where a project without a split keeps it:
|
|
21
21
|
|
|
22
22
|
```plaintext
|
|
23
|
-
❌ No
|
|
23
|
+
❌ No canon/context/development.md. This project has no documented dev loop.
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
## Step 1: read the entry
|
|
@@ -28,8 +28,8 @@ The base equalling HEAD is a usable baseline rather than the second case it used
|
|
|
28
28
|
Read these in parallel from the project root, skipping any that do not exist:
|
|
29
29
|
|
|
30
30
|
- `CLAUDE.md`: project type, conventions, and commands
|
|
31
|
-
-
|
|
32
|
-
-
|
|
31
|
+
- `canon/REQUIREMENTS.md`: feature scope and non-goals
|
|
32
|
+
- `canon/ARCHITECTURE.md`: technical design decisions
|
|
33
33
|
|
|
34
34
|
Coding standards from `.claude/rules/` are auto-loaded by Claude Code. Always-on rules apply every session. Path-scoped rules apply to files matching their `paths:` glob.
|
|
35
35
|
|
|
@@ -68,7 +68,7 @@ Review the full diff and changed file contents for:
|
|
|
68
68
|
5. Violations of rules from `.claude/rules/` that apply to the changed files
|
|
69
69
|
6. When the diff touches a file this project ships to a target holding none of its own history: a repository-relative path, a phase label naming a gitignored board, a same-repository pull request or commit reference, or a layout, stack, or config-path claim true of this checkout but stated as if it were general
|
|
70
70
|
|
|
71
|
-
Use `CLAUDE.md`,
|
|
71
|
+
Use `CLAUDE.md`, `canon/REQUIREMENTS.md`, `canon/ARCHITECTURE.md`, and the auto-loaded `.claude/rules/` as project context to inform what is intentional vs problematic. Do not fix, rewrite, or suggest refactors outside the scope of a finding.
|
|
72
72
|
|
|
73
73
|
### High-signal filter
|
|
74
74
|
|
|
@@ -44,8 +44,8 @@ Then resolve the PR: `gh pr view --json number,headRefName,headRefOid,title,body
|
|
|
44
44
|
Read these in parallel from the project root, skipping any that do not exist:
|
|
45
45
|
|
|
46
46
|
- `CLAUDE.md`: project type, conventions, and commands
|
|
47
|
-
-
|
|
48
|
-
-
|
|
47
|
+
- `canon/REQUIREMENTS.md`: feature scope and non-goals
|
|
48
|
+
- `canon/ARCHITECTURE.md`: technical design decisions
|
|
49
49
|
- `.canon/tasks/priority.md`: where this feature sits on the board and what each neighboring row waits on. Resolve this one at the main worktree root the way `session-worktree` does, since the board is gitignored and a linked worktree holds no copy of it
|
|
50
50
|
- `.canon/plans/feature-<slug>.md` for the branch, when present: the intent the PR should satisfy
|
|
51
51
|
|
|
@@ -194,7 +194,7 @@ The capture row states a standing debt rather than a per-run result. Running cap
|
|
|
194
194
|
|
|
195
195
|
That block is the detail. Lead the reply with the three slots under Every later turn above, so the human reads what they own before the evidence for it.
|
|
196
196
|
|
|
197
|
-
Treat a task that edits
|
|
197
|
+
Treat a task that edits `canon/context/` entries wholesale as conflicting with every other task, because the root instruction file requires each task to update its own domain entry as it lands.
|
|
198
198
|
|
|
199
199
|
Do not promote a task to fill the queue when nothing qualifies. A thin queue is a real answer and it beats a plan nobody needed.
|
|
200
200
|
|
|
@@ -32,7 +32,7 @@ Each item below is something a plan needed and a launch string did not carry.
|
|
|
32
32
|
|
|
33
33
|
- The task file, and its `## Findings` before deciding anything. A row can carry its own disproof under a title that still states the original claim, which is how one trial nearly planned against a premise the file had already recorded as dead.
|
|
34
34
|
- The source files themselves, opened rather than summarized. Never a count quoted from the task file, which was wrong or stale in ten places across four plans.
|
|
35
|
-
- `CLAUDE.md` and
|
|
35
|
+
- `CLAUDE.md` and `canon/ARCHITECTURE.md`, for the decision and the alternative it was taken against rather than for the decision alone.
|
|
36
36
|
- The plan of any row this one is sequenced behind, including one already moved to `.canon/plans/archive/`. Reading a shipped plan produced the strongest constraint in the first trial and no brief asked for it.
|
|
37
37
|
- `.canon/tasks/priority.md` for the row's Touches column and its stated blocker. That column is the file set the dispatch disjointness gate already reads.
|
|
38
38
|
- `${CLAUDE_SKILL_DIR}/../../standards/plan.md` for the shape, then `canon records validate plans` and `canon markdown audit <the plan file>` on the file once it is written. Nothing else opens a plan, since `.canon/plans/` is gitignored and the audit's default path set is what git lists.
|
|
@@ -11,7 +11,7 @@ Without this skill, `role-worker` and `role-planner` state three and two message
|
|
|
11
11
|
|
|
12
12
|
A standalone skill was proposed for the gap and declined the same day. It fired on no condition of its own, since nothing routes a session to a skill matching no request and reaching for no artifact, so a skill built to close the gap never closed it.
|
|
13
13
|
|
|
14
|
-
The first draft of this plan closed the gap with a paragraph drafted inline, once inside `role-worker` and once inside `role-planner`. The operator overrode that call: two bodies carrying identical protocol text is the shared-surface case
|
|
14
|
+
The first draft of this plan closed the gap with a paragraph drafted inline, once inside `role-worker` and once inside `role-planner`. The operator overrode that call: two bodies carrying identical protocol text is the shared-surface case `canon/ARCHITECTURE.md` already decided against duplicating, since a later fix reaching one copy and not the other diverges silently.
|
|
15
15
|
|
|
16
16
|
Neither attempt named who the relay is from. A message an operator relays by hand needs a sender as much as an addressee, and the standalone draft and the inline draft both composed a body and an addressee with no line stating whose turn produced it.
|
|
17
17
|
|
|
@@ -42,7 +42,7 @@ When the board is empty and a handoff was found, name what the handoff leaves op
|
|
|
42
42
|
|
|
43
43
|
Do not offer to remove entries. A completed task is archived out of `.canon/tasks/` when work ships. The git log is the authoritative record of shipped work. Plan files are archived per the lifecycle rule in `${CLAUDE_SKILL_DIR}/../../standards/plan.md`.
|
|
44
44
|
|
|
45
|
-
Memory is updated only when a recorded fact becomes wrong, never on resume. A domain fact reaches a session through
|
|
45
|
+
Memory is updated only when a recorded fact becomes wrong, never on resume. A domain fact reaches a session through `canon/context/`, which `memory-capture` routes to and the three-tier model loads on demand, so the memory folder read here is the residue no context entry owns.
|
|
46
46
|
|
|
47
47
|
## Writing the next one
|
|
48
48
|
|
|
@@ -26,7 +26,7 @@ Read these from the project root in parallel:
|
|
|
26
26
|
|
|
27
27
|
- `package.json`: dependencies and devDependencies
|
|
28
28
|
- Root config files: `astro.config.*`, `next.config.*`, `vite.config.*`, `tailwind.config.*`, `tsconfig.json`, `pyproject.toml`, `go.mod`, `Cargo.toml`
|
|
29
|
-
-
|
|
29
|
+
- `canon/REQUIREMENTS.md` and `canon/ARCHITECTURE.md` if present
|
|
30
30
|
- Directory structure via `ls -1` of the project root and `src/` if present
|
|
31
31
|
|
|
32
32
|
## Match
|
|
@@ -39,7 +39,7 @@ Read these from the project root in parallel, skipping any that do not exist:
|
|
|
39
39
|
|
|
40
40
|
- `package.json`: `dependencies` and `devDependencies`
|
|
41
41
|
- Root configs: `astro.config.*`, `next.config.*`, `vite.config.*`, `tailwind.config.*`, `tsconfig.json`, `pyproject.toml`, `go.mod`, `Cargo.toml`
|
|
42
|
-
-
|
|
42
|
+
- `canon/REQUIREMENTS.md` and `canon/ARCHITECTURE.md` if present
|
|
43
43
|
- Directory structure via `ls -1` of the project root and `src/` if present
|
|
44
44
|
|
|
45
45
|
## Resolve arguments
|
|
@@ -14,11 +14,11 @@ A reference page that reads like a lesson is a lesson wearing the wrong extensio
|
|
|
14
14
|
|
|
15
15
|
Sort by who owns the subject, which is the test the wiki already runs. The reader's activity decided the workspace and decides nothing here.
|
|
16
16
|
|
|
17
|
-
| The page's subject | Destination
|
|
18
|
-
| -------------------------------------------------------------------------------------------------------------------- |
|
|
19
|
-
| Owned by Anthropic | the project's wiki
|
|
20
|
-
| Owned by another tool or vendor, owned by no single vendor, or written for someone consuming what this project ships | the project's public docs
|
|
21
|
-
| How this project itself works, for the people who build it |
|
|
17
|
+
| The page's subject | Destination |
|
|
18
|
+
| -------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
|
|
19
|
+
| Owned by Anthropic | the project's wiki |
|
|
20
|
+
| Owned by another tool or vendor, owned by no single vendor, or written for someone consuming what this project ships | the project's public docs |
|
|
21
|
+
| How this project itself works, for the people who build it | `canon/context/<domain>.md`, or the domain's own nested `index.md` when it is already split into a folder |
|
|
22
22
|
|
|
23
23
|
A page a reader cannot sort by that question is a page whose subject has not been settled. Say which two destinations it sits between and let the operator choose, rather than picking the nearer one.
|
|
24
24
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ux-audit
|
|
3
|
-
description: Audits the current UI for incomplete, inconsistent, or confusing patterns. Reads DESIGN.md and
|
|
3
|
+
description: Audits the current UI for incomplete, inconsistent, or confusing patterns. Reads DESIGN.md and canon/wireframes/ for intent, scans UI files, and outputs observations grouped by surface. Use when asked "audit the UX", "audit the UI", "UX audit", or "find UI roughness". Do NOT use for new feature planning or code changes, and do NOT use to measure what a running interface costs to paint, which is `ux-measure`.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# UX audit
|
|
@@ -15,9 +15,9 @@ description: Audits the current UI for incomplete, inconsistent, or confusing pa
|
|
|
15
15
|
Read these in parallel from the project root, skipping any that do not exist:
|
|
16
16
|
|
|
17
17
|
- `CLAUDE.md`: project type and conventions
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
18
|
+
- `canon/DESIGN.md`: visual intent, tokens, typography, spacing rules
|
|
19
|
+
- `canon/wireframes/index.md` + every `canon/wireframes/<surface>.md`, each a flat file or a grouped surface's own `canon/wireframes/<surface>/index.md` and the siblings it lists: intended UI layout, UI copy, interaction rules. Surfaces are loaded one file at a time during Step 3. Per `${CLAUDE_SKILL_DIR}/../../standards/wireframes.md`, these carry layout and intent, not implementation detail.
|
|
20
|
+
- `canon/REQUIREMENTS.md`: feature scope and non-goals
|
|
21
21
|
- A committed capture beside the surface's own source, when the project has one. A rendered surface reads differently composed than it reads written, and a capture is the only artifact here that shows the composed result rather than the markup. Absent one, note that this audit reads source only, and keep going. This is a stated fallback, not a stop: a project with no capture yet, or a capture mid-rebuild, still gets a source-only audit rather than losing the skill entirely.
|
|
22
22
|
|
|
23
23
|
## Step 2: identify surfaces
|
|
@@ -33,7 +33,7 @@ For each surface, look for:
|
|
|
33
33
|
3. **Inconsistencies**: spacing, tone of voice, interaction patterns, icon use, keyboard affordances
|
|
34
34
|
4. **Roughness in daily use**: friction, redundant steps, unclear affordances, ambiguous labels
|
|
35
35
|
|
|
36
|
-
Use
|
|
36
|
+
Use `canon/DESIGN.md` and the per-surface `canon/wireframes/<surface>.md` files, each a flat file or a grouped surface's own `canon/wireframes/<surface>/index.md` and the siblings it lists, as ground truth for intent. For each implementation surface, read the matching wireframe file before flagging drift. Observations only, no implementation suggestions or fixes.
|
|
37
37
|
|
|
38
38
|
Where Step 1 found a committed capture for this surface, judge composed output (spacing, overlap, contrast, wrapping) against it rather than inferring layout from markup alone, which reports what the surface renders rather than what its source implies. Where none exists, judge from source alone and say so in that surface's findings, since a source-only read cannot see what only a render would show.
|
|
39
39
|
|
|
@@ -17,7 +17,7 @@ Report numbers. A sentence about what the source looks like is what this exists
|
|
|
17
17
|
Read these in parallel from the project root, skipping any that do not exist:
|
|
18
18
|
|
|
19
19
|
- `package.json`: the `scripts` block naming a dev, preview, or start command
|
|
20
|
-
-
|
|
20
|
+
- `canon/context/development/`: the documented run commands and the port each serves
|
|
21
21
|
- `CLAUDE.md`: project type and conventions
|
|
22
22
|
|
|
23
23
|
Prefer a production-shaped build (`preview`, `start`) over the dev server. A dev server ships unminified modules and reports a cost no user pays.
|
package/docs/agents/audits.md
CHANGED
|
@@ -19,7 +19,7 @@ canon audits list --json
|
|
|
19
19
|
| ----------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
20
20
|
| `--json` | Add a machine-readable record on stdout, keeping the frame |
|
|
21
21
|
| `--root <path>` | Measure this tree instead of the current worktree |
|
|
22
|
-
| `--record` | Write this run's tracked counts to
|
|
22
|
+
| `--record` | Write this run's tracked counts to `canon/config/baseline.json` |
|
|
23
23
|
| `--corpus <name>` | Limit the run to one corpus (`tracked`, `per-machine`, `upstream`), repeatable, defaulting to every corpus |
|
|
24
24
|
|
|
25
25
|
## What it runs
|
|
@@ -75,7 +75,7 @@ Every run states how many corpora it measured against how many it skipped, inclu
|
|
|
75
75
|
|
|
76
76
|
## The retained baseline
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
`canon/config/baseline.json` holds the counts from the last run recorded with `--record`, alongside the day it was taken and the commit it was read at, falling back to `.claude/canon/baseline.json` for a project that has not moved. Each later run reports which counts moved and by how much.
|
|
79
79
|
|
|
80
80
|
The file is committed. A per-machine record cannot answer the question this half exists for, which is whether a number grew since anyone last looked, and a fresh checkout has to inherit that answer rather than start over. The cost is that a branch moving a count either fixes it or re-records it and says why, which is the shape the consumed-copy assertion already carries.
|
|
81
81
|
|
package/docs/agents/commands.md
CHANGED
|
@@ -22,8 +22,8 @@ Full help: `canon <command> --help`. Behavior notes for the install and sync ver
|
|
|
22
22
|
| `canon indexes regen` | Regenerate `index.md` files from sibling frontmatter |
|
|
23
23
|
| `canon indexes list [path]` | Flatten every folder index under a path into one `{path, title, description}` catalog (`--json`) |
|
|
24
24
|
| `canon docs [topic]` | Emit toolkit reference docs (`list`, or a topic by name) |
|
|
25
|
-
| `canon design render` | Render
|
|
26
|
-
| `canon design regen` | Rewrite this repository's
|
|
25
|
+
| `canon design render` | Render `canon/DESIGN.md` tokens to HTML and CSS |
|
|
26
|
+
| `canon design regen` | Rewrite this repository's `canon/DESIGN.md` and `src/design/base.css` from `src/design/tokens.ts` |
|
|
27
27
|
| `canon design board` | Generate a static page set indexing tokens, surfaces, wireframes, past candidates, and components, against the toolkit checkout like `regen` (`--out`) |
|
|
28
28
|
| `canon design css` | Emit the design tokens and components as CSS on stdout (`--no-components` for properties alone) |
|
|
29
29
|
| `canon design install` | Install the base stylesheet into a project at `.claude/design/base.css` |
|
|
@@ -56,6 +56,7 @@ Full help: `canon <command> --help`. Behavior notes for the install and sync ver
|
|
|
56
56
|
| `canon migrate rename` | Rewrite every unprotected `aitk` token to `canon` and move the paths that carry the name, reporting the plan without `--write` (`--scope`, `--json`) |
|
|
57
57
|
| `canon migrate skill-names` | Move the prefixed skill folders onto their two-word names and rewrite every citation, reporting the plan without `--write` (`--root`, `--json`) |
|
|
58
58
|
| `canon migrate records` | Move the gitignored session records to `.canon/` and repoint every tracked citation, reporting the plan without `--write` (`--root`, `--json`) |
|
|
59
|
+
| `canon migrate surface-roots` | Move the tracked surfaces (`context/`, `wireframes/`, the three loose documents, and the install stamp folder) from `.claude/` to `canon/` with `git mv` and repoint every tracked citation, reporting the plan without `--write` (`--root`, `--json`) |
|
|
59
60
|
| `canon migrate record-tree` | Repoint the old-root citations inside the records themselves, scoped to the live folders and reporting every line without `--write` (`--root`, `--json`) |
|
|
60
61
|
| `canon migrate rule-layout` | Move a target's installed rules from the flat `.claude/rules/<subdir>/` layout to `.claude/rules/canon/<subdir>/`, reporting the plan without `--write` (`--root`, `--json`) |
|
|
61
62
|
| `canon migrate scratch-evidence` | Move a folder under `.tmp/` that a durable record cites as evidence to `.canon/review/evidence/`, repointing every citation live or archived, reporting the plan without `--write` (`--root`, `--json`) |
|
|
@@ -166,6 +167,10 @@ Common patterns:
|
|
|
166
167
|
|
|
167
168
|
A record folder already present at the destination is a refusal rather than a merge, and a line carrying `canon-keep-record-root`, or the nearest non-blank line below it, keeps the old spelling for prose that dates a decision. The records themselves are never swept: everything under `.canon/` and every `.claude/` record folder is passed over and reported as a count on its own line, which is what keeps the run that follows the ignore collapse touching the same files as one before it. Running it twice rewrites nothing, which is the check that the exclusions, the markers, and that skip all fired.
|
|
168
169
|
|
|
170
|
+
`migrate surface-roots` moves the tracked surfaces from `.claude/` to `canon/`: `context/`, `wireframes/`, `ARCHITECTURE.md`, `REQUIREMENTS.md`, `DESIGN.md`, and the install stamp folder, respelled `canon/config/` since a project under `canon/` reserves the bare `canon` name for the CLI's own install. Every path is tracked, so each file moves with `git mv` and its history follows it, and every tracked citation of one is rewritten in the same run. `rules/`, `skills/`, `hooks/`, and `settings.json` stay where Claude Code reads them. It reports until `--write` is passed, and a destination already present under `canon/` refuses the whole plan rather than splitting a surface across both roots.
|
|
171
|
+
|
|
172
|
+
A line carrying `canon-keep-surface-root`, or the nearest non-blank line above it, keeps the old spelling. A rule's frontmatter `paths:` glob, a citation shaped like a path into another repository, and one inside a dated paragraph are reported by file and line and left alone. Running it twice rewrites nothing, which is the idempotence check. A project that never runs it keeps resolving each surface under `.claude/`, since every reader takes whichever root holds the entry.
|
|
173
|
+
|
|
169
174
|
`migrate record-tree` is what reaches the records the sweep above passes over, and the two share no scope. That one enumerates through git, so it sees every tracked file and none of the records, which are gitignored by construction. This one walks `.canon/` itself and is scoped to the folders a session still follows a path into: `diagrams`, `memory`, `plans`, `proposals`, `review`, `tasks`, and `teach`, each minus its own `archive/` subtree. A closed groundwork or intake trail, the scratch folder, and the backup history are reported as counts and never rewritten, because a path inside a closed trail sits in a sentence about work that already ended. Run it after the move, since there is no new root to walk before one.
|
|
170
175
|
|
|
171
176
|
Every citation in scope is reported with its file, its line number, and the line text. The record tree is untracked, so a wrong rewrite has no git undo, and that report is what a reader judges before passing `--write`. Marking a line that has to keep the old spelling uses the same `canon-keep-record-root` comment, and a second run rewriting nothing is the idempotence check.
|
|
@@ -33,7 +33,7 @@ It reports and never gates, which is the split the citation check already draws.
|
|
|
33
33
|
|
|
34
34
|
## Length
|
|
35
35
|
|
|
36
|
-
Length quotes its checkpoint from `standards/context.md`: roughly 150 rendered lines for an entry, applied to each of the 60 entries the audit measures, 51 of them under
|
|
36
|
+
Length quotes its checkpoint from `standards/context.md`: roughly 150 rendered lines for an entry, applied to each of the 60 entries the audit measures, 51 of them under `canon/context/` and 9 diagram files beside them. It counts rendered lines rather than source lines, wrapping each line at 80 columns and summing the heights.
|
|
37
37
|
|
|
38
38
|
A line is wrapped at the width it renders at, so a link counts as its anchor text and a backticked path counts whole, which parts the rendered count from a source count wherever an entry cites a path in backticks rather than as a link. Entries here are authored one line per bullet, so a block of fifteen paragraph-bullets occupies fifteen source lines and renders past sixty, which source counting cannot see.
|
|
39
39
|
|
|
@@ -89,7 +89,7 @@ The JSON record carries the findings per entry as `entries[].narration` and the
|
|
|
89
89
|
|
|
90
90
|
## The architecture record
|
|
91
91
|
|
|
92
|
-
Two findings read
|
|
92
|
+
Two findings read `canon/ARCHITECTURE.md` rather than a folder, and only the first is a fact.
|
|
93
93
|
|
|
94
94
|
The length check compares the record against the ceiling it derives for itself, and only a record that states its own allowances has one. No standard sets a length rule for this document, so the numbers belong to whichever record declares them. The check reads a frame allowance and an allowance per decision out of the record's own prose and puts the ceiling at the frame plus the allowance times the decision count. The JSON record carries what it read as `architecture.allowances` and the reading as `architecture.lines` against `architecture.ceiling`.
|
|
95
95
|
|
|
@@ -105,7 +105,7 @@ The report gates nothing. Deciding whether a sentence states a claim is a judgme
|
|
|
105
105
|
|
|
106
106
|
## Which folders each check reaches
|
|
107
107
|
|
|
108
|
-
The provenance, required-section, and narration checks cover
|
|
108
|
+
The provenance, required-section, and narration checks cover `canon/context/` alone, the reference-form check covers the split folders inside it, and length and the table finding reach every audited folder.
|
|
109
109
|
|
|
110
110
|
What narrows the three is stated in `standards/context.md`, which opens its scope by handing diagrams and wireframes to `diagrams.md` and `wireframes.md`, and the sibling standards do not restate it. A marker reported in a diagram entry would cite a rule that entry's own standard routes elsewhere, and a diagram entry carries a heading per kind rather than a run of bullets deciding anything. The split is between kinds of rule rather than kinds of folder, and what decides it is which tier states the rule rather than what the check measures.
|
|
111
111
|
|