arcane-cli 1.14.3 → 1.15.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 +4 -4
- package/dist/assets/.agents/skills/spell-parallel-workers/SKILL.md +6 -0
- package/dist/assets/.arcane/spells/spell-parallel-workers.md +312 -0
- package/dist/assets/.claude/commands/spell-parallel-workers.md +13 -0
- package/dist/assets/.github/prompts/spell-parallel-workers.prompt.md +10 -0
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ npm install -g arcane-cli # then: spell init
|
|
|
32
32
|
|
|
33
33
|
<div align="center">
|
|
34
34
|
|
|
35
|
-
**🔁 opinionated lifecycle** · **📜 <!--count:spells-->
|
|
35
|
+
**🔁 opinionated lifecycle** · **📜 <!--count:spells-->43<!--/count:spells--> spells** · **🤖 <!--count:agents-->12<!--/count:agents--> agents** · **⚖️ <!--count:governance-->25<!--/count:governance--> governance standards** · **📝 markdown-native** · **🔌 tested with Claude Code, GitHub Copilot and Codex · GitHub or Azure DevOps**
|
|
36
36
|
|
|
37
37
|
</div>
|
|
38
38
|
|
|
@@ -115,21 +115,21 @@ It isn't a prompt snippet — it's a full framework. Everything installs into yo
|
|
|
115
115
|
|
|
116
116
|
| Layer | What you get |
|
|
117
117
|
| --- | --- |
|
|
118
|
-
| 📜 **Spells** | **<!--count:spells-->
|
|
118
|
+
| 📜 **Spells** | **<!--count:spells-->43<!--/count:spells-->** prompt-driven workflows spanning the entire lifecycle — planning, architecture, implementation, testing, review, shipping, session management, and ops. |
|
|
119
119
|
| ⚖️ **Governance** | **<!--count:governance-->25<!--/count:governance-->** battle-tested standards as drop-in templates: git conventions, testing standards, CI/CD, threat model, ADR format, naming, security hardening, and more. |
|
|
120
120
|
| 🤖 **Agents** | **<!--count:agents-->12<!--/count:agents-->** ready-made agent personas with roles, clusters, and a gamified autonomy model — assign work and power levels per repo. |
|
|
121
121
|
| 🛠️ **CLI** | `spell init / add / update / status / uninstall` — install by profile or à la carte, and keep everything in sync as new versions ship. `spell report` turns a program's `PLAN.md` into a Show Report — a generated completion page — offline. |
|
|
122
122
|
|
|
123
123
|
<!-- arcane:start -->
|
|
124
124
|
<details>
|
|
125
|
-
<summary><b>📜 The full spell catalogue (
|
|
125
|
+
<summary><b>📜 The full spell catalogue (43)</b></summary>
|
|
126
126
|
|
|
127
127
|
**Session** — `open-session` · `close-session` · `commit-work` · `status` · `arcane-version`
|
|
128
128
|
**Capture** — `save-idea` · `todo` · `feedback` · `suggest-feature` · `document` · `verification-ledger` · `brainstorm` · `explain-concept`
|
|
129
129
|
**Delivery** — `create-pull-request` · `sync-pull-request` · `address-review`
|
|
130
130
|
**Review** — `review` · `review-batch`
|
|
131
131
|
**Planning** — `plan` · `architect` · `scope` · `product-review`
|
|
132
|
-
**Build** — `implement` · `test` · `full-cycle` · `bug` · `bump` · `dotnet-expert` · `security-review` · `ship` · `enchant` · `generate-bot-icons` · `make-discoverable` · `scry` · `eas-store-deploy` · `compliance` · `app-store-accounts`
|
|
132
|
+
**Build** — `implement` · `test` · `full-cycle` · `bug` · `bump` · `dotnet-expert` · `security-review` · `ship` · `enchant` · `generate-bot-icons` · `make-discoverable` · `scry` · `eas-store-deploy` · `compliance` · `app-store-accounts` · `parallel-workers`
|
|
133
133
|
**Docs** — `adopt-docs`
|
|
134
134
|
**Venture** — `summon-venture` · `manifest`
|
|
135
135
|
**Meta** — `present-arcane` · `check-drift`
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spell-parallel-workers
|
|
3
|
+
description: Use PROACTIVELY when a plan has several independent slices of work (disjoint files, shared-file edits that can be listed up front) that could be prepared in parallel by worker sessions and integrated in order by one orchestrator.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
This skill is the Arcane `spell-parallel-workers` spell. Read `.arcane/spells/spell-parallel-workers.md` and follow it as the complete workflow.
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Spell — Parallel Workers
|
|
3
|
+
description: Run one orchestrator session and several worker sessions. Workers each prepare one independent slice of work on a prep branch and leave a short note; the orchestrator owns the plan, the shared files, the merge order and every protocol step, and integrates each slice when the stack reaches it.
|
|
4
|
+
tagline: Split disjoint work across worker sessions
|
|
5
|
+
claude_description: Use PROACTIVELY when a plan has several independent slices of work (disjoint files, shared-file edits that can be listed up front) that could be prepared in parallel by worker sessions and integrated in order by one orchestrator.
|
|
6
|
+
argument-hint: 'Orchestrator: the plan and its slices (e.g. "batches 3-6 of the component conversion"). Worker: worker <path to the brief>'
|
|
7
|
+
agent: agent
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Executive Summary
|
|
11
|
+
|
|
12
|
+
- This spell lets one **orchestrator** session farm independent slices of a larger plan out to **worker** sessions, so the slices are prepared in parallel while the protocols run once, at the top of the stack.
|
|
13
|
+
- Workers do the work only. Each leaves a **prep branch** plus a short **note** in a shared notes folder and reports back. They never touch the shared files, the stack branches, a pull request, a pipeline or the docs.
|
|
14
|
+
- The orchestrator owns the plan, every shared file (version bump, changelog, decision records, progress and architecture notes, lint scope lists, counters), the merge order and every protocol step. When the stack reaches a slice it rebases the prep branch, applies the listed shared-file edits, runs the full checks and the reviews, fixes every finding, commits through `spell-commit-work` and opens the pull request. The operator approves and merges; the orchestrator never does.
|
|
15
|
+
- It produces a plan with a footprint comparison, one brief per worker, one note per slice, a slice ledger, and one pull request per slice.
|
|
16
|
+
- **Why:** parallel speed without every worker paying the token cost of the full protocols. The protocols are paid once per slice, by the session that owns the shared state.
|
|
17
|
+
- **Not this spell:** `spell-full-cycle` and `spell-implement` build a feature end to end in one workspace and serialize by default. `spell-review-batch` reviews many pull requests that already exist. Subagents inside one session are a different mechanism with a different cost model; this spell is for separate sessions with their own context and worktree.
|
|
18
|
+
|
|
19
|
+
```mermaid
|
|
20
|
+
flowchart TD
|
|
21
|
+
OP1["Operator<br/>approves plan and merge order"] --> ORCH["Orchestrator<br/>plan, shared files, merge order,<br/>every protocol"]
|
|
22
|
+
ORCH -->|"brief + worktree from stack tip"| W["Workers A, B, ...<br/>one per slice, in parallel"]
|
|
23
|
+
W -->|"prepares"| PB[("Prep branch<br/>per slice")]
|
|
24
|
+
W -->|"writes"| NOTES["One note per slice<br/>in the shared notes folder"]
|
|
25
|
+
W -.->|"report: READY, BLOCKED or PARTIAL"| ORCH
|
|
26
|
+
PB --> INT
|
|
27
|
+
NOTES --> INT
|
|
28
|
+
ORCH -->|"when the stack reaches the slice"| INT["Integrate<br/>rebase, shared-file edits, full checks,<br/>review, security review, pull request"]
|
|
29
|
+
INT --> OP2["Operator<br/>approves and merges"]
|
|
30
|
+
OP2 -.->|"next slice"| INT
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## When to use it, and when not to
|
|
36
|
+
|
|
37
|
+
Use it only when **every** precondition holds:
|
|
38
|
+
|
|
39
|
+
1. **Disjoint footprints.** No two slices touch the same file, and none depends on another slice's output to be written or tested.
|
|
40
|
+
2. **Shared-file edits are listable up front.** You can name every shared file and say, per slice, roughly which edit it will need (a counter to bump, a list entry to add, a section to extend). If you cannot predict them, a worker will discover them mid-run and stall.
|
|
41
|
+
3. **No shared sequences.** No migration numbers, generated indexes, lockfiles, fixture IDs or anything else where correctness depends on what another slice picked. Where one exists, the orchestrator allocates it (a range per slice in the brief) or the slices are not parallel.
|
|
42
|
+
4. **Each slice is a pull request on its own.** It can be reviewed, merged and reverted without the others.
|
|
43
|
+
5. **There is real work per slice.** A slice that takes less time to do than to brief is done by the orchestrator.
|
|
44
|
+
|
|
45
|
+
Do **not** use it for sequential work, tightly coupled work, one-file refactors, or a plan whose slices keep changing each other. Serialize instead (`spell-full-cycle`, `spell-implement`; ARC-028 R4 in `git-conventions.md`). This spell is the parallel case ARC-028 R4 leaves open: genuinely disjoint footprints.
|
|
46
|
+
|
|
47
|
+
Footprint overlap is cheap to find now and expensive to find at merge review. Step 0 makes you state the comparison; "they seemed unrelated" is not one.
|
|
48
|
+
|
|
49
|
+
## Roles
|
|
50
|
+
|
|
51
|
+
| Role | Does | Never does |
|
|
52
|
+
| --- | --- | --- |
|
|
53
|
+
| **Operator** | Approves the slice plan, the merge order and each commit; reviews and merges each pull request. | — |
|
|
54
|
+
| **Orchestrator** | Owns the plan, the shared files, the merge order and every protocol step (docs, changelog, version bump, review, security review, commit, pull request, pipeline, asking the operator). Starts workers, receives their reports, integrates slices. | Hand a shared file to a worker. Merge a pull request. |
|
|
55
|
+
| **Worker** | Does one slice in its own worktree, on its own prep branch. Leaves a note in the shared notes folder and reports back. | Touch a shared file, commit to a stack branch, push to a shared branch, open a pull request, queue a pipeline, write docs or a changelog entry, run the session or review protocols. |
|
|
56
|
+
|
|
57
|
+
One worktree per slice, cut from the current stack tip. The prep branch is its worker's exclusive territory until the worker reports (`agent-policies.md`, concurrency rule 1); the report is the hand-over to the orchestrator. A worker may use several agents inside its own worktree if they own disjoint files (universal agent rule 27: at most one agent per file); the worker reconciles them and answers for the one branch and one note it returns. A slice that needs separate branches is separate slices.
|
|
58
|
+
|
|
59
|
+
## Context files
|
|
60
|
+
|
|
61
|
+
- [governance/git-conventions.md](../../.arcane/governance/git-conventions.md) — branch naming (a prep branch takes the session form of the branch-naming rule, with the slice id as the parallel-subagent suffix), worktree rules (ARC-028), content-verified branch deletion. **If missing**, name each prep branch for what it holds (date, topic, slice id), never with a generated name, and delete only branches whose content is verified merged.
|
|
62
|
+
- [governance/agent-policies.md](../../.arcane/governance/agent-policies.md) — an orchestrator starts workers and names the target repository in every delegation; one agent owns a branch at a time (concurrency rule 1). **If missing**, apply the same rules.
|
|
63
|
+
- [governance/universal-agent-rules.md](../../.arcane/governance/universal-agent-rules.md) — rule 27 (review the diff, not the summary). **If missing**, do the same.
|
|
64
|
+
- The plan, and the shared files it names (`project.md`, `TODO.md`, `DECISIONS.md`, `CHANGELOG.md`, progress notes, whatever the repository uses). **If a file does not exist**, it is not a shared file for this run.
|
|
65
|
+
- `.arcane.json` `push_policy`, when present (absent means `open`, as in `spell-commit-work`'s push-policy check). Workers never push, except as Step 2 allows.
|
|
66
|
+
|
|
67
|
+
This spell works in a repository with none of these: everything it needs is in the plan you write in Step 1.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Orchestrator workflow
|
|
72
|
+
|
|
73
|
+
### Step 0 — Qualify the work
|
|
74
|
+
|
|
75
|
+
1. Read the plan or request. If it names fewer than two slices, stop: there is nothing to parallelize.
|
|
76
|
+
2. Check the five preconditions above. State the **footprint comparison** in your opening report: per slice, the file and directory globs it will touch; the pairwise intersection (expected empty); the shared sequences found (expected none, or an allocation).
|
|
77
|
+
3. If a precondition fails, say which, and either re-scope the slices until it holds or stop and recommend a serial run. Never launch workers on a plan you could not qualify.
|
|
78
|
+
|
|
79
|
+
### Step 1 — Write the plan
|
|
80
|
+
|
|
81
|
+
Write it where the orchestrator's own progress is tracked (and keep a copy in the shared notes folder). It holds:
|
|
82
|
+
|
|
83
|
+
| Field | Content |
|
|
84
|
+
| --- | --- |
|
|
85
|
+
| Stack and tip | The ordered chain of branches or pull requests, and the commit a worker branches from. |
|
|
86
|
+
| Shared files | The explicit list. Everything on it is orchestrator-only. |
|
|
87
|
+
| Slices | For each: id, goal, footprint globs, depends-on (normally none), the checks its worker runs, the shared-file edits it is expected to need, any allocated identifiers. |
|
|
88
|
+
| Merge order | The order slices reach the stack. |
|
|
89
|
+
| Notes folder | An absolute path **outside** the repository, so notes are never committed. If none was given, ask for one. |
|
|
90
|
+
|
|
91
|
+
### Step 2 — Ask the operator
|
|
92
|
+
|
|
93
|
+
Parallel sessions are the operator's call. Put one question to them, listing the slice plan and the merge order, and wait for a yes. Two things the plan settles at the same time:
|
|
94
|
+
|
|
95
|
+
- **Who commits.** Commit authority is not passed along in a brief: in an interactive session every commit needs the operator's exact approval of that diff (`spell-commit-work` step 4.5 and step 8), and no one else's response stands in for it. So by default a worker **leaves its changes uncommitted** on its prep branch (the branch exists, at the base) and the note says `UNCOMMITTED`; the orchestrator commits the slice at integration through `spell-commit-work`. A worker may commit on its prep branch only where that spell's authority table lets it — an autonomous context with validated authority, or a delegation the repository records (`agent-policies.md`, "Solo-Operator Delegation Records") — and then the brief names the delegation and requires the attribution trailers.
|
|
96
|
+
- **Pushing.** A worker never pushes. The one exception is a worker on a separate clone (for example a cloud session) that cannot share the local repository: the brief then names the single prep branch it may push and the remote, and only if `push_policy` allows it. Under `guarded`, ask the operator for that push now and say so in the brief; under `blocked`, there is no such worker.
|
|
97
|
+
|
|
98
|
+
### Step 3 — Start the workers
|
|
99
|
+
|
|
100
|
+
For each slice, create its worktree yourself from the stack tip named in the plan (`git worktree add <path> -b <prep branch> <tip commit>`), naming the branch in the session form of the branch-naming rule with the slice id in the suffix position, never a generated name; then start a session of its own in that path. Give it the **worker brief** (template below) as its first message. The brief is the only context the worker has, so it carries everything: footprint, off-limits list, authority, checks, note path, and the override below. Do not write "see the conversation".
|
|
101
|
+
|
|
102
|
+
The repository's own instructions may route a session to the open-session, commit and pull-request spells. The brief overrides that for the worker, and the worker says so on the record (universal agent rule 27).
|
|
103
|
+
|
|
104
|
+
Start only as many workers as you can integrate. Two to four is the usual range.
|
|
105
|
+
|
|
106
|
+
### Step 4 — While the workers run
|
|
107
|
+
|
|
108
|
+
Work your own part of the stack. Do not poll. The note's `Status:` line is the report: check the notes folder whenever you next take a turn, use the client's cross-session messaging where it has one, or have the operator relay the worker's `READY`, `BLOCKED` or `PARTIAL` line. A worker that cannot write the notes folder (a sandbox, a separate clone) puts the whole note in its final message and you save it there. Answer a worker's question once, in a message that names its slice. If the plan changes (a slice dropped, reordered, a shared file added), tell every affected worker and update the ledger.
|
|
109
|
+
|
|
110
|
+
### Step 5 — Receive and verify each report
|
|
111
|
+
|
|
112
|
+
A worker's report is a claim, not evidence. Before treating a slice as ready:
|
|
113
|
+
|
|
114
|
+
1. Read the note. If there is none, see **Failure cases**.
|
|
115
|
+
2. Compare the prep branch's actual changes (`git diff --name-status <base>...<prep>` for commits; for uncommitted work `git -C <worktree> status --porcelain --untracked-files=all`, which also lists new files) with the slice's footprint and with the note's file list. A file outside the footprint, or any shared file, is a defect: handle it as a failure case, do not integrate it.
|
|
116
|
+
3. Check the prep branch's changed files against every other reported slice for overlap.
|
|
117
|
+
4. Mark the slice `reported` in the ledger. Do not merge, rebase or run protocols yet; the slice waits for its turn in the merge order.
|
|
118
|
+
|
|
119
|
+
### Step 6 — Integrate when the stack reaches the slice
|
|
120
|
+
|
|
121
|
+
The integration checklist, one slice at a time, in merge order:
|
|
122
|
+
|
|
123
|
+
1. **Position.** Every slice before this one in the merge order has merged (or is the stack tip you are building on). Confirm the stack tip. Define "stack" once in the plan: a chain of branches whose pull requests each target the previous one, or the trunk with each slice rebased after the last merge.
|
|
124
|
+
2. **Take over the branch.** The worker has reported, so the prep branch is yours. Work in the worker's worktree (`git -C <path>`); do not remove it yet, since it may hold the `UNCOMMITTED` changes.
|
|
125
|
+
3. **Commit the worker's slice** if it is uncommitted, through `spell-commit-work` steps 1–8 only (staging, trailers, the operator's approval of the exact diff), recording the worker session in the message body. Stop before its push and pull-request steps: those belong to `spell-create-pull-request`, after the reviews.
|
|
126
|
+
4. **Rebase** the prep branch onto the current stack tip. A conflict in a file outside the slice's footprint is a plan violation; record it. Then **re-verify scope**: re-run the footprint comparison on the rebased branch.
|
|
127
|
+
5. **Apply the shared-file edits** the note lists. The note records the kind of each edit, not final numbers, because earlier slices have moved them: compute the version with `spell-bump` and write the changelog entry from the note's text; apply decision records, progress and architecture notes, lint scope lists and counters against the current tip. An edit the plan did not predict is a finding to record. Commit these separately from the worker's work, through `spell-commit-work` steps 1–8.
|
|
128
|
+
6. **Run the full checks** on the rebased tree — the repository's whole gate set, plus the slice's own checks from the plan, not the worker's summary of them. A worker's green result does not carry over a rebase.
|
|
129
|
+
7. **Review:** `spell-review`, then `spell-security-review`, on the slice's diff against the stack tip. Docs updates belong here too.
|
|
130
|
+
8. **Fix every finding.** Every review and security finding is fixed, or deferred only with the operator's say-so recorded; none is waved through because a worker "already checked". Commit the fixes, then re-run the checks and the reviews.
|
|
131
|
+
9. **Open the pull request** with `spell-create-pull-request`, head branch the prep branch, base as the plan's definition of the stack says. The body is yours: what the slice does, the checks you ran, the findings and how each was fixed. Include nothing from a worker's note that you did not verify.
|
|
132
|
+
10. **The operator approves and merges.** Report the pull request in the `Needs you` block. You never merge.
|
|
133
|
+
11. **After the merge:** mark the slice `merged`; remove the worker's worktree and delete the merged prep branch using the content-verified deletion procedure in `git-conventions.md`. Slices still waiting are rebased at their own turn (item 4), not now.
|
|
134
|
+
|
|
135
|
+
### Step 7 — Close out
|
|
136
|
+
|
|
137
|
+
When the last slice has merged or been dropped, update the ledger, record lessons about the plan (every predicted-versus-actual difference in shared-file edits, footprints and gates), and run `spell-close-session`.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Worker mode
|
|
142
|
+
|
|
143
|
+
A worker is not required to load this spell: the brief carries every rule it needs, which is what keeps the worker cheap. If a worker session does invoke it with `worker <brief path>`, it reads the brief and the **Worker rules** below and **ignores everything above**.
|
|
144
|
+
|
|
145
|
+
### Worker rules
|
|
146
|
+
|
|
147
|
+
0. Check the brief first. If it lacks any of the base commit, prep branch, footprint, off-limits list, authority, checks or note path, reply `BLOCKED <slice> brief-incomplete` and stop.
|
|
148
|
+
1. Do exactly the slice in the brief. Unrelated problems go in the note under Follow-ups; do not fix them.
|
|
149
|
+
2. Edit only files inside the footprint. Never edit a shared file, a lint scope list, a counter, a lockfile, a changelog, a decision record, a progress or architecture note or the version. If you need one, write the edit in the note (see **Failure cases**).
|
|
150
|
+
3. Work only on your prep branch, in your own worktree. Do not commit to or switch to a stack branch, push (unless the brief names the one prep branch you may push), open a pull request, queue a pipeline or write docs.
|
|
151
|
+
4. Do not run the session, commit, review or pull-request spells, even if the repository's instructions route you to them. Run the checks the brief lists, exactly as listed, and record each command, its result and when you ran it. If a check cannot run or fails, say so; never change a check so that it passes.
|
|
152
|
+
5. Leave your changes uncommitted unless the brief names the delegation that lets you commit; then commit on the prep branch only, with the attribution trailers the brief lists.
|
|
153
|
+
6. The universal rules still apply: no secrets in files or notes, no real organization, person or product names in anything written to a public repository, generic examples only.
|
|
154
|
+
7. Write the note, re-read your own diff against the footprint, then report back.
|
|
155
|
+
|
|
156
|
+
### Worker brief template
|
|
157
|
+
|
|
158
|
+
The orchestrator fills this in, one per slice, and sends it as the worker's first message.
|
|
159
|
+
|
|
160
|
+
```markdown
|
|
161
|
+
# Worker brief — <slice id>: <slice title>
|
|
162
|
+
|
|
163
|
+
You are a worker session for one slice of a larger plan. Do exactly this slice. Unrelated problems
|
|
164
|
+
go in your note as follow-ups; do not fix them.
|
|
165
|
+
|
|
166
|
+
## Where
|
|
167
|
+
- Repository: <repository path or name>
|
|
168
|
+
- Base: <stack tip branch> at commit <sha>
|
|
169
|
+
- Your worktree: <path>, on prep branch `<prep branch name, set by the orchestrator>`, cut from that base
|
|
170
|
+
- Notes folder (outside the repository): <absolute path>. Write your note to `<file name>`.
|
|
171
|
+
|
|
172
|
+
## Your slice
|
|
173
|
+
- Goal: <what the slice delivers, in two or three sentences>
|
|
174
|
+
- You may change: <footprint globs>. Nothing else.
|
|
175
|
+
- Read first / follow: <files, examples, conventions the slice must match>
|
|
176
|
+
- Identifiers allocated to you: <ranges or names; anything else is the orchestrator's, or "none">
|
|
177
|
+
|
|
178
|
+
## Off limits
|
|
179
|
+
Shared files, orchestrator only: <the explicit list from the plan>.
|
|
180
|
+
You do not: edit those files; commit to or switch to a stack branch; push to a shared branch; open a
|
|
181
|
+
pull request; queue a pipeline; write docs, changelog entries or decision records; run the session,
|
|
182
|
+
commit, review or pull-request spells. If this repository's instructions route you to any of those
|
|
183
|
+
spells, this brief overrides them for this session; say so on the record.
|
|
184
|
+
If you need an off-limits file, do not edit it. Write the edit you need in the note (its kind and
|
|
185
|
+
content, not final numbers) and keep going. If you cannot finish without it, stop and report BLOCKED.
|
|
186
|
+
|
|
187
|
+
## Authority
|
|
188
|
+
- Commits: <"Leave your changes uncommitted." or "You may commit on your prep branch only, under
|
|
189
|
+
delegation <id>, with these trailers: <list>.">
|
|
190
|
+
- Push: <"None." or "Prep branch only, to <remote>, because you run on a separate clone.">
|
|
191
|
+
|
|
192
|
+
## Checks to run
|
|
193
|
+
- <command> — expected: <result>
|
|
194
|
+
Run each as written. Record command, result and date in the note. If one cannot run or fails, say so.
|
|
195
|
+
|
|
196
|
+
## Done means
|
|
197
|
+
- The prep branch holds the slice; the note exists at the path above, in the template's shape; you
|
|
198
|
+
have re-read your diff against the footprint.
|
|
199
|
+
- If you cannot write the notes folder, put the whole note in your final message.
|
|
200
|
+
- Your final message starts with `READY <slice> <prep branch>`, `BLOCKED <slice> <prep branch>` or
|
|
201
|
+
`PARTIAL <slice> <prep branch>`, then the note path, then at most three lines of anything the
|
|
202
|
+
orchestrator must decide. Nothing else.
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Note template
|
|
206
|
+
|
|
207
|
+
The worker writes one per slice in the shared notes folder, named `YYYY-MM-DD-<topic-slug>-<slice>.md`.
|
|
208
|
+
|
|
209
|
+
```markdown
|
|
210
|
+
# Slice note — <slice id>: <slice title>
|
|
211
|
+
|
|
212
|
+
- Status: READY | BLOCKED | PARTIAL
|
|
213
|
+
- Prep branch: <name> Base: <sha> Commits: <n> | UNCOMMITTED
|
|
214
|
+
- Written: <date>
|
|
215
|
+
|
|
216
|
+
## Files changed
|
|
217
|
+
<`git diff --name-status` against the base. Flag any file outside the footprint.>
|
|
218
|
+
|
|
219
|
+
## Shared-file edits the orchestrator needs
|
|
220
|
+
| File | Exact edit | Why |
|
|
221
|
+
| --- | --- | --- |
|
|
222
|
+
| <path> | <the kind and content of the edit: the entry to add, the list to extend, the bump level; the orchestrator recomputes numbers at integration> | <what in the slice requires it> |
|
|
223
|
+
(None, if none.)
|
|
224
|
+
|
|
225
|
+
## Checks and results
|
|
226
|
+
| Command | Result | Run on |
|
|
227
|
+
| --- | --- | --- |
|
|
228
|
+
| <command> | <pass / fail / not run: reason, with counts or the failing output's first line> | <date> |
|
|
229
|
+
|
|
230
|
+
## Gate differences from the plan
|
|
231
|
+
<A check that needed to differ, an extra one that mattered, a count that does not match the plan. None, if none.>
|
|
232
|
+
|
|
233
|
+
## Decisions and deviations
|
|
234
|
+
<Anything done differently from the brief, and why.>
|
|
235
|
+
|
|
236
|
+
## Follow-ups (outside the slice)
|
|
237
|
+
<One line each.>
|
|
238
|
+
|
|
239
|
+
## Open questions for the orchestrator
|
|
240
|
+
<Only what blocks or changes integration.>
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Failure cases
|
|
246
|
+
|
|
247
|
+
| Case | What happens |
|
|
248
|
+
| --- | --- |
|
|
249
|
+
| **A worker needs a shared file** | The worker does not edit it. It writes the edit in the note's shared-file table and continues. If it truly cannot proceed (for example a lint scope list must include the new files before the check can run), it works around it locally without committing the workaround, or stops with `BLOCKED` and the exact question. The orchestrator then adds the edit to the plan and to the integration list, or re-scopes the slice. If it happens in more than one slice, the up-front list was incomplete: update the plan and tell the other workers. |
|
|
250
|
+
| **Two workers collide** | Found at Step 5 (overlapping changed files) or at rebase. The earlier slice in the merge order keeps the file; the later slice's overlapping hunk is redone on top of it, by the orchestrator when small, by a re-briefed worker when not. Record it as a plan error and serialize those two slices from now on. A collision on an identifier both picked is the same failure: counters belong to the orchestrator, so give each slice its own range. |
|
|
251
|
+
| **A prep branch goes stale** | The stack tip moved while the worker worked. Rebase at Step 6; re-run every check on the rebased tree. If the new tip changed files in the slice's footprint, that is a plan violation: if conflicts are small and inside the footprint, resolve them; otherwise start a new worker from the new tip with the old note attached. Never merge a result that was tested before the rebase. |
|
|
252
|
+
| **A slice's gates differ from the plan** | The worker records the difference under "Gate differences" and does not alter a gate to make it pass. The orchestrator runs the gates that actually apply at integration, updates the plan for the slices still waiting, and treats a gate that cannot pass without a shared-file change as the shared-file case. |
|
|
253
|
+
| **A worker went out of scope** (edited a shared file, committed to a stack branch, pushed, opened a pull request) | Do not integrate the out-of-scope parts: revert them on the prep branch, or discard the branch and restart the slice (discarding goes through the content-verified deletion procedure in `git-conventions.md`, after the operator confirms). Anything already outward-facing (a pushed shared branch, an open pull request) goes in the `Needs you` block for the operator to resolve. Record it so the next brief says the rule louder. |
|
|
254
|
+
| **No note, or the worker ended early** | Inspect the worktree read-only. Without a note the slice is unverified. (On a re-run, a slice marked `launched` with no note gets this check before anything is restarted, so a second worker never collides with the first one's branch.) Either write the note yourself from the diff, marked "written by the orchestrator from the diff", and verify the branch fully at Step 6, or restart the slice. Never integrate on a worker's chat summary alone. |
|
|
255
|
+
| **The orchestrator's checks fail where the worker's passed** | The orchestrator's result governs. Fix it at integration, or send the slice back with the failing output. |
|
|
256
|
+
| **The plan changes mid-run** | Message the affected workers with the change; a worker whose slice was dropped stops and reports. Update the ledger. |
|
|
257
|
+
| **The operator declines the plan** | Re-plan with what they accept, or fall back to a serial run. Do not start workers on a plan the operator has not approved. |
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## Output
|
|
262
|
+
|
|
263
|
+
The orchestrator keeps one ledger and updates it at every state change.
|
|
264
|
+
|
|
265
|
+
```markdown
|
|
266
|
+
| Slice | Worker session | Prep branch | State | Shared-file edits | Pull request |
|
|
267
|
+
| --- | --- | --- | --- | --- | --- |
|
|
268
|
+
| <id> | <session> | <branch> | planned / launched / reported / integrating / merged / dropped | <applied / pending / none> | <link or —> |
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Reporting
|
|
272
|
+
|
|
273
|
+
Every report the orchestrator ends a turn with leads with the ledger, then what changed since the last report, then any open failure case with the decision it needs.
|
|
274
|
+
|
|
275
|
+
<!-- fragment:needs-you:start -->
|
|
276
|
+
**Needs you — required operator actions.** When this run leaves an action that only the operator can take, and the work is not correct or complete until it is taken, report it in one block at the very top of the final report, before every other section and before any optional next step:
|
|
277
|
+
|
|
278
|
+
```markdown
|
|
279
|
+
## ⚠ Needs you
|
|
280
|
+
|
|
281
|
+
- <exactly what to do: the command, the link, or the question> — <why the agent cannot do it itself>
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
- **What belongs in it:** an action the work needs that only the operator can take — approving or merging a pull request, accepting a decision record, answering a question the work is waiting on, confirming a `guarded` push, running an interactive command such as `spell unblock-push`, or a step on an external platform the agent cannot reach. An optional suggestion, a next spell to run, or anything the agent could do itself is not a required action and stays out of the block.
|
|
285
|
+
- **One line per action.** Say exactly what to do, then, after the dash, why the agent cannot do it. Write the command, link or question out in full; never point elsewhere with "see above".
|
|
286
|
+
- **Never only among optional steps.** An action required for correctness is never listed only under next steps, suggestions, `Carry Forward` or `What's Next?`. It may be repeated there, but it always appears in this block.
|
|
287
|
+
- **Omit it when empty.** When nothing needs the operator, leave the block out entirely: no heading and no "None" line.
|
|
288
|
+
- **Every final report.** The block belongs in whatever report ends the run, including a report written when the spell stops early.
|
|
289
|
+
- Enforcement: explicitly advisory prose (ARC-023) — no check reads a spell's actual output for this block; it holds by these instructions alone.
|
|
290
|
+
<!-- fragment:needs-you:end -->
|
|
291
|
+
|
|
292
|
+
## Rules
|
|
293
|
+
|
|
294
|
+
- **The orchestrator owns the shared state.** Shared files, merge order and every protocol step belong to one session. Never hand a shared file to a worker "just this once": write the edit in the note and apply it yourself.
|
|
295
|
+
- **Qualify before launching.** Refuse to start workers until the five preconditions hold and the footprint comparison is stated. Refuse a plan with fewer than two slices.
|
|
296
|
+
- **The brief is the only context.** A worker has not seen this conversation; a brief that points at it is incomplete. A worker with an incomplete brief stops (Worker rule 0).
|
|
297
|
+
- **Review the diff, not the report.** A note describes what the worker intended. Read the prep branch's actual changes against the footprint before relying on it (universal agent rule 27).
|
|
298
|
+
- **Workers run no spell protocols.** Open and close session, commit, review, security review and pull request run once per slice, by the orchestrator, at integration. Every review finding is fixed.
|
|
299
|
+
- **Nothing outward-facing without the operator.** The plan in Step 2, the exact approval of every commit, `spell-create-pull-request` for the pull request, and the operator's own merge each gate one step. The orchestrator never merges.
|
|
300
|
+
- **Notes stay out of the repository.** The notes folder is outside it; do not commit a note. Briefs and notes carry no secrets and, in a public repository, no real organization, person or product names.
|
|
301
|
+
- **Re-run safe.** Running this spell again on the same plan reads the ledger and the notes folder and resumes at the first slice not yet `merged` or `dropped`.
|
|
302
|
+
|
|
303
|
+
## Acceptance checklist
|
|
304
|
+
|
|
305
|
+
- [ ] Five preconditions checked; footprint comparison stated; shared files and shared sequences listed.
|
|
306
|
+
- [ ] Operator approved the plan and the merge order before any worker started; every commit had the operator's exact approval.
|
|
307
|
+
- [ ] Each worker had its own worktree from the stack tip, a compliant prep branch name and a self-contained brief.
|
|
308
|
+
- [ ] No prep branch contains a file outside its footprint or on the shared-files list.
|
|
309
|
+
- [ ] Every slice has a note; every shared-file edit it listed was applied (or rejected with a reason) by the orchestrator.
|
|
310
|
+
- [ ] Checks, review and security review ran on the rebased tree; every finding is fixed; the pull request body states what was run.
|
|
311
|
+
- [ ] The operator, not a worker or the orchestrator, merged each pull request.
|
|
312
|
+
- [ ] The ledger is current and merged prep branches and their worktrees are removed.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Use PROACTIVELY when a plan has several independent slices of work (disjoint files, shared-file edits that can be listed up front) that could be prepared in parallel by worker sessions and integrated in order by one orchestrator.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Parallel Workers
|
|
6
|
+
|
|
7
|
+
Invoke the Arcane `spell-parallel-workers` spell workflow.
|
|
8
|
+
|
|
9
|
+
See the full prompt at `.arcane/spells/spell-parallel-workers.md` for the complete workflow definition.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
@.arcane/spells/spell-parallel-workers.md
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Spell — Parallel Workers
|
|
3
|
+
description: Run one orchestrator session and several worker sessions. Workers each prepare one independent slice of work on a prep branch and leave a short note; the orchestrator owns the plan, the shared files, the merge order and every protocol step, and integrates each slice when the stack reaches it.
|
|
4
|
+
tagline: Split disjoint work across worker sessions
|
|
5
|
+
claude_description: Use PROACTIVELY when a plan has several independent slices of work (disjoint files, shared-file edits that can be listed up front) that could be prepared in parallel by worker sessions and integrated in order by one orchestrator.
|
|
6
|
+
argument-hint: 'Orchestrator: the plan and its slices (e.g. "batches 3-6 of the component conversion"). Worker: worker <path to the brief>'
|
|
7
|
+
agent: agent
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
This prompt is the Arcane `spell-parallel-workers` spell. Read [`.arcane/spells/spell-parallel-workers.md`](../../.arcane/spells/spell-parallel-workers.md) and follow it as the complete workflow.
|
package/dist/index.js
CHANGED
|
@@ -1210,7 +1210,11 @@ var COMPONENTS = [
|
|
|
1210
1210
|
".arcane/spells/spell-app-store-accounts.md",
|
|
1211
1211
|
".github/prompts/spell-app-store-accounts.prompt.md",
|
|
1212
1212
|
".claude/commands/spell-app-store-accounts.md",
|
|
1213
|
-
".agents/skills/spell-app-store-accounts/SKILL.md"
|
|
1213
|
+
".agents/skills/spell-app-store-accounts/SKILL.md",
|
|
1214
|
+
".arcane/spells/spell-parallel-workers.md",
|
|
1215
|
+
".github/prompts/spell-parallel-workers.prompt.md",
|
|
1216
|
+
".claude/commands/spell-parallel-workers.md",
|
|
1217
|
+
".agents/skills/spell-parallel-workers/SKILL.md"
|
|
1214
1218
|
],
|
|
1215
1219
|
// spell-make-discoverable cites the first two for every EV-/WD- rationale;
|
|
1216
1220
|
// spell-eas-store-deploy and spell-compliance consume the last two
|