@erclx/canon 5.41.0 → 5.43.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/api-design/references/adopted.md +34 -14
- package/claude/skills/auto-ship/REQUIREMENT.md +1 -0
- package/claude/skills/auto-ship/SKILL.md +24 -4
- package/claude/skills/auto-ship/references/draft-mark.md +32 -6
- package/claude/skills/auto-ship/references/failure-recovery.md +15 -13
- package/claude/skills/auto-ship/references/tier-failures.md +31 -10
- package/claude/skills/auto-ship/references/ui-checklist.md +9 -4
- package/claude/skills/auto-ship/references/worktree-name.md +9 -3
- package/claude/skills/build-in-slices/references/adopted.md +35 -21
- package/claude/skills/canvas-board/references/canvas.md +17 -6
- package/claude/skills/canvas-board/references/design.md +26 -7
- package/claude/skills/ci-workflow/REQUIREMENT.md +2 -1
- package/claude/skills/ci-workflow/SKILL.md +12 -2
- package/claude/skills/ci-workflow/references/workflows.md +12 -9
- package/claude/skills/code-craft/references/adopted.md +58 -20
- package/claude/skills/codebase-layout/references/adopted.md +49 -16
- package/claude/skills/codebase-layout/references/frontend.md +11 -4
- package/claude/skills/codebase-layout/references/tests.md +4 -2
- package/claude/skills/context-fold/references/classify.md +10 -15
- package/claude/skills/context-fold/references/completion-report.md +11 -9
- package/claude/skills/context-fold/references/context-refresh.md +26 -9
- package/claude/skills/context-fold/references/unusable-baseline.md +5 -3
- package/claude/skills/create-rule/REQUIREMENT.md +5 -0
- package/claude/skills/create-rule/SKILL.md +10 -1
- package/claude/skills/create-rule/references/checklist.md +26 -0
- package/claude/skills/create-rule/references/rule.md +98 -20
- package/claude/skills/create-skill/SKILL.md +1 -0
- package/claude/skills/create-skill/references/skill-disclosure.md +10 -2
- package/claude/skills/create-skill/references/skill-frontmatter.md +43 -0
- package/claude/skills/create-skill/references/skill-paths.md +7 -4
- package/claude/skills/create-skill/references/skill-practice.md +6 -3
- package/claude/skills/create-skill/references/skill-requirement.md +4 -2
- package/claude/skills/create-skill/references/skill.md +67 -44
- package/claude/skills/decision-escalate/SKILL.md +1 -2
- package/claude/skills/deploy-app/references/vercel.md +2 -1
- package/claude/skills/deprecation-migration/references/adopted.md +44 -25
- package/claude/skills/design-taste/references/adopted.md +9 -1
- package/claude/skills/design-taste/references/craft.md +3 -1
- package/claude/skills/design-taste/references/kinds.md +8 -7
- package/claude/skills/design-taste/references/preflight.md +12 -0
- package/claude/skills/design-taste/references/systems.md +7 -6
- package/claude/skills/design-taste/references/tells.md +24 -25
- package/claude/skills/design-taste/references/vocabulary.md +7 -5
- package/claude/skills/document-health/references/axes.md +55 -30
- package/claude/skills/draft-and-pick/references/live-arms.md +2 -2
- package/claude/skills/draft-doc/references/context.md +4 -3
- package/claude/skills/draft-doc/references/docs.md +6 -3
- package/claude/skills/draft-doc/references/readme/agent-facing.md +6 -0
- package/claude/skills/draft-doc/references/readme/application.md +8 -2
- package/claude/skills/draft-doc/references/readme/cli.md +5 -1
- package/claude/skills/draft-doc/references/readme/library.md +4 -0
- package/claude/skills/draft-doc/references/readme/plugin.md +9 -1
- package/claude/skills/draft-doc/references/readme.md +30 -13
- package/claude/skills/draft-doc/references/requirements.md +17 -4
- package/claude/skills/draft-doc/references/wiki-kind.md +20 -10
- package/claude/skills/draft-doc/references/wiki.md +1 -1
- package/claude/skills/draft-figure/references/architecture-set.md +7 -3
- package/claude/skills/draft-figure/references/figures.md +8 -6
- package/claude/skills/draft-figure/references/hand-drawn.md +3 -1
- package/claude/skills/draft-figure/references/mermaid-path.md +19 -9
- package/claude/skills/draft-figure/references/mermaid.md +10 -5
- package/claude/skills/draft-ready/references/ready.md +22 -15
- package/claude/skills/git-branch/references/branch.md +11 -1
- package/claude/skills/git-branch/references/slug.md +17 -5
- package/claude/skills/git-commit/references/commit.md +9 -5
- package/claude/skills/git-commit/references/versioning.md +23 -17
- package/claude/skills/git-followup/REQUIREMENT.md +1 -1
- package/claude/skills/git-followup/SKILL.md +5 -6
- package/claude/skills/git-issue/references/issue.md +29 -16
- package/claude/skills/git-pr/REQUIREMENT.md +1 -5
- package/claude/skills/git-pr/SKILL.md +11 -22
- package/claude/skills/git-pr/references/final-command.md +21 -8
- package/claude/skills/git-pr/references/labels.md +45 -28
- package/claude/skills/git-pr/references/pr.md +29 -9
- package/claude/skills/git-pr/references/publish.md +42 -28
- package/claude/skills/git-pr/references/task-number.md +20 -8
- package/claude/skills/git-ship/SKILL.md +1 -1
- package/claude/skills/plan-feature/SKILL.md +1 -1
- package/claude/skills/plan-feature/references/plan-lifecycle.md +10 -3
- package/claude/skills/plan-feature/references/plan.md +58 -21
- package/claude/skills/plan-groundwork/references/groundwork-spikes.md +4 -1
- package/claude/skills/plan-groundwork/references/groundwork.md +14 -16
- package/claude/skills/plan-intake/references/intake.md +29 -24
- package/claude/skills/pr-evidence/REQUIREMENT.md +40 -0
- package/claude/skills/pr-evidence/SKILL.md +53 -0
- package/claude/skills/pr-evidence/references/evidence.md +150 -0
- package/claude/skills/review-address/references/post-review-findings.md +10 -3
- package/claude/skills/review-address/references/rebase-conflicts.md +15 -7
- package/claude/skills/review-address/references/rest-reads.md +3 -1
- package/claude/skills/review-craft/references/adopted.md +35 -18
- package/claude/skills/review-craft/references/security.md +42 -7
- package/claude/skills/review-craft/references/ui.md +23 -8
- package/claude/skills/review-pr/SKILL.md +6 -6
- package/claude/skills/review-pr/references/body-variants.md +29 -9
- package/claude/skills/review-pr/references/close-out.md +20 -5
- package/claude/skills/review-pr/references/key-changes.md +27 -3
- package/claude/skills/review-pr/references/post.md +83 -31
- package/claude/skills/review-pr/references/scope.md +54 -19
- package/claude/skills/review-ui/references/close-out.md +7 -5
- package/claude/skills/review-ui/references/driving.md +24 -4
- package/claude/skills/review-ui/references/post.md +43 -15
- package/claude/skills/role-orchestrator/SKILL.md +2 -0
- package/claude/skills/role-orchestrator/references/orchestrator-cloud-launch.md +67 -17
- package/claude/skills/role-orchestrator/references/orchestrator-dispatch.md +80 -40
- package/claude/skills/role-orchestrator/references/orchestrator-handback.md +52 -15
- package/claude/skills/role-orchestrator/references/orchestrator-handoff.md +48 -26
- package/claude/skills/role-orchestrator/references/orchestrator-inbound.md +12 -13
- package/claude/skills/role-orchestrator/references/orchestrator-launch.md +72 -36
- package/claude/skills/role-orchestrator/references/orchestrator-output.md +16 -4
- package/claude/skills/role-orchestrator/references/orchestrator-parked.md +64 -24
- package/claude/skills/role-orchestrator/references/orchestrator-poll.md +80 -26
- package/claude/skills/role-orchestrator/references/orchestrator-refill.md +41 -18
- package/claude/skills/role-orchestrator/references/orchestrator-resume.md +19 -7
- package/claude/skills/role-orchestrator/references/orchestrator-review-dispatch.md +22 -12
- package/claude/skills/role-orchestrator/references/orchestrator-reviewer-launch.md +15 -6
- package/claude/skills/role-orchestrator/references/orchestrator-sweep.md +25 -7
- package/claude/skills/role-orchestrator/references/orchestrator-watch.md +34 -8
- package/claude/skills/role-orchestrator/scripts/poll.ts +16 -24
- package/claude/skills/role-planner/REQUIREMENT.md +1 -1
- package/claude/skills/role-planner/SKILL.md +3 -3
- package/claude/skills/role-worker/REQUIREMENT.md +3 -0
- package/claude/skills/role-worker/SKILL.md +34 -2
- package/claude/skills/search-craft/REQUIREMENT.md +1 -1
- package/claude/skills/search-craft/SKILL.md +2 -2
- package/claude/skills/search-craft/references/adopted.md +18 -6
- package/claude/skills/session-map/references/session.md +26 -7
- package/claude/skills/session-worktree/references/main-root-writes.md +25 -8
- package/claude/skills/systematic-debugging/references/adopted.md +30 -16
- package/claude/skills/target-check/references/domains.md +39 -11
- package/claude/skills/target-setup/references/detect.md +80 -65
- package/claude/skills/target-setup/references/indexes.md +8 -6
- package/claude/skills/task-board/references/board.md +86 -30
- package/claude/skills/task-board/references/decline.md +29 -13
- package/claude/skills/task-board/references/tasks-decline.md +12 -5
- package/claude/skills/task-board/references/tasks.md +65 -33
- package/claude/skills/task-complete/references/archive.md +41 -17
- package/claude/skills/task-complete/references/receipt-sweep.md +23 -9
- package/claude/skills/task-complete/references/unusable-baseline.md +10 -3
- package/claude/skills/teach-workspace/references/glossary.md +6 -2
- package/claude/skills/teach-workspace/references/lesson-build.md +44 -16
- package/claude/skills/teach-workspace/references/lesson-craft.md +12 -7
- package/claude/skills/teach-workspace/references/pedagogy.md +6 -3
- package/claude/skills/teach-workspace/references/promotion-fold.md +17 -11
- package/claude/skills/teach-workspace/references/promotion.md +31 -8
- package/claude/skills/teach-workspace/references/revisit.md +8 -2
- package/claude/skills/teach-workspace/references/teach.md +17 -9
- package/claude/skills/test-craft/references/adopted.md +48 -14
- package/claude/skills/test-craft/references/component.md +7 -4
- package/claude/skills/test-craft/references/e2e.md +25 -7
- package/claude/skills/test-craft/references/unit.md +3 -1
- package/claude/skills/test-first/references/adopted.md +12 -4
- package/claude/skills/ui-checklist/REQUIREMENT.md +1 -1
- package/claude/skills/ui-checklist/SKILL.md +1 -1
- package/claude/skills/video-craft/references/adopted.md +62 -18
- package/claude/skills/write-human/references/adopted.md +21 -8
- package/docs/agents/audits.md +1 -0
- package/docs/agents/migrate.md +11 -8
- package/docs/target/migrations.md +11 -0
- package/docs/workflow/parallel-features.md +1 -1
- package/docs/workflow/skill-map.md +1 -0
- package/governance/detect.toml +4 -0
- package/governance/rules/canon/context.md +2 -1
- package/governance/rules/canon/plan.md +3 -5
- package/governance/rules/canon/scratch.md +3 -1
- package/governance/rules/canon/task-scope.md +2 -1
- package/governance/rules/canon/tasks.md +2 -1
- package/governance/rules/canon/worktrees.md +5 -2
- package/governance/rules/claude/output.md +7 -4
- package/governance/rules/claude/skill.md +6 -4
- package/governance/rules/tooling/ci-workflow.md +6 -39
- package/governance/rules/ui/design-reference.md +37 -0
- package/governance/rules/writing/markdown.md +2 -1
- package/package.json +6 -6
- package/src/audits/catalog.ts +42 -0
- package/src/claude/cases/workflow.ts +5 -0
- package/src/claude/settings.ts +8 -4
- package/src/commands/claude.ts +11 -1
- package/src/commands/gov.ts +198 -0
- package/src/commands/migrate.ts +121 -2
- package/src/commands/pr.ts +146 -105
- package/src/commands/tooling.ts +3 -3
- package/src/commands/worktrees.ts +49 -0
- package/src/gate/stages.ts +15 -0
- package/src/gov/audit.ts +440 -0
- package/src/listeners/belongs.ts +21 -0
- package/src/listeners/machine.ts +93 -0
- package/src/listeners/parse.ts +41 -0
- package/src/markdown/scope.ts +144 -0
- package/src/migrate/session-defaults.ts +138 -0
- package/src/pr/lift.ts +6 -3
- package/src/pr/local.ts +4 -69
- package/src/pr/review-state.ts +182 -0
- package/src/sync/check.ts +15 -0
- package/src/tooling/stamp.ts +56 -12
- package/src/worktrees/stop.ts +92 -0
- package/tooling/base/configs/.github/workflows/phase-label-gate.yml +6 -2
- package/tooling/base/configs/commitlint.config.js +0 -20
- package/tooling/base/reference.md +1 -1
- package/tooling/base/seeds/.github/workflows/verify.yml +4 -1
- package/tooling/claude/reference.md +13 -7
- package/tooling/claude/seeds/.claude/settings.json +4 -0
- package/tooling/claude/user/settings.template.json +0 -4
- package/tooling/cloudflare/configs/.github/workflows/deploy.yml +5 -5
- package/tooling/public/configs/.github/dependabot.yml +12 -0
- package/tooling/public/configs/.github/workflows/release-please.yml +30 -0
- package/tooling/public/manifest.toml +8 -0
- package/tooling/public/reference.md +53 -0
- package/tooling/public/seeds/.github/ISSUE_TEMPLATE/bug.yml +48 -0
- package/tooling/public/seeds/.github/ISSUE_TEMPLATE/config.yml +5 -0
- package/tooling/public/seeds/.github/ISSUE_TEMPLATE/feature.yml +16 -0
- package/tooling/public/seeds/.release-please-manifest.json +3 -0
- package/tooling/public/seeds/CONTRIBUTING.md +50 -0
- package/tooling/public/seeds/LICENSE +21 -0
- package/tooling/public/seeds/SECURITY.md +13 -0
- package/tooling/public/seeds/release-please-config.json +12 -0
- package/tooling/shell/configs/.github/workflows/shell.yml +4 -1
- package/tooling/web/configs/.github/workflows/readme-screenshot.yml +6 -3
- package/tooling/web/configs/.github/workflows/verify.yml +15 -12
- package/claude/skills/git-pr/references/evidence.md +0 -124
|
@@ -17,7 +17,8 @@ Generate GitHub Actions workflow files for CI pipelines. Enforce parallel job ex
|
|
|
17
17
|
|
|
18
18
|
## Workflow setup
|
|
19
19
|
|
|
20
|
-
- Include `workflow_dispatch` on
|
|
20
|
+
- Include `workflow_dispatch` alongside the primary trigger, except on a commit-back workflow, where a manual run has no branch to commit onto and would pass while doing nothing.
|
|
21
|
+
- Set `permissions: contents: read` at the top level, and grant a write scope only on the job that needs it.
|
|
21
22
|
- Pin all actions to major version tags (`@v4`, never `@latest` or `@main`).
|
|
22
23
|
- Use `runs-on: ubuntu-latest` for all jobs.
|
|
23
24
|
|
|
@@ -50,6 +51,14 @@ Generate GitHub Actions workflow files for CI pipelines. Enforce parallel job ex
|
|
|
50
51
|
- Install with `bun install --frozen-lockfile`.
|
|
51
52
|
- Cache Playwright browsers keyed on the Playwright version string, never a static key.
|
|
52
53
|
|
|
54
|
+
## Commit-back
|
|
55
|
+
|
|
56
|
+
A workflow that pushes a regenerated file onto the pull request branch takes these on top of the setup above.
|
|
57
|
+
|
|
58
|
+
- Set the concurrency group on the ref so a newer push cancels the run committing onto a stale head.
|
|
59
|
+
- Set `HUSKY: 0` on the commit step when the runner lacks a tool a hook shells out to.
|
|
60
|
+
- Fail a template's first step while a path list still holds its placeholder, so an unfinished install fails loudly rather than never firing.
|
|
61
|
+
|
|
53
62
|
## Template
|
|
54
63
|
|
|
55
64
|
Load `${CLAUDE_SKILL_DIR}/references/workflows.md` for the base workflow template. Adapt it to the project's stack, test commands, and build output. Add or remove jobs as needed. The template already carries the folded shape, and the split beside it applies once the granularity rule above calls for it.
|
|
@@ -58,7 +67,8 @@ Load `${CLAUDE_SKILL_DIR}/references/workflows.md` for the base workflow templat
|
|
|
58
67
|
|
|
59
68
|
Before responding, verify:
|
|
60
69
|
|
|
61
|
-
- `workflow_dispatch` is present alongside the primary trigger.
|
|
70
|
+
- `workflow_dispatch` is present alongside the primary trigger, and absent from a commit-back workflow.
|
|
71
|
+
- The top-level `permissions` reads `contents: read`, and every write scope sits on a job.
|
|
62
72
|
- All actions pinned to major version tags, no `@latest` or `@main`.
|
|
63
73
|
- A new pipeline folds static, unit, and build into one job, and a gate a run log put past two minutes gives them no `needs` so they run in parallel.
|
|
64
74
|
- Every name in a `needs` matches a job declared in the same file. E2E names the artifact producer, release and deploy name E2E.
|
|
@@ -12,12 +12,15 @@ on:
|
|
|
12
12
|
branches: [main]
|
|
13
13
|
workflow_dispatch:
|
|
14
14
|
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
15
18
|
jobs:
|
|
16
19
|
checks:
|
|
17
20
|
name: '🛡️ Checks'
|
|
18
21
|
runs-on: ubuntu-latest
|
|
19
22
|
steps:
|
|
20
|
-
- uses: actions/checkout@
|
|
23
|
+
- uses: actions/checkout@v7
|
|
21
24
|
- uses: oven-sh/setup-bun@v2
|
|
22
25
|
with:
|
|
23
26
|
bun-version: latest
|
|
@@ -25,7 +28,7 @@ jobs:
|
|
|
25
28
|
- run: bun run check
|
|
26
29
|
- run: bun run test
|
|
27
30
|
- run: bun run build
|
|
28
|
-
- uses: actions/upload-artifact@
|
|
31
|
+
- uses: actions/upload-artifact@v7
|
|
29
32
|
with:
|
|
30
33
|
name: build-output
|
|
31
34
|
path: dist/
|
|
@@ -35,17 +38,17 @@ jobs:
|
|
|
35
38
|
needs: checks
|
|
36
39
|
runs-on: ubuntu-latest
|
|
37
40
|
steps:
|
|
38
|
-
- uses: actions/checkout@
|
|
41
|
+
- uses: actions/checkout@v7
|
|
39
42
|
- uses: oven-sh/setup-bun@v2
|
|
40
43
|
with:
|
|
41
44
|
bun-version: latest
|
|
42
45
|
- run: bun install --frozen-lockfile
|
|
43
|
-
- uses: actions/download-artifact@
|
|
46
|
+
- uses: actions/download-artifact@v8
|
|
44
47
|
with:
|
|
45
48
|
name: build-output
|
|
46
49
|
path: dist/
|
|
47
50
|
- run: bun run test:e2e
|
|
48
|
-
- uses: actions/upload-artifact@
|
|
51
|
+
- uses: actions/upload-artifact@v7
|
|
49
52
|
if: failure()
|
|
50
53
|
with:
|
|
51
54
|
name: e2e-results
|
|
@@ -63,7 +66,7 @@ jobs:
|
|
|
63
66
|
name: '🛡️ Static Checks'
|
|
64
67
|
runs-on: ubuntu-latest
|
|
65
68
|
steps:
|
|
66
|
-
- uses: actions/checkout@
|
|
69
|
+
- uses: actions/checkout@v7
|
|
67
70
|
- uses: oven-sh/setup-bun@v2
|
|
68
71
|
with:
|
|
69
72
|
bun-version: latest
|
|
@@ -74,7 +77,7 @@ jobs:
|
|
|
74
77
|
name: '🧪 Unit Tests'
|
|
75
78
|
runs-on: ubuntu-latest
|
|
76
79
|
steps:
|
|
77
|
-
- uses: actions/checkout@
|
|
80
|
+
- uses: actions/checkout@v7
|
|
78
81
|
- uses: oven-sh/setup-bun@v2
|
|
79
82
|
with:
|
|
80
83
|
bun-version: latest
|
|
@@ -85,13 +88,13 @@ jobs:
|
|
|
85
88
|
name: '📦 Build Check'
|
|
86
89
|
runs-on: ubuntu-latest
|
|
87
90
|
steps:
|
|
88
|
-
- uses: actions/checkout@
|
|
91
|
+
- uses: actions/checkout@v7
|
|
89
92
|
- uses: oven-sh/setup-bun@v2
|
|
90
93
|
with:
|
|
91
94
|
bun-version: latest
|
|
92
95
|
- run: bun install --frozen-lockfile
|
|
93
96
|
- run: bun run build
|
|
94
|
-
- uses: actions/upload-artifact@
|
|
97
|
+
- uses: actions/upload-artifact@v7
|
|
95
98
|
with:
|
|
96
99
|
name: build-output
|
|
97
100
|
path: dist/
|
|
@@ -5,48 +5,86 @@ description: Which external software design sources this skill adopted, which it
|
|
|
5
5
|
|
|
6
6
|
# Adopted and declined
|
|
7
7
|
|
|
8
|
-
External sources were read and filtered rather than imported. This file is the record
|
|
8
|
+
External sources were read and filtered rather than imported. This file is the record, and a later session extending the skill adds to it rather than re-arguing an item settled here.
|
|
9
9
|
|
|
10
|
-
## Adopted
|
|
10
|
+
## Adopted from the default shelf
|
|
11
11
|
|
|
12
|
-
###
|
|
12
|
+
### What to look for in a code review
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
[Google's engineering practices](https://google.github.io/eng-practices/review/reviewer/looking-for.html) say to solve the problem known to need solving now rather than one speculated about, and to read "too complex" as "cannot be understood quickly by a reader".
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Adopted as the writing-time half of the same judgment, behind the change test and the ban on building for an unnamed case. The review procedure itself stays with `review-craft`.
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
## Adopted for depth and decomposition
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
### Information hiding
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
David Parnas, [On the Criteria To Be Used in Decomposing Systems into Modules](https://dl.acm.org/doi/10.1145/361598.361623), 1972, splits a system by the design decision each module hides, not by the steps of processing. Adopted as the module-split rule under depth.
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
### Deep modules
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
John Ousterhout, [A Philosophy of Software Design](https://web.stanford.edu/~ouster/cgi-bin/book.php), holds that complexity is what makes a system hard to change, and a module is worth having when its interface is much simpler than its implementation.
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Adopted as the opening of the depth group and the pass-through flag. `api-design` declined depth as behind its boundary, so it lands here.
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
### The design book exchange
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
In [John Ousterhout and Robert Martin's discussion](https://github.com/johnousterhout/aposd-vs-clean-code), Martin argues for very small methods and Ousterhout for fewer, deeper ones a reader need not stitch together.
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Adopted as the third tension, stated as when each side wins rather than as a verdict, plus the depth bullet preferring one function a reader follows top to bottom.
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
### Reducing coupling
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
Martin Fowler, [Reducing Coupling](https://martinfowler.com/ieeeSoftware/coupling.pdf), IEEE Software, 2001, holds that a change in one module should not ripple into others. Adopted behind the rule that a decision stays in one unit and the red flag on a third file opened to adjust one rule.
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
## Adopted for the tensions
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
### DRY as knowledge
|
|
43
|
+
|
|
44
|
+
Andy Hunt and Dave Thomas, [Orthogonality and the DRY Principle](https://www.artima.com/articles/orthogonality-and-the-dry-principle), give every piece of knowledge one authoritative representation, which is broader than and different from avoiding repeated text.
|
|
45
|
+
|
|
46
|
+
Adopted as the first tension, with its other side stated. Two blocks that only look alike and change for different reasons stay apart.
|
|
47
|
+
|
|
48
|
+
### Yagni and its carve-out
|
|
49
|
+
|
|
50
|
+
Ron Jeffries, [You're NOT Gonna Need It](https://ronjeffries.com/xprog/articles/practices/pracnotneed/), and Martin Fowler, [Yagni](https://martinfowler.com/bliki/Yagni.html), build no capability for a presumptive feature, though Yagni "does not apply to effort to make the software easier to modify".
|
|
51
|
+
|
|
52
|
+
Adopted as the second tension, with Fowler's carve-out as the side that wins for a refactor, a test, or a parameter serving the asked-for code.
|
|
53
|
+
|
|
54
|
+
### Beck's design rules
|
|
55
|
+
|
|
56
|
+
Martin Fowler, [Beck Design Rules](https://martinfowler.com/bliki/BeckDesignRules.html), orders the rules as passes the tests, reveals intention, no duplication, fewest elements. Adopted for the ordering behind the closing checklist, where fewest elements stops the pattern table's indirection once the rules above it are met.
|
|
57
|
+
|
|
58
|
+
## Adopted for patterns and inputs
|
|
59
|
+
|
|
60
|
+
### Smells and patterns
|
|
61
|
+
|
|
62
|
+
[Refactoring Guru's code smells](https://refactoring.guru/refactoring/smells) and [design patterns](https://refactoring.guru/design-patterns) catalogs. Adopted only for the wrong case of six common patterns and the smells a red flag can see, such as speculative generality and a lazy class. Each pattern's definition is left to the model.
|
|
63
|
+
|
|
64
|
+
### Injection
|
|
65
|
+
|
|
66
|
+
Martin Fowler, [Inversion of Control Containers and the Dependency Injection pattern](https://martinfowler.com/articles/injection.html), hands a component what it depends on rather than letting it find it. Adopted as the hidden-inputs rule for the clock, the environment, randomness, and globals, without any container.
|
|
67
|
+
|
|
68
|
+
## Adopted for agent failure modes
|
|
69
|
+
|
|
70
|
+
Birgitta Böckeler, [The role of developer skills in agentic coding](https://martinfowler.com/articles/exploring-gen-ai/13-role-of-developer-skills.html), 2025, and [How far can we push AI autonomy in code generation?](https://martinfowler.com/articles/pushing-ai-autonomy.html), 2025.
|
|
71
|
+
|
|
72
|
+
- Together they record a lack of reuse and modularity, overeagerness that builds unrequested features, assumptions filled in for silent requirements, and brute-force fixes
|
|
73
|
+
- Adopted as the closing concern group, worded as checks on the session's own diff
|
|
74
|
+
- They are the source each excuse row and red flag traces to
|
|
43
75
|
|
|
44
76
|
## Declined
|
|
45
77
|
|
|
78
|
+
Each item below was read and left out, with the reason it changes nothing a session does.
|
|
79
|
+
|
|
80
|
+
### Definitions and language pages
|
|
81
|
+
|
|
46
82
|
**Definitions a model already holds.** What coupling, cohesion, or a given pattern is. Declined because a definition changes no behavior a session would otherwise get wrong.
|
|
47
83
|
|
|
48
|
-
**Language-specific pages.** Every page tied to one language, its type system, or its runtime. Declined because the body
|
|
84
|
+
**Language-specific pages.** Every page tied to one language, its type system, or its runtime. Declined because the body holds on every code stack, so the one language note the pattern table carried became "a plain function often replaces the class".
|
|
85
|
+
|
|
86
|
+
### Architecture and books
|
|
49
87
|
|
|
50
88
|
**Layering and hexagonal architecture.** Beyond the one bullet kept, keeping business rules free of transport and storage and skipping ports and adapters for a thin application. Declined because where layers sit is a structure call made once, not a writing-time one.
|
|
51
89
|
|
|
52
|
-
**The Gang of Four and The Pragmatic Programmer as books.** Gamma, Helm, Johnson, and Vlissides, Design Patterns, 1994, and Hunt and Thomas, The Pragmatic Programmer, 1999
|
|
90
|
+
**The Gang of Four and The Pragmatic Programmer as books.** Gamma, Helm, Johnson, and Vlissides, Design Patterns, 1994, and Hunt and Thomas, The Pragmatic Programmer, 1999, are declined as cited sources because neither is open to read at a link. The articles above carry the same positions where a reader can open them.
|
|
@@ -5,36 +5,69 @@ description: Which external layout patterns this skill adopted, which it decline
|
|
|
5
5
|
|
|
6
6
|
# Adopted and declined
|
|
7
7
|
|
|
8
|
-
External sources were read and filtered rather than imported. This file is the record
|
|
8
|
+
External sources were read and filtered rather than imported. This file is the record, and a later session extending the skill adds to it rather than re-arguing an item settled here.
|
|
9
9
|
|
|
10
|
-
## Adopted
|
|
10
|
+
## Adopted for placing files
|
|
11
11
|
|
|
12
|
-
###
|
|
12
|
+
### Group what changes together
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Robert Martin's restatement of the single responsibility principle reads "Gather together the things that change for the same reasons. Separate those things that change for different reasons" ([The Single Responsibility Principle](https://blog.cleancoder.com/uncle-bob/2014/05/08/SingleReponsibilityPrinciple.html)).
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
It gives "split by role" a test a planner can apply to a folder, which is whether these files would change together.
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
### Name folders for the domain rather than the framework
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Martin's [Screaming Architecture](https://blog.cleancoder.com/uncle-bob/2011/09/30/Screaming-Architecture.html) argues the top level should tell readers "about the system, not about the frameworks you used in your system". It is the root of naming a folder for what it holds rather than its technical kind.
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
### Feature folders, no cross-feature imports, one-way flow
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
bulletproof-react puts most code under per-feature folders holding only the subfolders each needs, forbids one feature importing another, and enforces a shared, then features, then app direction with an import-path lint rule ([project structure](https://github.com/alan2207/bulletproof-react/blob/master/docs/project-structure.md)).
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
Adopted as the direction rule in the body and the feature-folder guidance in `frontend.md`, without the mandate.
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
### Grow in levels and promote on the second consumer
|
|
29
|
+
|
|
30
|
+
Robin Wieruch grows a project from one file to feature folders, each level triggered by a named event rather than a count, and moves a helper to the shared layer once two or more features need it ([React folder structure](https://www.robinwieruch.de/react-folder-structure/)).
|
|
31
|
+
|
|
32
|
+
Adopted as the promotion rule in the body and the levels in `frontend.md`.
|
|
33
|
+
|
|
34
|
+
### Consistency over any one strategy
|
|
35
|
+
|
|
36
|
+
The Next.js docs call the framework unopinionated about organization, list three strategies, and ask a project to "choose a strategy that works for you and your team and be consistent across the project" ([project structure](https://nextjs.org/docs/app/getting-started/project-structure)).
|
|
37
|
+
|
|
38
|
+
Adopted as the body's first section, reading and keeping the project's own strategy.
|
|
39
|
+
|
|
40
|
+
### Fixtures in modules, page objects on their own
|
|
41
|
+
|
|
42
|
+
Playwright defines fixtures in dedicated modules that extend the base test, merges them into one module the specs import, and keeps page objects as their own modules ([fixtures](https://playwright.dev/docs/test-fixtures)). Adopted in `tests.md` as the split between specs and support.
|
|
43
|
+
|
|
44
|
+
## Adopted for closing the body
|
|
45
|
+
|
|
46
|
+
From `addyosmani/agent-skills@2686b620`, [`docs/skill-anatomy.md`](https://github.com/addyosmani/agent-skills/blob/2686b620fc1fed2e8f60c704839c766b8594c6b6/docs/skill-anatomy.md), the Common Rationalizations, Red Flags, and Verification sections.
|
|
47
|
+
|
|
48
|
+
- Adopted as the three closing sections every practice skill carries
|
|
49
|
+
- Each excuse row rebuts a reason a flat folder stayed flat in the target this skill's requirement measures, rather than an objection nobody raised
|
|
29
50
|
|
|
30
51
|
## Declined
|
|
31
52
|
|
|
32
|
-
|
|
53
|
+
Each item below was read and left out, with the condition that would reopen it where one exists.
|
|
54
|
+
|
|
55
|
+
### Deep modules and seams
|
|
56
|
+
|
|
57
|
+
Matt Pocock's [codebase-design](https://github.com/mattpocock/skills/blob/main/skills/engineering/codebase-design/SKILL.md) skill covers a lot of behavior behind a small interface placed at a clean seam. It answers where a boundary goes in code, not where a file goes on disk.
|
|
58
|
+
|
|
59
|
+
Absorbing it doubles the skill's scope before the placement problem is shown solved. It becomes a reference only when a plan places files well and still draws a boundary badly.
|
|
60
|
+
|
|
61
|
+
### A mandated `features/` tree
|
|
62
|
+
|
|
63
|
+
bulletproof-react's layout, and a stack rule some projects install, put domain code under `src/features/`. Declined as a mandate because it conflicts with keeping the project's own strategy, and a project that never adopted feature folders gains a second strategy rather than a better one.
|
|
33
64
|
|
|
34
|
-
|
|
65
|
+
A stack rule mandating the tree still loads beside this skill in a project that installs it. The two give different answers there until that rule is softened on its own.
|
|
35
66
|
|
|
36
|
-
|
|
67
|
+
### Numbers, fields, and the worker
|
|
37
68
|
|
|
38
|
-
|
|
69
|
+
Three smaller items were declined for the reason each states.
|
|
39
70
|
|
|
40
|
-
**
|
|
71
|
+
- **A numeric file ceiling.** No source gives a reliable number, and a count fails sixty files of one role that read fine flat. The body triggers on a second role, with about ten files a prompt to look.
|
|
72
|
+
- **A required placement field in the plan format.** It would touch every plan, even ones creating nothing, so the body asks a reason per new path. Revisit only if plans still list flat paths.
|
|
73
|
+
- **Loading the skill in the worker.** The worker copies the path the plan gives it, so placement is already decided by the time a worker would read this.
|
|
@@ -10,7 +10,8 @@ Read this before placing a new component, hook, helper, route, or fixture in an
|
|
|
10
10
|
## Feature folders against shared UI
|
|
11
11
|
|
|
12
12
|
- Put code that serves one feature under that feature's folder, holding only the subfolders it needs: its components, its hooks, its data access, its types ([bulletproof-react](https://github.com/alan2207/bulletproof-react/blob/master/docs/project-structure.md)).
|
|
13
|
-
- Keep the shared `components/` folder for pieces two or more features render, such as a button, a dialog, or a layout shell
|
|
13
|
+
- Keep the shared `components/` folder for pieces two or more features render, such as a button, a dialog, or a layout shell
|
|
14
|
+
- A component only one feature renders is feature code, even when it looks generic
|
|
14
15
|
- Never import one feature from another. Lift the piece both need to shared code, or compose the two features at the app or route level ([bulletproof-react](https://github.com/alan2207/bulletproof-react/blob/master/docs/project-structure.md)).
|
|
15
16
|
- Enforce the flow from shared toward features toward the app where the project already lints imports. An import-path restriction turns the direction into a check rather than a habit.
|
|
16
17
|
|
|
@@ -23,13 +24,15 @@ Read this before placing a new component, hook, helper, route, or fixture in an
|
|
|
23
24
|
## Routes
|
|
24
25
|
|
|
25
26
|
- Follow the router's own conventions where the framework ships file-based routing, and treat everything outside them as project strategy.
|
|
26
|
-
- A framework calling itself unopinionated about organization leaves the strategy to the project
|
|
27
|
+
- A framework calling itself unopinionated about organization leaves the strategy to the project ([Next.js project structure](https://nextjs.org/docs/app/getting-started/project-structure))
|
|
28
|
+
- Pick one of code outside the routes folder, top-level folders inside it, or a split by feature or route, and "be consistent across the project"
|
|
27
29
|
- Colocate a component only one route renders beside that route, in a folder the router excludes from routing, such as a private `_components` folder in a router that supports one.
|
|
28
30
|
- Treat `components` and `lib` as placeholder names with no framework meaning. Their contents still follow the body's rules.
|
|
29
31
|
|
|
30
32
|
## Hooks and helpers
|
|
31
33
|
|
|
32
|
-
- Put a hook or helper one feature uses inside that feature
|
|
34
|
+
- Put a hook or helper one feature uses inside that feature ([Robin Wieruch](https://www.robinwieruch.de/react-folder-structure/))
|
|
35
|
+
- Promote it to a shared `hooks/` or `lib/` folder when a second feature needs it, in the change that adds the second consumer
|
|
33
36
|
- Split a shared `lib/` by what each file serves once it holds two roles, such as data access beside formatting beside browser APIs. A flat `lib/` is the second folder to overflow after `components/`.
|
|
34
37
|
- Name a helper file for what it does rather than `utils` or `helpers`, so the folder listing reads as an index.
|
|
35
38
|
|
|
@@ -40,4 +43,8 @@ Read this before placing a new component, hook, helper, route, or fixture in an
|
|
|
40
43
|
|
|
41
44
|
## A worked failure
|
|
42
45
|
|
|
43
|
-
An interface project's `components/` folder held 11 files when its first plan landed and 46 six days later, with its `lib/` at 36, all flat. Every plan in between named each new file as a sibling of the last, since the folder it was measured against was flat.
|
|
46
|
+
An interface project's `components/` folder held 11 files when its first plan landed and 46 six days later, with its `lib/` at 36, all flat. Every plan in between named each new file as a sibling of the last, since the folder it was measured against was flat.
|
|
47
|
+
|
|
48
|
+
- The installed rules said to split by role and to keep domain logic in feature folders, and neither was applied
|
|
49
|
+
- The split, when it came, touched 98 files, and the end to end folder has since grown flat again, four specs beside five helpers
|
|
50
|
+
- Placing the twelfth component in a named subfolder would have cost that plan one folder
|
|
@@ -18,11 +18,13 @@ Read this before placing a new test file or a file a test imports. Which layer t
|
|
|
18
18
|
A browser suite starts as a folder of specs, and every helper written after the first lands beside them unless something says otherwise. Split the folder by role before the first support file lands.
|
|
19
19
|
|
|
20
20
|
- Keep specs in the folder the runner reads, and nothing there but specs once support code exists.
|
|
21
|
-
- Put fixtures in a
|
|
21
|
+
- Put fixtures in a module extending the runner's base test, merged into one fixtures module the specs import, so a new spec finds its setup in one place ([Playwright fixtures](https://playwright.dev/docs/test-fixtures))
|
|
22
22
|
- Give each page object its own module, named for the page or region it drives ([Playwright fixtures](https://playwright.dev/docs/test-fixtures)).
|
|
23
23
|
- Put helpers, stubs, and seed data in a support folder beside the specs rather than among them. Name each file for what it serves, never a single `helpers` file every spec imports.
|
|
24
24
|
- Group specs by journey once they mix, such as checkout specs in one folder and account specs in another. A folder of a handful of specs covering one journey stays flat.
|
|
25
25
|
|
|
26
26
|
## A worked failure
|
|
27
27
|
|
|
28
|
-
An interface project's end to end folder held four specs beside five helper files, all flat, after an earlier refactor had split its source folders by role. The project's plans named every new file as a literal flat path, so each helper landed as a sibling of the specs it served.
|
|
28
|
+
An interface project's end to end folder held four specs beside five helper files, all flat, after an earlier refactor had split its source folders by role. The project's plans named every new file as a literal flat path, so each helper landed as a sibling of the specs it served.
|
|
29
|
+
|
|
30
|
+
A new spec then had no single place to find its setup, and the next helper went beside the others. One plan naming a support folder when the first helper arrived would have kept the specs as the folder's only role.
|
|
@@ -30,7 +30,9 @@ Each finding carries `file`, a `verdict` of `KEEP`, `REPLACE`, `HISTORY`, or `MO
|
|
|
30
30
|
|
|
31
31
|
## Scope
|
|
32
32
|
|
|
33
|
-
Answer every non-`KEEP` finding the verb returns, not only the files Step 3 wrote this run
|
|
33
|
+
Answer every non-`KEEP` finding the verb returns, not only the files Step 3 wrote this run, since a branch carrying a prior session's commits has doc edits the fold is equally responsible for.
|
|
34
|
+
|
|
35
|
+
The verb's own extraction already scopes to canonical doc types and reports nothing when the range carries none, so there is no narrower check to add here.
|
|
34
36
|
|
|
35
37
|
## Applying a finding
|
|
36
38
|
|
|
@@ -40,7 +42,7 @@ Locate the finding by its `quote` in the file's current content. The quote is of
|
|
|
40
42
|
- `REPLACE`: rewrite the sentence or bullet carrying the quote in place with the fact that now stands, per Step 3's rewrite-in-place rule. State what is current and drop what the quote restated, in the one edit.
|
|
41
43
|
- `HISTORY`: rewrite the sentence or bullet carrying the quote to drop the narration and keep any current fact the same clause states. The quote narrates how the fact arrived rather than stating the fact, which a canonical doc excludes regardless of what wrote it, and a literal cut of the fragment alone would leave the rest of the clause grammatically stranded.
|
|
42
44
|
- `MOVE`: do not cut. The verdict means correct content sitting on the wrong surface, such as a rule written into a context entry that belongs in a path-scoped rule, and only the model layer returns it. Cutting would delete content a fold with no model configured would never have flagged at all. Report the finding instead, naming the surface the `reason` names as where the content belongs, and leave the file unedited.
|
|
43
|
-
- **Found more than once, or not found at all.** Report
|
|
45
|
+
- **Found more than once, or not found at all.** Report it as not located rather than guessing an occurrence or silently rewriting nothing. A model paraphrasing its quote is the usual cause.
|
|
44
46
|
|
|
45
47
|
Run the classifier once per fold. Do not re-run it after applying a finding to check the edit, since a second pass over what this step wrote is the loop the verb's own reference already warns against.
|
|
46
48
|
|
|
@@ -50,25 +52,18 @@ Keep a non-`KEEP` finding without applying it only when the quote is itself the
|
|
|
50
52
|
|
|
51
53
|
## When the verb is absent or refused
|
|
52
54
|
|
|
53
|
-
The verb ships with the CLI and this skill ships with the plugin, so a target holding an older installed binary carries no `context classify` subcommand.
|
|
54
|
-
|
|
55
|
-
`⚠ Classify: canon context classify not available on the installed binary. Skipped.`
|
|
56
|
-
|
|
57
|
-
and continue. Never read a missing subcommand as a clean pass, which would report a run that never checked anything as one that found nothing.
|
|
55
|
+
The verb ships with the CLI and this skill ships with the plugin, so a target holding an older installed binary carries no `context classify` subcommand. Never read a missing subcommand as a clean pass, which would report a run that never checked anything as one that found nothing.
|
|
58
56
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
`⚠ Classify:
|
|
57
|
+
| Case | Report, then continue |
|
|
58
|
+
| ------------------ | ------------------------------------------------------------------------------------ |
|
|
59
|
+
| Subcommand missing | `⚠ Classify: canon context classify not available on the installed binary. Skipped.` |
|
|
60
|
+
| Range refused | `⚠ Classify: <message>`, naming the verb's own message |
|
|
62
61
|
|
|
63
62
|
Neither case stops the fold. This step checks what the fold wrote, and a check that cannot run is not a reason to leave the fold's own output unshipped.
|
|
64
63
|
|
|
65
64
|
## Report
|
|
66
65
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
`✅ Classify: <n> findings, regex ran, model <modelLayer>`
|
|
70
|
-
|
|
71
|
-
Then one line per non-`KEEP` finding:
|
|
66
|
+
Print one line naming what ran, `✅ Classify: <n> findings, regex ran, model <modelLayer>`, then one line per non-`KEEP` finding:
|
|
72
67
|
|
|
73
68
|
- `✏ Rewrote: <file>, "<quote>" (<reason>)`
|
|
74
69
|
- `✂ Cut: <file>, "<quote>" (<reason>)`
|
|
@@ -7,16 +7,18 @@ description: The lines context-fold prints once every step has run, being one pe
|
|
|
7
7
|
|
|
8
8
|
The close of `context-fold`. The session reads this file once every step has run, before printing anything.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## Lines
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
| When | Line |
|
|
13
|
+
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|
|
14
|
+
| Per file updated | `✅ Updated: <path written>` |
|
|
15
|
+
| Step 2 noted a requirements change | `↪ Direction changed this session: run document-health on canon/REQUIREMENTS.md` |
|
|
16
|
+
| Per audit finding Step 4 reported | `⚠ Audit:` in the shape the body gives |
|
|
17
|
+
| Step 4's classify half applied or reported a finding | The exact shape `${CLAUDE_SKILL_DIR}/references/classify.md` gives under its Report section |
|
|
18
|
+
| No file updated and Step 4 reported nothing | `✅ No changes needed.` |
|
|
13
19
|
|
|
14
|
-
|
|
20
|
+
Do not shorten or paraphrase the audit and classify lines here or in the reply, since the quote and the reason are what a reader checks the finding against.
|
|
15
21
|
|
|
16
|
-
|
|
22
|
+
## Suppressing the closing line
|
|
17
23
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
`✅ No changes needed.`
|
|
21
|
-
|
|
22
|
-
Suppress that line when Step 2 already reported no context updates. It closes the run on its own, and emitting both leaves a quiet session reporting success twice for one outcome.
|
|
24
|
+
Suppress `✅ No changes needed.` when Step 2 already reported no context updates. That report closes the run on its own, and emitting both leaves a quiet session reporting success twice for one outcome.
|
|
@@ -5,19 +5,26 @@ description: How context-fold Step 3 folds diff-scoped rewrites into canon/conte
|
|
|
5
5
|
|
|
6
6
|
# Refresh context entries
|
|
7
7
|
|
|
8
|
-
Step 3 of `context-fold`, reached in order once `canon/context/index.md` lists at least one entry.
|
|
9
|
-
|
|
10
|
-
The diff carries what the repository changed, and this step rewrites against it.
|
|
8
|
+
Step 3 of `context-fold`, reached in order once `canon/context/index.md` lists at least one entry. The diff carries what the repository changed, and this step rewrites against it.
|
|
11
9
|
|
|
12
10
|
When the baseline is unusable, scope this step to the working tree and untracked files, and skip it only when that set is empty, reporting `⚠ No diff to scope against. Skipped the context refresh.`
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
## Reading each entry
|
|
13
|
+
|
|
14
|
+
Reuse the diff from the baseline above, names and content both. For each domain listed in `canon/context/index.md`, read its own entry, following the index rather than globbing the folder, since a folder can hold a file the index does not list yet.
|
|
15
|
+
|
|
16
|
+
- A flat domain reads `canon/context/<domain>.md`
|
|
17
|
+
- A domain split into a folder reads its `canon/context/<domain>/index.md` and every sibling file that index links
|
|
18
|
+
|
|
19
|
+
### What to rewrite
|
|
20
|
+
|
|
21
|
+
An entry is relevant only when the diff touches what it states, and the rewrite stays inside the part the trigger names.
|
|
15
22
|
|
|
16
23
|
- Treat an entry as relevant only when the diff adds, moves, or removes a folder its Layout lists, makes a folder's bullet untrue, or changes a trap it names
|
|
17
24
|
- For each relevant entry, rewrite only the H3 or the gotcha the trigger names, and leave unrelated sections alone
|
|
18
25
|
- Never rewrite a split domain's own `index.md`, which a regen overwrites, and rewrite the sibling file the section lives in instead
|
|
19
26
|
- Edit the bullet that went untrue in place and never append one beside it, the same rule the body states.
|
|
20
|
-
- Write a reference to another entry as the path that entry sits at,
|
|
27
|
+
- Write a reference to another entry as the path that entry sits at, per `${CLAUDE_SKILL_DIR}/references/context.md`, since a bare filename strands it once a domain splits into subfolders
|
|
21
28
|
|
|
22
29
|
## When the diff removes a capability
|
|
23
30
|
|
|
@@ -25,15 +32,25 @@ The mapping above is scoped by file, and a removal invalidates claims that mappi
|
|
|
25
32
|
|
|
26
33
|
Grep the tree for the name that went, rather than for the paths the diff carries. A capability removed by name is cited by that name, which reaches a file the diff never touched.
|
|
27
34
|
|
|
28
|
-
-
|
|
29
|
-
-
|
|
35
|
+
- Read an entry this run rewrote whole before leaving it. An updated top over a contradicting claim below reads worse than an untouched entry, since the opening lends authority to the stale rest.
|
|
36
|
+
- That is the one case overriding "do not touch unrelated sections", and only inside an entry the run edited anyway
|
|
37
|
+
- Check a claim comparing two surfaces even where its file is outside the diff. It holds only while both surfaces do, so moving one inverts it with nobody editing its file.
|
|
30
38
|
|
|
31
39
|
Report each hit as an ordinary rewrite.
|
|
32
40
|
|
|
33
|
-
|
|
41
|
+
## Creating an entry
|
|
42
|
+
|
|
43
|
+
Create a new entry only for a domain `canon/context/index.md` already lists but carries no file for, following `${CLAUDE_SKILL_DIR}/references/context.md` for its shape. A row in the catalog is the deliberate decision, taken by whoever added it, and this step only fills in what that decision left open.
|
|
44
|
+
|
|
45
|
+
- Confirm the domain holds no entry under either spelling, `canon/context/<domain>.md` or `canon/context/<domain>/index.md`, since a split domain passes a check for the flat file alone
|
|
46
|
+
- The next `canon indexes regen` rebuilds the catalog from each entry's frontmatter plus every sibling's, dropping a row whose file does not exist. Create the file before it runs.
|
|
47
|
+
- A domain the catalog does not list at all is a different case. Report it and stop, rather than creating an entry or a catalog row for it.
|
|
48
|
+
|
|
49
|
+
## Writing and reporting
|
|
34
50
|
|
|
35
51
|
Write each updated entry immediately. Output one line per file, naming the path this run actually wrote rather than always the flat template:
|
|
36
52
|
|
|
37
|
-
`✅ Context: canon/context/<domain>.md` for a flat entry
|
|
53
|
+
- `✅ Context: canon/context/<domain>.md` for a flat entry
|
|
54
|
+
- `✅ Context: canon/context/<domain>/<sub-area>.md` for the sibling file a nested edit landed in
|
|
38
55
|
|
|
39
56
|
The base lint-staged config runs `canon indexes regen` on every committed `*.md`, so `canon/context/index.md` refreshes automatically on commit. No manual step needed.
|
|
@@ -14,8 +14,10 @@ The baseline is unusable in two cases:
|
|
|
14
14
|
|
|
15
15
|
An unusable baseline costs only the committed half. `git diff <base> HEAD` is empty by definition once the base equals HEAD, while `git diff HEAD` and `git ls-files --others --exclude-standard` still report uncommitted and untracked work at correct scope.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
## Step 3 keeps the scoped set
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Run Step 3 on the working tree and untracked files alone, and skip only when that set comes out empty, reporting the warning its own reference names. Widening what a step reads is safe, and widening what a step writes is not.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
- Never substitute the whole tree for a missing baseline, and do not widen to `git log -p -1` for coverage
|
|
22
|
+
- On a fresh `git init` project the last commit is the scaffold, so that read is the whole tree by another route. Step 3 writes, so it would rewrite every context entry that tree touches.
|
|
23
|
+
- `task-complete` takes the widened read for its marking step, which only reads and matches conservatively against outcomes already on the board
|
|
@@ -18,6 +18,11 @@ The subdir gets picked by feel, so a UI copy rule lands in the always-on folder
|
|
|
18
18
|
- Write under `.claude/rules/project/`, the subfolder the sync engine reads as project-authored by location
|
|
19
19
|
- Take a slug no rule in the chosen project subdir uses and that equals no subdir name
|
|
20
20
|
- Read the rule standard before writing the body
|
|
21
|
+
- Hold the body to the rule standard's shape limits on words, bullets, sections, and bullet length
|
|
22
|
+
- Apply the content test, leaving out what Claude already knows, what the toolchain enforces, and what changes often
|
|
23
|
+
- Check the installed skills for one already covering the topic and point the rule at it, skipping the check when none are listed
|
|
24
|
+
- Run every written bullet through the checklist and fix what fails before reporting
|
|
25
|
+
- Tell the user to cite a source in the commit that adds a rule claiming outside practice
|
|
21
26
|
- Emit the path scope for a path-scoped rule and omit the key entirely for an always-on one
|
|
22
27
|
- Preview the resolved path, subdir, slug, and frontmatter, then write without pausing
|
|
23
28
|
- Say when the rule loads, since path-scoped and always-on rules behave differently
|
|
@@ -22,6 +22,7 @@ Resolve both from the request, and ask only for what is missing. Attach a propos
|
|
|
22
22
|
|
|
23
23
|
- What the rule enforces: one topic, phrased as a standard (`<topic> conventions`).
|
|
24
24
|
- Scope: a path glob relative to the project root (`<dir>/**/*.<ext>`) for a path-scoped rule, or always-on when the rule states a global principle with no file scope.
|
|
25
|
+
- An installed skill already covering the topic, found per `### Checking the installed skills` in `${CLAUDE_SKILL_DIR}/references/rule.md`. Point the rule at it rather than restating it.
|
|
25
26
|
|
|
26
27
|
## Step 2: resolve the subdir
|
|
27
28
|
|
|
@@ -74,6 +75,14 @@ paths:
|
|
|
74
75
|
|
|
75
76
|
Title casing is sentence case, with proper nouns keeping their own casing (`# TypeScript standards`). `${CLAUDE_SKILL_DIR}/references/rule.md` owns the rest of the body shape.
|
|
76
77
|
|
|
78
|
+
## Step 5: check each bullet
|
|
79
|
+
|
|
80
|
+
Read `${CLAUDE_SKILL_DIR}/references/checklist.md` and run every bullet of the written rule through it, along with the shape limits and the content test in `rule.md`.
|
|
81
|
+
|
|
82
|
+
- Rewrite a bullet marked revise and cut one marked drop, then run the checklist again over what changed
|
|
83
|
+
- Run `canon gov audit .claude/rules/project/<subdir>/<slug>.md` and fix every finding it reports, since the shape limits are counts the verb takes rather than a judgment
|
|
84
|
+
- Report the verdict counts with the path, and name any bullet kept against a criterion with the reason
|
|
85
|
+
|
|
77
86
|
## After writing
|
|
78
87
|
|
|
79
|
-
Emit the full path on its own line: `.claude/rules/project/<subdir>/<slug>.md`. Remind the user that Claude Code loads path-scoped rules when it reads or writes a matching file, and always-on rules every session.
|
|
88
|
+
Emit the full path on its own line: `.claude/rules/project/<subdir>/<slug>.md`. Remind the user that Claude Code loads path-scoped rules when it reads or writes a matching file, and always-on rules every session. When a bullet claims outside practice, tell them to cite its source in the commit that adds the rule.
|