@erclx/canon 4.103.0 → 4.104.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.
Files changed (52) hide show
  1. package/claude/.claude-plugin/plugin.json +1 -1
  2. package/claude/skills/canon-cli/SKILL.md +3 -77
  3. package/claude/skills/canon-operator/REQUIREMENT.md +2 -2
  4. package/claude/skills/canon-operator/SKILL.md +5 -5
  5. package/claude/skills/design-taste/references/craft.md +1 -1
  6. package/claude/skills/design-taste/references/preflight.md +2 -2
  7. package/claude/skills/design-taste/references/tells.md +1 -1
  8. package/claude/skills/git-followup/SKILL.md +1 -1
  9. package/claude/skills/git-issue/SKILL.md +2 -2
  10. package/{standards → claude/skills/git-issue/references}/issue.md +3 -8
  11. package/claude/skills/git-pr/SKILL.md +2 -2
  12. package/claude/skills/index-lookup/REQUIREMENT.md +2 -2
  13. package/claude/skills/project-commands/REQUIREMENT.md +1 -1
  14. package/claude/skills/seed-sync/REQUIREMENT.md +1 -1
  15. package/claude/skills/target-check/REQUIREMENT.md +1 -1
  16. package/claude/skills/target-setup/REQUIREMENT.md +56 -0
  17. package/claude/skills/target-setup/SKILL.md +163 -0
  18. package/claude/skills/target-setup/references/detect.md +80 -0
  19. package/claude/skills/{setup-indexes/SKILL.md → target-setup/references/indexes.md} +59 -23
  20. package/claude/skills/target-setup/references/verify.md +95 -0
  21. package/docs/agents/sandbox.md +1 -1
  22. package/docs/agents/scripting.md +3 -2
  23. package/docs/target-projects.md +11 -11
  24. package/docs/workflow/ai-workflow.md +8 -13
  25. package/governance/rules/ui/400-ui.md +0 -5
  26. package/governance/rules/ui/460-design-taste.md +1 -1
  27. package/governance/rules/ui/465-interface-casing.md +31 -0
  28. package/governance/stacks/astro.toml +1 -1
  29. package/governance/stacks/react.toml +1 -1
  30. package/package.json +1 -1
  31. package/scripts/core/regen-hero.sh +1 -1
  32. package/src/claude/cases/setup.ts +12 -11
  33. package/src/commands/sync.ts +1 -1
  34. package/src/gate/measures.ts +57 -0
  35. package/src/gate/stages.ts +10 -14
  36. package/src/gov/list.ts +1 -1
  37. package/src/sandbox/census.ts +3 -3
  38. package/src/shipped/references.ts +1 -1
  39. package/standards/index.md +0 -1
  40. package/claude/skills/setup-gov/REQUIREMENT.md +0 -37
  41. package/claude/skills/setup-gov/SKILL.md +0 -77
  42. package/claude/skills/setup-indexes/REQUIREMENT.md +0 -48
  43. package/claude/skills/setup-init/REQUIREMENT.md +0 -46
  44. package/claude/skills/setup-init/SKILL.md +0 -133
  45. package/claude/skills/setup-plugins/REQUIREMENT.md +0 -42
  46. package/claude/skills/setup-plugins/SKILL.md +0 -81
  47. package/claude/skills/setup-plugins/references/plugin-catalog.md +0 -53
  48. package/claude/skills/setup-smoke/REQUIREMENT.md +0 -38
  49. package/claude/skills/setup-smoke/SKILL.md +0 -53
  50. package/claude/skills/setup-verify/REQUIREMENT.md +0 -39
  51. package/claude/skills/setup-verify/SKILL.md +0 -51
  52. package/scripts/core/regen-tooling-paths.sh +0 -61
@@ -10,6 +10,7 @@ import {
10
10
  recordIdempotence,
11
11
  sandboxCoverage,
12
12
  seedStandards,
13
+ rawFieldFileReference,
13
14
  shippedReferences,
14
15
  standardCriteria,
15
16
  unreferencedRules,
@@ -207,20 +208,6 @@ export const STAGES: readonly Stage[] = [
207
208
  ],
208
209
  success: 'Hero clean',
209
210
  },
210
- {
211
- id: 'tooling-paths',
212
- label: 'Tooling paths',
213
- checks: [
214
- script('regen-tooling-paths.sh', 'Tooling-path regen failed'),
215
- {
216
- kind: 'drift',
217
- pathspec: 'claude/skills/canon-cli/SKILL.md',
218
- failure:
219
- 'The overwrite contract drifted from what the stacks hold. Run bun run check and commit claude/skills/canon-cli/SKILL.md.',
220
- },
221
- ],
222
- success: 'Tooling paths clean',
223
- },
224
211
  {
225
212
  // `canon/DESIGN.md`, the base stylesheet, the web stylesheet, and the
226
213
  // tab icon are all written from `src/design/tokens.ts` and none is edited
@@ -423,6 +410,15 @@ export const STAGES: readonly Stage[] = [
423
410
  skipped: 'No shipped corpus changed, so no reference was read',
424
411
  checks: [{ kind: 'measure', measure: shippedReferences }],
425
412
  },
413
+ {
414
+ // Same corpora as shipped-references and a separate stage, since the
415
+ // verdict is a flag spelling rather than an unresolvable reference.
416
+ id: 'raw-field-file-reference',
417
+ label: 'Raw-field file references',
418
+ scope: new RegExp(SHIPPED_CORPORA.map((corpus) => `^${corpus}/`).join('|')),
419
+ skipped: 'No shipped corpus changed, so no flag was read',
420
+ checks: [{ kind: 'measure', measure: rawFieldFileReference }],
421
+ },
426
422
  {
427
423
  // Scoped to the two files a citation can drift between, so an edit to
428
424
  // either one runs the check. web/src/content/copy.ts carries the anchors
package/src/gov/list.ts CHANGED
@@ -30,7 +30,7 @@ export interface GovCatalog {
30
30
 
31
31
  /**
32
32
  * Reports each stack's own entries expanded, so a folder entry reaches a
33
- * consumer as the rules it stands for. `setup-gov` dedupes `--add` extras
33
+ * consumer as the rules it stands for. the `setup` skill dedupes `--add` extras
34
34
  * against this list, and a stack answering `core` there would re-add every
35
35
  * rule that folder already carries.
36
36
  *
@@ -71,9 +71,9 @@ export function listSkills(root: string): string[] {
71
71
  *
72
72
  * `<category>-<command>` is the rule `canon/context/sandbox/coverage.md` states, and it
73
73
  * alone pairs 29 of 54 skills. The bare `<command>` fallback is what reaches the
74
- * rest: `claude/setup-init.sh` drives the `setup-init` skill, not a
75
- * `claude-setup-init` that does not exist. Stating one spelling and shipping two
76
- * is what let the audit report a paired skill as unpaired.
74
+ * rest: `claude/target-setup.sh` drives the `target-setup` skill, not a `claude-target-setup` that
75
+ * does not exist. Stating one spelling and shipping two is what let the audit
76
+ * report a paired skill as unpaired.
77
77
  *
78
78
  * Returns undefined for a scenario driving no skill at all, which is every
79
79
  * `infra/` and `tooling/` scenario. Those exercise a CLI domain rather than a
@@ -210,7 +210,7 @@ const PHASE_LABEL = /\bv\d+\.\d+(?!\.\d)\b/g
210
210
  *
211
211
  * Anchored on the trailing `\d{3}-[\w-]+\.md` rather than on the bare
212
212
  * `.claude/rules/` prefix, which is what keeps a folder mention carrying no
213
- * number, such as `create-rule`, `memory-review`, and `setup-gov` already
213
+ * number, such as `create-rule`, `memory-review`, and `target-setup` already
214
214
  * write correctly, from matching. The segment group between `rules/` and the
215
215
  * numbered file admits both a governance-namespace path
216
216
  * (`canon/core/055-scratch.md`) and a project-namespace one
@@ -19,7 +19,6 @@ Reference docs for consistent authoring across the toolkit and target projects.
19
19
  - [Glossary reference](glossary.md): Frontmatter, entry shape, ordering, and the rules deciding which terms a glossary carries
20
20
  - [Groundwork reference](groundwork.md): Folder layout, ordinal naming, reserved numbering, frontmatter and dating, required file contents, and conventions for a measurement track
21
21
  - [Intake reference](intake.md): Folder layout, ordinal naming, reserved index number, frontmatter and dating, the item template, the answer contract, and retrieval
22
- - [Issue reference](issue.md): GitHub issue title, labels, and body conventions
23
22
  - [Markdown reference](markdown.md): Headings, paragraph and list structure, code spans, the date form, punctuation, emphasis, file references, banned words, and frontmatter wording
24
23
  - [Memory reference](memory.md): Filename and type prefix, frontmatter, the body shape per type, links between entries, and the lifecycle from write to retire
25
24
  - [Mermaid reference](mermaid.md): Direction and layout, node and edge budgets, accessibility fields, label punctuation, and render verification for a Mermaid diagram
@@ -1,37 +0,0 @@
1
- ---
2
- name: setup-gov
3
- description: Scope boundary for governance rule install and the authoring it refuses to do in a target
4
- ---
5
-
6
- # Setup gov requirement
7
-
8
- ## Gap
9
-
10
- Without this skill, a session picks a stack name from memory and installs rules written for a framework the project does not use, passes an extra the catalog does not carry so the install warns on a file it cannot resolve, and adds a rule the picked stack already pulls in.
11
-
12
- The two costly failures are quieter. An unmatched technology gets the nearest rule instead of a stop, so the project carries governance authored for something adjacent and nothing marks it as a guess. A rule written directly into the target lands where no sync will ever reach it, so it drifts from the toolkit copy that owns it.
13
-
14
- The last failure sits at a boundary rather than inside a run. `setup-init` turns away a project whose language it carries no stack for and sends it here, and a body stating only what this skill does not cover leaves that route running one way, so a person arriving on it reads a skill that never says it is the destination.
15
-
16
- ## Must
17
-
18
- - Read the catalog at run time and resolve both the stack and every extra against it
19
- - Name the evidence file behind each detected technology in the preview, so a wrong match is visible before the install rather than after
20
- - Dedupe extras against the rules the picked stack already resolves
21
- - Run the install non-interactively, since the CLI picker blocks where no terminal is attached
22
- - State the inbound route from `setup-init`, so a project sent here for the language-neutral rule layer can tell it landed at the destination the chain named
23
-
24
- ## Must not
25
-
26
- - Author a rule inside the target project. Rules are authored in the toolkit and reach a project by install or sync.
27
- - Install a stack or extra whose name did not come from the catalog read
28
-
29
- ## Guards
30
-
31
- - An unmatched technology stops and presents the options rather than resolving to a nearby rule. Authoring the missing rule in the toolkit, installing the matching layers without the technology-specific one, and aborting are the three, and this skill picks none of them.
32
-
33
- ## Out of scope
34
-
35
- - The rest of the onboarding chain. This skill installs governance and nothing else, and `setup-init` is the one-shot path that installs governance beside tooling, snippets, and the seeds.
36
- - Scaffolding the rule file an unmatched technology needs. `create-rule` writes one into a target project, and a rule the toolkit should ship is authored under `governance/rules/` against `canon standards rule`.
37
- - Updating rules a project already has, which `canon gov sync` owns
@@ -1,77 +0,0 @@
1
- ---
2
- name: setup-gov
3
- description: Detects a project's stack from its files and installs matching toolkit governance rules into `.claude/rules/`. Use after scaffolding a new project, when asked to "install gov rules", "install governance", "set up governance", or when a target project has no `.claude/rules/` yet. Assumes the `canon` CLI is on PATH.
4
- ---
5
-
6
- # Gov install
7
-
8
- Automates `canon gov install` by inferring the stack and extras from the current project, then shelling out to the CLI with the resolved arguments.
9
-
10
- ## Scope
11
-
12
- - Governance rules and nothing else. `setup-init` is the one-shot chain that installs governance beside tooling, standards, snippets, and the seeds.
13
- - This is where `setup-init` sends a project whose language the toolkit carries no stack for. Rules install without the `base` development dependencies the tooling layer would drop on it. Resolve and stop exactly as below, since a language with no stack is the unmatched case `## Gap handling` already owns and arriving by that route changes none of it.
14
-
15
- ## Read the catalog
16
-
17
- Run this first to load the current stacks and rules. Never hardcode names. The catalog is the source of truth.
18
-
19
- ```bash
20
- canon gov list --json 2>/dev/null
21
- ```
22
-
23
- ## Detect the stack
24
-
25
- Read these from the project root in parallel:
26
-
27
- - `package.json`: dependencies and devDependencies
28
- - Root config files: `astro.config.*`, `next.config.*`, `vite.config.*`, `tailwind.config.*`, `tsconfig.json`, `pyproject.toml`, `go.mod`, `Cargo.toml`
29
- - `canon/REQUIREMENTS.md` and `canon/ARCHITECTURE.md` if present
30
- - Directory structure via `ls -1` of the project root and `src/` if present
31
-
32
- ## Match
33
-
34
- Match the detected evidence to the catalog:
35
-
36
- - Pick the closest stack. Match detected runtime or framework against stack names in the catalog.
37
- - Identify additional technologies not already covered by the picked stack. For each, find a rule whose `description` or `paths` points at that technology, then add it via `--add`.
38
- - Dedupe extras against stack rules. Do not add a rule the stack already pulls in.
39
-
40
- ## Gap handling
41
-
42
- If a detected technology has no matching rule, stop and surface the gap. Do not guess.
43
-
44
- Present four options:
45
-
46
- 1. Author a new rule in the toolkit at `governance/rules/<domain>/<num>-<name>.md` following `${CLAUDE_SKILL_DIR}/../../standards/rule.md`, commit, then re-run install. Take this route when the toolkit should ship the rule to every project.
47
- 2. Invoke `create-rule`, which scaffolds the file into the target project at a non-colliding number. Take this route when the rule is specific to this project and no sync should ever overwrite it.
48
- 3. Install the matching non-<tech> rules and skip the tech-specific layer.
49
- 4. Abort.
50
-
51
- This skill authors no rule itself. Option 1 writes in the toolkit repository, and option 2 hands the project-local file to `create-rule`.
52
-
53
- ## Preview
54
-
55
- Before executing, output:
56
-
57
- - **Detected:** each technology with the file that evidenced it
58
- - **Stack:** picked stack name and total resolved rule count
59
- - **Extras:** each `--add` rule with a one-line reason
60
- - **Target:** resolved target path
61
- - **Command:** the exact shell command to run
62
-
63
- ## Execute
64
-
65
- Run with `CANON_NON_INTERACTIVE=1` so no CLI picker prompts appear. Claude Code's tool permission dialog is the confirmation gate.
66
-
67
- ```bash
68
- CANON_NON_INTERACTIVE=1 canon gov install <stack> --add <extras> <target>
69
- ```
70
-
71
- ## Response
72
-
73
- After execution, report:
74
-
75
- - Rule count installed
76
- - Target path
77
- - Any rules that failed to resolve (the CLI warns on missing rule files)
@@ -1,48 +0,0 @@
1
- ---
2
- name: setup-indexes
3
- description: Why index bootstrap is all-or-nothing per folder, what the confirmation loop protects, and why the convention block is pasted rather than written
4
- ---
5
-
6
- # Setup indexes requirement
7
-
8
- ## Gap
9
-
10
- Without this skill, a session bootstrapping the index system writes `index.md` into a folder and leaves the sibling frontmatter for later, so the first regen hard-errors on the first file missing a `title`. Partial coverage is not a partial success. The folder is broken until every sibling carries both fields, and the error surfaces at regen rather than at the write that caused it.
11
-
12
- The scan is where the other failures start. A walk that does not prune reaches `node_modules`, gitignored output, and the snippets folder, which is invoked by reference rather than browsed and needs neither an index nor per-file frontmatter. A folder that already carries an `index.md` gets a second one written over the first.
13
-
14
- One failure predates the scan. `setup-init` declines an install that wants the Claude layer without the tooling chain and names this skill as where the index system gets bootstrapped, and a body that never states the inbound route leaves the person arriving on it unable to tell whether they landed at the destination or somewhere adjacent to it.
15
-
16
- Drafted frontmatter is a proposal, and a session that writes it before the user sees it turns a review into a cleanup. The convention block has the mirror failure. A session that paraphrases it into `CLAUDE.md` produces a copy that reads correctly and no longer matches its source, so the two drift with nothing reporting it. And a project with no `CLAUDE.md` gets one scaffolded to hold the block, which installs a file the project declined.
17
-
18
- A fourth failure sits after the scan rather than inside it. `## Present candidates` had no branch for a scan that finds zero folders, so an empty result walked straight into the ask with nothing to choose from. `setup-init` folds this skill into the onboarding chain, and a fresh scaffold usually carries no markdown-heavy folder yet, so the ordinary onboarding run reached the undefined case.
19
-
20
- ## Must
21
-
22
- - Bootstrap all-or-nothing per chosen folder, since a folder carrying partial frontmatter hard-errors on regen
23
- - Prune the scan to folders a reader browses, and skip any folder already carrying an `index.md`
24
- - Surface every drafted `title` and `description` for the user to accept, edit, or reject before anything is written
25
- - Validate with a dry run and stop on the first reported error, before writing for real
26
- - Paste the convention block verbatim from its single source
27
- - Emit the closeout exactly once, whatever the seed step concluded
28
- - State the inbound route from `setup-init`, so an install wanting the Claude layer without the tooling chain can tell it landed at the destination the chain named
29
-
30
- ## Must not
31
-
32
- - Write a draft the user has not confirmed
33
- - Index the snippets folder, which is read by reference rather than browsed
34
- - Create `CLAUDE.md` to hold the convention block. Name the skip and the command that installs the file.
35
- - Overwrite content below the frontmatter block, or touch a file the user rejected
36
-
37
- ## Guards
38
-
39
- - A folder with fewer than the sibling threshold stays out of the candidate list unless the user names it explicitly, so the scan proposes and the user overrides
40
- - A `CLAUDE.md` already carrying the convention section skips the seed silently rather than appending a second copy
41
- - A scan that finds no candidate reports a one-line result and returns, skipping the ask and every step between it and the seed offer, rather than opening a prompt with nothing in it
42
-
43
- ## Out of scope
44
-
45
- - Regenerating an index in a project that already runs the system, which `canon indexes regen` does on its own
46
- - Wiring the lint-staged entry or the hook, which the closeout offers and the user opts into
47
- - Installing governance rules or scaffolding a project: `setup-gov` and `setup-init`
48
- - Writing the frontmatter conventions themselves, which the prose standard owns
@@ -1,46 +0,0 @@
1
- ---
2
- name: setup-init
3
- description: Scope boundary for the one-shot onboarding chain and the setup steps it leaves to a caller
4
- ---
5
-
6
- # Setup init requirement
7
-
8
- ## Gap
9
-
10
- Without this skill, a session installs a stack whose name it recalled rather than read, hand-writes configs the tooling sync already ships as golden files, and re-runs the chain over a project that owns its configs already.
11
-
12
- Two failures are the expensive ones because both return success. A monorepo run drops husky into every subtree, git honors one `core.hooksPath`, and the extra hook directories go quiet with nothing reporting it. A caller reads the chain as onboarding complete when plugin provisioning never runs, since no step states that it sits outside the chain.
13
-
14
- Two more start at the resolve step. A project whose language the toolkit carries no stack for resolves to `base`, and the preview reports the resolved name without marking it as a fallback, so `base` development dependencies, scripts, and hooks land on a project that will not use them and nobody had the moment to decline.
15
-
16
- The other is the refusal that ends rather than routes. An existing project, an install wanting the Claude layer without the tooling chain, and a language with no stack are the three states the chain does not serve, and each is declined by a declaration naming no destination, so the person who arrived with one reads a stop and goes no further.
17
-
18
- ## Must
19
-
20
- - Resolve every domain argument against a catalog read at run time, so a stack, rule, snippet, or tooling name the catalog does not carry cannot reach the command line
21
- - Preview the resolved chain before the first command runs, naming the evidence file behind each detected technology
22
- - Pass `--skip base` on every subtree past the first in a monorepo, so the shared hook layer lands once
23
- - State which onboarding steps the chain does not run and why, so a caller knows what is left and where the boundary sits rather than inferring completeness from a clean report
24
- - Mark a stack reached by fallback as a fallback in the preview, and name what `base` carries, so the write can be declined at the one point it is still declinable
25
- - Name a destination for every state the chain does not serve, in this body rather than only in a reference doc the person would have to already know to open, and say for each whether the chain stops or runs on a default
26
-
27
- ## Must not
28
-
29
- - Generate a config that tooling sync ships as a golden file. Generating from prose duplicates the installed file and the two drift.
30
- - Author a rule, stack, or snippet inside the target project when detection finds no match. Authoring happens in the toolkit and reaches a project by install or sync.
31
- - Grow an existing-project branch, a mode switch, or a clobber guard. The chain runs once against a fresh scaffold and the per-domain paths cover everything after that.
32
-
33
- ## Guards
34
-
35
- - An unmatched technology stops for a decision. Surface the gap and either defer to rule authoring or proceed on the matched layer with the gap named in the report, rather than resolving to the nearest rule.
36
-
37
- ## Out of scope
38
-
39
- - Installing governance rules alone: `setup-gov`. This skill installs governance beside tooling and the seeds.
40
- - Provisioning Claude Code plugins: `setup-plugins`. Those install once per machine rather than into a project, so no project-scoped chain can carry them.
41
- - Running the verification scripts, which `setup-verify` owns and this chain invokes as step 4
42
- - Publishing repository metadata: `repo-metadata`. It reaches a remote, which is past the project edge this chain stops at.
43
- - Making the first commit: `git-commit`. It reaches the project's history, which is past the project edge this chain stops at.
44
- - Re-installing into a project that already has the files, which the per-domain `canon <domain> install` and `canon sync` commands own
45
- - Deciding which of those per-domain commands an existing project needs: `canon-operator`. That skill reads the target before naming one, which this chain never does, so it is the destination rather than a guess made here.
46
- - Seeding the `.claude/` folder without the tooling chain, which `canon claude init` does on its own and `setup-indexes` finishes
@@ -1,133 +0,0 @@
1
- ---
2
- name: setup-init
3
- description: Detects a new project's type and runs `canon init` with a resolved stack in one shot. Use when bootstrapping a new project with the toolkit, or when asked to "init this project", "bootstrap the toolkit", "set up toolkit", or "one-shot install". Assumes the `canon` CLI is on PATH. Do NOT use when only installing governance rules. Use `setup-gov` instead.
4
- ---
5
-
6
- # Init project
7
-
8
- Orchestrates the onboarding chain. Detects project type, resolves per-domain arguments, previews the chain, then runs `canon init` with flags. The CLI holds the install logic. This skill only resolves and previews.
9
-
10
- ## Scope
11
-
12
- - This skill and `canon init` run once on a fresh scaffold, never on an existing project. They do not guard against clobbering existing configs. When tempted to add guards, mode switches, or an existing-project branch, stop. Extend the per-domain `canon <domain> install` or `canon sync` paths instead.
13
- - The chain folds `setup-indexes` in as its own final step, once the project-scoped work is written. It still does not provision Claude Code plugins: `setup-plugins` owns that, installing once per machine rather than into a project, so no project-scoped chain can carry it. Name it in the report so a clean result does not read as onboarding complete.
14
-
15
- ## Declined states
16
-
17
- Three states reach this skill that the chain does not serve. Name the destination for each, so the refusal routes rather than ends. The first two stop the chain outright and the third runs it on a default the person may not want.
18
-
19
- - **An existing project.** Stop and hand off to `canon-operator`. It reads what the target already carries before it names a command, which this chain never does, so any per-domain install picked here is a guess against configs nobody read. The Scope bullet above names the same commands as the authoring alternative, and this is the destination a person takes.
20
- - **An install wanting the `.claude/` folder alone.** Stop. Run `canon claude init` for the seed docs, then invoke `setup-indexes` to bootstrap the `index.md` system over the project's own documentation folders. Neither needs the tooling sync this chain runs.
21
- - **A language the toolkit carries no stack for.** The chain still runs, on `base`, with the fallback marked in the preview. A project that wants none of what `base` carries declines there and takes `setup-gov` for the governance layer, which is language-neutral. Say so at the preview rather than resolving it here, since the fallback is a working default and only the person can say whether it fits.
22
-
23
- Do not add a stack, a mode switch, or an existing-project branch to satisfy one of these. Each destination already exists and routing to it costs a line.
24
-
25
- ## Read catalogs
26
-
27
- Run in parallel. Never hardcode stack, rule, snippet, or standards names.
28
-
29
- Run from the target project's current directory. Do not cd into the toolkit source tree. The `canon` CLI is global.
30
-
31
- ```bash
32
- canon gov list --json 2>/dev/null
33
- canon tooling list --json 2>/dev/null
34
- ```
35
-
36
- ## Detect
37
-
38
- Read these from the project root in parallel, skipping any that do not exist:
39
-
40
- - `package.json`: `dependencies` and `devDependencies`
41
- - Root configs: `astro.config.*`, `next.config.*`, `vite.config.*`, `tailwind.config.*`, `tsconfig.json`, `pyproject.toml`, `go.mod`, `Cargo.toml`
42
- - `canon/REQUIREMENTS.md` and `canon/ARCHITECTURE.md` if present
43
- - Directory structure via `ls -1` of the project root and `src/` if present
44
-
45
- ## Resolve arguments
46
-
47
- - **Stack:** pick the closest governance stack by matching detected runtime or framework against stack names in the catalog. If nothing matches, fall back to `base` and carry the fallback into the preview.
48
- - **Tooling stack:** pick the closest tooling stack from `canon tooling list --json` (e.g. `vite-react`, `astro`, `nextjs`). Distinct from the governance stack. Fall back to `base` if no framework match, and carry that fallback into the preview too.
49
- - **Next.js:** map `next` in `package.json` dependencies, or a root `next.config.ts`/`.js`/`.mjs` file, to the `nextjs` tooling stack. The dependency name does not match the stack name by itself.
50
- - **Extras:** identify technologies not already covered by the picked stack. For each, find a rule whose `description` or `paths` points at that technology and pass it via `--add`. Do not add a rule the stack already pulls in.
51
- - **Skip (`--skip`):** `wiki` installs by default. Add `--skip wiki` only when the user explicitly wants it left out.
52
-
53
- ## Gap handling
54
-
55
- If a detected technology has no matching rule or stack, do not guess. Surface the gap and either:
56
-
57
- 1. Defer to `setup-gov`. Author a rule in the toolkit, then re-run this skill.
58
- 2. Proceed with the matched layer, listing the gap in the final report.
59
-
60
- Rules and stacks are authored in the toolkit repo, never in the target project on the fly.
61
-
62
- ## Preview
63
-
64
- Before executing, output:
65
-
66
- - **Detected:** each technology with its evidence file
67
- - **Stack:** picked governance stack + resolved rule count. Mark it `fallback` when no detected runtime or framework matched a catalog name.
68
- - **Tooling stack:** picked tooling stack. Mark it `fallback` on the same test, and name what `base` lands: configs, seeds, and gitignore entries in every case, plus the JavaScript development dependencies, scripts, and hook activation wherever a `package.json` exists to carry them. A project outside that ecosystem runs none of the second group and keeps the first.
69
- - **Extras:** each `--add` rule with a one-line reason
70
- - **Skip:** any `--skip` entries with reason
71
- - **Target:** resolved target path
72
- - **Commands:** the full chain that will run
73
-
74
- A resolved name and a fallback read alike once written, so mark the fallback here rather than in the report. The preview is the last point before the first write, and the report runs after the files have landed.
75
-
76
- ## Execute
77
-
78
- Run the chain in order, starting immediately after the preview. Each step's permission dialog is the confirmation gate, except step 5, which hands off to a skill that confirms its own folder list with the operator. Do not pause for additional confirmation elsewhere. Run from the target project's current directory.
79
-
80
- Step 1: `canon init` installs base tooling, claude seeds, governance rules, and wiki.
81
-
82
- ```bash
83
- CANON_NON_INTERACTIVE=1 canon init \
84
- --stack <stack> \
85
- --add <rules> \
86
- <target>
87
- ```
88
-
89
- Omit any flag whose resolved value is empty.
90
-
91
- Step 2: `canon tooling sync <tooling-stack> --write` installs stack deps, scripts, gitignore entries, seeds, golden configs, and drops the reference doc. The extends chain is walked, so syncing `vite-react` also pulls `web` and `base` configs. Skip if the tooling stack is `base` (already synced by `canon init`).
92
-
93
- `--write` is required. A headless run without it reports what it would replace and exits 1, since golden configs overwrite whatever the target holds at those paths. Scaffolding into a fresh target has nothing to lose, so pass it directly rather than reading a report first.
94
-
95
- ```bash
96
- CANON_NON_INTERACTIVE=1 canon tooling sync <tooling-stack> <target> --write
97
- ```
98
-
99
- Monorepo with multiple language roots: run `canon init` once at the repo root so `base` (husky, prettier, cspell, commitlint, CI) lands single, then sync each subtree with `--skip base` so the shared layer is not re-dropped.
100
-
101
- ```bash
102
- CANON_NON_INTERACTIVE=1 canon tooling sync vite-react ./frontend --skip base --write
103
- CANON_NON_INTERACTIVE=1 canon tooling sync python ./backend --skip base --write
104
- ```
105
-
106
- Without `--skip base`, each subtree re-drops husky, and git honors only one `core.hooksPath`, so the extra hook dirs silently break. Each subtree keeps its own framework configs, and its own stack reference reads through `canon tooling reference <stack>`.
107
-
108
- Step 3: post-sync fixups. Golden configs arrive from sync, so no config generation is required. But a few items may need a one-time touch:
109
-
110
- - **ESLint version pin.** If `bun create vite` installed `eslint@^10` and the manifest pins `eslint@^9`, sync does not override a present dep. Run `bun add -d eslint@^9` if `bun run lint:fix` fails with `Class extends value undefined`.
111
- - **File naming.** `bun create vite`'s `App.tsx` violates the `KEBAB_CASE` rule. Rename to `app.tsx` and update the import in `main.tsx`.
112
- - **Docs.** Run `canon tooling reference <tooling-stack>` and `canon tooling reference web` for any stack-specific follow-ups (Chrome extension overrides, setup script details).
113
-
114
- Do not generate ESLint, Vitest, or Playwright configs. They ship as golden files. Generating from prose duplicates what sync already installed.
115
-
116
- Step 4: invoke `setup-verify`. Runs the `package.json` scripts and reports pass/fail.
117
-
118
- Step 5: hand off to `setup-indexes` to bootstrap the `index.md` system over the project's own documentation folders. The skill confirms candidate folders with the operator rather than running unattended, which is the one step in this chain that pauses for a conversation. A fresh scaffold usually has no markdown-heavy folder yet, so this step frequently hands off with nothing for `setup-indexes` to present, which is that skill's own outcome to define rather than a claim this chain makes for it.
119
-
120
- ## Report
121
-
122
- After the chain, report:
123
-
124
- - Domains installed with a check per domain
125
- - Tooling stack synced (or skipped). Name the layers pulled via the extends chain.
126
- - Any post-sync fixups applied (ESLint pin, filename renames)
127
- - `setup-verify` outcome
128
- - `setup-indexes` outcome (folders bootstrapped, or none found)
129
- - Any domains or scripts that failed
130
- - Any detection gaps surfaced during resolve
131
- - Onboarding steps left to the caller: `setup-plugins` for Claude Code plugins
132
-
133
- The chain stops at the project edge. `repo-metadata` and `git-commit` also ship, reaching a remote and the project's history respectively, and neither runs here.
@@ -1,42 +0,0 @@
1
- ---
2
- name: setup-plugins
3
- description: Why plugin installs read a curated catalog, install user-scoped, and never touch toolkit workflow skills
4
- ---
5
-
6
- # Setup plugins requirement
7
-
8
- ## Gap
9
-
10
- Without this skill, a session asked to install plugins invents marketplace sources and install strings from names it half remembers, and a plugin name that does not exist fails in a way that reads like a network problem. The catalog is the difference between an install and a guess.
11
-
12
- Scope is the failure that shows up later. A domain plugin installed into one project is missing from the next one, so the machine looks provisioned until the user opens another repository. The mirror mistake is treating toolkit workflow skills as plugins to install, when they load live through a plugin directory and a copied version goes stale the moment it lands.
13
-
14
- Two failures come from running the batch carelessly. A reinstall over a plugin already present costs time and can replace a working version. And a batch that aborts on the first failure leaves a partial install with no record of which rows ran, so the next attempt starts from an unknown state.
15
-
16
- ## Must
17
-
18
- - Read the curated catalog through the skill's own directory, so the path resolves from any project
19
- - Detect what is already installed and skip those rows
20
- - Install user-scoped, since a domain plugin belongs to the machine rather than to one project
21
- - Run each install independently so one failure does not abort the batch
22
- - Preview the chosen rows, the scope, and the exact commands before executing
23
- - Report the failures with their CLI errors, the reload requirement, and the settings-level remedy for an over-triggering plugin
24
-
25
- ## Must not
26
-
27
- - Install a plugin, marketplace, or command string that is not in the catalog
28
- - Install toolkit workflow skills, which load live rather than being copied
29
- - Reinstall a plugin already present
30
- - Pause for a confirmation beyond the tool permission dialog
31
-
32
- ## Guards
33
-
34
- - The `claude` CLI absent from PATH stops before any install, since every step shells out to it
35
- - A catalog row that installs outside the plugin CLI runs its own installer verbatim rather than being forced through the marketplace path
36
-
37
- ## Out of scope
38
-
39
- - Curating the catalog, which is an edit to the bundled reference rather than a run of this skill
40
- - Uninstalling, since an over-triggering plugin is tuned through settings rather than removed
41
- - Installing anything into a project, which every setup skill but this one does
42
- - First-time project scaffolding: `setup-init`
@@ -1,81 +0,0 @@
1
- ---
2
- name: setup-plugins
3
- description: Installs curated community and official Claude Code plugins user-scoped on the current machine via the `claude plugin` CLI. Use when asked to "install plugins", "set up plugins", "install the frontend/design/security/debugging plugins", "provision plugins on this machine", or when setting up Claude Code on a new computer. Do NOT use to install toolkit workflow skills, which load live via `--plugin-dir`. Assumes the `claude` CLI is on PATH.
4
- ---
5
-
6
- # Setup plugins
7
-
8
- Automates plugin installs by reading the curated catalog, detecting what is already
9
- installed, and shelling out to the `claude plugin` CLI with `--scope user` so the
10
- plugins are available in every project on this machine.
11
-
12
- Domain-knowledge plugins install once per machine. They are not copied into any
13
- project. Toolkit workflow skills are a separate concern and load live through
14
- `--plugin-dir`, so never install those here.
15
-
16
- ## Guards
17
-
18
- - If the `claude` CLI is not on PATH, stop: `❌ claude CLI not found. Install Claude Code first.`
19
-
20
- ## Read the catalog
21
-
22
- Read the curated list from the skill folder. Use `${CLAUDE_SKILL_DIR}`, which
23
- expands to this skill's own directory, so the path resolves from any project. Never
24
- invent plugin names or install strings that are not in it.
25
-
26
- - `${CLAUDE_SKILL_DIR}/references/plugin-catalog.md`: verified plugins, marketplace sources, and the recommended default set
27
-
28
- ## Detect what is installed
29
-
30
- Run this to skip plugins already present. Do not reinstall an installed plugin.
31
-
32
- ```bash
33
- claude plugin list 2>/dev/null || echo "NONE"
34
- ```
35
-
36
- ## Select
37
-
38
- When plugin names are passed as arguments, install exactly those and skip the prompt.
39
-
40
- When invoked bare, present the catalog grouped by category with the recommended
41
- default marked, then ask which to install. Accept a bulk answer:
42
-
43
- - `recommended`: the default set from the catalog
44
- - `all`: every catalog row not already installed
45
- - a specific list of plugin names
46
-
47
- ## Preview
48
-
49
- Before executing, output:
50
-
51
- - **Installed:** plugins already present, skipped
52
- - **To install:** each chosen plugin with its category and marketplace source
53
- - **Scope:** `user` (every project on this machine)
54
- - **Commands:** the exact shell commands to run
55
-
56
- ## Execute
57
-
58
- For each chosen plugin, add its marketplace source if it is not already added, then
59
- install the plugin user-scoped. Run each install independently so one failure does
60
- not abort the batch.
61
-
62
- ```bash
63
- claude plugin marketplace add <source> 2>/dev/null || true
64
- claude plugin install <name> --scope user
65
- ```
66
-
67
- For a catalog entry listed under "Installs outside the claude plugin CLI", skip the
68
- marketplace step and run its installer command verbatim instead.
69
-
70
- Claude Code's tool permission dialog is the confirmation gate. Do not pause for a
71
- separate confirmation.
72
-
73
- ## Response
74
-
75
- After execution, report:
76
-
77
- - Plugins installed, each with its marketplace
78
- - Plugins skipped as already installed
79
- - Any install that failed, with the CLI error
80
- - A reload note: installed plugins apply on the next session or after `/reload-plugins`
81
- - A tuning note: if a plugin over-triggers, set `skillOverrides` in settings to `name-only`, `user-invocable-only`, or `off` rather than uninstalling
@@ -1,53 +0,0 @@
1
- ---
2
- title: Plugin catalog
3
- description: Curated community and official Claude Code plugins that setup-plugins installs
4
- ---
5
-
6
- # Plugin catalog
7
-
8
- Curated domain-knowledge plugins the `setup-plugins` skill installs user-scoped.
9
- Each row is verified to install through the `claude plugin` CLI. This file holds
10
- only the actionable install data.
11
-
12
- ## Install data
13
-
14
- Add the marketplace source once, then install the plugin by name. The CLI resolves
15
- the plugin across added marketplaces, so `<name>@<marketplace>` is only needed to
16
- disambiguate a name that exists in more than one marketplace.
17
-
18
- | Plugin | Category | Marketplace source | Why |
19
- | ------------------- | --------- | ------------------------ | -------------------------------------------------------------------- |
20
- | `frontend-design` | design | `anthropics/claude-code` | Steers UI generation toward intentional typography, hierarchy, color |
21
- | `security-guidance` | security | `anthropics/claude-code` | Security-aware authoring guidance during code generation |
22
- | `code-review` | review | `anthropics/claude-code` | Multi-agent PR review across compliance, bugs, history, and comments |
23
- | `superpowers` | debugging | `obra/superpowers` | Methodology skills: systematic-debugging, root-cause-tracing |
24
-
25
- ## Recommended default
26
-
27
- The `design` and `security` categories cover the common gaps for a new machine.
28
- When the user asks for a recommended set, propose `frontend-design` and
29
- `security-guidance`. Offer `code-review` and `superpowers` as additions.
30
-
31
- `code-review` overlaps the toolkit's own `review-branch` skill. They run in
32
- different places, the plugin on a PR and the toolkit skill on a local diff. Install
33
- `code-review` only when the user wants the GitHub-side flow too.
34
-
35
- ## Installs outside the claude plugin CLI
36
-
37
- Some strong plugins do not distribute through a marketplace, so the `claude plugin`
38
- path does not reach them. List them here with their real installer. Surface them to
39
- the user during selection, but do not run their install through the marketplace
40
- step above. Run the installer command verbatim only when the user picks it.
41
-
42
- | Plugin | Category | Installer | Why |
43
- | ------------ | -------- | ------------------------------- | ----------------------------------------------------------------- |
44
- | `impeccable` | design | `npx impeccable skills install` | Curated anti-slop reference files, sharper than `frontend-design` |
45
-
46
- `npx impeccable skills install` detects the Claude Code harness and installs into
47
- `.claude/`. It may prompt, so it is not fully non-interactive. After install, run
48
- `/impeccable init` and reload.
49
-
50
- Install per project, not per machine. The skill invokes its scripts through paths
51
- relative to the current project (`.claude/skills/impeccable/scripts/*.mjs`), so a
52
- copy under `~/.claude/` cannot locate them once the working directory is a
53
- different project. Re-run the installer in each project that wants impeccable.