@erclx/canon 4.6.1 → 4.7.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/canon-feedback-file/SKILL.md +3 -3
- package/claude/skills/canon-feedback-triage/SKILL.md +1 -1
- package/claude/skills/canon-rollout/SKILL.md +1 -1
- package/claude/skills/canon-screencast/SKILL.md +5 -5
- package/claude/skills/canon-slides-draft/SKILL.md +1 -1
- package/claude/skills/claude-address-review/SKILL.md +4 -4
- package/claude/skills/claude-autoship/SKILL.md +17 -17
- package/claude/skills/claude-design-extract/SKILL.md +2 -2
- package/claude/skills/claude-diagram/SKILL.md +13 -13
- package/claude/skills/claude-docs/SKILL.md +23 -23
- package/claude/skills/claude-feature/SKILL.md +6 -6
- package/claude/skills/claude-groundwork/SKILL.md +16 -16
- package/claude/skills/claude-intake/SKILL.md +8 -8
- package/claude/skills/claude-intake-answer/SKILL.md +1 -1
- package/claude/skills/claude-markdown-propose/REQUIREMENT.md +2 -2
- package/claude/skills/claude-markdown-propose/SKILL.md +8 -8
- package/claude/skills/claude-markdown-propose/references/format.md +3 -3
- package/claude/skills/claude-memory-capture/SKILL.md +13 -13
- package/claude/skills/claude-memory-review/SKILL.md +28 -28
- package/claude/skills/claude-memory-review/references/receipt-format.md +1 -1
- package/claude/skills/claude-orchestrate/SKILL.md +9 -9
- package/claude/skills/claude-orchestrate/references/orchestrator-dispatch.md +1 -1
- package/claude/skills/claude-orchestrate/references/orchestrator-parked.md +1 -1
- package/claude/skills/claude-orchestrate/references/orchestrator-poll.md +1 -1
- package/claude/skills/claude-orchestrate/references/orchestrator-resume.md +1 -1
- package/claude/skills/claude-orchestrate/scripts/poll.sh +1 -1
- package/claude/skills/claude-planner/REQUIREMENT.md +1 -1
- package/claude/skills/claude-planner/SKILL.md +6 -6
- package/claude/skills/claude-pr-review/SKILL.md +5 -5
- package/claude/skills/claude-review/SKILL.md +4 -4
- package/claude/skills/claude-seed-sync/SKILL.md +2 -2
- package/claude/skills/claude-tasks/SKILL.md +16 -16
- package/claude/skills/claude-teach/SKILL.md +9 -9
- package/claude/skills/claude-ui-test/SKILL.md +3 -3
- package/claude/skills/claude-ux-audit/SKILL.md +5 -5
- package/claude/skills/claude-ux-measure/SKILL.md +3 -3
- package/claude/skills/claude-worker/SKILL.md +2 -2
- package/claude/skills/claude-worktree/SKILL.md +3 -3
- package/claude/skills/git-issue/SKILL.md +4 -4
- package/claude/skills/git-pr/SKILL.md +6 -6
- package/claude/skills/git-ship/SKILL.md +3 -3
- package/claude/skills/git-split/REQUIREMENT.md +1 -1
- package/claude/skills/git-split/SKILL.md +20 -20
- package/claude/skills/migration-superseded/SKILL.md +4 -4
- package/claude/skills/session-map/SKILL.md +2 -2
- package/claude/skills/session-resume/SKILL.md +8 -8
- package/docs/agents/capture.md +1 -1
- package/docs/agents/commands.md +5 -2
- package/docs/agents/demo.md +1 -1
- package/docs/agents/indexes.md +1 -1
- package/docs/agents/install-and-sync.md +1 -1
- package/docs/agents/intake.md +1 -1
- package/docs/agents/key-changes.md +1 -1
- package/docs/agents/records.md +12 -9
- package/docs/agents/restated.md +2 -2
- package/docs/agents/rule-citations.md +1 -1
- package/docs/agents/sandbox.md +1 -1
- package/docs/agents/tasks.md +6 -6
- package/docs/agents/teach.md +4 -4
- package/docs/ai-workflow.md +26 -19
- package/docs/operating-model.md +3 -3
- package/docs/target-projects.md +22 -2
- package/docs/visual-design-workflow.md +1 -1
- package/governance/rules/claude/555-tasks.md +3 -3
- package/governance/rules/claude/556-groundwork.md +2 -2
- package/governance/rules/claude/557-intake.md +2 -2
- package/governance/rules/claude/558-plan.md +3 -3
- package/governance/rules/claude/559-memory.md +2 -2
- package/governance/rules/claude/560-diagrams.md +3 -3
- package/governance/rules/claude/561-teach.md +2 -2
- package/governance/rules/claude/562-session.md +2 -2
- package/governance/rules/core/035-tasks.md +2 -2
- package/governance/rules/core/045-memory.md +3 -3
- package/governance/rules/core/055-scratch.md +2 -1
- package/governance/rules/core/085-worktrees.md +1 -1
- package/package.json +1 -1
- package/scripts/core/check-ignore-parity.sh +24 -51
- package/scripts/core/install-check.sh +4 -4
- package/scripts/core/snapshot.sh +1 -1
- package/scripts/manage-sandbox.sh +1 -1
- package/scripts/tooling/verify.sh +2 -2
- package/snippets/claude/decision-memo.md +1 -1
- package/snippets/claude/feature-recap.md +1 -1
- package/src/audits/catalog.ts +1 -1
- package/src/claude/cases/all.ts +1 -1
- package/src/claude/seeds.ts +13 -2
- package/src/claude/skills-rank.ts +1 -1
- package/src/cli.ts +4 -4
- package/src/commands/demo.ts +1 -1
- package/src/commands/design.ts +1 -1
- package/src/commands/feedback.ts +5 -5
- package/src/commands/gov.ts +17 -6
- package/src/commands/intake.ts +1 -1
- package/src/commands/migrate.ts +173 -2
- package/src/commands/pr.ts +1 -1
- package/src/commands/records.ts +1 -1
- package/src/commands/serve.ts +2 -2
- package/src/commands/slides.ts +1 -1
- package/src/commands/tasks.ts +5 -5
- package/src/commands/teach.ts +1 -1
- package/src/context/audit.ts +1 -1
- package/src/demo/compile.ts +1 -1
- package/src/gov/citations.ts +1 -1
- package/src/gov/restated.ts +3 -3
- package/src/migrate/apply.ts +67 -1
- package/src/migrate/records.ts +276 -0
- package/src/paths.ts +1 -1
- package/src/pr/paths.ts +1 -1
- package/src/record-root.ts +77 -27
- package/src/records/backup.ts +71 -17
- package/src/records/validate.ts +1 -1
- package/src/sync/layout.ts +11 -2
- package/src/tasks/answers.ts +1 -1
- package/src/tasks/archive.ts +20 -3
- package/standards/diagrams.md +4 -4
- package/standards/glossary.md +1 -1
- package/standards/groundwork.md +3 -3
- package/standards/index.md +2 -2
- package/standards/intake.md +3 -3
- package/standards/memory.md +2 -2
- package/standards/plan.md +3 -3
- package/standards/session.md +2 -2
- package/standards/standard.md +1 -1
- package/standards/tasks.md +9 -9
- package/standards/teach.md +2 -2
- package/standards/versioning.md +1 -1
- package/tooling/base/configs/.husky/post-merge +1 -1
- package/tooling/base/reference.md +1 -1
- package/tooling/claude/manifest.toml +13 -3
- package/tooling/claude/reference.md +28 -15
- package/tooling/claude/seeds/.claude/hooks/scratch-guard.sh +8 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: claude-groundwork
|
|
3
|
-
description: Opens and runs a numbered groundwork folder under `.
|
|
3
|
+
description: Opens and runs a numbered groundwork folder under `.canon/groundwork/<nn>-<slug>/` for a topic that has to be measured before it can be planned. Detects open, resume, and close from the folder itself. Use when asked to "research X", "dig into X", "work out what we should do about X", "measure this before we commit", or "open a groundwork folder". Do NOT use to write a feature plan or to implement. That is `claude-feature`.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Claude groundwork
|
|
@@ -19,10 +19,10 @@ Read `${CLAUDE_SKILL_DIR}/../../standards/groundwork.md` before writing any file
|
|
|
19
19
|
|
|
20
20
|
## Write scope
|
|
21
21
|
|
|
22
|
-
- Write only inside `.
|
|
22
|
+
- Write only inside `.canon/groundwork/<nn>-<slug>/`. A feature plan, source changes, a standard, a rule, and a reference doc all live outside that folder, so this one rule forbids every one of them.
|
|
23
23
|
- One exception, at close only: write one task file recording what the track concluded.
|
|
24
|
-
- A second exception, for what a spike reads: write an input under `.
|
|
25
|
-
- What a spike produces stays inside the track rather than joining the two exceptions above: write evidence a spike file cites under `.
|
|
24
|
+
- A second exception, for what a spike reads: write an input under `.canon/tmp/groundwork-fixtures/<slug>/`. Keep it out of `.canon/groundwork/` so mode detection never matches a fixture as a track. A fixture a headless run is pointed at goes outside the repository instead, per the rule in `## Running a spike`.
|
|
25
|
+
- What a spike produces stays inside the track rather than joining the two exceptions above: write evidence a spike file cites under `.canon/groundwork/<nn>-<slug>/evidence/`, which the first rule already permits. Mode detection matches entries at the top level of the tracks directory, so the sibling the fixtures rule guards against cannot be a folder nested inside a track, and the scratch path holds only what can be deleted without loss, which a recording a finding rests on is not.
|
|
26
26
|
- Reading is not restricted. External research is in scope, so read documentation, comparable projects, and papers whenever a live question needs them.
|
|
27
27
|
- Every claim about a source outside the project carries a link to it. A source found and not read is listed as a lead and is never cited.
|
|
28
28
|
- Treat the folder as gitignored and unbacked. It dies with the machine, so `07-next-session.md` repeats what it needs instead of pointing at its siblings.
|
|
@@ -35,17 +35,17 @@ A track may run an experiment to settle an open question without stopping to ask
|
|
|
35
35
|
- Writing a fixture this session reads or provisions itself: run it, under the fixtures path above. Provisioning is the usual blocker rather than spend, and it costs nothing.
|
|
36
36
|
- Spawning a billed headless session: run up to three, then ask before spawning more. The bound is a run count rather than a budget, because a headless run reports its total cost only after it finishes, so a dollar ceiling is reportable and not enforceable while a run count is checkable before spawning.
|
|
37
37
|
|
|
38
|
-
A fixture a headless run is pointed at goes outside the repository, under `mktemp -d`, and never under `.
|
|
38
|
+
A fixture a headless run is pointed at goes outside the repository, under `mktemp -d`, and never under `.canon/tmp/`. A session started anywhere beneath the project root loads that project's `CLAUDE.md` and `.claude/rules/` through the ancestor chain, so an in-repo fixture measures the repository instead of the arm. Record the fixture as contaminated and re-run it outside if this is discovered after the fact, because the result reads as evidence either way.
|
|
39
39
|
|
|
40
40
|
Record method, result, measured cost, and caveats in `08-spikes.md`. Put whatever the run produced that the record cites in `evidence/` beside it, so a reader checking a claim opens the artifact rather than taking the prose for it. Reach for a test harness the project already carries before building one, and copy how it isolates its fixture rather than only what it asserts.
|
|
41
41
|
|
|
42
42
|
## Step 1: detect the mode
|
|
43
43
|
|
|
44
|
-
List `.
|
|
44
|
+
List `.canon/groundwork/` from the project root and match the topic against the slug half of each `<nn>-<slug>` folder already there before deriving anything. A resume pass rarely phrases the topic the way the folder was named, so a fresh slug derived from the wording would miss a live track and restart it.
|
|
45
45
|
|
|
46
46
|
Never match against `.claude/` itself. That directory holds every other workflow surface, so a topic matched there lands on a folder that was never a track.
|
|
47
47
|
|
|
48
|
-
With no match, derive a kebab-case slug named for the subject rather than the activity. Prefer `ts-migration` over `migration-research`. Also list `.
|
|
48
|
+
With no match, derive a kebab-case slug named for the subject rather than the activity. Prefer `ts-migration` over `migration-research`. Also list `.canon/intake/` and take `<nn>` as the highest ordinal present across both listings, incremented, per `${CLAUDE_SKILL_DIR}/../../standards/groundwork.md`. Then route on `.canon/groundwork/<nn>-<slug>/`:
|
|
49
49
|
|
|
50
50
|
- Folder absent: open
|
|
51
51
|
- Folder present without `06-decision.md`: resume
|
|
@@ -60,7 +60,7 @@ Read these in parallel from the project root, skipping any that do not exist:
|
|
|
60
60
|
- `CLAUDE.md`: behavior rules, conventions, commands
|
|
61
61
|
- `.claude/REQUIREMENTS.md`: scope and non-goals
|
|
62
62
|
- `.claude/ARCHITECTURE.md`: decisions already made
|
|
63
|
-
- `.
|
|
63
|
+
- `.canon/tasks/index.md`: what is already tracked, and what a prior track concluded. Open a task file only when its entry looks related.
|
|
64
64
|
|
|
65
65
|
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.
|
|
66
66
|
|
|
@@ -72,7 +72,7 @@ The standard sets the open question format and requires it inside a topic file a
|
|
|
72
72
|
|
|
73
73
|
## Open mode
|
|
74
74
|
|
|
75
|
-
1. Create `.
|
|
75
|
+
1. Create `.canon/groundwork/<nn>-<slug>/`, with `<nn>` and `<slug>` as derived in Step 1.
|
|
76
76
|
2. Write `README.md` first. Writing it first forces the question of what the track is for.
|
|
77
77
|
3. Write `01-current-state.md` by measuring now. Never carry a figure from a previous session or from recall without re-measuring it. Measure only what an open question in the folder needs. A number with no question attached is how groundwork turns into the work.
|
|
78
78
|
4. Write `00-scope.md` when the track is large enough to run away. Skip it on a small track.
|
|
@@ -91,7 +91,7 @@ The standard sets the open question format and requires it inside a topic file a
|
|
|
91
91
|
1. Write `06-decision.md`. It states the problem once, names the goal, lists what to do, and lists what was considered and dropped.
|
|
92
92
|
2. Write `07-next-session.md` self-contained, so it survives a compaction that loses the conversation.
|
|
93
93
|
3. Update the file map in `README.md`.
|
|
94
|
-
4. Write one task file in `.
|
|
94
|
+
4. Write one task file in `.canon/tasks/` recording what the track concluded, even when the conclusion is to do nothing. Follow `${CLAUDE_SKILL_DIR}/../../standards/tasks.md` for the filename and frontmatter. Aside from an experiment fixture, this and the routing in Step 5 are the only ways close mode reaches outside the folder.
|
|
95
95
|
5. When the task written in Step 4 does not cover every finding the track surfaced, route what it leaves out through `claude-intake`. Skip this step when it does.
|
|
96
96
|
6. Report uncited external claims. Closing already reads every file in the folder, so list any statement about a source outside the project that carries neither a link nor a lead entry. Report and do not block, because judging whether a sentence makes an external claim is the call a checker gets wrong.
|
|
97
97
|
|
|
@@ -104,12 +104,12 @@ Emit the full relative path from the project root for every file written or upda
|
|
|
104
104
|
Open and resume:
|
|
105
105
|
|
|
106
106
|
```plaintext
|
|
107
|
-
📂 Opened .
|
|
107
|
+
📂 Opened .canon/groundwork/<nn>-<slug>/
|
|
108
108
|
|
|
109
109
|
**Written:**
|
|
110
110
|
|
|
111
|
-
- `.
|
|
112
|
-
- `.
|
|
111
|
+
- `.canon/groundwork/<nn>-<slug>/README.md`
|
|
112
|
+
- `.canon/groundwork/<nn>-<slug>/01-current-state.md`
|
|
113
113
|
|
|
114
114
|
**Open questions:**
|
|
115
115
|
|
|
@@ -123,12 +123,12 @@ Use `📂 Resumed` in place of `📂 Opened` on a resume pass.
|
|
|
123
123
|
Close:
|
|
124
124
|
|
|
125
125
|
```plaintext
|
|
126
|
-
✅ Closed .
|
|
126
|
+
✅ Closed .canon/groundwork/<nn>-<slug>/
|
|
127
127
|
|
|
128
128
|
**Written:**
|
|
129
129
|
|
|
130
|
-
- `.
|
|
131
|
-
- `.
|
|
130
|
+
- `.canon/groundwork/<nn>-<slug>/06-decision.md`
|
|
131
|
+
- `.canon/groundwork/<nn>-<slug>/07-next-session.md`
|
|
132
132
|
|
|
133
133
|
**Uncited external claims:** <count, or none>
|
|
134
134
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: claude-intake
|
|
3
|
-
description: Files a raw brain dump into a numbered intake folder under `.
|
|
3
|
+
description: Files a raw brain dump into a numbered intake folder under `.canon/intake/<nn>-<slug>/`, one item per finding carrying a measured problem, a proposed fix, and a verdict. Use when asked to "file this dump", "triage my notes", "work through this list", "sort out this brain dump", or "run an intake pass". Do NOT use for one question that has to be measured before anyone can plan it. That is `claude-groundwork`.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Claude intake
|
|
@@ -29,7 +29,7 @@ Using the wrong one fails in two shapes. Intake on a question that needs measuri
|
|
|
29
29
|
|
|
30
30
|
## Write scope
|
|
31
31
|
|
|
32
|
-
- Write only inside `.
|
|
32
|
+
- Write only inside `.canon/intake/<nn>-<slug>/`. A plan file, a task file, a source change, a standard, and a rule all live outside that folder, so this one rule forbids every one of them.
|
|
33
33
|
- There is no exception. Promoting an item onto the board runs through `claude-tasks` after the operator has answered, which is a separate invocation.
|
|
34
34
|
- Reading is unrestricted inside the project. Measuring is the work.
|
|
35
35
|
- Treat the folder as gitignored and unbacked. No check reaches its contents, so every rule stated here holds only while a session reads it.
|
|
@@ -38,11 +38,11 @@ Nothing outside this body carries the write-scope floor, and no path-scoped rule
|
|
|
38
38
|
|
|
39
39
|
## Step 1: detect open or resume
|
|
40
40
|
|
|
41
|
-
List `.
|
|
41
|
+
List `.canon/intake/` from the project root and match the topic against the slug half of each `<nn>-<slug>` folder already there before deriving a slug. A second pass over the same subject rarely phrases the topic the way the folder was named, so a fresh slug would open a duplicate beside a live folder.
|
|
42
42
|
|
|
43
43
|
Never match against `.claude/` itself. That directory holds every other workflow surface, so a topic matched there lands on a folder that was never an intake.
|
|
44
44
|
|
|
45
|
-
With no match, derive a kebab-case slug named for the subject rather than the activity. Prefer `toolkit-overview` over `august-triage`. Also list `.
|
|
45
|
+
With no match, derive a kebab-case slug named for the subject rather than the activity. Prefer `toolkit-overview` over `august-triage`. Also list `.canon/groundwork/` and take `<nn>` as the highest ordinal present across both listings, incremented, per `${CLAUDE_SKILL_DIR}/../../standards/intake.md`. An absent folder opens, and a present one resumes by appending items and revising verdicts the tree has moved under.
|
|
46
46
|
|
|
47
47
|
## Step 2: orient
|
|
48
48
|
|
|
@@ -51,7 +51,7 @@ Read these in parallel from the project root, skipping any that do not exist:
|
|
|
51
51
|
- `CLAUDE.md`: behavior rules, conventions, commands
|
|
52
52
|
- `.claude/REQUIREMENTS.md`: scope and non-goals
|
|
53
53
|
- `.claude/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.
|
|
57
57
|
|
|
@@ -90,12 +90,12 @@ Emit the full relative path from the project root for every file written, and na
|
|
|
90
90
|
A file the pass only read gets no line, which is what keeps the block short.
|
|
91
91
|
|
|
92
92
|
```plaintext
|
|
93
|
-
📂 Opened .
|
|
93
|
+
📂 Opened .canon/intake/<nn>-<slug>/
|
|
94
94
|
|
|
95
95
|
**Filed:**
|
|
96
96
|
|
|
97
|
-
- `.
|
|
98
|
-
- `.
|
|
97
|
+
- `.canon/intake/<nn>-<slug>/05-coverage.md` gains items 6 to 8 under a new `## What the merge gate covers`
|
|
98
|
+
- `.canon/intake/<nn>-<slug>/00-overview.md` cluster rows and verdict counts updated
|
|
99
99
|
|
|
100
100
|
**Routing:** <N> plan-ready, <N> groundwork candidates, <N> already settled
|
|
101
101
|
|
|
@@ -21,7 +21,7 @@ A second failure compounds the first. A claim copied across several files is cor
|
|
|
21
21
|
- Grep the named surface for the concern before proposing, so a defect's site count is measured rather than assumed
|
|
22
22
|
- Draft the replacement text, not only the finding
|
|
23
23
|
- Carry three labelled variants on a change whose replacement was invented, and one on a change that corrects text to a recorded fact
|
|
24
|
-
- Write one proposal file per source file under `.
|
|
24
|
+
- Write one proposal file per source file under `.canon/proposals/<slug>/` and stop, leaving `You:` empty on every change
|
|
25
25
|
- Apply only a change carrying an answer, one file at a time, and re-grep its anchor before applying it
|
|
26
26
|
- Report what each file leaves alone, so a proposal cannot be read as finding everything wanting
|
|
27
27
|
|
|
@@ -44,4 +44,4 @@ A second failure compounds the first. A claim copied across several files is cor
|
|
|
44
44
|
- Reporting a violation with no drafted replacement, which `claude-standards-audit` and `canon markdown audit` already own
|
|
45
45
|
- Reviewing a diff someone already wrote, which `claude-review` owns
|
|
46
46
|
- Filing a raw brain dump as findings, which `claude-intake` owns
|
|
47
|
-
- Reviewing `.
|
|
47
|
+
- Reviewing `.canon/memory/` and proposing promote-or-retire actions per entry, which `claude-memory-review` owns on a different subject with a different answer contract
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: claude-markdown-propose
|
|
3
|
-
description: Reviews a named markdown surface against a named concern, drafts a per-file proposal under `.
|
|
3
|
+
description: Reviews a named markdown surface against a named concern, drafts a per-file proposal under `.canon/proposals/<slug>/` carrying a diff and a reason for each change, and stops without editing a source file. Takes the concern and the surface as inputs, such as a claim stated stronger than the record, a fact gone stale, two files disagreeing, or a passage duplicated without derivation. A later invocation applies what the operator answered. Use when asked to "propose a change to CLAUDE.md", "draft a rewrite of this standard", "propose fixes to this doc", "draft alternatives for this passage", or "apply the answered proposals". Do NOT use to report without drafting a replacement (`claude-standards-audit` or `canon markdown audit`), to review a diff already made (`claude-review`), or to file a raw brain dump as findings (`claude-intake`).
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Claude markdown propose
|
|
@@ -20,16 +20,16 @@ The value is the gate. A rewrite delivered in chat gets applied from memory acro
|
|
|
20
20
|
|
|
21
21
|
Two phases share this body, picked by whether a proposal folder already exists for the request's slug.
|
|
22
22
|
|
|
23
|
-
Derive `<slug>` from the concern and the surface, kebab-case, naming the subject rather than the activity. List `.
|
|
23
|
+
Derive `<slug>` from the concern and the surface, kebab-case, naming the subject rather than the activity. List `.canon/proposals/` at the main worktree root and match the topic against the folders already there before deriving a fresh one, the same way `claude-intake` matches its own folder. Never match against `.claude/` itself.
|
|
24
24
|
|
|
25
25
|
- No matching folder, or the operator names a concern and a surface: **Propose**.
|
|
26
26
|
- A matching folder exists and the operator says apply, ship, or commit the answers: **Apply**.
|
|
27
27
|
|
|
28
|
-
All `.
|
|
28
|
+
All `.canon/proposals/` reads and writes resolve at the main worktree root, not the current worktree. See Worktrees in `CLAUDE.md`.
|
|
29
29
|
|
|
30
30
|
## Write scope
|
|
31
31
|
|
|
32
|
-
Write only inside `.
|
|
32
|
+
Write only inside `.canon/proposals/<slug>/`. A source file, a standard, a rule, and a plan all live outside that folder, so this one rule forbids every one of them during the Propose phase. The Apply phase is the one exception, and only for a change carrying a `You:` answer.
|
|
33
33
|
|
|
34
34
|
## Concerns
|
|
35
35
|
|
|
@@ -66,7 +66,7 @@ A matched string means different things in different registers. A word describin
|
|
|
66
66
|
|
|
67
67
|
### 4. Write the proposals
|
|
68
68
|
|
|
69
|
-
One file per source file under `.
|
|
69
|
+
One file per source file under `.canon/proposals/<slug>/`, per `${CLAUDE_SKILL_DIR}/references/format.md`.
|
|
70
70
|
|
|
71
71
|
Draft the replacement text. A proposal reporting a problem without a replacement hands the work back rather than doing it.
|
|
72
72
|
|
|
@@ -97,20 +97,20 @@ Report the counts once the pass stops: files committed, changes applied, changes
|
|
|
97
97
|
Chat output is the report. This skill persists only the proposal folder itself.
|
|
98
98
|
|
|
99
99
|
```plaintext
|
|
100
|
-
📂 Opened .
|
|
100
|
+
📂 Opened .canon/proposals/<slug>/
|
|
101
101
|
|
|
102
102
|
**Screened:** <N> files, <N> changes proposed, <N> carrying three variants
|
|
103
103
|
|
|
104
104
|
**Highest value:** <the single strongest change, one line>
|
|
105
105
|
|
|
106
|
-
Next: answer the `You:` slots in the files under .
|
|
106
|
+
Next: answer the `You:` slots in the files under .canon/proposals/<slug>/,
|
|
107
107
|
then re-invoke this skill to apply what you answered.
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
Use `📂 Resumed` in place of `📂 Opened` on a resume pass. The Apply phase reports instead:
|
|
111
111
|
|
|
112
112
|
```plaintext
|
|
113
|
-
✅ Applied .
|
|
113
|
+
✅ Applied .canon/proposals/<slug>/
|
|
114
114
|
|
|
115
115
|
**Committed:** <N> files, <N> changes
|
|
116
116
|
|
|
@@ -4,7 +4,7 @@ Governs the proposal `claude-markdown-propose` writes before it edits anything.
|
|
|
4
4
|
|
|
5
5
|
## Folder
|
|
6
6
|
|
|
7
|
-
- One folder per screening pass at `.
|
|
7
|
+
- One folder per screening pass at `.canon/proposals/<slug>/`, where the slug names the subject rather than the activity
|
|
8
8
|
- One proposal file per source file, named `<nn>-<source filename, its own extension dropped>.md`, so a source already named `CLAUDE.md` becomes `01-CLAUDE.md` rather than `01-CLAUDE.md.md`
|
|
9
9
|
- `00-overview.md` when the pass spans more than two source files, holding the cross-file pattern, the change counts, and the settle order
|
|
10
10
|
- `applied.md` once the first change lands, holding every applied change with its reason and the answer it carried
|
|
@@ -95,13 +95,13 @@ The folder is gitignored and unbacked. It carries decision state rather than gen
|
|
|
95
95
|
Count the unread changes per file:
|
|
96
96
|
|
|
97
97
|
```bash
|
|
98
|
-
grep -c '^- \*\*You:\*\*$' .
|
|
98
|
+
grep -c '^- \*\*You:\*\*$' .canon/proposals/<slug>/*.md
|
|
99
99
|
```
|
|
100
100
|
|
|
101
101
|
Report every answer given, against the change it sits under:
|
|
102
102
|
|
|
103
103
|
```bash
|
|
104
|
-
awk '/^### /{h=FILENAME": "$0} /^- \*\*You:\*\*./{print h; print " "$0}' .
|
|
104
|
+
awk '/^### /{h=FILENAME": "$0} /^- \*\*You:\*\*./{print h; print " "$0}' .canon/proposals/<slug>/*.md
|
|
105
105
|
```
|
|
106
106
|
|
|
107
107
|
Both walk `###` headings, which is the mechanical reason an answer typed anywhere else is lost.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: claude-memory-capture
|
|
3
|
-
description: Extracts durable patterns from the current session, routes a domain fact to the context entry that owns it, and writes the residue to `.
|
|
3
|
+
description: Extracts durable patterns from the current session, routes a domain fact to the context entry that owns it, and writes the residue to `.canon/memory/` as feedback, project, user, or reference files. Use when asked to "capture memory", "capture lessons", "wrap up the session", "end of session memory", or as a step in autoship. Do NOT use to curate existing memory. Use `claude-memory-review` for that.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Claude memory capture
|
|
7
7
|
|
|
8
|
-
Scan the current session for patterns worth persisting, send each to the surface that owns it, and leave in `.
|
|
8
|
+
Scan the current session for patterns worth persisting, send each to the surface that owns it, and leave in `.canon/memory/` only what no surface owns. Pair with `claude-memory-review` for later curation.
|
|
9
9
|
|
|
10
10
|
A fact about a domain belongs in that domain's context entry, which the three-tier model already loads on demand. Writing it to memory instead puts it in a folder nothing opens. Routing is therefore the point of this skill and the memory file is the fallback.
|
|
11
11
|
|
|
@@ -13,9 +13,9 @@ The filename and its type prefix, the frontmatter, the body shape each type carr
|
|
|
13
13
|
|
|
14
14
|
## Guards
|
|
15
15
|
|
|
16
|
-
- All `.
|
|
16
|
+
- All `.canon/memory/` reads and writes resolve at the main worktree root, not the current worktree. See Worktrees in `CLAUDE.md`.
|
|
17
17
|
- From a linked worktree the file-editing tools refuse every path below, so each write in this skill goes out through `Bash` as a plain single command. A memory entry holds one fact and this session has read it, so an update rewrites the whole file with a heredoc rather than editing a line inside it.
|
|
18
|
-
- If `.
|
|
18
|
+
- If `.canon/memory/` does not exist at the main worktree root, create it, along with an `index.md` carrying `title` and `subtitle` frontmatter. `canon claude init` seeds both, and a project predating that seed has neither. Regeneration errors without the index, so the first write into a bare folder would report a frontmatter failure against a file that is fine.
|
|
19
19
|
- If the session produced no user corrections, confirmations, or context disclosures worth persisting, stop: `✅ Nothing worth capturing.`
|
|
20
20
|
- Routing edits a tracked file, so it runs only where the caller commits. When the session is in the main worktree, or the caller states it does not commit, skip Step 3 and write every candidate as a memory file. `claude-orchestrate` is the caller this covers.
|
|
21
21
|
|
|
@@ -25,7 +25,7 @@ Read in parallel, skipping any that do not exist:
|
|
|
25
25
|
|
|
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
|
- `.claude/context/index.md`: the domain catalog Step 3 routes against
|
|
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
|
|
@@ -44,7 +44,7 @@ For each project candidate, match its subject against `.claude/context/index.md`
|
|
|
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. `claude-docs` 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 `.
|
|
47
|
+
Do not edit a context entry here. `claude-docs` 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. 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
|
```markdown
|
|
50
50
|
## .claude/context/<domain>.md
|
|
@@ -58,20 +58,20 @@ The handoff is a file rather than a spoken result so the routed fact survives a
|
|
|
58
58
|
|
|
59
59
|
## Step 4: dedupe
|
|
60
60
|
|
|
61
|
-
For each remaining candidate, grep `.
|
|
61
|
+
For each remaining candidate, grep `.canon/memory/` for an existing file on the same topic. If one exists, update it in place rather than create a new file. Read it first and write the whole file back, since the guard above rules out editing a line inside it.
|
|
62
62
|
|
|
63
63
|
## Step 5: write the residue
|
|
64
64
|
|
|
65
|
-
Write each remaining candidate to `.
|
|
65
|
+
Write each remaining candidate to `.canon/memory/<type>-<slug>.md`, following the template and the shape rules in `${CLAUDE_SKILL_DIR}/../../standards/memory.md`. Copy the shape from there rather than from this body, so one edit to the standard moves every entry.
|
|
66
66
|
|
|
67
67
|
Two of its rules are the ones a capture pass gets wrong under time pressure. State the rule rather than the incident that produced it, since the session ending is the only reader who has the narrative. Write the `title` as the rule itself, never as the filename stem.
|
|
68
68
|
|
|
69
|
-
Do not edit the index. `.
|
|
69
|
+
Do not edit the index. `.canon/memory/index.md` is generated from sibling frontmatter by a `PostToolUse` hook, the same way the task board's index is, so a hand-appended row is drift the next regeneration discards.
|
|
70
70
|
|
|
71
71
|
The hook matches `Write|Edit|MultiEdit`, so nothing fires on the shell writes a linked worktree makes. Regenerate the index once after the last write when the entries went out through `Bash`:
|
|
72
72
|
|
|
73
73
|
```bash
|
|
74
|
-
canon indexes regen --no-stage --root <main-root> <main-root>/.
|
|
74
|
+
canon indexes regen --no-stage --root <main-root> <main-root>/.canon/memory/index.md
|
|
75
75
|
```
|
|
76
76
|
|
|
77
77
|
Run `canon records validate memory` when the writes are done and fix what it names. It reads the whole pen rather than this session's writes, so treat a finding on a carried entry as one to fix in place rather than as a reason to stop.
|
|
@@ -81,12 +81,12 @@ Run `canon records validate memory` when the writes are done and fix what it nam
|
|
|
81
81
|
Respond with one line per fact routed, written, or updated:
|
|
82
82
|
|
|
83
83
|
- `➡️ Routed: <fact subject> → .claude/context/<domain>.md`
|
|
84
|
-
- `✅ Wrote: .
|
|
85
|
-
- `✏️ Updated: .
|
|
84
|
+
- `✅ Wrote: .canon/memory/<file> (<type>)`
|
|
85
|
+
- `✏️ Updated: .canon/memory/<file> (<type>)`
|
|
86
86
|
|
|
87
87
|
When anything routed, add a line naming the handoff so the caller knows a `claude-docs` pass is owed:
|
|
88
88
|
|
|
89
|
-
`→ Routed facts wait at .
|
|
89
|
+
`→ Routed facts wait at .canon/tmp/memory-routing/<slug>.md. Run /claude-docs to fold them in.`
|
|
90
90
|
|
|
91
91
|
Omit that line when the caller runs `claude-docs` itself later in its own chain.
|
|
92
92
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: claude-memory-review
|
|
3
|
-
description: Reviews `.
|
|
3
|
+
description: Reviews `.canon/memory/` and proposes per-entry actions (promote to `CLAUDE.md`, move into a skill body, route to a context entry, hand off to governance, or retire as stale). Also runs the discuss, challenge, apply, and cleanup phases on an existing review file. Use when asked to "review memory", "discuss memory questions", "challenge the promotes", "apply memory decisions", "cleanup memory review", "promote memory", or "consolidate memories". Do NOT auto-apply. Output a grouped proposal and wait for block-by-block approval.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Claude memory review
|
|
7
7
|
|
|
8
|
-
This skill drives the full memory review lifecycle in five phases. Pick the phase from what the user said and whether a review receipt already exists at `<main-root>/.
|
|
8
|
+
This skill drives the full memory review lifecycle in five phases. Pick the phase from what the user said and whether a review receipt already exists at `<main-root>/.canon/review/memory/memory-review-*.md`.
|
|
9
9
|
|
|
10
10
|
What an entry looks like and why a retired one is moved rather than deleted are fixed by `${CLAUDE_SKILL_DIR}/../../standards/memory.md`. Read it before rewriting an entry, since a promotion rewrites the rule and a rewrite has to leave the entry conforming.
|
|
11
11
|
|
|
@@ -21,10 +21,10 @@ If the user re-pings the skill with no new phrase and a receipt exists, default
|
|
|
21
21
|
|
|
22
22
|
## Guards
|
|
23
23
|
|
|
24
|
-
- All `.
|
|
25
|
-
- If no `.
|
|
26
|
-
- If `.
|
|
27
|
-
- Cleanup is exempt from the two stops above. It works on receipts in `.
|
|
24
|
+
- All `.canon/memory/` reads, edits, and archive moves resolve at the main worktree root, not the current worktree. See Worktrees in `CLAUDE.md`.
|
|
25
|
+
- If no `.canon/memory/` directory exists at the main worktree root, stop: `❌ No .canon/memory/ directory found.`
|
|
26
|
+
- If `.canon/memory/` contains no `*.md` entries other than `index.md`, stop: `✅ No memory entries to review.`
|
|
27
|
+
- Cleanup is exempt from the two stops above. It works on receipts in `.canon/review/`, and a drained pen is the normal state once Apply has run, so a pen-shaped stop would strand the receipt it exists to delete.
|
|
28
28
|
- Resolve the main root via `git worktree list --porcelain | grep -m 1 '^worktree ' | cut -d' ' -f2-`, falling back to `pwd`. All review and memory reads anchor here.
|
|
29
29
|
- From a linked worktree the file-editing tools refuse every main-root path, so each write below goes out through `Bash` as a plain single command. The receipt and a memory entry are both short and this session has read them whole, so a rewrite replaces the file with a heredoc rather than editing a line inside it. Promotion targets are tracked files at `pwd` and keep taking `Edit`.
|
|
30
30
|
|
|
@@ -41,8 +41,8 @@ Propose is the ship-time entry point. The ship skills run it right after capture
|
|
|
41
41
|
|
|
42
42
|
Read in parallel from the project root:
|
|
43
43
|
|
|
44
|
-
- `.
|
|
45
|
-
- every other `*.md` file under `.
|
|
44
|
+
- `.canon/memory/index.md`: the generated index
|
|
45
|
+
- every other `*.md` file under `.canon/memory/`: individual entries with frontmatter (`title`, `description`, `category`)
|
|
46
46
|
|
|
47
47
|
### Step 2: read promotion targets
|
|
48
48
|
|
|
@@ -56,7 +56,7 @@ Read in parallel from the project root. Skip any file or folder that does not ex
|
|
|
56
56
|
|
|
57
57
|
### Step 3: classify each entry
|
|
58
58
|
|
|
59
|
-
`.
|
|
59
|
+
`.canon/memory/` is a holding pen. Default every entry to promote or retire on review. Skip is the rare exception, reserved for active task overlap or user-type memories with no in-repo target.
|
|
60
60
|
|
|
61
61
|
`claude-memory-capture` routes a project fact naming a domain with a context entry to that entry, so a pen filled since routing shipped is mostly feedback: rules about how to work, which no context entry owns. Propose against what the pen holds rather than expecting the older mix. An entry carried from before routing may still name a domain that has a context entry, and that entry's action is **Promote to a context entry**, which hands it to `claude-docs` the same way capture does rather than editing the entry here.
|
|
62
62
|
|
|
@@ -65,11 +65,11 @@ 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 `.claude/context/index.md`. Append it to `.
|
|
68
|
+
- **Promote to a context entry**: the entry states a fact about a domain carrying an entry in `.claude/context/index.md`. Append it to `.canon/tmp/memory-routing/<slug>.md` in the format `claude-memory-capture` writes, and tell the user to run `/claude-docs` 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/`.
|
|
72
|
-
- **Retire**: the rule is stale, already absorbed into a durable surface, too vague to phrase as a rule, or a one-time incident narrative. Apply moves the file to `.
|
|
72
|
+
- **Retire**: the rule is stale, already absorbed into a durable surface, too vague to phrase as a rule, or a one-time incident narrative. Apply moves the file to `.canon/tmp/memory-archive/` rather than deleting it.
|
|
73
73
|
|
|
74
74
|
Retire is an archive, not a deletion, which `${CLAUDE_SKILL_DIR}/../../standards/memory.md` states as the rule and this skill executes. The archive is worth less than a plan's, since a promoted entry survives in its destination and a stale one is discarded on purpose, which is why the move is cheap rather than free.
|
|
75
75
|
|
|
@@ -89,11 +89,11 @@ Rules that resist crisp one-line phrasing default to **Retire** over promote. Ne
|
|
|
89
89
|
|
|
90
90
|
Derive `<slug>` per `${CLAUDE_SKILL_DIR}/../../standards/slug.md`. Fall back to `latest` on an empty result.
|
|
91
91
|
|
|
92
|
-
Write the full proposal to `.
|
|
92
|
+
Write the full proposal to `.canon/review/memory/memory-review-<slug>.md` at the main worktree root. Do not print it inline. Read `${CLAUDE_SKILL_DIR}/references/receipt-format.md` for the file structure, the item template, and how each action type varies the body. The four phases below rewrite items inside an existing receipt rather than authoring one, so none of them opens it.
|
|
93
93
|
|
|
94
94
|
A phase changing items reads the receipt, applies every change for that phase, and writes the whole file back in one command. Batching is what keeps a per-item rewrite from costing a full read each time, and it is the only route from a linked worktree, where the guard above rules out editing a line in place.
|
|
95
95
|
|
|
96
|
-
Tell the user `✅ Wrote proposal to .
|
|
96
|
+
Tell the user `✅ Wrote proposal to .canon/review/memory/memory-review-<slug>.md`. Ask them to fill in `Decision:` per item, then re-ping with "discuss" for question rounds or "apply" to commit.
|
|
97
97
|
|
|
98
98
|
Rewrite the review file in place whenever the proposal changes mid-review. The file stays the source of truth for the current decisions.
|
|
99
99
|
|
|
@@ -101,7 +101,7 @@ Rewrite the review file in place whenever the proposal changes mid-review. The f
|
|
|
101
101
|
|
|
102
102
|
Trigger: user says "challenge the promotes", "challenge before apply", or asks for a high-bar pass. Run before Apply. No mutations to memory files or promotion targets. Review file only.
|
|
103
103
|
|
|
104
|
-
1. Read the latest `.
|
|
104
|
+
1. Read the latest `.canon/review/memory/memory-review-*.md` at the main root.
|
|
105
105
|
2. For each promote item, apply three tests:
|
|
106
106
|
- **Absorbed**: grep the target surface for the rule's keywords. If already stated or implied, flip to retire.
|
|
107
107
|
- **Delta**: if the rule is a nice-to-have next to existing bullets, flip to retire.
|
|
@@ -112,7 +112,7 @@ Trigger: user says "challenge the promotes", "challenge before apply", or asks f
|
|
|
112
112
|
|
|
113
113
|
Trigger: user says "discuss", "respond to questions", or any `Decision:` value contains `?` or an unrecognized verb. No mutations to memory files or targets. Review file only. Multi-round.
|
|
114
114
|
|
|
115
|
-
1. Read the latest `.
|
|
115
|
+
1. Read the latest `.canon/review/memory/memory-review-*.md` at the main root.
|
|
116
116
|
2. For each item whose `Decision:` contains `?` or any unrecognized verb (anything other than `apply`, `skip`, `defer`):
|
|
117
117
|
- Write a `Take:` line under `Decision:`, separated by exactly one blank line. If a `Take:` line already exists, overwrite it.
|
|
118
118
|
- Format: pick + one-line reason. Max 2 sentences. Decision-help style. State the recommendation (`apply` / `skip` / `retire` / specific alternative) first, then the reason. Do not enumerate tradeoffs unless one changes the call.
|
|
@@ -132,7 +132,7 @@ Before applying any item, check the worktree state:
|
|
|
132
132
|
[ "$(git rev-parse --git-dir 2>/dev/null)" = "$(git rev-parse --git-common-dir 2>/dev/null)" ] && echo "MAIN" || echo "LINKED"
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
-
If the result is `MAIN`, stop and tell the user: `❌ Apply phase mutates tracked files. Run /claude-worktree first.` Discuss and Challenge phases only touch `.
|
|
135
|
+
If the result is `MAIN`, stop and tell the user: `❌ Apply phase mutates tracked files. Run /claude-worktree first.` Discuss and Challenge phases only touch `.canon/review/` scratch and run from anywhere.
|
|
136
136
|
|
|
137
137
|
Before applying a promote to root `CLAUDE.md`, load `internal-claude` so its seed-mirror rule fires on the edit.
|
|
138
138
|
|
|
@@ -150,16 +150,16 @@ Free-form text after the verb is a reason. Capture it in the receipt but do not
|
|
|
150
150
|
Action by action type:
|
|
151
151
|
|
|
152
152
|
- **Promote**: use `Edit` to insert the rewritten rule into the target surface, then archive the memory file.
|
|
153
|
-
- **Promote to a context entry**: append the fact to `.
|
|
153
|
+
- **Promote to a context entry**: append the fact to `.canon/tmp/memory-routing/<slug>.md`, then archive the memory file. `claude-docs` folds it in on its next run from a branch, which is what keeps one skill writing context entries.
|
|
154
154
|
- **Hand off**: do not edit governance. Archive the memory file only if the user confirmed the handoff explicitly. Otherwise leave it in place.
|
|
155
155
|
- **Retire**: archive the memory file.
|
|
156
156
|
|
|
157
|
-
Archiving means creating `.
|
|
157
|
+
Archiving means creating `.canon/tmp/memory-archive/` at the main worktree root and moving the file there under its original name, overwriting any file already at that name. Send the `mkdir -p` and the `mv` as two plain commands rather than joining them with `&&`, which is refused as compound from a linked worktree. Never delete a memory entry. Nothing recovers one from a gitignored folder.
|
|
158
158
|
|
|
159
|
-
Do not hand-edit `.
|
|
159
|
+
Do not hand-edit `.canon/memory/index.md`. Once every archive move is done, regenerate it instead:
|
|
160
160
|
|
|
161
161
|
```bash
|
|
162
|
-
canon indexes regen --no-stage --root <main-root> <main-root>/.
|
|
162
|
+
canon indexes regen --no-stage --root <main-root> <main-root>/.canon/memory/index.md
|
|
163
163
|
```
|
|
164
164
|
|
|
165
165
|
The `PostToolUse` hook that keeps the index current matches `Write|Edit|MultiEdit`, and an archive move is a shell `mv`, so nothing fires on it. Without this call the index keeps a row per archived entry and drifts exactly the way the hand-appended one did. Run it once after the last move rather than per item.
|
|
@@ -186,11 +186,11 @@ End with: `✅ Applied: <nums> | ⏭ Skipped: <nums> | 📝 Pending: <nums>`. Om
|
|
|
186
186
|
|
|
187
187
|
Trigger: user says "cleanup" or "delete the receipt" after Apply has run.
|
|
188
188
|
|
|
189
|
-
Cleanup folds one receipt's skips and removes that receipt, and does nothing else. It is the fallback route now that Apply and `claude-docs` Step 10 each collect a resolved receipt on their own, so it reaches a file those two left behind rather than being the only collector. Apply is still the only phase that moves a memory entry out of the pen, and it does so per approved item into `.
|
|
189
|
+
Cleanup folds one receipt's skips and removes that receipt, and does nothing else. It is the fallback route now that Apply and `claude-docs` Step 10 each collect a resolved receipt on their own, so it reaches a file those two left behind rather than being the only collector. Apply is still the only phase that moves a memory entry out of the pen, and it does so per approved item into `.canon/tmp/memory-archive/`. A user asking to sweep stale memories wants Propose, which classifies entries and writes a decision slot per entry.
|
|
190
190
|
|
|
191
|
-
If no `.
|
|
191
|
+
If no `.canon/review/memory/memory-review-*.md` exists at the main root, stop: `✅ No review receipt to clean up.` Every other refusal in this skill carries a message, and the phase reads a receipt before it does anything else.
|
|
192
192
|
|
|
193
|
-
1. Read the latest `.
|
|
193
|
+
1. Read the latest `.canon/review/memory/memory-review-*.md` at the main root and confirm Apply has run against it. If any item is still 📝 pending, stop and name the pending numbers.
|
|
194
194
|
2. Collect it per the collection rule in `${CLAUDE_SKILL_DIR}/../../standards/memory.md`, folding each ⏭ skipped item before the file goes. The fold happens wherever a receipt is collected, so this phase runs the same rule the Apply sweep does.
|
|
195
195
|
3. Delete that one file. Leave every other receipt beside it in place, because the pending test above covers the file it read and nothing has tested the rest.
|
|
196
196
|
4. Leave every memory entry in the pen. A skip records the decline on the entry and keeps the file, and applied promotions, governance handoffs, and user-type memories each stay as the review left them.
|
|
@@ -201,10 +201,10 @@ Do not promote or archive a memory entry. The skip fold is the one rewrite this
|
|
|
201
201
|
|
|
202
202
|
Output one line per action taken in the most recent phase:
|
|
203
203
|
|
|
204
|
-
- `✅ Promoted: .
|
|
205
|
-
- `✅ Handed off: .
|
|
206
|
-
- `📦 Retired: .
|
|
207
|
-
- `🗑 Swept: .
|
|
208
|
-
- `⏭ Kept: .
|
|
204
|
+
- `✅ Promoted: .canon/memory/<memory-file> → <target>`
|
|
205
|
+
- `✅ Handed off: .canon/memory/<memory-file> → governance`
|
|
206
|
+
- `📦 Retired: .canon/memory/<memory-file> → .canon/tmp/memory-archive/`
|
|
207
|
+
- `🗑 Swept: .canon/review/<review-file>, folded <n> skips`
|
|
208
|
+
- `⏭ Kept: .canon/review/<review-file>, <n> items pending`
|
|
209
209
|
|
|
210
210
|
If the user accepted nothing, output: `✅ No changes applied.`
|
|
@@ -5,7 +5,7 @@ description: The proposal file structure, its item template, and how each action
|
|
|
5
5
|
|
|
6
6
|
# Memory review receipt format
|
|
7
7
|
|
|
8
|
-
The shape Step 4 of the Propose phase writes to `.
|
|
8
|
+
The shape Step 4 of the Propose phase writes to `.canon/review/memory/memory-review-<slug>.md`. Only Propose writes this file. Challenge, Discuss, and Apply rewrite items inside a receipt that already exists, and Cleanup deletes one, so none of the four needs this file.
|
|
9
9
|
|
|
10
10
|
## Structure
|
|
11
11
|
|