specrails-core 4.12.1 → 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 -339
- package/bin/specrails-core.mjs +20 -98
- package/bin/tui-installer.mjs +22 -105
- package/commands/doctor.md +1 -1
- package/dist/installer/cli.js +16 -2
- package/dist/installer/cli.js.map +1 -1
- package/dist/installer/commands/doctor.js +3 -5
- package/dist/installer/commands/doctor.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 +122 -82
- package/dist/installer/commands/init.js.map +1 -1
- package/dist/installer/commands/update.js +90 -83
- package/dist/installer/commands/update.js.map +1 -1
- package/dist/installer/commands/v5-migration.js +133 -0
- package/dist/installer/commands/v5-migration.js.map +1 -0
- package/dist/installer/phases/framework-lifecycle.js +2 -0
- package/dist/installer/phases/framework-lifecycle.js.map +1 -1
- package/dist/installer/phases/install-config.js +3 -6
- package/dist/installer/phases/install-config.js.map +1 -1
- package/dist/installer/phases/manifest.js +2 -6
- package/dist/installer/phases/manifest.js.map +1 -1
- package/dist/installer/phases/prereqs.js +0 -1
- package/dist/installer/phases/prereqs.js.map +1 -1
- package/dist/installer/phases/scaffold.js +228 -405
- 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/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/schemas/profile.v1.json +1 -1
- package/templates/agents/sr-architect.md +30 -0
- package/templates/agents/sr-developer.md +30 -19
- package/templates/agents/sr-reviewer.md +70 -64
- package/templates/codex-skills/batch-implement/SKILL.md +58 -267
- package/templates/codex-skills/implement/SKILL.md +136 -420
- package/templates/codex-skills/rails/sr-architect/SKILL.md +45 -20
- package/templates/codex-skills/rails/sr-developer/SKILL.md +42 -10
- package/templates/codex-skills/rails/sr-reviewer/SKILL.md +60 -15
- package/templates/codex-skills/retry/SKILL.md +37 -117
- package/templates/commands/specrails/batch-implement.md +16 -288
- package/templates/commands/specrails/doctor.md +1 -1
- package/templates/commands/specrails/implement.md +94 -1260
- package/templates/commands/specrails/memory-inspect.md +6 -4
- package/templates/commands/specrails/propose-spec.md +1 -1
- package/templates/commands/specrails/refactor-recommender.md +8 -51
- package/templates/commands/specrails/retry.md +22 -350
- package/templates/commands/specrails/telemetry.md +1 -1
- package/templates/gemini-commands/batch-implement.toml +28 -40
- package/templates/gemini-commands/implement.toml +55 -105
- package/templates/gemini-commands/retry.toml +21 -0
- package/templates/kimi/specrails/run-skill.mjs +51 -2
- package/templates/profiles/default.json +5 -18
- package/templates/runtime/provider-pipeline.md +55 -0
- package/commands/enrich.md +0 -1456
- package/templates/agents/sr-backend-developer.md +0 -91
- package/templates/agents/sr-backend-reviewer.md +0 -152
- package/templates/agents/sr-doc-sync.md +0 -247
- package/templates/agents/sr-frontend-developer.md +0 -85
- package/templates/agents/sr-frontend-reviewer.md +0 -145
- package/templates/agents/sr-merge-resolver.md +0 -195
- package/templates/agents/sr-performance-reviewer.md +0 -186
- package/templates/agents/sr-product-analyst.md +0 -36
- package/templates/agents/sr-product-manager.md +0 -148
- package/templates/agents/sr-security-reviewer.md +0 -191
- package/templates/agents/sr-test-writer.md +0 -176
- package/templates/codex-skills/enrich/SKILL.md +0 -191
- package/templates/codex-skills/merge-resolve/SKILL.md +0 -88
- package/templates/codex-skills/rails/sr-backend-developer/SKILL.md +0 -93
- package/templates/codex-skills/rails/sr-backend-reviewer/SKILL.md +0 -120
- package/templates/codex-skills/rails/sr-doc-sync/SKILL.md +0 -124
- package/templates/codex-skills/rails/sr-frontend-developer/SKILL.md +0 -106
- package/templates/codex-skills/rails/sr-frontend-reviewer/SKILL.md +0 -111
- package/templates/codex-skills/rails/sr-merge-resolver/SKILL.md +0 -156
- package/templates/codex-skills/rails/sr-performance-reviewer/SKILL.md +0 -109
- package/templates/codex-skills/rails/sr-product-analyst/SKILL.md +0 -85
- package/templates/codex-skills/rails/sr-product-manager/SKILL.md +0 -131
- package/templates/codex-skills/rails/sr-security-reviewer/SKILL.md +0 -121
- package/templates/codex-skills/rails/sr-test-writer/SKILL.md +0 -115
- package/templates/commands/specrails/auto-propose-backlog-specs.md +0 -312
- package/templates/commands/specrails/enrich.md +0 -1456
- package/templates/commands/specrails/get-backlog-specs.md +0 -226
- package/templates/commands/specrails/merge-resolve.md +0 -172
- package/templates/commands/specrails/reconfig.md +0 -80
- package/templates/commands/specrails/vpc-drift.md +0 -405
- package/templates/commands/test.md +0 -58
- package/templates/personas/persona.md +0 -43
- package/templates/personas/the-maintainer.md +0 -98
- package/templates/settings/perf-thresholds.yml +0 -25
|
@@ -1,425 +1,141 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: implement
|
|
3
|
-
description: "Implement
|
|
3
|
+
description: "Implement one frozen spec or route multiple specs to an aggregate pipeline, with resumable design, implementation, verification, review, archive and ownership-aware delivery."
|
|
4
4
|
license: MIT
|
|
5
|
-
compatibility: "Codex-native
|
|
5
|
+
compatibility: "Codex-native role delegation with explicit handoffs and the installed SpecRails pipeline runtime. Use only capabilities exposed by the host."
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
> to this change. The orchestrator uses these to route
|
|
143
|
-
> subsequent phases.
|
|
144
|
-
>
|
|
145
|
-
> Reply with the one-line summary the skill specifies.
|
|
146
|
-
|
|
147
|
-
- `wait_agent`. Read the reply. Extract the plan path.
|
|
148
|
-
- `close_agent`. Open the plan file + design.md.
|
|
149
|
-
- **Parse the Scope line** from design.md's Context section.
|
|
150
|
-
Store the set of labels for use in phases 2-3. If the line is
|
|
151
|
-
missing, default to scope = `both`.
|
|
152
|
-
|
|
153
|
-
If the architect replied with `BLOCKED: …`, stop the pipeline,
|
|
154
|
-
write that reason into the final report, and exit without
|
|
155
|
-
updating the ticket.
|
|
156
|
-
|
|
157
|
-
### 2. Phase 2 — Developer(s)
|
|
158
|
-
|
|
159
|
-
Routing matrix (`available_rails` is the set from step 0.3,
|
|
160
|
-
`scope` is the parsed set from step 1):
|
|
161
|
-
|
|
162
|
-
| scope contains | available_rails has | spawn |
|
|
163
|
-
|---|---|---|
|
|
164
|
-
| `frontend` only | `sr-frontend-developer` | $sr-frontend-developer |
|
|
165
|
-
| `backend` only | `sr-backend-developer` | $sr-backend-developer |
|
|
166
|
-
| `frontend` only | (no fe specialist) | $sr-developer (general) |
|
|
167
|
-
| `backend` only | (no be specialist) | $sr-developer (general) |
|
|
168
|
-
| `both` | both specialists installed | TWO devs in parallel (see below) |
|
|
169
|
-
| `both` | only one or neither specialist | $sr-developer (general) |
|
|
170
|
-
| neither/unknown | — | $sr-developer (general) |
|
|
171
|
-
|
|
172
|
-
**Parallel developer case** (`scope = both` AND both specialists
|
|
173
|
-
installed AND `tasks.md` has tasks tagged `[frontend]` /
|
|
174
|
-
`[backend]`):
|
|
175
|
-
|
|
176
|
-
- spawn TWO `spawn_agent`s, anonymously named e.g.
|
|
177
|
-
`developer-fe-#<TICKET_ID>` and `developer-be-#<TICKET_ID>`.
|
|
178
|
-
- `send_message` to the frontend agent: `$sr-frontend-developer
|
|
179
|
-
... only run task blocks tagged [frontend] in tasks.md`.
|
|
180
|
-
Symmetric message to the backend agent.
|
|
181
|
-
- `wait_agent` on BOTH. Aggregate the changed-files list.
|
|
182
|
-
- `close_agent` on both.
|
|
183
|
-
|
|
184
|
-
If the architect's `tasks.md` doesn't tag task blocks, fall back
|
|
185
|
-
to a single `$sr-developer` invocation — the parallel split
|
|
186
|
-
needs ordered, non-overlapping cycles.
|
|
187
|
-
|
|
188
|
-
**Sequential developer case** (default):
|
|
189
|
-
|
|
190
|
-
- `spawn_agent` (full-history).
|
|
191
|
-
- `send_message`:
|
|
192
|
-
|
|
193
|
-
> `$<developer-skill>`
|
|
194
|
-
>
|
|
195
|
-
> Ticket id: `<TICKET_ID>`
|
|
196
|
-
> Plan: `<PLAN_PATH>`
|
|
197
|
-
> Scope: `<comma-separated labels>`
|
|
198
|
-
>
|
|
199
|
-
> Follow the `$<developer-skill>` skill instructions exactly.
|
|
200
|
-
|
|
201
|
-
- `wait_agent`. Capture file list. `close_agent`.
|
|
202
|
-
|
|
203
|
-
If the developer returned `BLOCKED: …`, surface it to the user
|
|
204
|
-
in the final report (no review phase, no ticket update).
|
|
205
|
-
|
|
206
|
-
### 3. Phase 3 — Reviewer(s) in parallel
|
|
207
|
-
|
|
208
|
-
Always spawn `$sr-reviewer`. In addition, spawn each of the
|
|
209
|
-
following if the rail is installed AND the scope flag applies:
|
|
210
|
-
|
|
211
|
-
| scope flag | rail to add (if installed) |
|
|
212
|
-
|---|---|
|
|
213
|
-
| `frontend` | `$sr-frontend-reviewer` |
|
|
214
|
-
| `backend` | `$sr-backend-reviewer` |
|
|
215
|
-
| `security-sensitive` | `$sr-security-reviewer` |
|
|
216
|
-
| `performance-sensitive` | `$sr-performance-reviewer` |
|
|
217
|
-
|
|
218
|
-
For each reviewer:
|
|
219
|
-
|
|
220
|
-
- `spawn_agent` (full-history).
|
|
221
|
-
- `send_message`:
|
|
222
|
-
|
|
223
|
-
> `$<reviewer-skill>`
|
|
224
|
-
>
|
|
225
|
-
> Ticket id: `<TICKET_ID>`
|
|
226
|
-
> Plan: `<PLAN_PATH>`
|
|
227
|
-
> Changed files:
|
|
228
|
-
> <one per line>
|
|
229
|
-
>
|
|
230
|
-
> Follow the `$<reviewer-skill>` skill instructions exactly.
|
|
231
|
-
|
|
232
|
-
**Spawn all reviewers BEFORE waiting** so they run in parallel.
|
|
233
|
-
Then `wait_agent` on each in turn. `close_agent` each as it
|
|
234
|
-
returns.
|
|
235
|
-
|
|
236
|
-
**Aggregate verdicts**:
|
|
237
|
-
|
|
238
|
-
- Per reviewer: parse `Score: N/100` and `Verdict: …` from the
|
|
239
|
-
reply.
|
|
240
|
-
- Overall score = minimum of the reviewer scores (the harshest
|
|
241
|
-
reviewer is the bound).
|
|
242
|
-
- Overall verdict:
|
|
243
|
-
- `clean` — every reviewer scored ≥ 70 AND nobody said
|
|
244
|
-
fix/blocked
|
|
245
|
-
- `fix needed` — any reviewer said `fix needed: …`, OR any
|
|
246
|
-
score < 70 with no `blocked: …` verdict, OR any reviewer
|
|
247
|
-
said `blocked: …` AND the overall score is **in the
|
|
248
|
-
recoverable range 30-69**. The recoverable-blocked case is
|
|
249
|
-
the common one where the reviewer used "blocked" because
|
|
250
|
-
the issue is significant, not because the design itself is
|
|
251
|
-
wrong — a single developer fix pass can usually clear it
|
|
252
|
-
(e.g. API surface mismatch, missing JSX component shape,
|
|
253
|
-
forgotten persistence hook).
|
|
254
|
-
- `blocked` — any reviewer said `blocked: …` AND overall
|
|
255
|
-
score is **< 30**, OR every reviewer said `blocked: …`.
|
|
256
|
-
This is the design-level case where another developer
|
|
257
|
-
pass won't help — the architect needs to re-engage.
|
|
258
|
-
|
|
259
|
-
### 4. Phase 4 — Optional augmentation
|
|
260
|
-
|
|
261
|
-
Run AFTER review is `clean` (or after the single fix-loop pass).
|
|
262
|
-
Skip when the overall verdict is `fix needed` or `blocked` — no
|
|
263
|
-
point sugar-coating an unsound change.
|
|
264
|
-
|
|
265
|
-
- If `sr-test-writer` is installed AND the reviewer's confidence
|
|
266
|
-
artefact reports a coverage gap (`tdd_evidence.all_tasks_have_tests`
|
|
267
|
-
is `false`, or `tdd_evidence.tests_are_non_trivial` is `false`),
|
|
268
|
-
spawn it with the changed files list. It writes more tests, runs
|
|
269
|
-
them, reports. (These are the fields the `$sr-reviewer` skill
|
|
270
|
-
actually writes — do not key on a non-existent "coverage" field.)
|
|
271
|
-
- If `sr-doc-sync` is installed AND the change touches a
|
|
272
|
-
publicly-documented surface (README mentions a renamed
|
|
273
|
-
function, AGENTS.md references a removed file, openspec specs
|
|
274
|
-
drifted), spawn it.
|
|
275
|
-
|
|
276
|
-
These augment, never block. If they return findings, surface in
|
|
277
|
-
the final report under "Follow-up" rather than reopening the
|
|
278
|
-
ticket.
|
|
279
|
-
|
|
280
|
-
### 5. Optional fix loop (single pass only)
|
|
281
|
-
|
|
282
|
-
If phase 3's overall verdict is `fix needed`:
|
|
283
|
-
|
|
284
|
-
- Spawn ONE follow-up developer (same routing rules as phase 2)
|
|
285
|
-
with a message that includes every reviewer's `issues[]`
|
|
286
|
-
array from their confidence artefacts.
|
|
287
|
-
- `wait_agent`. `close_agent`.
|
|
288
|
-
- Re-run phase 3 (same reviewer set). If still `fix needed` or
|
|
289
|
-
`blocked`, **do not loop again** — surface in the final
|
|
290
|
-
report.
|
|
291
|
-
|
|
292
|
-
### 6. Phase 5 — Archive FIRST, then close + report
|
|
293
|
-
|
|
294
|
-
> **INVARIANT.** A ticket may be marked `done` ONLY if its change is
|
|
295
|
-
> archived (`openspec/changes/archive/<slug>/` exists). A `clean`
|
|
296
|
-
> verdict with an unarchived change is `todo` + `fix needed`, never
|
|
297
|
-
> `done`. Archiving the change and closing the ticket are a single
|
|
298
|
-
> atomic obligation — you cannot satisfy one and skip the other.
|
|
299
|
-
|
|
300
|
-
**Step A — Archive the OpenSpec change through `$sr-reviewer`
|
|
301
|
-
(mandatory when the verdict is `clean`). Run this BEFORE touching the
|
|
302
|
-
ticket or writing the report.** A change is not done until it is
|
|
303
|
-
archived — this is the codex equivalent of `opsx:archive`, and it MUST
|
|
304
|
-
run. When the overall verdict is `clean`, delegate the final OpenSpec
|
|
305
|
-
close to the reviewer rail so the same agent that validated the change
|
|
306
|
-
performs the lifecycle close:
|
|
307
|
-
|
|
308
|
-
1. Spawn `$sr-reviewer` one final time (full-history fork).
|
|
309
|
-
2. Send this exact close prompt:
|
|
310
|
-
|
|
311
|
-
> `$sr-reviewer`
|
|
312
|
-
>
|
|
313
|
-
> ARCHIVE_ONLY=true
|
|
314
|
-
> ARCHIVE_AUTHORIZED=true
|
|
315
|
-
> Ticket id: `<TICKET_ID>`
|
|
316
|
-
> Plan: `<PLAN_PATH>`
|
|
317
|
-
> Change slug: `<slug>`
|
|
318
|
-
>
|
|
319
|
-
> The aggregated reviewer verdict is clean. Follow the
|
|
320
|
-
> `$sr-reviewer` archive-only instructions exactly: validate the
|
|
321
|
-
> OpenSpec change, confirm every task is checked, perform the
|
|
322
|
-
> OpenSpec archive command, and verify the archive landed.
|
|
323
|
-
|
|
324
|
-
3. `wait_agent`, parse the two-line `Score:` / `Verdict:` reply, and
|
|
325
|
-
`close_agent`.
|
|
326
|
-
4. Treat any non-clean archive reply as archive failure.
|
|
327
|
-
|
|
328
|
-
The reviewer rail's archive-only mode must run these checks:
|
|
329
|
-
|
|
330
|
-
1. Re-confirm every task box in `${SPECRAILS_REPO_DIR:-.}/openspec/changes/<slug>/tasks.md`
|
|
331
|
-
is ticked (`- [x]`) and the change validates:
|
|
332
|
-
`(cd "${SPECRAILS_REPO_DIR:-.}" && openspec validate "<slug>" --strict)`.
|
|
333
|
-
2. Archive it: `(cd "${SPECRAILS_REPO_DIR:-.}" && openspec archive "<slug>" -y)` — this updates the
|
|
334
|
-
main specs and moves the change to `${SPECRAILS_REPO_DIR:-.}/openspec/changes/archive/`.
|
|
335
|
-
3. **Verify the archive landed — do NOT assume success.** Confirm
|
|
336
|
-
`${SPECRAILS_REPO_DIR:-.}/openspec/changes/archive/` now contains the slug
|
|
337
|
-
(`ls -d "${SPECRAILS_REPO_DIR:-.}"/openspec/changes/archive/*<slug>* 2>/dev/null`) AND that
|
|
338
|
-
`${SPECRAILS_REPO_DIR:-.}/openspec/changes/<slug>/` is gone. If the archive directory is
|
|
339
|
-
absent, archiving FAILED.
|
|
340
|
-
4. If `openspec validate`, `openspec archive`, or the step-3
|
|
341
|
-
verification fails: do NOT mark the ticket `done`. Treat the run
|
|
342
|
-
as `fix needed`, surface the error in the final report, set the
|
|
343
|
-
report's `Archive:` line to `FAILED`, and leave the ticket
|
|
344
|
-
`todo`.
|
|
345
|
-
|
|
346
|
-
Skip archiving only when the verdict is `fix needed` or `blocked` —
|
|
347
|
-
an unsound change must never be archived. In that case set the
|
|
348
|
-
report's `Archive:` line to `skipped (<verdict>)`.
|
|
349
|
-
|
|
350
|
-
**Step B — Close the ticket + report.** If a ticket id is in play:
|
|
351
|
-
|
|
352
|
-
- Update `.specrails/local-tickets.json`. Modify only:
|
|
353
|
-
- `tickets["<ID>"].status` → `"done"` (clean) or `"todo"`
|
|
354
|
-
(fix needed / blocked)
|
|
355
|
-
- `tickets["<ID>"].updated_at` → `date -Iseconds`
|
|
356
|
-
- top-level `revision` → `revision + 1`
|
|
357
|
-
- PRESERVE every other field.
|
|
358
|
-
|
|
359
|
-
Print the final summary (≤18 lines):
|
|
360
|
-
|
|
361
|
-
```
|
|
362
|
-
#<N> → done|todo
|
|
363
|
-
Pipeline: architect → <developer skill(s)> → <reviewer skill(s)>
|
|
364
|
-
Plan: <path>
|
|
365
|
-
Confidence: <best path> (overall <score>/100)
|
|
366
|
-
Archive: archived → openspec/changes/archive/<slug> | skipped (<verdict>) | FAILED
|
|
367
|
-
Files: <one path per line, capped at 12; truncate beyond>
|
|
368
|
-
Tests: <ran command, pass/fail>
|
|
369
|
-
Build: <ran command, ok/fail/n/a>
|
|
370
|
-
Follow-up: <one bullet per item>
|
|
371
|
-
```
|
|
372
|
-
|
|
373
|
-
## While a sub-agent is running: WAIT, do nothing else
|
|
374
|
-
|
|
375
|
-
After `spawn_agent` + `send_message`, the only tool you should
|
|
376
|
-
call is `wait_agent`. Do **not**:
|
|
377
|
-
|
|
378
|
-
- Read files (`sed`, `cat`, `head`, `tail`) for "context to
|
|
379
|
-
prepare the next phase"
|
|
380
|
-
- Run `find`, `git status`, `git diff`, `npm test`, `ls`, or
|
|
381
|
-
any other inspection during the wait
|
|
382
|
-
- Spawn additional sub-agents speculatively
|
|
383
|
-
- Try to "save time" by overlapping work
|
|
384
|
-
|
|
385
|
-
Why:
|
|
386
|
-
|
|
387
|
-
- The sub-agent is editing files; concurrent reads race with
|
|
388
|
-
its writes and can return half-written content that
|
|
389
|
-
poisons your next decision.
|
|
390
|
-
- Each `sed`/`find`/`grep` you run costs tokens. A
|
|
391
|
-
10-minute developer phase with you reading the codebase
|
|
392
|
-
every 30s adds up to a real cost increase for no benefit.
|
|
393
|
-
- The next phase's brief is **deterministic** — it only
|
|
394
|
-
needs the sub-agent's reply. You don't need to pre-scout.
|
|
395
|
-
|
|
396
|
-
If `wait_agent` returns before the sub-agent is done (e.g.
|
|
397
|
-
timeout on your side), wait again. Do not start
|
|
398
|
-
inspecting.
|
|
399
|
-
|
|
400
|
-
The only acceptable activity during the wait is your own
|
|
401
|
-
narration — a single short line explaining what you're
|
|
402
|
-
waiting for is fine for the user, but do not chain more
|
|
403
|
-
than one such line per wait.
|
|
404
|
-
|
|
405
|
-
## What you must NOT do
|
|
406
|
-
|
|
407
|
-
- **Do NOT handle multi-ticket invocations.** Route them to
|
|
408
|
-
`$batch-implement` (see "Single-ticket only" above).
|
|
409
|
-
- **Do NOT pass `agent_type`, `model`, or `reasoning_effort`** to
|
|
410
|
-
`spawn_agent` on full-history forks.
|
|
411
|
-
- **Do NOT inline role instructions** in your messages — each
|
|
412
|
-
rail skill is the source of truth for what its role does.
|
|
413
|
-
Your message points the sub-agent at the right skill and
|
|
414
|
-
passes parameters; the skill body teaches the role.
|
|
415
|
-
- **Do NOT spawn rails that aren't installed** in
|
|
416
|
-
`.codex/skills/rails/`. The user's wizard selection determines
|
|
417
|
-
what's available; respect it.
|
|
418
|
-
- **Do NOT skip phases**. Even on trivial tickets, run
|
|
419
|
-
architect → developer → at-least-one reviewer. A trivial run
|
|
420
|
-
is still trazabilidad.
|
|
421
|
-
- **Do NOT loop the fix-review more than once**.
|
|
422
|
-
- **Do NOT touch `.claude/agent-memory/`** — codex projects use
|
|
423
|
-
`.specrails/agent-memory/`.
|
|
424
|
-
- **Do NOT update `.specrails/local-tickets.json`** from inside
|
|
425
|
-
a sub-agent. Only you (the orchestrator) write that file.
|
|
8
|
+
You coordinate the implementation. Role skills supply design, coding and review
|
|
9
|
+
instructions; the installed runtime supplies immutable scope, phase status and
|
|
10
|
+
actual verification evidence. A completed valid phase needs no new model call.
|
|
11
|
+
|
|
12
|
+
**Input:** `$implement #N`, `$implement #N --yes`, a free-form description, or
|
|
13
|
+
multiple `#N` references. More than one ID routes directly to
|
|
14
|
+
`.codex/skills/batch-implement/SKILL.md` with the original arguments and complete
|
|
15
|
+
frozen context. Do not ask the user to resend or spawn a nested implement.
|
|
16
|
+
|
|
17
|
+
## Admission and capabilities
|
|
18
|
+
|
|
19
|
+
Follow the executable pipeline contract above. Initialize the one stable change
|
|
20
|
+
with supplied context, explicit ticket IDs, or a free-form scope request; then
|
|
21
|
+
read `status`. Do not initialize another run on retry or replace frozen requirements
|
|
22
|
+
with live ticket text. OpenSpec lives under `context.artifactRoot`; the compatibility
|
|
23
|
+
path `${SPECRAILS_REPO_DIR:-.}/openspec/changes/<slug>/` applies only after resolving
|
|
24
|
+
that variable to artifactRoot. Source/tests use the selected repository ID/path;
|
|
25
|
+
backlog uses `context.backlogPath`, independent of cwd.
|
|
26
|
+
|
|
27
|
+
Discover `.codex/skills/rails/` and require sr-architect, sr-developer and
|
|
28
|
+
sr-reviewer. Validate any explicit profile (`SPECRAILS_PROFILE_PATH`, otherwise the
|
|
29
|
+
project's configured default): schemaVersion 1, baseline trio, routing/default and
|
|
30
|
+
referenced installed roles. Only installed custom-* roles may supplement or fulfill
|
|
31
|
+
a routed task group; they do not bypass the canonical phase gates.
|
|
32
|
+
|
|
33
|
+
Use the host's actual `spawn_agent`, `send_message` and `wait_agent` signatures.
|
|
34
|
+
Invoke required architect/developer/reviewer roles as real workers and collect their
|
|
35
|
+
terminal outcomes. Full-history forks inherit the current model; do not pass model
|
|
36
|
+
or reasoning overrides unsupported by that fork mode. Report unsupported profile
|
|
37
|
+
model overrides honestly. Use `close_agent` only when that capability exists and
|
|
38
|
+
only after the worker finished; never invent a cleanup tool or interrupt running
|
|
39
|
+
work to simulate completion. Avoid parallel writers in shared candidate roots.
|
|
40
|
+
|
|
41
|
+
Every worker receives its `$sr-*` skill and the explicit bounded handoff: runId,
|
|
42
|
+
phase, absolute runtime/context paths, all frozen criteria, repository ownership,
|
|
43
|
+
change/plan/tasks paths, prior outcome and next action. Do not rely on inherited
|
|
44
|
+
conversation memory. A task start, turn limit or process exit alone is not success.
|
|
45
|
+
Continue from durable progress; two continuations without progress become blocked.
|
|
46
|
+
|
|
47
|
+
## Durable phases
|
|
48
|
+
|
|
49
|
+
`architect → developer → reviewer → archive → ship → ci`
|
|
50
|
+
|
|
51
|
+
Follow `status.resumePhase`. Start required work with the helper's
|
|
52
|
+
`phase --phase <phase> --status running`. Record done only after validating actual
|
|
53
|
+
outcomes and runtime gates. Record blocked/failed with a concrete reason; dependent
|
|
54
|
+
phases remain incomplete. Reopening a phase invalidates dependent completion.
|
|
55
|
+
If every phase is valid, report existing completion without new worker calls.
|
|
56
|
+
|
|
57
|
+
### Architect
|
|
58
|
+
|
|
59
|
+
Invoke `$sr-architect` with the exact slug and aggregate frozen scope. Use the
|
|
60
|
+
installed official OpenSpec fast-forward workflow. Require proposal, design, specs,
|
|
61
|
+
tasks and medium/high design-confidence.json. Missing/malformed/low confidence
|
|
62
|
+
blocks development; record the unresolved issue and retain artifacts for retry.
|
|
63
|
+
Do not edit a ticket and silently substitute the new description into this run.
|
|
64
|
+
Changed requirements need a newly admitted scope.
|
|
65
|
+
|
|
66
|
+
### Developer
|
|
67
|
+
|
|
68
|
+
Invoke `$sr-developer` or the validated profile role for each task group. Keep
|
|
69
|
+
source writes in its selected repositories, serialize dependencies/shared files,
|
|
70
|
+
and persist real task progress. A BLOCKED outcome stops downstream phases.
|
|
71
|
+
Scoped checks support development; once all groups are implemented, execute one
|
|
72
|
+
full CI-equivalent check request through the installed helper. Derive actual checks
|
|
73
|
+
from each selected repository and include required cross-repository integration.
|
|
74
|
+
All tasks and current full evidence must pass before recording developer done.
|
|
75
|
+
|
|
76
|
+
### Reviewer and bounded repair
|
|
77
|
+
|
|
78
|
+
Invoke `$sr-reviewer` with complete criteria, candidate inventory and current
|
|
79
|
+
verification receipt. Ordinary review does not archive. Require explicit semantic
|
|
80
|
+
acceptance, safe behavior and required regression coverage; green baseline tests
|
|
81
|
+
with missing implementation are incomplete. Reuse unchanged full verification;
|
|
82
|
+
review edits require one fresh final full request on the resulting candidate.
|
|
83
|
+
|
|
84
|
+
Read canonical `<context.artifactRoot>/openspec/changes/<slug>/confidence-score.json`.
|
|
85
|
+
Require overall ≥70, security ≥75 and every other aspect ≥60 (or stricter configured
|
|
86
|
+
thresholds), all tasks complete and no unresolved explicit blocker. Missing or
|
|
87
|
+
ambiguous verdicts/scores fail closed. A numeric score never converts a blocked
|
|
88
|
+
security or design finding into clean acceptance.
|
|
89
|
+
|
|
90
|
+
For concrete recoverable findings, reopen developer and invoke it once with those
|
|
91
|
+
exact findings, then re-review and refresh evidence. An architectural blocker
|
|
92
|
+
returns to architect; do not infer its category from a score range. If the one
|
|
93
|
+
repair round does not resolve acceptance, preserve work and record blocked.
|
|
94
|
+
Only then may the runtime record reviewer done.
|
|
95
|
+
|
|
96
|
+
### Archive
|
|
97
|
+
|
|
98
|
+
Run `archive-check` immediately before archiving. Nonzero means stop. After success,
|
|
99
|
+
invoke `$sr-reviewer` with ARCHIVE_ONLY=true and ARCHIVE_AUTHORIZED=true and the
|
|
100
|
+
same explicit handoff, or run the installed official archive workflow directly
|
|
101
|
+
as coordinator. Preserve approved confidence bytes; no rescoring or code changes.
|
|
102
|
+
Confirm the exact active change is gone, its archive exists under
|
|
103
|
+
`<context.artifactRoot>/openspec/changes/archive/<date>-<slug>/` and canonical specs
|
|
104
|
+
synced before `phase --phase archive --status done`. Do not emulate an official
|
|
105
|
+
archive with file moves or accept incomplete-task prompts. A failed archive remains
|
|
106
|
+
resumable; it never closes specs or restarts valid development automatically.
|
|
107
|
+
|
|
108
|
+
### Delivery and CI
|
|
109
|
+
|
|
110
|
+
For `context.ownership.git === "host"`, record ship and ci skipped with the ownership
|
|
111
|
+
reason and return evidence to the host. Do not stage, commit, push or open PRs.
|
|
112
|
+
For Core-owned git, perform only the delivery already authorized by user/settings,
|
|
113
|
+
in each selected repository. `GIT_AUTO=false` and preview disable shipping even if
|
|
114
|
+
Core owns git. Preserve unrelated changes; stage only the reviewed candidate.
|
|
115
|
+
Record actual per-repository commits/PRs and required CI results before phase done.
|
|
116
|
+
Partial delivery stays incomplete. CI retry checks existing delivery, without
|
|
117
|
+
creating duplicate commits or PRs. No authorized delivery means a concrete blocker,
|
|
118
|
+
not a fabricated successful ship phase.
|
|
119
|
+
|
|
120
|
+
### Backlog and report
|
|
121
|
+
|
|
122
|
+
Host-owned backlog remains untouched. Core-owned backlog may close only after all
|
|
123
|
+
required delivery succeeds, current evidence remains valid, and live participating
|
|
124
|
+
ticket requirements still match frozen IDs/descriptions/criteria/repository scope.
|
|
125
|
+
A mismatch leaves that ticket open and reports the conflict. Read/write only
|
|
126
|
+
`context.backlogPath` (fallback context.backlogRoot/.specrails/local-tickets.json),
|
|
127
|
+
preserve unrelated tickets/fields, and apply the store's revision protocol. Workers
|
|
128
|
+
never close tickets. A free-form scope without a real ticket has no ticket mutation.
|
|
129
|
+
|
|
130
|
+
Report run/change, frozen tickets/roots, reused and newly completed phases,
|
|
131
|
+
verification commands, confidence, archive and each repository's actual delivery.
|
|
132
|
+
Distinguish ready-for-host-delivery from delivered. Include concrete remaining
|
|
133
|
+
blockers; no complete/done claim while a required gate or repository is incomplete.
|
|
134
|
+
|
|
135
|
+
## Preview and apply
|
|
136
|
+
|
|
137
|
+
`--dry-run`/`--preview` uses the runtime preview contract and reports UNVERIFIED
|
|
138
|
+
PREVIEW. Tests on untouched source are baseline evidence only. `--apply` resumes the
|
|
139
|
+
exact existing preview journal, verifies unchanged base/cache and runs checks on
|
|
140
|
+
actual applied source through `apply-preview`; continue the ordinary review,
|
|
141
|
+
confidence and archive gates. Preview never grants shipping/backlog ownership.
|