specrails-core 5.0.0 → 5.1.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 +103 -310
- package/bin/specrails-core.mjs +3 -1
- package/dist/installer/cli.js +4 -0
- package/dist/installer/cli.js.map +1 -1
- package/dist/installer/commands/framework.js +64 -49
- package/dist/installer/commands/framework.js.map +1 -1
- package/dist/installer/commands/init.js +102 -66
- package/dist/installer/commands/init.js.map +1 -1
- package/dist/installer/commands/update.js +80 -74
- package/dist/installer/commands/update.js.map +1 -1
- package/dist/installer/commands/v5-migration.js +14 -0
- package/dist/installer/commands/v5-migration.js.map +1 -1
- package/dist/installer/phases/framework-lifecycle.js +2 -0
- package/dist/installer/phases/framework-lifecycle.js.map +1 -1
- package/dist/installer/phases/scaffold.js +191 -258
- package/dist/installer/phases/scaffold.js.map +1 -1
- package/dist/installer/runtime/pipeline-state.js +801 -0
- package/dist/installer/runtime/pipeline-state.js.map +1 -0
- package/dist/installer/util/exec.js +6 -1
- package/dist/installer/util/exec.js.map +1 -1
- package/dist/installer/util/fs.js +11 -2
- package/dist/installer/util/fs.js.map +1 -1
- package/dist/installer/util/install-transaction.js +246 -0
- package/dist/installer/util/install-transaction.js.map +1 -0
- package/dist/installer/util/registry.js +20 -0
- package/dist/installer/util/registry.js.map +1 -1
- package/docs/ci-cd.md +57 -0
- package/docs/user-docs/codex-vs-claude-code.md +23 -151
- package/docs/user-docs/core-updates.md +70 -0
- package/docs/user-docs/provider-pipelines.md +53 -0
- package/integration-contract.json +179 -66
- package/package.json +5 -2
- package/templates/agents/sr-developer.md +9 -11
- package/templates/agents/sr-reviewer.md +26 -33
- package/templates/codex-skills/batch-implement/SKILL.md +58 -244
- package/templates/codex-skills/implement/SKILL.md +136 -338
- package/templates/codex-skills/rails/sr-architect/SKILL.md +7 -0
- package/templates/codex-skills/rails/sr-developer/SKILL.md +13 -0
- package/templates/codex-skills/rails/sr-reviewer/SKILL.md +39 -5
- package/templates/codex-skills/retry/SKILL.md +37 -117
- package/templates/commands/specrails/batch-implement.md +16 -288
- package/templates/commands/specrails/implement.md +62 -1057
- package/templates/commands/specrails/retry.md +22 -314
- package/templates/gemini-commands/batch-implement.toml +28 -40
- package/templates/gemini-commands/implement.toml +55 -114
- package/templates/gemini-commands/retry.toml +21 -0
- package/templates/kimi/specrails/run-skill.mjs +51 -2
- package/templates/runtime/provider-pipeline.md +55 -0
|
@@ -1,249 +1,63 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: batch-implement
|
|
3
|
-
description: "
|
|
3
|
+
description: "Implement the frozen batch in one OpenSpec change and journal, with aggregate verification, review and archive gates."
|
|
4
4
|
license: MIT
|
|
5
|
-
compatibility: "Codex-native
|
|
5
|
+
compatibility: "Codex-native root-level role delegation. One aggregate change per run; hosted worktrees stay under host ownership."
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
You
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
`ls .codex/skills/rails/`. Cache the set; you'll reuse it
|
|
65
|
-
for routing each ticket's developer + reviewer phase.
|
|
66
|
-
6. State (≤4 lines) which tickets you're processing, in what
|
|
67
|
-
mode, and the available rails.
|
|
68
|
-
|
|
69
|
-
### 1. Sequential pipeline (default)
|
|
70
|
-
|
|
71
|
-
For each ticket id in order, run the three-phase pipeline at
|
|
72
|
-
ROOT level (do NOT spawn `$implement` as a sub-agent — drive
|
|
73
|
-
the pipeline yourself):
|
|
74
|
-
|
|
75
|
-
#### 1.a Architect phase (per ticket)
|
|
76
|
-
|
|
77
|
-
- `spawn_agent` (full-history, no agent_type / model /
|
|
78
|
-
reasoning_effort).
|
|
79
|
-
- `send_message`:
|
|
80
|
-
|
|
81
|
-
> `$sr-architect`
|
|
82
|
-
>
|
|
83
|
-
> Ticket id: `<TICKET_ID>`
|
|
84
|
-
> Ticket title: `<TICKET_TITLE>`
|
|
85
|
-
>
|
|
86
|
-
> Read `jq '.tickets["<TICKET_ID>"]' .specrails/local-tickets.json`
|
|
87
|
-
> for the full ticket. Follow the `$sr-architect` skill
|
|
88
|
-
> instructions exactly.
|
|
89
|
-
|
|
90
|
-
- `wait_agent`. Parse reply for the plan path. `close_agent`.
|
|
91
|
-
- Open the plan + design.md.
|
|
92
|
-
- If the architect returned `BLOCKED: …`, mark this ticket
|
|
93
|
-
as failed for the batch report and **continue to the next
|
|
94
|
-
ticket** — do not stop the batch.
|
|
95
|
-
|
|
96
|
-
#### 1.b Developer phase (per ticket)
|
|
97
|
-
|
|
98
|
-
One developer rail. Unless a profile routes the ticket to a
|
|
99
|
-
listed `custom-*` developer, spawn `$sr-developer`.
|
|
100
|
-
|
|
101
|
-
- `spawn_agent`. `send_message`:
|
|
102
|
-
|
|
103
|
-
> `$sr-developer`
|
|
104
|
-
>
|
|
105
|
-
> Ticket id: `<TICKET_ID>`
|
|
106
|
-
> Plan: `<PLAN_PATH>`
|
|
107
|
-
>
|
|
108
|
-
> Follow the `$sr-developer` skill instructions exactly.
|
|
109
|
-
|
|
110
|
-
- `wait_agent`. Capture file list. `close_agent`.
|
|
111
|
-
- If `BLOCKED: …` → mark ticket as failed in the batch report
|
|
112
|
-
and move to next ticket.
|
|
113
|
-
|
|
114
|
-
#### 1.c Reviewer phase (per ticket)
|
|
115
|
-
|
|
116
|
-
Spawn the single `$sr-reviewer` — it covers correctness, tests,
|
|
117
|
-
security, and performance. `wait_agent`, then `close_agent`.
|
|
118
|
-
|
|
119
|
-
Verdict (same matrix as `$implement`):
|
|
120
|
-
|
|
121
|
-
- `clean` — every reviewer ≥70, no fix/blocked verdicts.
|
|
122
|
-
- `fix needed` — any "fix needed", OR score <70 with no
|
|
123
|
-
blocked, OR blocked with score 30-69 (recoverable case).
|
|
124
|
-
- `blocked` — blocked with score <30, OR all reviewers blocked.
|
|
125
|
-
|
|
126
|
-
#### 1.d Optional fix loop (single pass per ticket)
|
|
127
|
-
|
|
128
|
-
If the verdict is `fix needed`, run ONE follow-up developer
|
|
129
|
-
pass with the reviewer's issues list, then re-run the
|
|
130
|
-
reviewer set. If still `fix needed` or `blocked`, do NOT
|
|
131
|
-
loop again — record the failure in the batch report and
|
|
132
|
-
continue.
|
|
133
|
-
|
|
134
|
-
#### 1.e Close the ticket (per ticket)
|
|
135
|
-
|
|
136
|
-
If the final verdict is `clean`:
|
|
137
|
-
- Update `.specrails/local-tickets.json` — set
|
|
138
|
-
`tickets["<ID>"].status = "done"`, bump `revision`, set
|
|
139
|
-
`updated_at` to `date -Iseconds`. Preserve every other
|
|
140
|
-
field.
|
|
141
|
-
|
|
142
|
-
If the verdict is `fix needed` or `blocked`:
|
|
143
|
-
- Leave status as `todo`. Still bump `revision` and set
|
|
144
|
-
`updated_at` so the file reflects the run. Record the
|
|
145
|
-
blocker in the batch report's Follow-up section.
|
|
146
|
-
|
|
147
|
-
**Important**: only YOU (the root orchestrator) ever writes
|
|
148
|
-
to `.specrails/local-tickets.json`. None of the sub-agents
|
|
149
|
-
(architect, developer, reviewer) should touch it — the rail
|
|
150
|
-
skills already enforce that on their side.
|
|
151
|
-
|
|
152
|
-
### 2. Parallel pipeline (opt-in via `--parallel`)
|
|
153
|
-
|
|
154
|
-
When the user passed `--parallel`:
|
|
155
|
-
|
|
156
|
-
a. **Pre-spawn architect-only pass**. For each ticket, spawn
|
|
157
|
-
`$sr-architect` in parallel via `spawn_agents_on_csv`
|
|
158
|
-
(cap at 10 concurrent). Wait for each to produce its
|
|
159
|
-
`tasks.md` + plan path.
|
|
160
|
-
b. **Disjoint-file check**. Collect every file path mentioned
|
|
161
|
-
across all `tasks.md` files. If ANY file appears in more
|
|
162
|
-
than one ticket's list, abort parallel mode for the
|
|
163
|
-
overlapping tickets — process them sequentially after the
|
|
164
|
-
non-overlapping batch. State in your reply which tickets
|
|
165
|
-
were re-routed and why.
|
|
166
|
-
c. For the non-overlapping tickets, run their developer +
|
|
167
|
-
reviewer phases (and optional fix-loop) in parallel
|
|
168
|
-
per-ticket. Each ticket is still a sequence
|
|
169
|
-
internally — only the outer per-ticket processing is
|
|
170
|
-
concurrent.
|
|
171
|
-
|
|
172
|
-
The safety net exists because two developer pipelines editing
|
|
173
|
-
the same file would race. If unsure, fall back to sequential.
|
|
174
|
-
|
|
175
|
-
### 3. Aggregate the batch
|
|
176
|
-
|
|
177
|
-
For each ticket, collect:
|
|
178
|
-
|
|
179
|
-
- `ticket_id`
|
|
180
|
-
- `verdict`: `done` | `todo` | `blocked` | `arch_blocked`
|
|
181
|
-
- `score`: overall (or `n/a` if no reviewer ran)
|
|
182
|
-
- `plan_path`, `confidence_path` (omit if `n/a`)
|
|
183
|
-
- `files_changed`: list (or `n/a`)
|
|
184
|
-
- `tests_summary`, `build_summary`
|
|
185
|
-
- Any Follow-up bullets
|
|
186
|
-
|
|
187
|
-
### 4. Report
|
|
188
|
-
|
|
189
|
-
Print ONE consolidated summary (≤30 lines for typical
|
|
190
|
-
batches):
|
|
191
|
-
|
|
192
|
-
```
|
|
193
|
-
batch-implement — <N> tickets attempted
|
|
194
|
-
|
|
195
|
-
Outcomes:
|
|
196
|
-
done: #<id> #<id> ...
|
|
197
|
-
todo: #<id> (reason: …) ...
|
|
198
|
-
blocked: #<id> (reason: …) ...
|
|
199
|
-
|
|
200
|
-
Per-ticket details:
|
|
201
|
-
#<id> → <verdict> (score <N>/100)
|
|
202
|
-
plan: <path>
|
|
203
|
-
confidence: <path>
|
|
204
|
-
files: <count> (<one path>, +N more)
|
|
205
|
-
tests: <pass/fail summary>
|
|
206
|
-
|
|
207
|
-
Aggregate stats:
|
|
208
|
-
Files touched: <total unique count>
|
|
209
|
-
Tests run: <total>, pass <count>, fail <count>
|
|
210
|
-
Build: <count where ran, count ok, count failed>
|
|
211
|
-
|
|
212
|
-
Follow-up across batch:
|
|
213
|
-
- <bullet> (#<id>)
|
|
214
|
-
- ...
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
If every ticket ended in `done`, also print:
|
|
218
|
-
|
|
219
|
-
```
|
|
220
|
-
✓ Batch complete: <N>/<N> tickets done.
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
If some ended in `todo` or `blocked`, finish with the
|
|
224
|
-
re-launch hint:
|
|
225
|
-
|
|
226
|
-
```
|
|
227
|
-
Re-run with: $batch-implement #<id> [#<id> ...] --yes
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
## What you must NOT do
|
|
231
|
-
|
|
232
|
-
- **Do NOT spawn `$implement` as a sub-agent** to handle a
|
|
233
|
-
ticket. Drive the architect/developer/reviewer pipeline
|
|
234
|
-
yourself, at depth 1 (root → role-skill). Nested spawning
|
|
235
|
-
at depth 2 drops phases silently and produces "done"
|
|
236
|
-
tickets with no confidence artefact.
|
|
237
|
-
- **Do NOT pass `agent_type`, `model`, or `reasoning_effort`**
|
|
238
|
-
to `spawn_agent` on full-history forks.
|
|
239
|
-
- **Do NOT proceed in parallel mode** without the
|
|
240
|
-
disjoint-file check.
|
|
241
|
-
- **Do NOT exceed 10 parallel sub-agents** in one fan-out.
|
|
242
|
-
- **Do NOT do speculative work** (sed/find/grep/etc.) while
|
|
243
|
-
a sub-agent is running. Wait silently for `wait_agent`.
|
|
244
|
-
- **Do NOT touch `.claude/agent-memory/`** — codex projects
|
|
245
|
-
use `.specrails/agent-memory/`.
|
|
246
|
-
- **Do NOT skip a phase**. Every ticket gets architect →
|
|
247
|
-
developer → reviewer (+ fix loop if needed). A ticket
|
|
248
|
-
reported as "done" without a confidence artefact is a
|
|
249
|
-
contract violation.
|
|
8
|
+
You coordinate one batch run. Explicit #IDs retain their order; filters resolve
|
|
9
|
+
against the shared backlog. Freeze the full ticket descriptions, acceptance criteria
|
|
10
|
+
and repository IDs once. With host context use its complete specs unchanged.
|
|
11
|
+
|
|
12
|
+
Initialize ONE stable aggregate change slug and journal for the batch. Do not
|
|
13
|
+
initialize another change with the same runId or create child per-ticket journals.
|
|
14
|
+
Resolve source via context.repositories, OpenSpec via context.artifactRoot, and
|
|
15
|
+
backlog via context.backlogPath/backlogRoot; cwd can be an external workspace.
|
|
16
|
+
|
|
17
|
+
Read the single implement role instructions, but execute the following aggregate
|
|
18
|
+
pipeline DIRECTLY from this root. Do NOT spawn `$implement` as a sub-agent.
|
|
19
|
+
Each role receives the explicit bounded handoff including ALL frozen specs and
|
|
20
|
+
repository paths, aggregate change slug and already completed task groups.
|
|
21
|
+
|
|
22
|
+
1. Architect: one `$sr-architect` creates and validates one change covering every
|
|
23
|
+
ticket, grouping tasks by ticket and repository and recording dependency order.
|
|
24
|
+
Record architect running/done via the helper. Require high/medium design
|
|
25
|
+
confidence. Missing or low confidence blocks development; never infer a pass.
|
|
26
|
+
2. Developer: one `$sr-developer` applies the task groups sequentially, preserving
|
|
27
|
+
preceding groups and all repositories. Persist per-group progress in tasks.md
|
|
28
|
+
before yielding. Scoped checks run per group; the full verification gate runs
|
|
29
|
+
once for the aggregate candidate through the helper. Only then record developer
|
|
30
|
+
done. Incomplete groups block downstream review and remain retriable.
|
|
31
|
+
3. Reviewer: one `$sr-reviewer` semantically checks every ticket/criterion and
|
|
32
|
+
cross-ticket interaction. Include the full receipt and changed-file inventory.
|
|
33
|
+
Ordinary review does NOT archive. If recoverable findings need changes, invoke
|
|
34
|
+
developer once with the exact findings and re-review. Missing/ambiguous verdicts
|
|
35
|
+
and stale receipts never become done; record blocked/failed with a next action.
|
|
36
|
+
4. Archive: after semantic reviewer done and canonical confidence thresholds from
|
|
37
|
+
implement pass (including security), run `archive-check`. Only success permits
|
|
38
|
+
`$sr-reviewer` with ARCHIVE_ONLY=true and ARCHIVE_AUTHORIZED=true. Validate the
|
|
39
|
+
archive exists and active change is absent; record archive done. Failure leaves
|
|
40
|
+
EVERY batch ticket open.
|
|
41
|
+
5. Delivery/CI: follow implement ownership exactly. Host-owned Git records ship/ci
|
|
42
|
+
skipped and returns evidence; Core-owned authorized delivery records each selected
|
|
43
|
+
repository outcome and required CI. Partial delivery keeps the batch incomplete.
|
|
44
|
+
6. Backlog: only Core-owned backlog may close participating tickets at
|
|
45
|
+
context.backlogPath after required delivery and live-vs-frozen requirements match.
|
|
46
|
+
Preserve unrelated data and revisions. Host-owned backlog stays untouched.
|
|
47
|
+
|
|
48
|
+
Before any role, inspect status.resumePhase; reuse every still-valid phase without
|
|
49
|
+
respawning. Use available worker capabilities and capability-aware cleanup from
|
|
50
|
+
implement; never invent close_agent or native model override support.
|
|
51
|
+
|
|
52
|
+
On a provider turn limit, continue the same role from explicit saved progress;
|
|
53
|
+
never launch a nested coordinator or repeat valid earlier stages. Retry resumes
|
|
54
|
+
this same aggregate change/journal. Two continuations without progress block.
|
|
55
|
+
|
|
56
|
+
`--parallel` is a preference, not permission to create unmanaged worktrees or
|
|
57
|
+
assume ten available agent slots. The aggregate pipeline is sequential by default;
|
|
58
|
+
keep hosted worktrees in the supplied repositories. Do not claim parallel work
|
|
59
|
+
when it did not run. Do not override models on a full-history fork.
|
|
60
|
+
|
|
61
|
+
Report one table with every ticket and actual implemented/reviewed outcome, the
|
|
62
|
+
aggregate verification receipt, archive result and outstanding groups. No ticket
|
|
63
|
+
is done until the whole aggregate close succeeds.
|