@erclx/aitk 3.44.0 → 3.45.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.
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aitk-rollout
|
|
3
|
+
description: Why one skill carries both roles of an outbound wave, and where its boundary sits against the seven skills that operate inside a target
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Aitk rollout requirement
|
|
7
|
+
|
|
8
|
+
## Gap
|
|
9
|
+
|
|
10
|
+
Without this skill, a toolkit change reaches its consuming projects by hand. One measured pass across four targets took four hand-written `cd <path> && claude --bg` invocations, each carrying a brief composed by hand from that project's review. Nothing enumerated the targets, nothing derived the brief, and nothing applied a convention across the set.
|
|
11
|
+
|
|
12
|
+
The conventions were already settled and reached none of the four. The branch and title shape was answered and reconfirmed, and the four pull requests carried four titles across two scopes, neither of them the settled one, with three naming the toolkit in the half of the shape that withholds it. A convention nothing applies holds only where somebody remembers it.
|
|
13
|
+
|
|
14
|
+
The return leg dead-ends outside this repository. A review that posts a finding on a target's pull request has to reach the session holding that branch, and every dispatch guessed instead. All four sessions that opened those pull requests were still alive holding their worktrees hours later, two fresh addressers were sent over them, one refused on the worktree lock, and one cut a second worktree on the same branch, which would have put two sessions pushing to one ref.
|
|
15
|
+
|
|
16
|
+
A wave ends without telling the operator what to do. Reading where four targets stood took a hand-written shell loop over four repositories, re-run three times as reviews landed, and every status line it produced named a repository and a number and no link. Merging is the one act only the operator performs, and they reached each result by navigating to it by hand.
|
|
17
|
+
|
|
18
|
+
A worker's reply reads as done when it is not. One pull request's fix for two minor findings closed both and introduced four more, all in prose the fix added, including a claim about a workflow that runs on a trigger it does not declare. A loop that closes a target on the worker's word merges that.
|
|
19
|
+
|
|
20
|
+
## Must
|
|
21
|
+
|
|
22
|
+
- Enumerate the targets from the record the install writes, with the sweep as the fallback and its stated bound read before any count is trusted, since a hand census of this population was wrong in both directions at once
|
|
23
|
+
- Write the branch and the title from a fixed shape rather than leaving either to the dispatched session, since the settled convention reached none of four hand-driven repairs
|
|
24
|
+
- Carry one line in each target's body naming the toolkit as the source and where to change the content upstream, since a reader in that repository has no other route to the fact that a local edit is lost at the next wave
|
|
25
|
+
- Name no toolkit version in any target's body, since the install stamp in that target already records `syncedAt` and a sha256 per synced file and a version string is the copy that goes stale
|
|
26
|
+
- Dispatch one worker per target, with the branch checked as unclaimed in that target before the launch
|
|
27
|
+
- Branch from the clone that is current rather than from whichever the record names first, since a working copy answers what that machine last pulled rather than what the target holds
|
|
28
|
+
- Resolve who holds a branch before dispatching an addresser, and dispatch a fresh one only where the resolver reports the owning session gone
|
|
29
|
+
- Address every finding whatever its severity, and close a target only when a narrow re-review posts `## Review closed`
|
|
30
|
+
- Name a pull request URL on every line that reports a target, at dispatch and at hand-back both
|
|
31
|
+
- Close a wave by naming every target with its URL, review heading, CI state, and what is owed, the targets needing nothing included
|
|
32
|
+
|
|
33
|
+
## Must not
|
|
34
|
+
|
|
35
|
+
- Merge anything, in either role, at any size. The operator holds that gate over every role rather than as a setting on a wave.
|
|
36
|
+
- Reimplement what `aitk targets list`, `aitk targets pulls`, or `aitk sessions list --repository` already answers. Each is a shipped verb this body reads under `AITK_NON_INTERACTIVE=1`.
|
|
37
|
+
- Restate the in-target diagnosis and routing that `aitk-operator` owns, or the review, address, and worktree procedures the three skills named below own
|
|
38
|
+
- Read or write this repository's task board. The board is `claude-orchestrate`'s subject and a wave is not a row on it.
|
|
39
|
+
- Bound the review and address loop with a count. The bound was declined with its failure mode stated, and what guards the loop is the orchestrator reviewing every round itself.
|
|
40
|
+
- Edit a managed file in a target by hand rather than through the `aitk` verb that owns it
|
|
41
|
+
- Be a skill nothing invokes but its author typing the name. Nothing else routes to it, since it carries `disable-model-invocation: true` and no sibling body names it, so a wave that only ever runs when somebody types the name is the signal that the loop never replaced the hand-driven pass it was built against.
|
|
42
|
+
|
|
43
|
+
## Guards
|
|
44
|
+
|
|
45
|
+
- `gh` absent: stop, since no target's pull request can be read or opened
|
|
46
|
+
- The target index reads as unknown with no sweep behind it: stop and name the reason, rather than reporting a population of zero
|
|
47
|
+
- The claim check refuses or comes back with either readability flag false: treat the target as unverified rather than clear and hand it to the operator
|
|
48
|
+
- Every clone of a target is behind its remote: refuse that target rather than branching from a stale base
|
|
49
|
+
- More than one session holds a target's branch: report the ambiguity and stop, rather than sending findings to whichever row came first
|
|
50
|
+
|
|
51
|
+
## Out of scope
|
|
52
|
+
|
|
53
|
+
- This repository's own board, queue, and worker dispatch, which `claude-orchestrate` holds
|
|
54
|
+
- The role a session building one branch under one plan in this repository takes, which `claude-worker` holds. A rollout worker does not take it, since that body resolves session scratch against a main worktree root a target does not carry.
|
|
55
|
+
- Entering the worktree, which `claude-worktree` owns, including the branch collision tests it runs before entry
|
|
56
|
+
- Diagnosing what a target is behind on and routing each finding to its command, which `aitk-operator` owns
|
|
57
|
+
- Posting a review to a pull request and moving its heading, which `claude-pr-review` owns
|
|
58
|
+
- Answering a posted review inside the target, which `claude-address-review` owns
|
|
59
|
+
- The commit and the pull request mechanics, which the `git-*` family owns
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aitk-rollout
|
|
3
|
+
description: Takes one toolkit change out to every consuming project and brings each to a mergeable pull request. Carries an orchestrator role that enumerates the targets, dispatches a worker into each, reviews every pull request, and routes what each review posts, and a worker role that builds inside one target and answers its review. Use when asked to "roll this out to the targets", "take this change to every project", "run a rollout wave", "update the consuming projects", or when a session was dispatched into a target by a wave. Do NOT use for this repository's own board, which is `claude-orchestrate`, and merge nothing.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Aitk rollout
|
|
8
|
+
|
|
9
|
+
This skill runs outward. Every other skill for operating on a target assumes the session already sits inside it, and this one starts in the toolkit and reaches the projects the toolkit installed into.
|
|
10
|
+
|
|
11
|
+
One wave takes one toolkit change to every target and ends with a pull request per target for a person to merge. Two roles carry three phases over one target list. The orchestrator enumerates, dispatches, reviews, and routes. The worker holds one target from the worktree entry to the merge of the branch it opened.
|
|
12
|
+
|
|
13
|
+
`claude-orchestrate` owns this repository's own board and is a different subject. Read nothing from `.claude/tasks/` here and write nothing to it.
|
|
14
|
+
|
|
15
|
+
## Take a role before anything else
|
|
16
|
+
|
|
17
|
+
- The invocation or the launch prompt names the worker role, a target path, or both: worker. Skip to `## The worker role` and run no phase above it.
|
|
18
|
+
- Neither is named: orchestrator. Run the three phases in order.
|
|
19
|
+
|
|
20
|
+
The role is read off the prompt because nothing else carries it. A dispatched worker starts in the target's own checkout, which is a repository like any other from the session's side, so a test on the working directory answers the same for a worker in a target and an operator who invoked this from one. Reading the role wrong in that direction starts a second wave from inside a consuming project, which is why the dispatch below names the role and the path both rather than relying on either alone.
|
|
21
|
+
|
|
22
|
+
Do not invoke `aitk:claude-worker` from either role. That body states the role for a session building one branch under one plan in this repository, and it resolves session scratch against a main worktree root a target does not carry, so a rollout worker reading it hunts for a plan nobody wrote.
|
|
23
|
+
|
|
24
|
+
## Guards
|
|
25
|
+
|
|
26
|
+
- `gh` absent from the path: stop. `❌ gh is not installed, so no target's pull request can be read or opened.`
|
|
27
|
+
- `aitk targets list` refuses, or reports the index as unknown with no `--sweep` behind it: stop and name the reason. A count of zero taken from an index nothing read is a confident wrong answer.
|
|
28
|
+
- Read a record's own `reason` field rather than a command's exit status. An operator's shell profile may wrap `aitk` in a function whose status comes from a trailing command, which reports every refusal as success.
|
|
29
|
+
- Neither role merges anything, at any size and with no proportionality exception. A wave ends by handing the operator a list to merge from, and merging is the one act only they perform.
|
|
30
|
+
|
|
31
|
+
## The fixed shape every target receives
|
|
32
|
+
|
|
33
|
+
Every target in every wave takes the same branch and the same title, written from here rather than chosen per session. Four hand-driven repairs produced four titles across two scopes, neither of them this one, and three named the toolkit in the half of the shape that withholds it.
|
|
34
|
+
|
|
35
|
+
- Branch: `chore/agents`, in every target and every wave.
|
|
36
|
+
- Title: `chore(agents): <what changed in that target>`.
|
|
37
|
+
- Body: the sections `${CLAUDE_SKILL_DIR}/../../standards/pr.md` fixes, describing what that target received.
|
|
38
|
+
- Body, one line: name this toolkit as the source of the changed files and where to change the content upstream. A reader in that repository months later has no other route to the fact that these files are toolkit-managed and that a local edit is lost at the next wave.
|
|
39
|
+
- Body, no version number anywhere in it. `${CLAUDE_SKILL_DIR}/../../standards/versioning.md` permits a semver tag only where the pull request cuts a release, and `.claude/aitk/config.json` in the target already records `syncedAt` and a sha256 per synced file. A version in the body is a second copy of a fact the target holds canonically, and it is the copy that goes stale while the pull request sits open.
|
|
40
|
+
|
|
41
|
+
The title withholds the source and the body supplies it, because the two have different audiences. `agents` says what changed without saying where it came from, which is what a target's own history wants, and the source line is for a reader inside that repository rather than for whoever merges.
|
|
42
|
+
|
|
43
|
+
One branch name across every target is also what lets the return leg resolve. `aitk sessions list --branch chore/agents --repository <clone>` answers about that project rather than the working one, and a branch each session named for itself gives that read nothing to match.
|
|
44
|
+
|
|
45
|
+
## Phase 1: enumerate and dispatch
|
|
46
|
+
|
|
47
|
+
### Read the population
|
|
48
|
+
|
|
49
|
+
1. Pin the wave. Record the commit of this repository that the wave carries and name it in this session's own reports. Name it in no target's body.
|
|
50
|
+
2. Enumerate. Run `aitk targets list --json` under `AITK_NON_INTERACTIVE=1`, adding `--sweep <root...>` to reach targets installed before the index existed. Read the `bound` object back before treating any count as the population, since it names the roots walked, the depth, where the walk stopped, and what it could not read. The bound a sweep can never state is the machine, so a target on another one sits outside every answer it gives.
|
|
51
|
+
3. Pick the clone that is current. A row carries every checkout of that project under `paths` and leads with the one a sync ran in, which records where an install happened rather than what the checkout holds today. Fetch each candidate, compare it against the origin's default branch, and dispatch into one that is level. Refuse one that is behind rather than branching from a stale base, since three clones read as still owing the repair in one census and every one of them was behind its remote and nothing else.
|
|
52
|
+
|
|
53
|
+
### Check, then dispatch
|
|
54
|
+
|
|
55
|
+
4. Check the branch is unclaimed in that target. Run `aitk sessions list --branch chore/agents --repository <clone> --json` and read `claimed` off the record.
|
|
56
|
+
- `claimed: true`: something already holds it. Report what does, `worktree` when it names a path, `sessions` when it carries a row, and `refs` when the branch already exists, then leave that target out of the wave rather than colliding.
|
|
57
|
+
- `claimed: false` with `sessionsReadable` and `refsReadable` both true: dispatch.
|
|
58
|
+
- Anything else, a refusal or a record carrying no `claimed` key included: treat the target as unverified rather than clear, name which reading could not be taken, and hand it to the operator to launch by hand. Dispatching on a check that could not be read reproduces the collision the check exists to prevent.
|
|
59
|
+
5. Dispatch one worker per target, one session each.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
cd <clone> && claude --bg --model <model> -n "rollout-<target>" "Run /aitk:aitk-rollout in the worker role against the target at <clone>. <what the wave carries>"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`--bg` returns immediately, `-n` sets the name that separates a wave's worker from an operator's own launch in the roster, and `--model` overrides the inheritance that otherwise spends this session's model on every worker. Keep the `rollout-` prefix.
|
|
66
|
+
|
|
67
|
+
Running the targets in turn is the alternative and it puts every target's diff through one session's context. A wave's spend scales with the target count instead, and nothing caps it, so weigh the count before widening rather than after.
|
|
68
|
+
|
|
69
|
+
Report each dispatch by naming the target, the clone, the branch, the model, and the session name. Carry the pull request URL into every later report from the moment its worker announces one.
|
|
70
|
+
|
|
71
|
+
## Phase 2: review every pull request
|
|
72
|
+
|
|
73
|
+
1. Poll. Run `aitk targets pulls --json`, naming the wave's clones as arguments to read those alone. A target comes back as `read` with a `pulls` array or as `refused` with a `reason`, and a refusal is not a target with no work. Reading a failed query as no open work reports a target as done having read nothing.
|
|
74
|
+
2. Review here, in this session. Invoke `aitk:claude-pr-review` and redirect every call that body makes, since it resolves a pull request from the repository the session stands in and this session stands in the toolkit. Every call takes a redirect, and the ones that silently answer about the wrong repository are worse than the ones that fail:
|
|
75
|
+
- `--repo <owner>/<name>` on `gh pr view`, `gh pr diff`, and `gh pr review`, where it is a global flag.
|
|
76
|
+
- `-C <clone>` on `git fetch origin pull/<n>/head`, `git merge-base`, `git diff`, `git log`, `git show`, and `git grep`.
|
|
77
|
+
- `GH_REPO=<owner>/<name>` on any `gh api repos/{owner}/{repo}/...` call, which is the close-out route. `gh api` takes no `--repo` flag and fills those placeholders from the working directory or from that variable, so the one call a flag cannot redirect is the one that edits a review in place.
|
|
78
|
+
- That project's own root file, rules, and context, read from under the clone.
|
|
79
|
+
|
|
80
|
+
A missed redirect reports rather than fails. A pass that redirects the `gh` half and leaves a `git` call alone reads this repository's history against a target's diff and reports a delta, which is a finding nobody can trace back to the call that produced it.
|
|
81
|
+
|
|
82
|
+
This session wrote none of these diffs, so reviewing them costs nothing in independence.
|
|
83
|
+
|
|
84
|
+
3. Dispatch a reviewer into the target when a diff is too large for this session to hold. That is the fallback rather than the default. Dispatching one per target was measured and what it saved was reading four diffs, not reading four sets of findings, and that second half reaches this session either way, since routing a finding back means composing the brief from it.
|
|
85
|
+
4. Read the heading each pass posted. `aitk targets pulls` reports `review` as `open`, `closed`, or `null` when no pass has landed, and reports `reviewReadable` as `false` when the query failed, which leaves `review` covering nothing.
|
|
86
|
+
|
|
87
|
+
## Phase 3: route every finding and close each target
|
|
88
|
+
|
|
89
|
+
1. Address every finding whatever its severity. A minor is a finding, and a reviewer calling one non-blocking does not close the pass that raised it.
|
|
90
|
+
2. Resolve who holds the branch before dispatching anybody. Run `aitk sessions list --branch chore/agents --repository <clone> --json` and read the count rather than the first row.
|
|
91
|
+
- A live session holds it: send that session the findings and name `aitk:claude-address-review` for it to run, which is step 6 of `## The worker role` and the step that session already stands at. Never name this skill in that message. This body carries `disable-model-invocation: true`, which blocks the `Skill` tool rather than only suppressing an auto-trigger, and a session acting on an inbound message reaches a skill that way and no other, so a message naming this one halts the address leg with the branch built and the findings unread. A launch prompt is the one route to a flagged body, which is why the dispatch above names this skill and this message must not. Assuming the worker was gone is what one hand-driven pass got wrong. All four sessions that opened those pull requests were still alive holding their worktrees hours later, and of two fresh addressers sent over them, one refused on the worktree lock and one cut a second worktree on the same branch, which would have put two sessions pushing to one ref.
|
|
92
|
+
- No live session holds it: dispatch a fresh worker into that clone and brief it with the findings, since it holds none of the reasoning behind the diff.
|
|
93
|
+
- More than one row: report the ambiguity and stop rather than picking among candidates.
|
|
94
|
+
3. Re-review when the answer lands, scoped to the commits added since. A worker's reply never closes a target. One fix for two minor findings closed both and introduced four more, every one of them in prose that fix added, and a loop trusting the reply merges that.
|
|
95
|
+
4. A target leaves the wave when a pass posts `## Review closed` and not before.
|
|
96
|
+
5. Run until every target closes. No count bounds the loop. What guards it is this session reviewing every round itself, so it holds what each pass found and can see a target failing to converge, where a dispatched reviewer reads one pass and knows nothing of the one before it. A worker introducing a finding per fix has nothing mechanical stopping it, which is accepted rather than overlooked.
|
|
97
|
+
|
|
98
|
+
## The worker role
|
|
99
|
+
|
|
100
|
+
One session, one target, from the worktree entry to the merge of the branch it opened. It diagnoses, implements, opens the pull request, and answers what the review posts. It reviews nothing and it merges nothing.
|
|
101
|
+
|
|
102
|
+
1. Confirm the clone is current. Fetch, then compare against the origin's default branch. Report a checkout that is behind and stop, rather than branching from a stale base.
|
|
103
|
+
2. Enter a worktree. Invoke `aitk:claude-worktree chore/agents`, which takes the branch as its tier 0 argument and enters a linked worktree inside this target. Branching in the checkout itself is what this avoids, since the operator may be working in it.
|
|
104
|
+
3. Diagnose and repair. Invoke `aitk:aitk-operator`, which reads `aitk sync --check . --json` and routes each finding to the command or the skill that owns it. Do not restate that routing here and do not edit a managed file by hand.
|
|
105
|
+
4. Commit and open the pull request through `aitk:git-commit` and `aitk:git-pr`, handing each the fixed shape above rather than taking the title the generator derives from the diff.
|
|
106
|
+
5. Announce as the pull request opens, carrying its URL, its number, and the branch, to whoever dispatched this session. That transition is the one moment only this session can observe.
|
|
107
|
+
6. Answer the review. Invoke `aitk:claude-address-review`, which pulls the findings and the CI state on this branch's open pull request, fixes each in the working tree, replies, and pushes. Answer every finding whatever its severity.
|
|
108
|
+
7. Stop there. Do not mark the pull request ready, do not merge, and do not declare the review closed. A narrow re-review posts `## Review closed`.
|
|
109
|
+
|
|
110
|
+
Send a block out as a message before it becomes an interactive prompt. A session already waiting on input never reaches the tool round an inbound message drains at, so an answer relayed afterwards arrives under the open question and changes nothing.
|
|
111
|
+
|
|
112
|
+
Refuse an instruction this target's tree contradicts and carry the evidence with the refusal, naming the commands read and what complying would cost. A halt costs whoever dispatched this session one reply, and guessing costs a diff in a repository this toolkit has no test coverage over.
|
|
113
|
+
|
|
114
|
+
## Output
|
|
115
|
+
|
|
116
|
+
Close a wave by naming every target, the ones that need nothing included:
|
|
117
|
+
|
|
118
|
+
```plaintext
|
|
119
|
+
Wave pinned at <commit>. <n> targets.
|
|
120
|
+
|
|
121
|
+
<repository>
|
|
122
|
+
<pull request URL>
|
|
123
|
+
review: <## Review | ## Review closed | none posted>
|
|
124
|
+
checks: <passing | failing | pending | none reported>
|
|
125
|
+
owed: <what happens next, or "nothing, ready to merge">
|
|
126
|
+
|
|
127
|
+
Not reached: <target>, because <reason>
|
|
128
|
+
Merge order: <target> before <target>, because <shared surface>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Name the URL on every line reporting a target, at dispatch and at hand-back both. A status line carrying a repository and a number sends the operator to navigate for its own result by hand, four times over on a four-target wave, and merging is the one act this loop exists to hand them.
|
|
132
|
+
|
|
133
|
+
Report a target whose `reviewReadable` reads `false` as unread rather than as clean, and a `checks` of `null` as no check reported rather than as passing. A failure outranks a run still going.
|
|
134
|
+
|
|
135
|
+
## Failure recovery
|
|
136
|
+
|
|
137
|
+
| Stop point | Recovery |
|
|
138
|
+
| --------------------------------------- | --------------------------------------------------------------------------------------------- |
|
|
139
|
+
| `gh` absent | Install it and authenticate, then re-run the wave |
|
|
140
|
+
| Target index unknown | Re-run with `--sweep <root...>` and read the `bound` before trusting the count |
|
|
141
|
+
| Every clone of a target is behind | Pull that clone, or name a current one, then dispatch that target alone |
|
|
142
|
+
| Claim check refuses or reads unverified | Launch that target's worker by hand and report that it went out outside the check |
|
|
143
|
+
| Branch already claimed in a target | Resolve what holds `chore/agents` there, then dispatch that target alone |
|
|
144
|
+
| A target refuses the pull read | Read the `reason`, repair it, and re-poll that target. Never record it as having no work |
|
|
145
|
+
| Diff too large to review here | Dispatch a reviewer into that clone and route its findings back through Phase 3 |
|
|
146
|
+
| Two sessions hold one branch | Report both and stop. Sending findings to either puts two sessions on one ref |
|
|
147
|
+
| A target fails to converge | Stop that target's loop, report the rounds it took and what each pass found, and hand it over |
|
package/docs/ai-workflow.md
CHANGED
|
@@ -268,6 +268,7 @@ This section is the corpus the coverage claim is measured against: every name `a
|
|
|
268
268
|
| `aitk:migration-standards-drop` | When the project still holds an installed `.claude/standards/` tree |
|
|
269
269
|
| `aitk:aitk-feedback-file` | When something in the toolkit is broken, missing, or off |
|
|
270
270
|
| `aitk:aitk-feedback-triage` | In the toolkit repo, to work through the open feedback issues |
|
|
271
|
+
| `aitk:aitk-rollout` | In the toolkit repo, to take one change out to every consuming project at once |
|
|
271
272
|
|
|
272
273
|
### Generate an artifact on demand
|
|
273
274
|
|
package/package.json
CHANGED
|
@@ -78,6 +78,14 @@ export const SETUP_CASES: readonly SkillCase[] = [
|
|
|
78
78
|
'Work through the open feedback issues on the toolkit repo one by one.',
|
|
79
79
|
expect: 'aitk-feedback-triage',
|
|
80
80
|
},
|
|
81
|
+
// The outbound direction is what separates this from the front door above.
|
|
82
|
+
// aitk-operator runs inside one project the session already stands in, and
|
|
83
|
+
// this reaches every project the toolkit installed into from the toolkit.
|
|
84
|
+
{
|
|
85
|
+
prompt:
|
|
86
|
+
'Take this change out to every project that installed the toolkit and get each one to a pull request.',
|
|
87
|
+
expect: 'aitk-rollout',
|
|
88
|
+
},
|
|
81
89
|
{
|
|
82
90
|
prompt:
|
|
83
91
|
"This project needs its own coding rule that the toolkit doesn't ship.",
|