@erclx/aitk 0.30.0 → 0.31.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/README.md CHANGED
@@ -55,7 +55,7 @@ Each domain has a canonical source in this repo and a thin install or sync CLI o
55
55
  - [Design system](.claude/context/design.md): `DESIGN.md` token shape, extract skill and its two paths, render command
56
56
  - [Slides](.claude/context/slides.md): `SLIDES.md` source, layout catalog, render command, draft skill
57
57
  - [Transcripts](.claude/context/transcripts.md): fetch a YouTube transcript with metadata frontmatter via `aitk transcripts`
58
- - [Sandbox](.claude/context/sandbox.md): scenario-based scaffolds for verifying each domain flow
58
+ - [Sandbox](.claude/context/sandbox/index.md): scenario-based scaffolds for verifying each domain flow
59
59
 
60
60
  ## Documentation
61
61
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aitk",
3
3
  "description": "Automated governance, versioning, and discovery tools for Claude Code.",
4
- "version": "0.30.0",
4
+ "version": "0.31.0",
5
5
  "author": {
6
6
  "name": "Eric Le",
7
7
  "url": "https://github.com/erclx"
@@ -16,6 +16,7 @@ Without this skill, the memory folder grows and never drains. Entries pile up re
16
16
  - Rewrite a rule into the destination's voice instead of moving it unchanged
17
17
  - Write the proposal to a receipt on disk and take no action until the user decides per item
18
18
  - Keep a promotion on its own commit, since a change to how the agent operates should not ride inside a feature a reviewer is vetting for something else
19
+ - Confine the pass that runs after application to the one receipt it tested, so tidying up removes a file whose decisions are known to be resolved and leaves the pen and every untested receipt alone
19
20
 
20
21
  ## Must not
21
22
 
@@ -23,12 +24,14 @@ Without this skill, the memory folder grows and never drains. Entries pile up re
23
24
  - Author a governance rule inline. Coding-standards rules have an owner and a scaffolding path, and a rule written here bypasses both.
24
25
  - Mutate tracked files from the main worktree
25
26
  - Answer a question raised in a decision slot while applying. Discussion and application are separate passes so an approval is never inferred from a reply.
27
+ - Delete a memory entry outside the approved-per-item pass. The folder is gitignored with no history behind it, so a removal any other phase makes has no undo and no record of what it took.
26
28
 
27
29
  ## Guards
28
30
 
29
31
  - No memory folder at the main root: stop
30
32
  - The folder holds only its index: stop with a pass, not an error
31
33
  - Apply invoked from the main worktree: stop and name the worktree command
34
+ - Cleanup invoked with no receipt on disk: stop with a pass, not an error
32
35
 
33
36
  ## Out of scope
34
37
 
@@ -7,21 +7,22 @@ description: Reviews `.claude/memory/` and proposes per-entry actions (promote t
7
7
 
8
8
  This skill drives the full memory review lifecycle in five phases. Pick the phase from what the user said and whether a review receipt already exists at `<main-root>/.claude/review/memory-review-*.md`.
9
9
 
10
- | User intent | Phase | Mutates |
11
- | ---------------------------------------------- | --------- | ---------------------------- |
12
- | "review memory", "promote memory" (no receipt) | Propose | review file only |
13
- | "challenge the promotes" (receipt exists) | Challenge | review file only |
14
- | "discuss", "respond to questions" | Discuss | review file only |
15
- | "apply decisions", "commit", "ship the review" | Apply | tracked files + memory files |
16
- | "cleanup", "sweep stale", "delete the receipt" | Cleanup | memory files + review file |
10
+ | User intent | Phase | Mutates |
11
+ | ---------------------------------------------------------------------- | --------- | ---------------------------- |
12
+ | "review memory", "promote memory", "sweep stale memories" (no receipt) | Propose | review file only |
13
+ | "challenge the promotes" (receipt exists) | Challenge | review file only |
14
+ | "discuss", "respond to questions" | Discuss | review file only |
15
+ | "apply decisions", "commit", "ship the review" | Apply | tracked files + memory files |
16
+ | "cleanup", "delete the receipt" | Cleanup | one review file |
17
17
 
18
- If the user just re-pings the skill with no new phrase and a receipt exists, default to Discuss when any `Decision:` contains `?`, otherwise Apply.
18
+ If the user re-pings the skill with no new phrase and a receipt exists, default to Discuss when any `Decision:` contains `?`, otherwise Apply.
19
19
 
20
20
  ## Guards
21
21
 
22
22
  - All `.claude/memory/` reads, edits, and deletes resolve at the main worktree root, not the current worktree. See Worktrees in `CLAUDE.md`.
23
23
  - If no `.claude/memory/` directory exists at the main worktree root, stop: `❌ No .claude/memory/ directory found.`
24
24
  - If `.claude/memory/` contains no `*.md` entries other than `MEMORY.md`, stop: `✅ No memory entries to review.`
25
+ - Cleanup is exempt from the two stops above. It works on receipts in `.claude/review/`, and a drained pen is the normal state once Apply has run, so a pen-shaped stop would strand the receipt it exists to delete.
25
26
  - Resolve the main root via `git worktree list --porcelain | grep -m 1 '^worktree ' | cut -d' ' -f2-`, falling back to `pwd`. All review and memory reads anchor here.
26
27
 
27
28
  ## Propose phase
@@ -186,14 +187,17 @@ End with: `✅ Applied: <nums> | ⏭ Skipped: <nums> | 📝 Pending: <nums>`. Om
186
187
 
187
188
  ## Cleanup phase
188
189
 
189
- Trigger: user says "cleanup", "sweep stale memories", or "delete the receipt" after Apply has run.
190
+ Trigger: user says "cleanup" or "delete the receipt" after Apply has run.
190
191
 
191
- 1. Read the latest `.claude/review/memory-review-*.md` to see which entries were skipped.
192
- 2. Treat a `Skip` decision as terminal. Do not delete a memory just because it would Skip again next review. Target only entries whose decision value is exhausted: already-applied promotions and stale receipts.
193
- 3. Delete the review file itself.
194
- 4. Leave applied promotions, governance handoffs, and user-type memories alone.
192
+ Cleanup removes one receipt and nothing else. Apply is the only phase that deletes a memory entry, and it does so per approved item against a folder that is gitignored with no history behind it, so a deletion made anywhere else has no undo and leaves no record of what it took. A user asking to sweep stale memories wants Propose, which classifies entries and writes a decision slot per entry.
195
193
 
196
- Do not promote or rewrite. Cleanup only.
194
+ If no `.claude/review/memory-review-*.md` exists at the main root, stop: `✅ No review receipt to clean up.` Every other refusal in this skill carries a message, and the phase reads a receipt before it does anything else.
195
+
196
+ 1. Read the latest `.claude/review/memory-review-*.md` at the main root and confirm Apply has run against it. If any item is still 📝 pending, stop and name the pending numbers.
197
+ 2. Delete that one file. Leave every other receipt beside it in place, because the pending test above covers the file it read and nothing has tested the rest.
198
+ 3. Leave every memory entry in place. A `Skip` decision is terminal, and applied promotions, governance handoffs, and user-type memories each stay as the review left them.
199
+
200
+ Do not promote, rewrite, or delete a memory entry. Receipts only.
197
201
 
198
202
  ## After completion
199
203
 
@@ -202,5 +206,6 @@ Output one line per action taken in the most recent phase:
202
206
  - `✅ Promoted: .claude/memory/<memory-file> → <target>`
203
207
  - `✅ Handed off: .claude/memory/<memory-file> → governance`
204
208
  - `🗑 Deleted: .claude/memory/<memory-file>`
209
+ - `🗑 Swept: .claude/review/<review-file>`
205
210
 
206
211
  If the user accepted nothing, output: `✅ No changes applied.`
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: migration-context
3
+ description: Scope boundary for the docs audience split and its ordering against the other two migrations
4
+ ---
5
+
6
+ # Migration context requirement
7
+
8
+ ## Gap
9
+
10
+ Without this skill, a session judges a `docs/` file agent-facing, moves it, and rewrites the inbound links in the same pass, so a classification the user rejects is no longer one command to undo.
11
+
12
+ Three more failures share a cause. The skill reads a folder two other surfaces also write, and a proposal blind to them destroys work. A seed-derived `development.md` moved out of `docs/` comes back on the next seed sync. A move onto an existing `.claude/context/` filename overwrites the entry sitting there. A proposal drafted while `migration-claude-md` is proposing entries into the same folder cannot see those targets, and running the two in the wrong order turns a legitimate move into a skipped conflict.
13
+
14
+ ## Must
15
+
16
+ - Classify by audience signal in the file rather than by its name or its folder position
17
+ - Propose and stop. The `git mv` commands and the link fixes stay the user's to run.
18
+ - Report every inbound reference to a moved path as a TODO line, leaving the reference itself untouched
19
+ - Defer a seed-derived file to the seed sync path rather than proposing a move for it
20
+ - Skip a move whose destination already exists and report it as a conflict
21
+
22
+ ## Must not
23
+
24
+ - Sort a file carrying both audiences into either bucket. Flag it for a manual split, since a whole-file move and a silent split are both wrong.
25
+ - Descend into `docs/` subfolders. List them for manual review and leave them alone.
26
+
27
+ ## Guards
28
+
29
+ - A missing `docs/` directory, or one holding no top-level markdown, stops before any classification runs
30
+
31
+ ## Out of scope
32
+
33
+ - Classifying `CLAUDE.md` sections, which `migration-claude-md` proposes into this same `.claude/context/` folder. Run this skill first when both apply, so that skill's append-or-create check reads a folder the moves have already populated.
34
+ - Relocating root `standards/` and `snippets/`: `migration-standards`
35
+ - Regenerating `.claude/context/index.md`, which `aitk indexes regen` does once the user has applied the moves
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: setup-gov
3
+ description: Scope boundary for governance rule install and the authoring it refuses to do in a target
4
+ ---
5
+
6
+ # Setup gov requirement
7
+
8
+ ## Gap
9
+
10
+ Without this skill, a session picks a stack name from memory and installs rules written for a framework the project does not use, passes an extra the catalog does not carry so the install warns on a file it cannot resolve, and adds a rule the picked stack already pulls in.
11
+
12
+ The two costly failures are quieter. An unmatched technology gets the nearest rule instead of a stop, so the project carries governance authored for something adjacent and nothing marks it as a guess. A rule written directly into the target lands where no sync will ever reach it, so it drifts from the toolkit copy that owns it.
13
+
14
+ ## Must
15
+
16
+ - Read the catalog at run time and resolve both the stack and every extra against it
17
+ - Name the evidence file behind each detected technology in the preview, so a wrong match is visible before the install rather than after
18
+ - Dedupe extras against the rules the picked stack already resolves
19
+ - Run the install non-interactively, since the CLI picker blocks where no terminal is attached
20
+
21
+ ## Must not
22
+
23
+ - Author a rule inside the target project. Rules are authored in the toolkit and reach a project by install or sync.
24
+ - Install a stack or extra whose name did not come from the catalog read
25
+
26
+ ## Guards
27
+
28
+ - An unmatched technology stops and presents the options rather than resolving to a nearby rule. Authoring the missing rule in the toolkit, installing the matching layers without the technology-specific one, and aborting are the three, and this skill picks none of them.
29
+
30
+ ## Out of scope
31
+
32
+ - The rest of the onboarding chain. This skill installs governance and nothing else, and `setup-init` is the one-shot path that installs governance beside tooling, standards, snippets, and the seeds.
33
+ - Scaffolding the rule file an unmatched technology needs. `create-rule` writes one into a target project, and a rule the toolkit should ship is authored under `governance/rules/` against `.claude/standards/rule.md`.
34
+ - Updating rules a project already has, which `aitk gov sync` owns
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: setup-init
3
+ description: Scope boundary for the one-shot onboarding chain and the setup steps it leaves to a caller
4
+ ---
5
+
6
+ # Setup init requirement
7
+
8
+ ## Gap
9
+
10
+ Without this skill, a session installs a stack whose name it recalled rather than read, hand-writes configs the tooling sync already ships as golden files, and re-runs the chain over a project that owns its configs already.
11
+
12
+ Two failures are the expensive ones because both return success. A monorepo run drops husky into every subtree, git honors one `core.hooksPath`, and the extra hook directories go quiet with nothing reporting it. A caller reads the chain as onboarding complete when index bootstrap and plugin provisioning never ran, since no step states whether they belong to the chain.
13
+
14
+ ## Must
15
+
16
+ - Resolve every domain argument against a catalog read at run time, so a stack, rule, snippet, or tooling name the catalog does not carry cannot reach the command line
17
+ - Preview the resolved chain before the first command runs, naming the evidence file behind each detected technology
18
+ - Pass `--skip base` on every subtree past the first in a monorepo, so the shared hook layer lands once
19
+ - State which onboarding steps the chain does not run, so a caller knows what is left rather than inferring completeness from a clean report
20
+
21
+ ## Must not
22
+
23
+ - Generate a config that tooling sync ships as a golden file. Generating from prose duplicates the installed file and the two drift.
24
+ - Author a rule, stack, or snippet inside the target project when detection finds no match. Authoring happens in the toolkit and reaches a project by install or sync.
25
+ - Grow an existing-project branch, a mode switch, or a clobber guard. The chain runs once against a fresh scaffold and the per-domain paths cover everything after that.
26
+
27
+ ## Guards
28
+
29
+ - An unmatched technology stops for a decision. Surface the gap and either defer to rule authoring or proceed on the matched layer with the gap named in the report, rather than resolving to the nearest rule.
30
+
31
+ ## Out of scope
32
+
33
+ - Installing governance rules alone: `setup-gov`. This skill installs governance beside tooling, standards, snippets, and the seeds.
34
+ - Bootstrapping the `index.md` system: `setup-indexes`. Neither `aitk init` nor this chain performs it.
35
+ - Provisioning Claude Code plugins: `setup-plugins`. Those install once per machine rather than into a project, so no project-scoped chain can carry them.
36
+ - Running the verification scripts, which `setup-verify` owns and this chain invokes as its last step
37
+ - Re-installing into a project that already has the files, which the per-domain `aitk <domain> install` and `aitk sync` commands own
@@ -127,7 +127,7 @@ Use a targeted entry point when only one surface moved upstream. Use the catch-a
127
127
 
128
128
  ## Verify a sync
129
129
 
130
- Before running a sync against a real project, run the relevant sandbox scenario. The sandbox provisions a representative project state and routes `SANDBOX_SCENARIO=sync` through the domain flow. See [sandbox](../.claude/context/sandbox.md) for the scenario catalog and routing patterns.
130
+ Before running a sync against a real project, run the relevant sandbox scenario. The sandbox provisions a representative project state and routes `SANDBOX_SCENARIO=sync` through the domain flow. See [sandbox](../.claude/context/sandbox/index.md) for the scenario catalog and routing patterns.
131
131
 
132
132
  ## Scenarios
133
133
 
@@ -182,4 +182,4 @@ Sync also refuses a target whose working tree is dirty, so commit or stash befor
182
182
  - [agents](agents.md): CLI flags, exit codes, and JSON output shapes
183
183
  - [AI workflow](ai-workflow.md): feature-development loop inside a toolkit-managed project
184
184
  - [tooling](../.claude/context/tooling.md), [governance](../.claude/context/governance.md), [claude plugin](../.claude/context/claude-plugin/index.md), [indexes](../.claude/context/indexes.md), [snippets](../.claude/context/snippets.md), [standards](../.claude/context/standards.md): per-domain mechanics
185
- - [sandbox](../.claude/context/sandbox.md): scenario catalog for verifying domain flows
185
+ - [sandbox](../.claude/context/sandbox/index.md): scenario catalog for verifying domain flows
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@erclx/aitk",
3
3
  "type": "module",
4
- "version": "0.30.0",
4
+ "version": "0.31.0",
5
5
  "description": "Infrastructure and quality tooling for developer workflows",
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -69,7 +69,7 @@ export function listSkills(root: string): string[] {
69
69
  /**
70
70
  * Maps a scenario to the skill it drives, trying two spellings in order.
71
71
  *
72
- * `<category>-<command>` is the rule `.claude/context/sandbox.md` states, and it
72
+ * `<category>-<command>` is the rule `.claude/context/sandbox/coverage.md` states, and it
73
73
  * alone pairs 29 of 55 skills. The bare `<command>` fallback is what reaches the
74
74
  * rest: `claude/setup-init.sh` drives the `setup-init` skill, not a
75
75
  * `claude-setup-init` that does not exist. Stating one spelling and shipping two