@erclx/aitk 3.42.1 → 3.43.1

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aitk",
3
3
  "description": "Automated governance, versioning, and discovery tools for Claude Code.",
4
- "version": "3.42.1",
4
+ "version": "3.43.1",
5
5
  "author": {
6
6
  "name": "Eric Le",
7
7
  "url": "https://github.com/erclx"
@@ -17,7 +17,8 @@ Review is the step that varies most. It gets skipped on a diff that needed one,
17
17
  - Give every step a stop condition, and leave the code on the branch and the receipts on disk at each one
18
18
  - Classify the changed-file list by path as well as by extension, so informational prose skips a code review with no signal on it and executable prose still reaches one
19
19
  - Split findings by origin, stopping on a critical or should-fix one the branch inherited and repairing one this run caused
20
- - Open the pull request as a draft, then watch continuous integration to a terminal state
20
+ - Delegate the ship sequence to `git-ship` rather than restating it, and name only what this chain adds to it
21
+ - Open the pull request as a draft before the continuous integration watch begins, since a pull request marked after it is mergeable for the length of the run
21
22
  - Name the recovery for the stop it took, since the value of stopping is that the user knows where to resume
22
23
 
23
24
  ## Must not
@@ -27,6 +28,8 @@ Review is the step that varies most. It gets skipped on a diff that needed one,
27
28
  - Fix an inherited review finding or a failing check. Both stops are deliberate, since a green pull request reached by auto-fix hides what broke.
28
29
  - Loop on a self-introduced finding. One repair pass, then stop, which is the bound a failed verify already carries.
29
30
  - Read the plan's file list as the boundary on a repair. It scopes what the run builds, and a finding this run caused is in reach wherever it landed.
31
+ - Restate the ship sequence. Two copies of one order drift with nothing comparing them, which is what the merge into `git-ship` closed.
32
+ - Skip that skill's own verify for repeating this chain's. The gate exists for the resumed run, and a chain that suppresses it leaves the resumed run reaching nothing.
30
33
  - Run the memory Apply phase. Promoting an entry changes how the agent operates and ships as its own change.
31
34
  - Read an empty changed-file list as prose-only. It satisfies that test vacuously and would route the branch past review instead of through it.
32
35
  - Read a markdown extension as evidence the change only informs. A skill body, a governance rule, and a standard are behavior written in prose.
@@ -43,4 +46,4 @@ Review is the step that varies most. It gets skipped on a diff that needed one,
43
46
 
44
47
  - Writing the plan, which `claude-feature` owns. This chain starts from one already approved.
45
48
  - The behavior of each step, owned by the skill invoked. This skill owns the order and the stop conditions.
46
- - The resume path after a stop, which `git-ship` owns. That skill is the tail of this same sequence, which is why the two overlap by design.
49
+ - The ship sequence and the resume path after a stop, both of which `git-ship` owns. That skill is the tail of this chain, invoked at Step 7 rather than copied into it, so the overlap is one body reached two ways rather than two bodies stating one order.
@@ -134,33 +134,17 @@ Bound the repair at one pass, the way Step 3 bounds verify. When that re-read sh
134
134
 
135
135
  ## Step 7: ship
136
136
 
137
- Invoke each sub-skill in order via the Skill tool. After each returns, invoke the next immediately. Do not output text between steps.
137
+ Invoke `aitk:git-ship`. That body owns the sequence, being the verify gate, memory capture, both doc syncs, staging, the commit grouping, the branch rename, the pull request, the CI watch, and the scoped memory review, along with the reason each step sits where it does. This step used to restate that list and the two drifted apart with nothing comparing them, so read the order there and never here.
138
138
 
139
- 1. `aitk:claude-memory-capture`: route what this session learned to the context entries that own it, and write the residue to `.claude/memory/`
140
- 2. `aitk:claude-docs`: sync `.claude/` planning docs against session decisions, folding in the routed facts
141
- 3. `aitk:docs-sync`: sync public docs against changes since main
142
- 4. Run `git add -A` to stage files the sync skills wrote
143
- 5. `aitk:git-stage`: group staged changes and commit by concern
144
- 6. `aitk:git-branch`: rename the branch to conventional format
145
- 7. `aitk:git-pr`: push and open the pull request
146
-
147
- Capture runs first because a routed fact lands in a context entry, which is a tracked file. Running it after `git-pr`, where it used to sit, leaves that edit outside the branch and outside the pull request, so the fact reaches nothing. Memory files stay gitignored either way, which is why the old order was invisible.
148
-
149
- After the PR is created, mark it as draft:
139
+ One thing this chain adds. Mark the pull request as a draft as soon as `git-ship`'s pull request step returns, ahead of its CI watch:
150
140
 
151
141
  ```bash
152
142
  gh pr ready --undo
153
143
  ```
154
144
 
155
- After marking draft, watch CI. Poll `gh pr checks <number>` until no check is pending, then read the final status.
156
-
157
- On all-pass, continue. On any failure, stop and report the failing check with its URL. Do not auto-fix.
145
+ Placement is the whole point of naming it. Marking after the watch leaves the pull request ready to merge for as long as CI runs, which is the window an unattended worker's branch is least supervised.
158
146
 
159
- 8. `aitk:claude-memory-review`: if step 1's capture wrote or updated at least one memory file, propose fixes scoped to those entries, writing the decision-ready receipt while session context is fresh. Skip when capture wrote nothing to the folder, which is the ordinary outcome once routing has taken the domain facts.
160
-
161
- Review stays last because its receipt is gitignored and needs nothing from the commit, and because a proposal is worth more once CI has said whether the branch stands.
162
-
163
- Stop at the Propose phase. Do not run Apply. Promoting an entry to `CLAUDE.md` or a skill body mutates how the agent operates and ships as its own change, separate from this feature.
147
+ `git-ship` verifies again at its own gate, which repeats this chain's Step 3 on the run where nothing stopped. That cost is deliberate: four of the stop points in the table below hand the run straight back to that body, and a gate the chain skips for being redundant is a gate no resumed run ever meets.
164
148
 
165
149
  ## Output
166
150
 
@@ -176,6 +160,8 @@ Respond with up to five lines:
176
160
 
177
161
  Omit the second line if there were no minor findings, and the third if nothing routed. Omit the fourth and fifth if `claude-memory-capture` wrote no memory file this session, since an empty pen means no scoped review and no proposal. A run that routes every fact and writes none is the shape to expect, and it reports three lines.
178
162
 
163
+ This block replaces the one `git-ship` closes on rather than following it. The two carry the same three trailing lines and differ on the two above them, since the first names the draft state and the second reports the minor findings Step 6 kept, neither of which that body has a counterpart for. Emitting both reports one run twice and buries the draft under a `✅ Shipped` that does not name it.
164
+
179
165
  ## Failure recovery
180
166
 
181
167
  Every stop point leaves recoverable state. The user resumes manually from the appropriate step.
@@ -16,6 +16,8 @@ A session that does start one picks a runner on the spot. The reading then comes
16
16
  - Detect the harness the project already carries before naming any runner
17
17
  - Report a number per metric beside the threshold it is measured against and the published source of that threshold
18
18
  - Cover paint, processor, and layout cost, and name what the run left unmeasured
19
+ - Name the elements the layout figure came from, taken off the run that produced the median so the parts sum to the figure beside them
20
+ - Distinguish a layout figure of zero from a harness that reported no attribution, since one is a page that held still and the other is a reading that went missing
19
21
  - Report what the measurement needs and stop when no harness is detected, since that is a project without a runner rather than a failure here
20
22
  - Take several readings and report the median, since one load carries startup noise wider than the gap between two thresholds
21
23
  - Write the reading to the branch-derived path at the main worktree root, overwriting
@@ -28,7 +30,8 @@ A session that does start one picks a runner on the spot. The reading then comes
28
30
  - Invent a threshold, or move a published one to fit a reading
29
31
  - Report an observation about the source in place of a measurement
30
32
  - Suggest a fix for what it measured, which is a change with its own review
31
- - Measure anything past the three metrics, since every adjacent ask doubles the run
33
+ - Measure anything past the three metrics, since every adjacent ask doubles the run. Naming which elements shifted is not a fourth metric, being the composition of the third and already present in the reading it summarizes.
34
+ - Read the source to improve an element name the harness gave. A better selector bought that way is the source judgment this skill replaces.
32
35
 
33
36
  ## Guards
34
37
 
@@ -54,10 +54,18 @@ Measure these three and nothing else:
54
54
 
55
55
  - **Paint**: Largest Contentful Paint, the moment the largest element in the viewport finishes rendering
56
56
  - **Processor**: Total Blocking Time, main-thread time past 50ms per long task between first paint and interactive
57
- - **Layout**: Cumulative Layout Shift, the summed score of unexpected shifts over the page lifetime
57
+ - **Layout**: Cumulative Layout Shift, the summed score of unexpected shifts over the page lifetime, reported with the elements that shifted
58
58
 
59
59
  Through Playwright or an MCP server, read them from a `PerformanceObserver` registered before navigation against the `largest-contentful-paint`, `longtask`, and `layout-shift` entry types. Lighthouse reports all three under its JSON audits, so parse rather than re-derive them.
60
60
 
61
+ ### Attributing the layout figure
62
+
63
+ A layout score on its own names nothing to look at, and the elements are already in the reading rather than a second measurement. Each `layout-shift` entry carries a `sources` array naming the nodes that moved, so sum each entry's `value` against the nodes its sources name and keep the three largest. Lighthouse carries the same attribution in the `details.items` of its layout-shift audit, which names elements rather than scores in some versions, so report what that audit gives and do not compute a score it withheld.
64
+
65
+ Take the attribution from the run that produced the median rather than merging all three, so the parts sum to the figure printed beside them. Merging reports shares of a total no run measured.
66
+
67
+ Identify each element the way the harness names it, which is a selector from Playwright and a node label from Lighthouse. Do not open the source to improve a name. Reading the tree that produced the page is what this skill exists to replace.
68
+
61
69
  Write any probe the harness needs into the project's own test folder, run it, then delete it. Leave no file behind.
62
70
 
63
71
  ### Thresholds
@@ -83,12 +91,16 @@ These are Google's published Core Web Vitals boundaries, with the Lighthouse lab
83
91
  | TBT | <n> | `≤ 200ms` | <verdict> |
84
92
  | CLS | <n> | `≤ 0.1` | <verdict> |
85
93
 
94
+ Shifted: `<element>` <n>, `<element>` <n>, `<element>` <n>.
95
+
86
96
  Thresholds: Google Core Web Vitals, Lighthouse lab boundary for TBT.
87
97
 
88
98
  Not measured: network waterfall, bundle size, accessibility, contrast.
89
99
  ```
90
100
 
91
- Report the reading and stop there. A remedy for a poor verdict is a change with its own review, so name no fix and edit no source.
101
+ Write `Shifted: nothing recorded.` when the median run logged no shift, and drop any element past the third. A layout figure of zero and a harness that reported no sources are different states, and the line says which one the run met.
102
+
103
+ Report the reading and stop there. A remedy for a poor verdict is a change with its own review, so name no fix and edit no source. Naming a shifted element stays inside that rule, since it says where the score came from rather than what to do about it.
92
104
 
93
105
  ### Persist
94
106
 
@@ -15,6 +15,8 @@ The tree the entry hands over is also not one the session can run. Dependencies
15
15
 
16
16
  A declined request also has to land somewhere. The description turns away a list, cleanup, or rotation request and names no destination, so the session that reads it picks one, while the sibling owning those requests already points back here. One half of a pair carrying the pointer reads as the boundary running one way.
17
17
 
18
+ A submodule checkout is the state the entry path reads wrong while reporting nothing. The two directory reads that separate a linked worktree from a plain checkout return the same path there, so the guard passes and every derivation after it takes the submodule for the project: the main root, the plan lookup, and the folder entry builds all resolve inside a tree the superproject tracks as a commit.
19
+
18
20
  A stack that derives its ports from the working directory has the same shape. The number is correct and invisible, and `claude-orchestrate` sends a reader here to read it rather than assign one, so the entry that knows the working directory is the surface that owes it.
19
21
 
20
22
  ## Must
@@ -44,6 +46,7 @@ A stack that derives its ports from the working directory has the same shape. Th
44
46
  ## Guards
45
47
 
46
48
  - Already inside a linked worktree: stop rather than nesting
49
+ - Inside a submodule checkout: stop and name the superproject, since the two reads that catch a linked worktree return the same path here and everything derived afterward would take the submodule for the project
47
50
  - Not a git repository and no creation hook configured: stop
48
51
  - Target branch already exists: stop before entering and leave it alone, since resolving it automatically risks the wrong branch
49
52
  - Target worktree directory already exists: stop before entering, which is the only read that sees two branches differing by type collapsing onto one name
@@ -11,6 +11,9 @@ Wrap the `EnterWorktree` entry path with name derivation so the user does not pi
11
11
 
12
12
  - If `git rev-parse --git-dir` and `git rev-parse --git-common-dir` differ, the session is already inside a linked worktree. Stop: `❌ Already in a worktree. Run ExitWorktree first.`
13
13
  - If neither command resolves, the session is not in a git repo and no `WorktreeCreate` hook is configured. Stop: `❌ Not a git repository. EnterWorktree needs git or a WorktreeCreate hook.`
14
+ - If the two match and `git rev-parse --show-superproject-working-tree` prints a path, the session is inside a submodule checkout. Stop: `❌ Inside a submodule of <path>. Run this from there instead.`
15
+
16
+ The submodule guard sits on the matching branch rather than ahead of the first one, and a measurement decided that. Inside a submodule at git 2.43.0 both reads return the same absorbed path under the superproject's `.git/modules/`, so the first guard does not fire and the session proceeds. Every derivation below then reads the submodule as the project: Step 1 resolves the main root to the submodule, the plan lookup reads a `.claude/plans/` the project never wrote, and entry builds `.claude/worktrees/` inside a tree the superproject tracks as a commit. The superproject read is empty in a linked worktree of a submodule and in one of the superproject alike, which is why it separates the two states rather than qualifying the first guard.
14
17
 
15
18
  ## Step 1: resolve the main worktree root
16
19
 
@@ -9,11 +9,17 @@ description: What the ship chain is for, the gaps it closes, and why it does not
9
9
 
10
10
  Without this skill, the post-feature sequence runs from memory. Doc sync gets skipped, so the pull request ships with planning docs describing the previous scope, or it runs after staging has already closed and its output never reaches a commit. Chaining by hand is also where a session narrates between steps, which turns one flow into a conversation and invites a decision at every boundary.
11
11
 
12
+ The sequence also reaches the remote on work nothing re-checked. This skill is the resume point `claude-autoship` names at four of its stop points, including the one a failed verify takes, so the fix the user makes by hand after that stop is pushed with no suite run against it. Every branch shipped so far passed that verify on its first attempt, which is why the path has produced no instance rather than being closed.
13
+
12
14
  ## Must
13
15
 
16
+ - Run the project's verify commands before the sequence starts, and stop on a failure rather than fixing it
17
+ - Say so and continue when the project names no verify command, since silence there reads as a suite that passed
14
18
  - Invoke each step through the Skill tool in the stated order and continue without waiting
15
19
  - Stage after the sync skills write, so what they produced reaches a commit
16
20
  - Emit no text between steps. The sequence is the unit and prose inside it reopens settled decisions.
21
+ - Name the one point a wrapping caller may act at, so a chain built on this one is not left to pick a gap of its own
22
+ - Name the condition under which the closing block is not emitted, since a caller that closes on its own block leaves two instructions about the last line and nothing deciding between them
17
23
  - Watch continuous integration to a terminal state, and stop on a failure naming the check
18
24
  - Stop memory work at the Propose phase
19
25
 
@@ -22,13 +28,15 @@ Without this skill, the post-feature sequence runs from memory. Doc sync gets sk
22
28
  - Auto-trigger. Shipping is a decision the user takes, which is what the disabled model invocation encodes.
23
29
  - Fix a failing check. The stop is the point, since a green pull request reached by auto-fix hides what broke.
24
30
  - Run the memory Apply phase. Promoting an entry changes how the agent operates and ships as its own change.
25
- - Implement, verify, or review. This chain starts from work already believed done.
31
+ - Attempt a fix for a failing verify. The user is already making one, which is what brought the run back here.
32
+ - Implement or review. This chain starts from work already believed done.
26
33
 
27
34
  ## Guards
28
35
 
36
+ - A failing verify stops the run before the sync skills write, so the tree is left as the user left it
29
37
  - A failing check stops the sequence. This is the one place text is allowed between steps.
30
38
 
31
39
  ## Out of scope
32
40
 
33
- - Implementation, verification, and review, which `claude-autoship` chains ahead of this same sequence. That skill is the full pipeline and this one is the resume point after a stop, which is why the two overlap by design.
41
+ - Implementation and review, which `claude-autoship` chains ahead of this same sequence. That skill is the full pipeline and this one is the resume point after a stop, which is why the two overlap by design. Verification is the one of the three that belongs on both, since a resume point that trusts the caller's verify trusts a run that stopped.
34
42
  - The behavior of each step, owned by the skill invoked. This skill owns the order and nothing else.
@@ -8,7 +8,15 @@ disable-model-invocation: true
8
8
 
9
9
  Run the full post-feature workflow by invoking each skill in sequence using the Skill tool. After each skill returns, invoke the next step immediately in the same response.
10
10
 
11
- Do not output any text between steps and do not wait for user input. Tool permission dialogs are the only interrupts allowed. The final output is `✅ Shipped`.
11
+ Do not output any text between steps and do not wait for user input. Tool permission dialogs are the only interrupts allowed. The final output is `✅ Shipped`, unless a wrapping caller states it closes on its own block, which `claude-autoship` does.
12
+
13
+ ## Verify
14
+
15
+ Run the verify commands `CLAUDE.md` names (lint, typecheck, tests) before the sequence starts. On a failure, stop: `❌ Verify failed. Fix the reported errors and run /git-ship again.` Make no fix attempt. This skill is the resume point after a stop, so the fix is the one the user is already making.
16
+
17
+ When `CLAUDE.md` names no verify command, say so on one line and continue. A project with no suite is not a project with a failing one.
18
+
19
+ Verify runs ahead of the sync skills so a stop leaves the tree exactly as the user left it. Re-running a suite the caller already ran costs one command, and the path it closes is the one that has no other guard: `claude-autoship` verifies at its own Step 3 and then hands four of its stop points straight back here, so a fix made by hand after one of those stops otherwise reaches the remote with nothing re-run.
12
20
 
13
21
  ## Pre-check
14
22
 
@@ -26,6 +34,8 @@ Run `git diff --cached --name-only 2>/dev/null` to check for staged files. If ou
26
34
  8. After the PR opens, watch CI. Poll `gh pr checks <number>` until no check is pending, then read the final status. On all-pass, continue. On any failure, stop the sequence and report the failing check with its URL. Do not auto-fix. This step may output on failure, the one exception to the no-text-between-steps rule.
27
35
  9. If step 1 wrote or updated at least one memory file, invoke `aitk:claude-memory-review` scoped to those entries to propose fixes while session context is fresh. If the pen got nothing, skip this step.
28
36
 
37
+ A caller wrapping this sequence may act between step 7 and step 8, which is the one gap the order leaves open, since the pull request exists there and nothing has read its checks yet. `claude-autoship` marks the pull request draft in it. Nothing else may go there, and a caller that needs a step anywhere else in the sequence is asking for a change to this body rather than for a place to stand.
38
+
29
39
  Capture leads the sequence because a routed fact lands in a context entry, which is a tracked file. Running it after the pull request opens leaves that edit off the branch entirely, so the fact reaches nothing. Memory files are gitignored either way, which is what hid the ordering while capture wrote only those.
30
40
 
31
41
  Stop at the Propose phase. Do not run Apply. Promoting an entry to `CLAUDE.md` or a skill body ships as its own change, separate from this feature.
@@ -42,3 +52,5 @@ Output up to four lines:
42
52
  ```
43
53
 
44
54
  Omit the second line if nothing routed. Omit the third and fourth if `claude-memory-capture` wrote no memory file this session, since an empty pen means no scoped review and no proposal.
55
+
56
+ Emit nothing here when a wrapping caller states it closes on its own block. `claude-autoship` is that caller and its block carries these same three trailing lines above a first line naming the draft state, so emitting both reports one run twice. A caller that states no such thing gets this block, which is every direct invocation.
@@ -63,7 +63,7 @@ Start a fresh Claude Code session. The diff is sufficient context for both revie
63
63
 
64
64
  - Invoke `aitk:claude-review` to review all changes since main and output a findings report
65
65
  - Fix any valid findings
66
- - Invoke `aitk:git-ship` to sync docs, commit by concern, rename branch, and open PR
66
+ - Invoke `aitk:git-ship` to run the project's verify commands, sync docs, commit by concern, rename branch, and open PR
67
67
 
68
68
  ### Parallel features
69
69
 
@@ -146,7 +146,7 @@ An empty changed-file list stops the chain rather than counting as prose-only. T
146
146
 
147
147
  #### Memory in the chain
148
148
 
149
- Both `autoship` and `git-ship` open with `claude-memory-capture`, which sends what the session learned to the surface that owns it. A fact about a domain carrying an entry in `.claude/context/index.md` is routed to that entry, and `claude-docs` folds it in on the next step, so it ships in the same pull request. Anything no entry owns stays a file in `.claude/memory/`.
149
+ `git-ship` runs its verify gate and then opens on `claude-memory-capture`, which sends what the session learned to the surface that owns it. `autoship` reaches the same step by invoking that skill at its Step 7 rather than restating the order. A fact about a domain carrying an entry in `.claude/context/index.md` is routed to that entry, and `claude-docs` folds it in on the next step, so it ships in the same pull request. Anything no entry owns stays a file in `.claude/memory/`.
150
150
 
151
151
  Capture leads rather than trails because a routed fact edits a tracked file, which has to reach the branch before the commit steps run.
152
152
 
@@ -226,17 +226,17 @@ This section is the corpus the coverage claim is measured against: every name `a
226
226
 
227
227
  ### Ship it
228
228
 
229
- | Skill | When to use |
230
- | ---------------------------- | ---------------------------------------------------------------------------------- |
231
- | `aitk:git-ship` | To run the whole post-feature chain from docs sync through open PR |
232
- | `aitk:claude-memory-capture` | First in that chain, to route what the session learned to the surface owning it |
233
- | `aitk:claude-docs` | When decisions diverged from the plan, or a shipped task needs its outcomes marked |
234
- | `aitk:docs-sync` | When a change since main left `README.md` or `docs/` stale |
235
- | `aitk:git-stage` | When the staged set spans several concerns and wants one commit each |
236
- | `aitk:git-commit` | When the staged set is one concern, or was staged hunk by hand |
237
- | `aitk:git-branch` | When a branch name needs generating or renaming to conventional form |
238
- | `aitk:git-pr` | When a pull request needs a title and body written from the diff |
239
- | `aitk:claude-memory-review` | After capture writes an entry, to propose where each one belongs |
229
+ | Skill | When to use |
230
+ | ---------------------------- | ------------------------------------------------------------------------------------- |
231
+ | `aitk:git-ship` | To run the whole post-feature chain from the verify gate through open PR |
232
+ | `aitk:claude-memory-capture` | First skill in that chain, to route what the session learned to the surface owning it |
233
+ | `aitk:claude-docs` | When decisions diverged from the plan, or a shipped task needs its outcomes marked |
234
+ | `aitk:docs-sync` | When a change since main left `README.md` or `docs/` stale |
235
+ | `aitk:git-stage` | When the staged set spans several concerns and wants one commit each |
236
+ | `aitk:git-commit` | When the staged set is one concern, or was staged hunk by hand |
237
+ | `aitk:git-branch` | When a branch name needs generating or renaming to conventional form |
238
+ | `aitk:git-pr` | When a pull request needs a title and body written from the diff |
239
+ | `aitk:claude-memory-review` | After capture writes an entry, to propose where each one belongs |
240
240
 
241
241
  ### After the pull request opens
242
242
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@erclx/aitk",
3
3
  "type": "module",
4
- "version": "3.42.1",
4
+ "version": "3.43.1",
5
5
  "description": "Infrastructure and quality tooling for developer workflows",
6
6
  "license": "MIT",
7
7
  "bin": {