@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.
- package/claude/.claude-plugin/plugin.json +1 -1
- package/claude/skills/canon-cli/SKILL.md +3 -77
- package/claude/skills/canon-operator/REQUIREMENT.md +2 -2
- package/claude/skills/canon-operator/SKILL.md +5 -5
- package/claude/skills/design-taste/references/craft.md +1 -1
- package/claude/skills/design-taste/references/preflight.md +2 -2
- package/claude/skills/design-taste/references/tells.md +1 -1
- package/claude/skills/git-followup/SKILL.md +1 -1
- package/claude/skills/git-issue/SKILL.md +2 -2
- package/{standards → claude/skills/git-issue/references}/issue.md +3 -8
- package/claude/skills/git-pr/SKILL.md +2 -2
- package/claude/skills/index-lookup/REQUIREMENT.md +2 -2
- package/claude/skills/project-commands/REQUIREMENT.md +1 -1
- package/claude/skills/seed-sync/REQUIREMENT.md +1 -1
- package/claude/skills/target-check/REQUIREMENT.md +1 -1
- package/claude/skills/target-setup/REQUIREMENT.md +56 -0
- package/claude/skills/target-setup/SKILL.md +163 -0
- package/claude/skills/target-setup/references/detect.md +80 -0
- package/claude/skills/{setup-indexes/SKILL.md → target-setup/references/indexes.md} +59 -23
- package/claude/skills/target-setup/references/verify.md +95 -0
- package/docs/agents/sandbox.md +1 -1
- package/docs/agents/scripting.md +3 -2
- package/docs/target-projects.md +11 -11
- package/docs/workflow/ai-workflow.md +8 -13
- package/governance/rules/ui/400-ui.md +0 -5
- package/governance/rules/ui/460-design-taste.md +1 -1
- package/governance/rules/ui/465-interface-casing.md +31 -0
- package/governance/stacks/astro.toml +1 -1
- package/governance/stacks/react.toml +1 -1
- package/package.json +1 -1
- package/scripts/core/regen-hero.sh +1 -1
- package/src/claude/cases/setup.ts +12 -11
- package/src/commands/sync.ts +1 -1
- package/src/gate/measures.ts +57 -0
- package/src/gate/stages.ts +10 -14
- package/src/gov/list.ts +1 -1
- package/src/sandbox/census.ts +3 -3
- package/src/shipped/references.ts +1 -1
- package/standards/index.md +0 -1
- package/claude/skills/setup-gov/REQUIREMENT.md +0 -37
- package/claude/skills/setup-gov/SKILL.md +0 -77
- package/claude/skills/setup-indexes/REQUIREMENT.md +0 -48
- package/claude/skills/setup-init/REQUIREMENT.md +0 -46
- package/claude/skills/setup-init/SKILL.md +0 -133
- package/claude/skills/setup-plugins/REQUIREMENT.md +0 -42
- package/claude/skills/setup-plugins/SKILL.md +0 -81
- package/claude/skills/setup-plugins/references/plugin-catalog.md +0 -53
- package/claude/skills/setup-smoke/REQUIREMENT.md +0 -38
- package/claude/skills/setup-smoke/SKILL.md +0 -53
- package/claude/skills/setup-verify/REQUIREMENT.md +0 -39
- package/claude/skills/setup-verify/SKILL.md +0 -51
- package/scripts/core/regen-tooling-paths.sh +0 -61
|
@@ -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"
|