@erclx/canon 4.103.0 → 4.105.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 (60) 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/agents/tasks.md +13 -11
  24. package/docs/target-projects.md +11 -11
  25. package/docs/workflow/ai-workflow.md +8 -13
  26. package/governance/rules/ui/400-ui.md +0 -5
  27. package/governance/rules/ui/410-a11y.md +5 -0
  28. package/governance/rules/ui/440-surface-capture.md +7 -1
  29. package/governance/rules/ui/460-design-taste.md +1 -1
  30. package/governance/rules/ui/465-interface-casing.md +31 -0
  31. package/governance/stacks/astro.toml +1 -1
  32. package/governance/stacks/react.toml +1 -1
  33. package/package.json +1 -1
  34. package/scripts/core/regen-hero.sh +1 -1
  35. package/src/claude/cases/setup.ts +12 -11
  36. package/src/commands/sync.ts +1 -1
  37. package/src/commands/tasks.ts +1 -0
  38. package/src/design/document.ts +2 -0
  39. package/src/design/tokens.ts +4 -0
  40. package/src/gate/measures.ts +57 -0
  41. package/src/gate/stages.ts +10 -14
  42. package/src/gov/list.ts +1 -1
  43. package/src/sandbox/census.ts +3 -3
  44. package/src/shipped/references.ts +1 -1
  45. package/src/tasks/validate.ts +68 -0
  46. package/standards/design.md +1 -1
  47. package/standards/index.md +0 -1
  48. package/claude/skills/setup-gov/REQUIREMENT.md +0 -37
  49. package/claude/skills/setup-gov/SKILL.md +0 -77
  50. package/claude/skills/setup-indexes/REQUIREMENT.md +0 -48
  51. package/claude/skills/setup-init/REQUIREMENT.md +0 -46
  52. package/claude/skills/setup-init/SKILL.md +0 -133
  53. package/claude/skills/setup-plugins/REQUIREMENT.md +0 -42
  54. package/claude/skills/setup-plugins/SKILL.md +0 -81
  55. package/claude/skills/setup-plugins/references/plugin-catalog.md +0 -53
  56. package/claude/skills/setup-smoke/REQUIREMENT.md +0 -38
  57. package/claude/skills/setup-smoke/SKILL.md +0 -53
  58. package/claude/skills/setup-verify/REQUIREMENT.md +0 -39
  59. package/claude/skills/setup-verify/SKILL.md +0 -51
  60. package/scripts/core/regen-tooling-paths.sh +0 -61
@@ -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.
@@ -1,38 +0,0 @@
1
- ---
2
- name: setup-smoke
3
- description: Why the heavy scaffold stages need an owner and what heuristic judges a server smoke pass
4
- ---
5
-
6
- # Setup smoke requirement
7
-
8
- ## Gap
9
-
10
- Without this skill, a freshly scaffolded project's dev server, preview server, end-to-end suite, and screenshot harness never run anywhere. `setup-verify` excludes all three for the flakiness reasons that make them wrong for an unattended chain, and names no destination for any of them, so a broken dev server or a missing end-to-end dependency surfaces only once the user hits it by hand.
11
-
12
- A dev or preview server carries no exit code to read, since it runs until stopped rather than finishing on its own, unlike the leaf scripts `setup-verify` runs. Judging it needs a heuristic rather than a pass/fail read.
13
-
14
- ## Must
15
-
16
- - Read the scripts the project declares and run only those, skip absent ones
17
- - Run `dev`, `preview`, `test:e2e`, `screenshot` in that fixed order, stopping at the first failure
18
- - Judge a server script by running it in the background, waiting a fixed window, checking the process is alive and its output carries no fatal error string, then killing it regardless of the outcome
19
- - Install dependencies itself when missing, so it runs standalone without `setup-verify` having run first
20
-
21
- ## Must not
22
-
23
- - Invent a fallback command for an absent script
24
- - Run a composite script
25
- - Require `setup-verify` to have passed first
26
- - Duplicate a leaf script `setup-verify` already runs
27
- - Get invoked by anything other than a person or a chain naming it directly. Review this at each future change, since nothing can answer it before the skill has run. `canon docs target-projects` states the scaffold chain that keeps it outside the unattended path, for the same flakiness reasons that keep it out of `setup-verify`'s own leaf-script order.
28
-
29
- ## Guards
30
-
31
- - No `package.json` at the project root stops, since there are no declared scripts to read
32
- - A missing dependency folder installs first rather than letting every script fail on the same cause
33
-
34
- ## Out of scope
35
-
36
- - The leaf scripts `setup-verify` already runs: `lint:fix`, `typecheck`, `check`, `test:run`, `build`
37
- - Generating the configs these scripts drive, which the tooling stack reference owns
38
- - A true port-probe readiness check, since no manifest key exposes a generic port across stacks
@@ -1,53 +0,0 @@
1
- ---
2
- name: setup-smoke
3
- description: Runs the heavy scaffold checks setup-verify skips - dev and preview server smoke, Playwright end-to-end tests, and the screenshot harness - on the same declared-scripts contract. Use after setup-verify passes, or when asked to "run the smoke tests", "check the dev server", "run e2e against the scaffold", or "run the heavy checks". Do NOT use in place of setup-verify, or on a project without package.json.
4
- ---
5
-
6
- # Smoke scaffold
7
-
8
- Runs the local checks a scaffold's leaf scripts cannot cover: whether the dev and preview servers actually start, whether the end-to-end suite passes against a real server, and whether the screenshot harness produces output. Standalone from `setup-verify`. Neither skill requires the other to have run first.
9
-
10
- ## Guards
11
-
12
- - If `package.json` does not exist at the project root, stop: `❌ No package.json found. Cannot smoke test.`
13
- - If `node_modules/` does not exist, run `bun install` first, then proceed.
14
-
15
- ## Step 1: read scripts
16
-
17
- Read `package.json` from the project root and extract the `scripts` block. Do not hardcode script names.
18
-
19
- ## Step 2: run the chain
20
-
21
- Run the scripts below in order. Stop on the first failure and surface the error.
22
-
23
- | Order | Script | Skip if | How judged |
24
- | ----- | ------------ | ------- | ----------------------- |
25
- | 1 | `dev` | absent | server smoke, see below |
26
- | 2 | `preview` | absent | server smoke, see below |
27
- | 3 | `test:e2e` | absent | leaf script: exit code |
28
- | 4 | `screenshot` | absent | leaf script: exit code |
29
-
30
- Skip any script not present in `package.json`. Do not invent a fallback command. Run each leaf script as `bun run <script>` from the project root.
31
-
32
- ### Server smoke
33
-
34
- `dev` and `preview` run until stopped, so there is no exit code to read. Start the script backgrounded, wait 5 seconds, then check two things: the process is still running, and its captured output carries no string matching `error`, `Error`, or `fatal`. Kill the process either way once judged. Report a failure on either check failing.
35
-
36
- This is weaker than a real readiness probe. No manifest key exposes a generic port to poll across stacks, so port-probing is out of reach here.
37
-
38
- ## Step 3: report
39
-
40
- For each script run, report one of:
41
-
42
- - `✅ <script>`
43
- - `❌ <script>` followed by the failing output (last 40 lines) or, for a server script, the reason judged (process died, or a fatal string in its output)
44
-
45
- End with a summary line:
46
-
47
- - On pass: `✅ Scaffold smoke-tested (<n> scripts passed).`
48
- - On fail: `❌ Scaffold failed at <script>. Fix the error and re-run setup-smoke.`
49
-
50
- ## Out of scope
51
-
52
- - `lint:fix`, `typecheck`, `check`, `test:run`, `build`. Those are `canon:setup-verify`'s leaf-script chain.
53
- - Generating the configs these scripts drive, which the tooling stack reference owns.
@@ -1,39 +0,0 @@
1
- ---
2
- name: setup-verify
3
- description: Why a fresh scaffold is checked with declared leaf scripts in a fixed order, and what the excluded stages would cost
4
- ---
5
-
6
- # Setup verify requirement
7
-
8
- ## Gap
9
-
10
- Without this skill, a freshly scaffolded project is handed over on the strength of the configs looking right, and the first typo surfaces when the user runs something. A scaffold is generated from a reference, so the errors it carries are wiring mistakes and missing dependencies, both of which any script run would have caught.
11
-
12
- The naive check fails two ways. A session that assumes script names runs `test` against a stack that exposes `test:run`, or invents a fallback command when a script is absent, and either result reports on something the project never declared. A session that runs a composite script gets one failure covering several stages, so the output names the wrapper rather than the break.
13
-
14
- The stages left out are the ones that lie, and each now has an owner in `canon:setup-smoke` rather than nowhere at all. A dev server or a preview reads as failed when it starts slowly, a browser test needs an install and a running server before it can even fail correctly, and a CI workflow cannot be judged locally at all. Including any of them turns a scaffold check into a flaky one, and a flaky check gets ignored.
15
-
16
- ## Must
17
-
18
- - Read the scripts the project declares and run only those
19
- - Run leaf scripts in a fixed order, so a failure points at the exact stage that broke
20
- - Stop at the first failure and surface its output rather than continuing to collect more
21
- - Report per script and close with one summary line naming the failing stage when there is one
22
-
23
- ## Must not
24
-
25
- - Invent a fallback command for an absent script. Skip it.
26
- - Run a composite script, which hides which stage broke
27
- - Run a dev server, a preview, or a browser test
28
-
29
- ## Guards
30
-
31
- - No `package.json` at the project root stops, since there are no declared scripts to read
32
- - A missing dependency folder installs first rather than letting every script fail on the same cause
33
-
34
- ## Out of scope
35
-
36
- - Dev and preview smoke tests, which `project-commands` starts on request and `canon:setup-smoke` checks automatically
37
- - Browser end-to-end tests, which need a browser install and a running server, covered by `canon:setup-smoke`
38
- - CI workflow validation, which runs on the pull request rather than locally. `canon:setup-smoke` runs the same stages locally as the closest proxy
39
- - Generating the configs it checks, which the tooling stack reference owns
@@ -1,51 +0,0 @@
1
- ---
2
- name: setup-verify
3
- description: Verifies a freshly scaffolded project by running its `package.json` scripts in order and reporting pass/fail per script. Use after the agent has followed a tooling stack reference and generated configs, or when asked to "verify the scaffold", "check the setup", "run verify", or "make sure everything works". Do NOT use on a project without `package.json`, or to run E2E or dev servers.
4
- ---
5
-
6
- # Verify scaffold
7
-
8
- Runs the local verification chain against a freshly scaffolded project. Catches config typos, missing deps, and wiring mistakes before the user ever sees them.
9
-
10
- ## Guards
11
-
12
- - If `package.json` does not exist at the project root, stop: `❌ No package.json found. Cannot verify.`
13
- - If `node_modules/` does not exist, run `bun install` first, then proceed.
14
-
15
- ## Step 1: read scripts
16
-
17
- Read `package.json` from the project root and extract the `scripts` block. Do not hardcode script names. Different stacks expose different scripts.
18
-
19
- ## Step 2: run the chain
20
-
21
- Run the scripts below in order. Stop on the first failure and surface the error. Each script is a leaf command so failures point at the exact break.
22
-
23
- | Order | Script | Skip if |
24
- | ----- | ----------- | --------------------------- |
25
- | 1 | `lint:fix` | absent |
26
- | 2 | `typecheck` | absent |
27
- | 3 | `check` | absent |
28
- | 4 | `test:run` | absent, fall back to `test` |
29
- | 5 | `build` | absent |
30
-
31
- Skip any script not present in `package.json`. Do not invent a fallback command. Do not run composite scripts like `check:full`. Do not run `dev`, `preview`, `test:e2e`, `test:ui`, `screenshot`.
32
-
33
- Run each as `bun run <script>` from the project root.
34
-
35
- ## Step 3: report
36
-
37
- For each script run, report one of:
38
-
39
- - `✅ <script>`
40
- - `❌ <script>` followed by the failing output (last 40 lines)
41
-
42
- End with a summary line:
43
-
44
- - On pass: `✅ Scaffold verified (<n> scripts passed).`
45
- - On fail: `❌ Scaffold failed at <script>. Fix the error and re-run setup-verify.`
46
-
47
- ## Out of scope
48
-
49
- - Dev server and preview server smoke tests. Too flaky for a scaffold check, where a slow start reads as a failure. Use `project-commands` to start one on request, or `canon:setup-smoke` to check both automatically.
50
- - Playwright E2E tests. Require browser install and a running server. Use `canon:setup-smoke`.
51
- - CI workflow validation. Runs in GitHub Actions on PR, not locally. `canon:setup-smoke` runs the same end-to-end and screenshot stages locally, as the closest proxy.
@@ -1,61 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
- set -o pipefail
4
-
5
- # Rewrites the generated path block in the shipped overwrite contract, which
6
- # names every file a tooling sync can replace. The category reaches past the
7
- # linters its name suggests, into the CI workflow, the end-to-end harness, and
8
- # the shell scripts under scripts/, so a reader cannot infer the list. Generating
9
- # it is what keeps a stack gaining a file from leaving the contract wrong.
10
- #
11
- # The stack names come from `tooling list` rather than from a directory walk,
12
- # so a stack the verb excludes never reaches a contract about what the verb does.
13
-
14
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
15
- PROJECT_ROOT="${PROJECT_ROOT:-$(cd "$SCRIPT_DIR/../.." && pwd)}"
16
-
17
- TOOLING_DIR="$PROJECT_ROOT/tooling"
18
- CONTRACT="$PROJECT_ROOT/claude/skills/canon-cli/SKILL.md"
19
-
20
- BEGIN="<!-- generated:tooling-paths -->"
21
- END="<!-- /generated:tooling-paths -->"
22
-
23
- [ -d "$TOOLING_DIR" ] || exit 0
24
- [ -f "$CONTRACT" ] || exit 0
25
-
26
- grep -qF "$BEGIN" "$CONTRACT" || {
27
- echo "Missing $BEGIN marker in $CONTRACT" >&2
28
- exit 1
29
- }
30
-
31
- block="$(mktemp)"
32
- trap 'rm -f "$block" "$CONTRACT.tmp"' EXIT
33
-
34
- {
35
- echo "$BEGIN"
36
- echo
37
- while IFS= read -r stack; do
38
- [ -d "$TOOLING_DIR/$stack/configs" ] || continue
39
- echo "### $stack"
40
- echo
41
- while IFS= read -r rel; do
42
- echo "- \`$rel\`"
43
- done < <(cd "$TOOLING_DIR/$stack/configs" && find . -type f | sed 's|^\./||' | sort)
44
- echo
45
- done < <(bun "$PROJECT_ROOT/src/cli.ts" tooling list --json | jq -r '.stacks[].name' | sort)
46
- echo "$END"
47
- } >"$block"
48
-
49
- # awk streams the file rather than editing in place, so a pattern that matches
50
- # nothing produces a file missing the block instead of an unchanged one that
51
- # exits zero.
52
- awk -v block_file="$block" -v begin="$BEGIN" -v end="$END" '
53
- $0 == begin { while ((getline line < block_file) > 0) print line; skipping = 1; next }
54
- $0 == end { skipping = 0; next }
55
- !skipping { print }
56
- ' "$CONTRACT" >"$CONTRACT.tmp"
57
-
58
- # The destination is a tracked file with a mode the copy must not inherit from
59
- # mktemp, so the content moves onto the original rather than replacing it.
60
- cat "$CONTRACT.tmp" >"$CONTRACT"
61
- rm -f "$CONTRACT.tmp"