@erclx/canon 4.66.0 → 4.68.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/{claude-autoship → auto-ship}/REQUIREMENT.md +3 -3
- package/claude/skills/{claude-autoship → auto-ship}/SKILL.md +36 -36
- package/claude/skills/canon-cli/REQUIREMENT.md +2 -2
- package/claude/skills/canon-cli/SKILL.md +2 -2
- package/claude/skills/canon-feedback-triage/REQUIREMENT.md +1 -1
- package/claude/skills/canon-feedback-triage/SKILL.md +3 -3
- package/claude/skills/canon-operator/REQUIREMENT.md +1 -1
- package/claude/skills/canon-operator/SKILL.md +4 -4
- package/claude/skills/canon-rollout/REQUIREMENT.md +6 -6
- package/claude/skills/canon-rollout/SKILL.md +7 -7
- package/claude/skills/{claude-design-extract → design-extract}/REQUIREMENT.md +4 -4
- package/claude/skills/{claude-design-extract → design-extract}/SKILL.md +1 -1
- package/claude/skills/{claude-docs → docs-fold}/REQUIREMENT.md +3 -3
- package/claude/skills/{claude-docs → docs-fold}/SKILL.md +14 -14
- package/claude/skills/{claude-docs → docs-fold}/references/anchor-sweep.md +1 -1
- package/claude/skills/{claude-docs → docs-fold}/references/wireframe-sweep.md +1 -1
- package/claude/skills/docs-sync/REQUIREMENT.md +3 -3
- package/claude/skills/docs-sync/SKILL.md +1 -1
- package/claude/skills/draft-and-pick/REQUIREMENT.md +4 -4
- package/claude/skills/draft-and-pick/SKILL.md +6 -6
- package/claude/skills/draft-context/REQUIREMENT.md +2 -2
- package/claude/skills/draft-context/SKILL.md +3 -3
- package/claude/skills/{claude-diagram → draft-diagram}/REQUIREMENT.md +4 -4
- package/claude/skills/{claude-diagram → draft-diagram}/SKILL.md +3 -3
- package/claude/skills/draft-docs/REQUIREMENT.md +1 -1
- package/claude/skills/draft-wireframes/REQUIREMENT.md +1 -1
- package/claude/skills/draft-wireframes/SKILL.md +2 -2
- package/claude/skills/git-followup/REQUIREMENT.md +1 -1
- package/claude/skills/git-followup/SKILL.md +1 -1
- package/claude/skills/git-pr/SKILL.md +3 -3
- package/claude/skills/git-ship/REQUIREMENT.md +2 -2
- package/claude/skills/git-ship/SKILL.md +8 -8
- package/claude/skills/git-worktree/REQUIREMENT.md +2 -2
- package/claude/skills/git-worktree/SKILL.md +3 -3
- package/claude/skills/identity/REQUIREMENT.md +2 -2
- package/claude/skills/identity/SKILL.md +3 -3
- package/claude/skills/{claude-markdown-propose → markdown-propose}/REQUIREMENT.md +8 -8
- package/claude/skills/{claude-markdown-propose → markdown-propose}/SKILL.md +5 -5
- package/claude/skills/{claude-markdown-propose → markdown-propose}/references/format.md +1 -1
- package/claude/skills/{claude-memory-capture → memory-capture}/REQUIREMENT.md +5 -5
- package/claude/skills/{claude-memory-capture → memory-capture}/SKILL.md +13 -13
- package/claude/skills/{claude-memory-review → memory-review}/REQUIREMENT.md +4 -4
- package/claude/skills/{claude-memory-review → memory-review}/SKILL.md +10 -10
- package/claude/skills/migration-context/SKILL.md +1 -1
- package/claude/skills/migration-standards-drop/REQUIREMENT.md +1 -1
- package/claude/skills/migration-superseded/REQUIREMENT.md +1 -1
- package/claude/skills/{claude-feature → plan-feature}/REQUIREMENT.md +4 -4
- package/claude/skills/{claude-feature → plan-feature}/SKILL.md +4 -4
- package/claude/skills/{claude-groundwork → plan-groundwork}/REQUIREMENT.md +5 -5
- package/claude/skills/{claude-groundwork → plan-groundwork}/SKILL.md +8 -8
- package/claude/skills/{claude-intake → plan-intake}/REQUIREMENT.md +6 -6
- package/claude/skills/{claude-intake → plan-intake}/SKILL.md +10 -10
- package/claude/skills/{claude-intake-answer → plan-intake-answer}/REQUIREMENT.md +4 -4
- package/claude/skills/{claude-intake-answer → plan-intake-answer}/SKILL.md +5 -5
- package/claude/skills/{claude-address-review → review-address}/REQUIREMENT.md +5 -5
- package/claude/skills/{claude-address-review → review-address}/SKILL.md +6 -6
- package/claude/skills/{claude-address-review → review-address}/references/rebase-conflicts.md +1 -1
- package/claude/skills/{claude-review → review-branch}/REQUIREMENT.md +4 -4
- package/claude/skills/{claude-review → review-branch}/SKILL.md +4 -4
- package/claude/skills/{claude-pr-review → review-pr}/REQUIREMENT.md +5 -5
- package/claude/skills/{claude-pr-review → review-pr}/SKILL.md +11 -11
- package/claude/skills/{claude-orchestrate → role-orchestrator}/REQUIREMENT.md +5 -5
- package/claude/skills/{claude-orchestrate → role-orchestrator}/SKILL.md +20 -20
- package/claude/skills/{claude-orchestrate → role-orchestrator}/references/orchestrator-dispatch.md +30 -30
- package/claude/skills/{claude-orchestrate → role-orchestrator}/references/orchestrator-handoff.md +2 -2
- package/claude/skills/{claude-orchestrate → role-orchestrator}/references/orchestrator-parked.md +8 -8
- package/claude/skills/{claude-orchestrate → role-orchestrator}/references/orchestrator-poll.md +8 -8
- package/claude/skills/{claude-orchestrate → role-orchestrator}/references/orchestrator-resume.md +1 -1
- package/claude/skills/{claude-orchestrate → role-orchestrator}/references/orchestrator-sweep.md +1 -1
- package/claude/skills/{claude-orchestrate → role-orchestrator}/scripts/poll.sh +6 -6
- package/claude/skills/{claude-planner → role-planner}/REQUIREMENT.md +12 -12
- package/claude/skills/{claude-planner → role-planner}/SKILL.md +4 -4
- package/claude/skills/{claude-worker → role-worker}/REQUIREMENT.md +8 -8
- package/claude/skills/{claude-worker → role-worker}/SKILL.md +6 -6
- package/claude/skills/{claude-seed-sync → seed-sync}/REQUIREMENT.md +2 -2
- package/claude/skills/{claude-seed-sync → seed-sync}/SKILL.md +3 -3
- package/claude/skills/session-map/REQUIREMENT.md +2 -2
- package/claude/skills/session-map/SKILL.md +2 -2
- package/claude/skills/session-resume/REQUIREMENT.md +2 -2
- package/claude/skills/session-resume/SKILL.md +2 -2
- package/claude/skills/{claude-worktree → session-worktree}/REQUIREMENT.md +3 -3
- package/claude/skills/{claude-worktree → session-worktree}/SKILL.md +6 -6
- package/claude/skills/setup-plugins/references/plugin-catalog.md +1 -1
- package/claude/skills/{claude-standards-audit → standards-audit}/REQUIREMENT.md +2 -2
- package/claude/skills/{claude-standards-audit → standards-audit}/SKILL.md +2 -2
- package/claude/skills/systematic-debugging/REQUIREMENT.md +1 -1
- package/claude/skills/{claude-tasks → task-board}/REQUIREMENT.md +3 -3
- package/claude/skills/{claude-tasks → task-board}/SKILL.md +7 -7
- package/claude/skills/{claude-teach → teach-workspace}/REQUIREMENT.md +2 -2
- package/claude/skills/{claude-teach → teach-workspace}/SKILL.md +4 -4
- package/claude/skills/test-first/REQUIREMENT.md +2 -2
- package/claude/skills/{claude-ui-test → ui-test}/REQUIREMENT.md +3 -3
- package/claude/skills/{claude-ui-test → ui-test}/SKILL.md +3 -3
- package/claude/skills/{claude-ux-audit → ux-audit}/REQUIREMENT.md +6 -6
- package/claude/skills/{claude-ux-audit → ux-audit}/SKILL.md +5 -5
- package/claude/skills/{claude-ux-measure → ux-measure}/REQUIREMENT.md +5 -5
- package/claude/skills/{claude-ux-measure → ux-measure}/SKILL.md +5 -5
- package/docs/agents/commands.md +4 -1
- package/docs/agents/install-and-sync.md +1 -1
- package/docs/agents/key-changes.md +3 -3
- package/docs/agents/markdown-audit.md +1 -1
- package/docs/agents/restated.md +1 -1
- package/docs/agents/review-classification.md +1 -1
- package/docs/agents/sessions.md +1 -1
- package/docs/agents/state-scoped-risk.md +1 -1
- package/docs/agents/targets.md +1 -1
- package/docs/agents/tasks.md +4 -4
- package/docs/agents/teach.md +1 -1
- package/docs/target-projects.md +28 -9
- package/docs/workflow/ai-workflow.md +84 -84
- package/docs/workflow/operating-model.md +17 -17
- package/docs/workflow/visual-design-workflow.md +6 -6
- package/governance/rules/core/045-memory.md +1 -1
- package/governance/rules/core/085-worktrees.md +1 -1
- package/package.json +1 -1
- package/scripts/core/regen-agent-fixture.sh +1 -1
- package/scripts/core/regen-hero.sh +7 -7
- package/snippets/claude/decision-memo.md +1 -1
- package/src/autoship/paths.ts +1 -1
- package/src/claude/cases/all.ts +2 -2
- package/src/claude/cases/{claude-workflow.ts → workflow.ts} +33 -33
- package/src/commands/migrate.ts +90 -13
- package/src/commands/sync.ts +3 -3
- package/src/design/components.ts +1157 -4
- package/src/design/css.ts +44 -17
- package/src/design/tokens.ts +1 -1
- package/src/gov/restated.ts +2 -2
- package/src/markdown/structure.ts +1 -1
- package/src/migrate/plan.ts +13 -5
- package/src/migrate/rename.ts +210 -94
- package/src/migrate/skill-names.ts +89 -0
- package/src/pr/bijection.ts +1 -1
- package/src/pr/paths.ts +2 -2
- package/src/shipped/references.ts +1 -1
- package/src/sync/seeds-report.ts +1 -1
- package/src/targets/pulls.ts +2 -2
- package/src/tasks/answers.ts +1 -1
- package/src/tasks/archive.ts +4 -4
- package/src/tasks/record.ts +2 -2
- package/src/tasks/validate.ts +1 -1
- package/src/teach/fonts.ts +28 -0
- package/src/teach/nav.ts +11 -1
- package/src/teach/workspace.ts +4 -1
- package/standards/groundwork.md +1 -1
- package/standards/snippets.md +1 -1
- package/standards/tasks.md +3 -3
- package/standards/teach.md +2 -2
- package/tooling/base/configs/.husky/post-merge +3 -3
- package/tooling/claude/reference.md +5 -5
- package/tooling/claude/seeds/.claude/hooks/pr-create-log.sh +2 -2
- /package/claude/skills/{claude-memory-review → memory-review}/references/receipt-format.md +0 -0
- /package/claude/skills/{claude-orchestrate → role-orchestrator}/scripts/watch.sh +0 -0
- /package/claude/skills/{claude-teach → teach-workspace}/references/lesson-craft.md +0 -0
- /package/claude/skills/{claude-teach → teach-workspace}/references/pedagogy.md +0 -0
- /package/claude/skills/{claude-teach → teach-workspace}/references/promotion.md +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { SkillCase } from '@/claude/skills-rank'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* The
|
|
5
|
-
*
|
|
4
|
+
* The session workflow skills: feature planning, review, and the artifacts
|
|
5
|
+
* that coordinate work across sessions.
|
|
6
6
|
*
|
|
7
7
|
* Every positive is phrased away from its skill's own quoted trigger, since a
|
|
8
8
|
* verbatim trigger passes by construction and proves nothing about a prompt in
|
|
@@ -10,33 +10,33 @@ import type { SkillCase } from '@/claude/skills-rank'
|
|
|
10
10
|
* an explicit `Do NOT` boundary against each other, since a boundary in a
|
|
11
11
|
* body does not reach the field a router reads.
|
|
12
12
|
*/
|
|
13
|
-
export const
|
|
13
|
+
export const WORKFLOW_CASES: readonly SkillCase[] = [
|
|
14
14
|
{
|
|
15
15
|
prompt: 'Go fix everything the reviewer flagged on my open PR.',
|
|
16
|
-
expect: '
|
|
16
|
+
expect: 'review-address',
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
prompt:
|
|
20
20
|
'Run the whole implement, verify, review, and ship pipeline for the approved plan.',
|
|
21
|
-
expect: '
|
|
21
|
+
expect: 'auto-ship',
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
prompt: "Pull together a design system from what's already in the app.",
|
|
25
|
-
expect: '
|
|
25
|
+
expect: 'design-extract',
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
prompt: 'Draw me a diagram of how the pieces of this system connect.',
|
|
29
|
-
expect: '
|
|
29
|
+
expect: 'draft-diagram',
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
prompt:
|
|
33
33
|
'Bring the internal planning docs under .claude up to date with what we decided this session.',
|
|
34
|
-
expect: '
|
|
34
|
+
expect: 'docs-fold',
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
prompt:
|
|
38
38
|
'Sketch out a plan for adding this new capability before we touch any code.',
|
|
39
|
-
expect: '
|
|
39
|
+
expect: 'plan-feature',
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
prompt:
|
|
@@ -46,43 +46,43 @@ export const CLAUDE_WORKFLOW_CASES: readonly SkillCase[] = [
|
|
|
46
46
|
{
|
|
47
47
|
prompt:
|
|
48
48
|
'We need to measure this properly before committing to an approach.',
|
|
49
|
-
expect: '
|
|
49
|
+
expect: 'plan-groundwork',
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
prompt: 'Take this pile of raw notes and turn it into filed items.',
|
|
53
|
-
expect: '
|
|
53
|
+
expect: 'plan-intake',
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
prompt: 'Walk me through the open intake items so I can decide on each.',
|
|
57
|
-
expect: '
|
|
57
|
+
expect: 'plan-intake-answer',
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
prompt:
|
|
61
61
|
"Draft a diff-based proposal for tightening this passage in the standard, don't just edit it.",
|
|
62
|
-
expect: '
|
|
62
|
+
expect: 'markdown-propose',
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
prompt: 'Pull the durable lessons out of this session before it ends.',
|
|
66
|
-
expect: '
|
|
66
|
+
expect: 'memory-capture',
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
prompt:
|
|
70
70
|
'Go through the memory folder and propose what to do with each entry.',
|
|
71
|
-
expect: '
|
|
71
|
+
expect: 'memory-review',
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
prompt:
|
|
75
75
|
'Take on the orchestrator role and coordinate the parallel feature builds.',
|
|
76
|
-
expect: '
|
|
76
|
+
expect: 'role-orchestrator',
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
prompt:
|
|
80
80
|
'I am writing the plan for a row another session will build. What may I write, and where do I read what is already in flight?',
|
|
81
|
-
expect: '
|
|
81
|
+
expect: 'role-planner',
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
prompt: 'Post a formal review with findings on that open pull request.',
|
|
85
|
-
expect: '
|
|
85
|
+
expect: 'review-pr',
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
prompt:
|
|
@@ -92,7 +92,7 @@ export const CLAUDE_WORKFLOW_CASES: readonly SkillCase[] = [
|
|
|
92
92
|
{
|
|
93
93
|
prompt:
|
|
94
94
|
'Look over everything that changed on this branch for bugs and edge cases.',
|
|
95
|
-
expect: '
|
|
95
|
+
expect: 'review-branch',
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
98
|
prompt: 'Draft me a script with beats for a screencast recording.',
|
|
@@ -101,7 +101,7 @@ export const CLAUDE_WORKFLOW_CASES: readonly SkillCase[] = [
|
|
|
101
101
|
{
|
|
102
102
|
prompt:
|
|
103
103
|
"Check whether my installed Claude seed docs have drifted from the toolkit's.",
|
|
104
|
-
expect: '
|
|
104
|
+
expect: 'seed-sync',
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
107
|
prompt: 'Turn this topic into a slide deck I can render.',
|
|
@@ -110,37 +110,37 @@ export const CLAUDE_WORKFLOW_CASES: readonly SkillCase[] = [
|
|
|
110
110
|
{
|
|
111
111
|
prompt:
|
|
112
112
|
'Check whether the markdown I changed violates any authoring standards.',
|
|
113
|
-
expect: '
|
|
113
|
+
expect: 'standards-audit',
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
116
|
prompt: 'Open a new entry on the task board for this piece of work.',
|
|
117
|
-
expect: '
|
|
117
|
+
expect: 'task-board',
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
prompt: 'Open a learning workspace so I can study this topic properly.',
|
|
121
|
-
expect: '
|
|
121
|
+
expect: 'teach-workspace',
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
124
|
prompt: 'Generate the Playwright tests I need after this UI change.',
|
|
125
|
-
expect: '
|
|
125
|
+
expect: 'ui-test',
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
128
|
prompt:
|
|
129
129
|
'Look over the interface and tell me what feels unfinished or confusing.',
|
|
130
|
-
expect: '
|
|
130
|
+
expect: 'ux-audit',
|
|
131
131
|
},
|
|
132
132
|
{
|
|
133
133
|
prompt: 'Tell me the paint and layout cost of this page right now.',
|
|
134
|
-
expect: '
|
|
134
|
+
expect: 'ux-measure',
|
|
135
135
|
},
|
|
136
136
|
{
|
|
137
137
|
prompt:
|
|
138
138
|
'I am building this branch for another session. What am I on the hook for, and what is off limits?',
|
|
139
|
-
expect: '
|
|
139
|
+
expect: 'role-worker',
|
|
140
140
|
},
|
|
141
141
|
{
|
|
142
142
|
prompt: 'Get me set up in a fresh Claude Code worktree for this branch.',
|
|
143
|
-
expect: '
|
|
143
|
+
expect: 'session-worktree',
|
|
144
144
|
},
|
|
145
145
|
|
|
146
146
|
// Negatives: pairs whose bodies already carry an explicit Do NOT boundary.
|
|
@@ -151,23 +151,23 @@ export const CLAUDE_WORKFLOW_CASES: readonly SkillCase[] = [
|
|
|
151
151
|
},
|
|
152
152
|
{
|
|
153
153
|
prompt: 'Sort through this brain dump and write it up as findings.',
|
|
154
|
-
expect: '
|
|
154
|
+
expect: 'plan-intake',
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
157
|
prompt:
|
|
158
158
|
"Go through what's still unanswered in the intake folder and decide.",
|
|
159
|
-
expect: '
|
|
159
|
+
expect: 'plan-intake-answer',
|
|
160
160
|
},
|
|
161
161
|
{
|
|
162
162
|
prompt: 'Check this markdown against the house style rules.',
|
|
163
|
-
expect: '
|
|
163
|
+
expect: 'standards-audit',
|
|
164
164
|
},
|
|
165
165
|
{
|
|
166
166
|
prompt: 'Find the rough, unfinished-feeling spots in this interface.',
|
|
167
|
-
expect: '
|
|
167
|
+
expect: 'ux-audit',
|
|
168
168
|
},
|
|
169
169
|
{
|
|
170
170
|
prompt: 'Tell me the render cost of this page in the browser.',
|
|
171
|
-
expect: '
|
|
171
|
+
expect: 'ux-measure',
|
|
172
172
|
},
|
|
173
173
|
]
|
package/src/commands/migrate.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { listRepositoryFiles } from '@/git-files'
|
|
|
5
5
|
import { indexSourceRules } from '@/gov/adapter'
|
|
6
6
|
import { applyRecordsMove, applyRename, readSources } from '@/migrate/apply'
|
|
7
7
|
import { isToolkitOwned, planRename, type RenamePlan } from '@/migrate/plan'
|
|
8
|
+
import { AITK_RULES, type RenameRules } from '@/migrate/rename'
|
|
8
9
|
import {
|
|
9
10
|
applyRecordTree,
|
|
10
11
|
planRecordTree,
|
|
@@ -24,6 +25,7 @@ import {
|
|
|
24
25
|
type RuleLayoutPlan,
|
|
25
26
|
walkFlatRules,
|
|
26
27
|
} from '@/migrate/rule-layout'
|
|
28
|
+
import { SKILL_NAME_MAP, SKILL_NAME_RULES } from '@/migrate/skill-names'
|
|
27
29
|
import {
|
|
28
30
|
applyScratchEvidence,
|
|
29
31
|
planScratchEvidence,
|
|
@@ -33,12 +35,15 @@ import {
|
|
|
33
35
|
} from '@/migrate/scratch-evidence'
|
|
34
36
|
import { checkoutMismatchWarning, PROJECT_ROOT } from '@/project-root'
|
|
35
37
|
import { readStamp, stampedHashes } from '@/sync/stamp'
|
|
36
|
-
import { logError, logInfo, logStep, logWarn,
|
|
38
|
+
import { logError, logInfo, logStep, logWarn, plural } from '@/ui'
|
|
37
39
|
|
|
38
|
-
interface
|
|
40
|
+
interface SweepOptions {
|
|
39
41
|
readonly json?: boolean
|
|
40
42
|
readonly write?: boolean
|
|
41
43
|
readonly root?: string
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface RenameOptions extends SweepOptions {
|
|
42
47
|
readonly scope?: string
|
|
43
48
|
}
|
|
44
49
|
|
|
@@ -51,12 +56,11 @@ function isScope(value: string): value is Scope {
|
|
|
51
56
|
}
|
|
52
57
|
|
|
53
58
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
59
|
+
* The `aitk` sweep, which is the one rename with a second population to name.
|
|
60
|
+
* A target holds toolkit-owned folders whose content came from here beside
|
|
61
|
+
* prose that project wrote, and the scope is what separates them.
|
|
57
62
|
*/
|
|
58
63
|
async function runRename(opts: RenameOptions): Promise<number> {
|
|
59
|
-
const root = opts.root ?? process.cwd()
|
|
60
64
|
const scope = opts.scope ?? 'self'
|
|
61
65
|
|
|
62
66
|
if (!isScope(scope)) {
|
|
@@ -64,6 +68,33 @@ async function runRename(opts: RenameOptions): Promise<number> {
|
|
|
64
68
|
return 1
|
|
65
69
|
}
|
|
66
70
|
|
|
71
|
+
return runSweep(opts, AITK_RULES, scope)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The skill rename owns no scope. Every folder it moves is authored here, and
|
|
76
|
+
* no target holds a copy of this repository's skill catalog, so there is no
|
|
77
|
+
* second population for a caller to name.
|
|
78
|
+
*/
|
|
79
|
+
async function runSkillNames(opts: SweepOptions): Promise<number> {
|
|
80
|
+
return runSweep(opts, SKILL_NAME_RULES, undefined)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* One sweep over a repository's tracked files under whichever rules it was
|
|
85
|
+
* handed.
|
|
86
|
+
*
|
|
87
|
+
* Reports rather than writes without `--write`, matching `canon records
|
|
88
|
+
* migrate`. A rename touching this many files has no undo short of the branch
|
|
89
|
+
* it ran on, so the safe outcome sits on the default path.
|
|
90
|
+
*/
|
|
91
|
+
async function runSweep(
|
|
92
|
+
opts: SweepOptions,
|
|
93
|
+
rules: RenameRules,
|
|
94
|
+
scope: Scope | undefined,
|
|
95
|
+
): Promise<number> {
|
|
96
|
+
const root = opts.root ?? process.cwd()
|
|
97
|
+
|
|
67
98
|
const files = await listRepositoryFiles(root)
|
|
68
99
|
if (files === undefined) {
|
|
69
100
|
logError(`Could not list files under ${root}. Is it a git repository?`)
|
|
@@ -72,7 +103,7 @@ async function runRename(opts: RenameOptions): Promise<number> {
|
|
|
72
103
|
|
|
73
104
|
const scoped = scope === 'target' ? files.filter(isToolkitOwned) : files
|
|
74
105
|
const sources = await readSources(root, scoped)
|
|
75
|
-
const plan = planRename(sources)
|
|
106
|
+
const plan = planRename(sources, rules)
|
|
76
107
|
|
|
77
108
|
// A target scope reports the citations it did not rewrite, since prose the
|
|
78
109
|
// project wrote is theirs to change and a sweep editing it underneath them
|
|
@@ -84,12 +115,15 @@ async function runRename(opts: RenameOptions): Promise<number> {
|
|
|
84
115
|
root,
|
|
85
116
|
files.filter((f) => !isToolkitOwned(f)),
|
|
86
117
|
),
|
|
118
|
+
rules,
|
|
87
119
|
).entries.length
|
|
88
120
|
: 0
|
|
89
121
|
|
|
122
|
+
// stdout, so the record pipes clean. `pipeOutput` frames to stderr, which is
|
|
123
|
+
// where this command's report belongs and where a JSON record does not.
|
|
90
124
|
if (opts.json) {
|
|
91
|
-
|
|
92
|
-
JSON.stringify(toRecord(plan, scope, citations, opts.write), null, 2)
|
|
125
|
+
process.stdout.write(
|
|
126
|
+
`${JSON.stringify(toRecord(plan, scope, citations, opts.write), null, 2)}\n`,
|
|
93
127
|
)
|
|
94
128
|
}
|
|
95
129
|
|
|
@@ -115,8 +149,12 @@ async function runRename(opts: RenameOptions): Promise<number> {
|
|
|
115
149
|
return 0
|
|
116
150
|
}
|
|
117
151
|
|
|
118
|
-
function report(
|
|
119
|
-
|
|
152
|
+
function report(
|
|
153
|
+
plan: RenamePlan,
|
|
154
|
+
scope: Scope | undefined,
|
|
155
|
+
citations: number,
|
|
156
|
+
): void {
|
|
157
|
+
if (scope !== undefined) logInfo(`Scope ${scope}.`)
|
|
120
158
|
logInfo(
|
|
121
159
|
`${plural(plan.entries.length, 'file')} to change, ${plural(plan.renamed, 'occurrence')} to rewrite.`,
|
|
122
160
|
)
|
|
@@ -138,12 +176,12 @@ function report(plan: RenamePlan, scope: Scope, citations: number): void {
|
|
|
138
176
|
|
|
139
177
|
function toRecord(
|
|
140
178
|
plan: RenamePlan,
|
|
141
|
-
scope: Scope,
|
|
179
|
+
scope: Scope | undefined,
|
|
142
180
|
citations: number,
|
|
143
181
|
wrote: boolean | undefined,
|
|
144
182
|
): unknown {
|
|
145
183
|
return {
|
|
146
|
-
scope,
|
|
184
|
+
...(scope === undefined ? {} : { scope }),
|
|
147
185
|
wrote: wrote === true,
|
|
148
186
|
files: plan.entries.length,
|
|
149
187
|
renamed: plan.renamed,
|
|
@@ -851,6 +889,45 @@ export function register(program: Command): void {
|
|
|
851
889
|
process.exitCode = await runRename(opts)
|
|
852
890
|
})
|
|
853
891
|
|
|
892
|
+
migrate
|
|
893
|
+
.command('skill-names')
|
|
894
|
+
.description('Move the prefixed skill folders onto their two-word names')
|
|
895
|
+
.helpOption('-h, --help', 'Show this help message')
|
|
896
|
+
.option('--json', 'Add a machine-readable record on stdout')
|
|
897
|
+
.option('--write', 'Apply the plan rather than reporting it')
|
|
898
|
+
.option(
|
|
899
|
+
'--root <path>',
|
|
900
|
+
'Project root, defaulting to the working directory',
|
|
901
|
+
)
|
|
902
|
+
.addHelpText(
|
|
903
|
+
'after',
|
|
904
|
+
[
|
|
905
|
+
'',
|
|
906
|
+
`Rewrites ${Object.keys(SKILL_NAME_MAP).length} skill names and moves the folders that carry them.`,
|
|
907
|
+
'It takes no scope. The skill folders it moves are authored in the',
|
|
908
|
+
'toolkit and no target holds a copy of that catalog, so in a target it',
|
|
909
|
+
'rewrites citations of a renamed skill and moves nothing.',
|
|
910
|
+
'',
|
|
911
|
+
'Exit codes:',
|
|
912
|
+
' 0 nothing to rewrite, or --write applied the whole plan',
|
|
913
|
+
' 1 refused, or a move failed',
|
|
914
|
+
' 2 a plan exists and --write was not passed',
|
|
915
|
+
'',
|
|
916
|
+
'The changelog is never rewritten, and neither is an eval transcript.',
|
|
917
|
+
'Each records what shipped or what a session ran under the name that',
|
|
918
|
+
'was current then.',
|
|
919
|
+
'',
|
|
920
|
+
'Examples:',
|
|
921
|
+
' canon migrate skill-names',
|
|
922
|
+
' canon migrate skill-names --write',
|
|
923
|
+
' canon migrate skill-names --json',
|
|
924
|
+
'',
|
|
925
|
+
].join('\n'),
|
|
926
|
+
)
|
|
927
|
+
.action(async (opts: SweepOptions) => {
|
|
928
|
+
process.exitCode = await runSkillNames(opts)
|
|
929
|
+
})
|
|
930
|
+
|
|
854
931
|
migrate
|
|
855
932
|
.command('rule-layout')
|
|
856
933
|
.description('Move installed rules from the flat layout onto canon/')
|
package/src/commands/sync.ts
CHANGED
|
@@ -265,7 +265,7 @@ function renderTooling(report: CheckReport): void {
|
|
|
265
265
|
/**
|
|
266
266
|
* Seeds print their own section because no sync command applies them. A `stale`
|
|
267
267
|
* seed is safe to take whole and a `drifted` one holds edits, which is the split
|
|
268
|
-
* `
|
|
268
|
+
* `seed-sync` reads to decide what needs a section-level merge.
|
|
269
269
|
*/
|
|
270
270
|
function renderSeeds(report: CheckReport): void {
|
|
271
271
|
const notable = report.seeds.entries.filter(
|
|
@@ -283,7 +283,7 @@ function renderSeeds(report: CheckReport): void {
|
|
|
283
283
|
logWarn(`${entry.rel} (${entry.state})`)
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
-
logInfo('Run /canon:
|
|
286
|
+
logInfo('Run /canon:seed-sync to reconcile these section by section.')
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
/**
|
|
@@ -399,7 +399,7 @@ async function runSync(target: string): Promise<number> {
|
|
|
399
399
|
|
|
400
400
|
if (existsSync(join(resolved, '.claude'))) {
|
|
401
401
|
process.stderr.write(
|
|
402
|
-
`${GREY}Tip: run \`/
|
|
402
|
+
`${GREY}Tip: run \`/seed-sync\` to audit seed drift per section, preserving local customizations.${NC}\n`,
|
|
403
403
|
)
|
|
404
404
|
}
|
|
405
405
|
|