@erclx/canon 4.86.0 → 4.88.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/auto-ship/SKILL.md +6 -6
- package/claude/skills/canon-feedback-file/SKILL.md +2 -2
- package/claude/skills/design-extract/SKILL.md +3 -3
- package/claude/skills/docs-fold/SKILL.md +6 -6
- package/claude/skills/draft-and-pick/SKILL.md +1 -1
- package/claude/skills/draft-diagram/SKILL.md +2 -2
- package/claude/skills/draft-slides/SKILL.md +1 -1
- package/claude/skills/git-followup/SKILL.md +1 -1
- package/claude/skills/git-pr/SKILL.md +8 -8
- package/claude/skills/git-split/SKILL.md +19 -19
- package/claude/skills/memory-capture/SKILL.md +2 -2
- package/claude/skills/memory-review/SKILL.md +2 -2
- package/claude/skills/plan-groundwork/SKILL.md +1 -1
- package/claude/skills/review-address/SKILL.md +11 -11
- package/claude/skills/review-branch/SKILL.md +3 -3
- package/claude/skills/review-pr/SKILL.md +2 -2
- package/claude/skills/role-orchestrator/references/orchestrator-poll.md +1 -1
- package/claude/skills/role-orchestrator/scripts/poll.sh +1 -1
- package/claude/skills/sketch-design/SKILL.md +4 -4
- package/claude/skills/teach-workspace/SKILL.md +2 -2
- package/claude/skills/ui-test/REQUIREMENT.md +1 -1
- package/claude/skills/ui-test/SKILL.md +2 -2
- package/docs/agents/commands.md +99 -96
- package/docs/agents/design-board.md +7 -7
- package/docs/agents/records.md +27 -0
- package/docs/agents/sandbox.md +1 -1
- package/docs/workflow/ai-workflow.md +5 -3
- package/docs/workflow/visual-design-workflow.md +1 -1
- package/governance/rules/core/055-scratch.md +1 -0
- package/package.json +1 -1
- package/scripts/tooling/verify.sh +2 -2
- package/src/claude/skills-headings.ts +1 -1
- package/src/cli.ts +1 -1
- package/src/commands/design.ts +3 -3
- package/src/commands/feedback.ts +12 -12
- package/src/commands/migrate.ts +36 -13
- package/src/commands/records.ts +159 -0
- package/src/commands/slides.ts +2 -2
- package/src/design/board.ts +17 -10
- package/src/migrate/evidence-ordinal.ts +79 -0
- package/src/migrate/record-layout.ts +328 -75
- package/src/migrate/scratch-evidence.ts +60 -35
- package/src/record-root.ts +3 -0
- package/src/records/prune.ts +488 -0
- package/src/records/size.ts +24 -1
- package/standards/publish.md +1 -1
- package/standards/skill.md +1 -1
- package/tooling/claude/seeds/.claude/hooks/index-reminder.sh +2 -2
- package/tooling/claude/seeds/.claude/hooks/pr-create-log.sh +2 -2
- package/tooling/claude/seeds/.claude/hooks/scratch-guard.sh +2 -2
- package/tooling/claude/seeds/CLAUDE.md +2 -6
package/src/records/size.ts
CHANGED
|
@@ -87,7 +87,7 @@ interface Walked {
|
|
|
87
87
|
* already, since these folders are gitignored and hold whatever that disk holds,
|
|
88
88
|
* so a local date is the answer consistent with the rest of the report.
|
|
89
89
|
*/
|
|
90
|
-
function day(ms: number): string {
|
|
90
|
+
export function day(ms: number): string {
|
|
91
91
|
const at = new Date(ms)
|
|
92
92
|
const month = String(at.getMonth() + 1).padStart(2, '0')
|
|
93
93
|
const date = String(at.getDate()).padStart(2, '0')
|
|
@@ -245,6 +245,29 @@ export async function sizeRecords(
|
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
+
/**
|
|
249
|
+
* The file count, byte total, and newest `mtime` under one path, for a caller
|
|
250
|
+
* that wants a unit's freshness rather than the full per-window reading.
|
|
251
|
+
*
|
|
252
|
+
* It walks with the same `walk`/`absorb` pair `sizeRecords` uses, so the two
|
|
253
|
+
* verbs agree on what counts as a file and which mtime a rewritten entry
|
|
254
|
+
* carries, rather than each answering from a second walk of its own.
|
|
255
|
+
*/
|
|
256
|
+
export async function newestMtime(
|
|
257
|
+
path: string,
|
|
258
|
+
): Promise<{ files: number; bytes: number; newest?: number } | undefined> {
|
|
259
|
+
if (!existsSync(path)) return undefined
|
|
260
|
+
|
|
261
|
+
const walked: Walked = {
|
|
262
|
+
files: 0,
|
|
263
|
+
bytes: 0,
|
|
264
|
+
touched: GROWTH_WINDOWS.map(() => 0),
|
|
265
|
+
}
|
|
266
|
+
await walk(path, walked, Date.now())
|
|
267
|
+
|
|
268
|
+
return { files: walked.files, bytes: walked.bytes, newest: walked.newest }
|
|
269
|
+
}
|
|
270
|
+
|
|
248
271
|
const UNITS = ['B', 'K', 'M', 'G'] as const
|
|
249
272
|
|
|
250
273
|
/**
|
package/standards/publish.md
CHANGED
|
@@ -40,7 +40,7 @@ This check is one of the two the destination rule above scopes. The reader insid
|
|
|
40
40
|
|
|
41
41
|
A phase label is one way text names the board, and a path under a record root is the other. Both resolve for a reader holding this checkout and neither resolves for anyone else, so this check is the second one the destination rule scopes.
|
|
42
42
|
|
|
43
|
-
Two shapes get past a reader scanning for a bare label. A code span quoting a label is still the label, so read a span whose whole content is one as a hit and leave a longer token inside a span alone, which is a fixture name rather than a reference. The second shape is a path under a record root, gitignored and therefore absent from every clone, so `.canon/
|
|
43
|
+
Two shapes get past a reader scanning for a bare label. A code span quoting a label is still the label, so read a span whose whole content is one as a hit and leave a longer token inside a span alone, which is a fixture name rather than a reference. The second shape is a path under a record root, gitignored and therefore absent from every clone, so `.canon/feedback/` names a folder the remote's reader cannot open.
|
|
44
44
|
|
|
45
45
|
Under the tracked `canon/` and `.claude/` folders there is no hit, since `canon/context/governance/rules.md` resolves everywhere. `.canon/` carries no such carve-out: one ignore line covers the root whole, so every path beneath it is a hit regardless of which folder names it.
|
|
46
46
|
|
package/standards/skill.md
CHANGED
|
@@ -210,7 +210,7 @@ Without this skill, a session <observed failure>, <observed failure>.
|
|
|
210
210
|
### Output and tuning
|
|
211
211
|
|
|
212
212
|
- Skill success lines emit the full relative path from the project root (`<dir>/<file>`) for any file written, updated, or deleted. A bare filename names a file the reader cannot open. The `## Output` section of the project's instruction file sets the form that path takes, so a skill body states which path is emitted and leaves the form to that section.
|
|
213
|
-
- Before a skill writes anything, decide whether the output is a deliverable the project keeps or a toolkit session record. A deliverable lands among the project's own tracked files. A session record lands under `.canon/`, in the named subfolder for its kind (`tasks/`, `plans/`, `review/`, `memory/`, `groundwork/`, `intake/`, `proposals/`, `diagrams/`, `teach/`, `ready/`, or `walkthroughs/`, with `tmp/` for scratch nothing else claims), never in a folder the body invents. `canon/ARCHITECTURE.md`'s per-folder decisions are the precedent for which kind takes which folder.
|
|
213
|
+
- Before a skill writes anything, decide whether the output is a deliverable the project keeps or a toolkit session record. A deliverable lands among the project's own tracked files. A session record lands under `.canon/`, in the named subfolder for its kind (`tasks/`, `plans/`, `review/`, `memory/`, `groundwork/`, `intake/`, `proposals/`, `diagrams/`, `teach/`, `ready/`, `feedback/`, `picks/`, `evidence/`, `transcripts/`, or `walkthroughs/`, with `tmp/` for scratch nothing else claims), never in a folder the body invents. A `review/` writer names its file `<kind>-<slug>.md` and writes it flat, and an `evidence/` folder takes the next two-digit ordinal as `<nn>-<slug>/`, numbered in the order the folders first appeared. `canon/ARCHITECTURE.md`'s per-folder decisions are the precedent for which kind takes which folder.
|
|
214
214
|
- Codify a skill's posted or generated output as a fenced template, and keep the body consistent with every capability the frontmatter description names.
|
|
215
215
|
- When a skill gathers user input or pre-seeds a template, attach a concrete proposed default to every question, derived from project context. Accept "use defaults" as a bulk-confirm.
|
|
216
216
|
- Separate correctness axes (routing, sourcing, escalation, decline) from shape axes (line count, formatting, variant sprawl) when tuning a skill. Tighten only on correctness regressions. Do not convert soft caps to hard caps for aesthetic drift when correctness passes.
|
|
@@ -44,9 +44,9 @@ key=$(printf '%s__%s' "$session" "$index" | tr -c 'A-Za-z0-9' '_')
|
|
|
44
44
|
# root the project carries rather than creating a second one beside it.
|
|
45
45
|
project="${CLAUDE_PROJECT_DIR:-.}"
|
|
46
46
|
if [ -d "$project/.canon" ]; then
|
|
47
|
-
marker_dir="$project/.canon/tmp/index-reminder"
|
|
47
|
+
marker_dir="$project/.canon/tmp/hooks/index-reminder"
|
|
48
48
|
else
|
|
49
|
-
marker_dir="$project/.claude/.tmp/index-reminder"
|
|
49
|
+
marker_dir="$project/.claude/.tmp/hooks/index-reminder"
|
|
50
50
|
fi
|
|
51
51
|
marker="$marker_dir/$key"
|
|
52
52
|
[ -f "$marker" ] && exit 0
|
|
@@ -43,9 +43,9 @@ esac
|
|
|
43
43
|
# The log is scratch, so it follows the scratch folder to whichever record root
|
|
44
44
|
# the project carries rather than creating a second one beside it.
|
|
45
45
|
if [ -d "$root/.canon" ]; then
|
|
46
|
-
log_dir="$root/.canon/tmp/pr
|
|
46
|
+
log_dir="$root/.canon/tmp/pr/log"
|
|
47
47
|
else
|
|
48
|
-
log_dir="$root/.claude/.tmp/pr
|
|
48
|
+
log_dir="$root/.claude/.tmp/pr/log"
|
|
49
49
|
fi
|
|
50
50
|
mkdir -p "$log_dir"
|
|
51
51
|
session=$(printf '%s' "$input" | jq -r '.session_id // "unknown"')
|
|
@@ -48,9 +48,9 @@ session=$(printf '%s' "$input" | jq -r '.session_id // "none"')
|
|
|
48
48
|
key=$(printf '%s' "$session" | tr -c 'A-Za-z0-9' '_')
|
|
49
49
|
project="${CLAUDE_PROJECT_DIR:-.}"
|
|
50
50
|
if [ -d "$project/.canon" ]; then
|
|
51
|
-
marker_dir="$project/.canon/tmp/scratch-guard"
|
|
51
|
+
marker_dir="$project/.canon/tmp/hooks/scratch-guard"
|
|
52
52
|
else
|
|
53
|
-
marker_dir="$project/.claude/.tmp/scratch-guard"
|
|
53
|
+
marker_dir="$project/.claude/.tmp/hooks/scratch-guard"
|
|
54
54
|
fi
|
|
55
55
|
marker="$marker_dir/$key"
|
|
56
56
|
[ -f "$marker" ] && exit 0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Project
|
|
2
2
|
|
|
3
|
-
[One
|
|
3
|
+
[One or two line description]
|
|
4
4
|
|
|
5
5
|
## Context
|
|
6
6
|
|
|
@@ -13,13 +13,9 @@
|
|
|
13
13
|
|
|
14
14
|
## Commands
|
|
15
15
|
|
|
16
|
-
-
|
|
17
|
-
- [Command to run before committing]. Full script reference in the development entry under `canon/context/`.
|
|
16
|
+
- [Command to run before committing]
|
|
18
17
|
|
|
19
18
|
## Key paths
|
|
20
19
|
|
|
21
20
|
- `src/`: [description]
|
|
22
21
|
- `canon/DESIGN.md`: design tokens and the visual system
|
|
23
|
-
- `canon/context/`: per-domain narrative (how a domain is structured, decisions, gotchas), indexed via `canon/context/index.md`
|
|
24
|
-
- `canon/wireframes/`: per-surface regions and states loaded on demand, indexed via `canon/wireframes/index.md`
|
|
25
|
-
- `canon/decisions/`: decision history a project doc points at, never loaded eagerly
|