specrails-core 4.6.4 → 4.6.5
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/commands/enrich.md +109 -214
- package/dist/installer/phases/scaffold.js +152 -153
- package/dist/installer/phases/scaffold.js.map +1 -1
- package/docs/deployment.md +1 -1
- package/package.json +1 -2
- package/schemas/profile.v1.json +1 -9
- package/templates/agents/sr-architect.md +9 -6
- package/templates/codex-skills/enrich/SKILL.md +3 -3
- package/templates/codex-skills/implement/SKILL.md +75 -8
- package/templates/codex-skills/rails/sr-architect/SKILL.md +33 -7
- package/templates/codex-skills/rails/sr-developer/SKILL.md +6 -3
- package/templates/codex-skills/rails/sr-reviewer/SKILL.md +57 -5
- package/templates/commands/specrails/enrich.md +36 -213
- package/templates/commands/specrails/implement.md +22 -10
- package/templates/commands/specrails/reconfig.md +1 -10
- package/templates/commands/specrails/retry.md +2 -1
- package/templates/skills/rails/sr-architect/SKILL.md +0 -234
- package/templates/skills/rails/sr-developer/SKILL.md +0 -210
- package/templates/skills/rails/sr-merge-resolver/SKILL.md +0 -197
- package/templates/skills/rails/sr-reviewer/SKILL.md +0 -320
- package/templates/skills/sr-auto-propose-backlog-specs/SKILL.md +0 -275
- package/templates/skills/sr-batch-implement/SKILL.md +0 -292
- package/templates/skills/sr-compat-check/SKILL.md +0 -275
- package/templates/skills/sr-get-backlog-specs/SKILL.md +0 -199
- package/templates/skills/sr-implement/SKILL.md +0 -1205
- package/templates/skills/sr-refactor-recommender/SKILL.md +0 -216
- package/templates/skills/sr-why/SKILL.md +0 -106
|
@@ -30,6 +30,12 @@ path documented per phase (architect / developer can return
|
|
|
30
30
|
`BLOCKED: …` and you stop). Otherwise: spawn, wait, close,
|
|
31
31
|
move on.
|
|
32
32
|
|
|
33
|
+
**A `clean` run is NOT finished until the change is archived.**
|
|
34
|
+
Archiving (`openspec archive`) is a hard obligation, not an
|
|
35
|
+
optional epilogue — see Phase 5. If you mark a ticket `done`
|
|
36
|
+
without an archived change under `openspec/changes/archive/`,
|
|
37
|
+
you violated this contract.
|
|
38
|
+
|
|
33
39
|
## How the user invokes you
|
|
34
40
|
|
|
35
41
|
- `$implement #N` — implement ticket `N` from
|
|
@@ -95,9 +101,10 @@ the combo and you'll burn a turn on the retry.
|
|
|
95
101
|
3. **List the installed rail skills**:
|
|
96
102
|
`ls .codex/skills/rails/`
|
|
97
103
|
The output drives routing in phases 2-4. Skills that aren't
|
|
98
|
-
listed are not installed — never spawn them. The
|
|
99
|
-
rails (`sr-architect`, `sr-developer`, `sr-reviewer
|
|
100
|
-
`sr-merge-resolver`
|
|
104
|
+
listed are not installed — never spawn them. The three core
|
|
105
|
+
rails (`sr-architect`, `sr-developer`, `sr-reviewer`) are
|
|
106
|
+
always present. `sr-merge-resolver` and every layer specialist
|
|
107
|
+
are optional — spawn them only when listed.
|
|
101
108
|
4. State (≤4 lines) the ticket goal, the stack you detected from
|
|
102
109
|
a quick `ls`/`find`, and the optional rails that are
|
|
103
110
|
available. Do NOT plan files-to-touch — that's the
|
|
@@ -247,8 +254,11 @@ Skip when the overall verdict is `fix needed` or `blocked` — no
|
|
|
247
254
|
point sugar-coating an unsound change.
|
|
248
255
|
|
|
249
256
|
- If `sr-test-writer` is installed AND the reviewer's confidence
|
|
250
|
-
artefact reports a coverage
|
|
251
|
-
|
|
257
|
+
artefact reports a coverage gap (`tdd_evidence.all_tasks_have_tests`
|
|
258
|
+
is `false`, or `tdd_evidence.tests_are_non_trivial` is `false`),
|
|
259
|
+
spawn it with the changed files list. It writes more tests, runs
|
|
260
|
+
them, reports. (These are the fields the `$sr-reviewer` skill
|
|
261
|
+
actually writes — do not key on a non-existent "coverage" field.)
|
|
252
262
|
- If `sr-doc-sync` is installed AND the change touches a
|
|
253
263
|
publicly-documented surface (README mentions a renamed
|
|
254
264
|
function, AGENTS.md references a removed file, openspec specs
|
|
@@ -270,9 +280,65 @@ If phase 3's overall verdict is `fix needed`:
|
|
|
270
280
|
`blocked`, **do not loop again** — surface in the final
|
|
271
281
|
report.
|
|
272
282
|
|
|
273
|
-
### 6. Phase 5 —
|
|
274
|
-
|
|
275
|
-
|
|
283
|
+
### 6. Phase 5 — Archive FIRST, then close + report
|
|
284
|
+
|
|
285
|
+
> **INVARIANT.** A ticket may be marked `done` ONLY if its change is
|
|
286
|
+
> archived (`openspec/changes/archive/<slug>/` exists). A `clean`
|
|
287
|
+
> verdict with an unarchived change is `todo` + `fix needed`, never
|
|
288
|
+
> `done`. Archiving the change and closing the ticket are a single
|
|
289
|
+
> atomic obligation — you cannot satisfy one and skip the other.
|
|
290
|
+
|
|
291
|
+
**Step A — Archive the OpenSpec change through `$sr-reviewer`
|
|
292
|
+
(mandatory when the verdict is `clean`). Run this BEFORE touching the
|
|
293
|
+
ticket or writing the report.** A change is not done until it is
|
|
294
|
+
archived — this is the codex equivalent of `opsx:archive`, and it MUST
|
|
295
|
+
run. When the overall verdict is `clean`, delegate the final OpenSpec
|
|
296
|
+
close to the reviewer rail so the same agent that validated the change
|
|
297
|
+
performs the lifecycle close:
|
|
298
|
+
|
|
299
|
+
1. Spawn `$sr-reviewer` one final time (full-history fork).
|
|
300
|
+
2. Send this exact close prompt:
|
|
301
|
+
|
|
302
|
+
> `$sr-reviewer`
|
|
303
|
+
>
|
|
304
|
+
> ARCHIVE_ONLY=true
|
|
305
|
+
> ARCHIVE_AUTHORIZED=true
|
|
306
|
+
> Ticket id: `<TICKET_ID>`
|
|
307
|
+
> Plan: `<PLAN_PATH>`
|
|
308
|
+
> Change slug: `<slug>`
|
|
309
|
+
>
|
|
310
|
+
> The aggregated reviewer verdict is clean. Follow the
|
|
311
|
+
> `$sr-reviewer` archive-only instructions exactly: validate the
|
|
312
|
+
> OpenSpec change, confirm every task is checked, perform the
|
|
313
|
+
> OpenSpec archive command, and verify the archive landed.
|
|
314
|
+
|
|
315
|
+
3. `wait_agent`, parse the two-line `Score:` / `Verdict:` reply, and
|
|
316
|
+
`close_agent`.
|
|
317
|
+
4. Treat any non-clean archive reply as archive failure.
|
|
318
|
+
|
|
319
|
+
The reviewer rail's archive-only mode must run these checks:
|
|
320
|
+
|
|
321
|
+
1. Re-confirm every task box in `openspec/changes/<slug>/tasks.md`
|
|
322
|
+
is ticked (`- [x]`) and the change validates:
|
|
323
|
+
`openspec validate "<slug>" --strict`.
|
|
324
|
+
2. Archive it: `openspec archive "<slug>" -y` — this updates the
|
|
325
|
+
main specs and moves the change to `openspec/changes/archive/`.
|
|
326
|
+
3. **Verify the archive landed — do NOT assume success.** Confirm
|
|
327
|
+
`openspec/changes/archive/` now contains the slug
|
|
328
|
+
(`ls -d openspec/changes/archive/*<slug>* 2>/dev/null`) AND that
|
|
329
|
+
`openspec/changes/<slug>/` is gone. If the archive directory is
|
|
330
|
+
absent, archiving FAILED.
|
|
331
|
+
4. If `openspec validate`, `openspec archive`, or the step-3
|
|
332
|
+
verification fails: do NOT mark the ticket `done`. Treat the run
|
|
333
|
+
as `fix needed`, surface the error in the final report, set the
|
|
334
|
+
report's `Archive:` line to `FAILED`, and leave the ticket
|
|
335
|
+
`todo`.
|
|
336
|
+
|
|
337
|
+
Skip archiving only when the verdict is `fix needed` or `blocked` —
|
|
338
|
+
an unsound change must never be archived. In that case set the
|
|
339
|
+
report's `Archive:` line to `skipped (<verdict>)`.
|
|
340
|
+
|
|
341
|
+
**Step B — Close the ticket + report.** If a ticket id is in play:
|
|
276
342
|
|
|
277
343
|
- Update `.specrails/local-tickets.json`. Modify only:
|
|
278
344
|
- `tickets["<ID>"].status` → `"done"` (clean) or `"todo"`
|
|
@@ -288,6 +354,7 @@ Print the final summary (≤18 lines):
|
|
|
288
354
|
Pipeline: architect → <developer skill(s)> → <reviewer skill(s)>
|
|
289
355
|
Plan: <path>
|
|
290
356
|
Confidence: <best path> (overall <score>/100)
|
|
357
|
+
Archive: archived → openspec/changes/archive/<slug> | skipped (<verdict>) | FAILED
|
|
291
358
|
Files: <one path per line, capped at 12; truncate beyond>
|
|
292
359
|
Tests: <ran command, pass/fail>
|
|
293
360
|
Build: <ran command, ok/fail/n/a>
|
|
@@ -19,16 +19,35 @@ source files outside `openspec/` and `.specrails/agent-memory/`.
|
|
|
19
19
|
|
|
20
20
|
### A. OpenSpec change package
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
**Scaffold the change with the OpenSpec CLI — this is mandatory.**
|
|
23
|
+
Do NOT hand-create the change directory; the `openspec` CLI owns
|
|
24
|
+
scaffolding so the change is registered with a workflow schema and
|
|
25
|
+
stays trackable by `openspec status`. Run:
|
|
23
26
|
|
|
24
|
-
|
|
27
|
+
```
|
|
28
|
+
openspec new change "<slug>" --schema spec-driven
|
|
29
|
+
```
|
|
25
30
|
|
|
26
31
|
where `<slug>` is a kebab-case derivation of the ticket title
|
|
27
32
|
(e.g. ticket "Build a Playable Tetris Game" → `add-tetris-game`).
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
This creates `openspec/changes/<slug>/.openspec.yaml`.
|
|
34
|
+
|
|
35
|
+
- If the command fails because OpenSpec isn't initialised in this
|
|
36
|
+
repo, run `openspec init . --tools codex --force` once, then
|
|
37
|
+
re-run `openspec new change …`.
|
|
38
|
+
- If the change directory already exists from a prior run,
|
|
39
|
+
**reuse** it (idempotent) — skip the `new change` call.
|
|
30
40
|
|
|
31
|
-
|
|
41
|
+
Then fill the change's artefacts **in the dependency order
|
|
42
|
+
OpenSpec enforces** (proposal first; then design + specs; then
|
|
43
|
+
tasks). Check the order and what's still outstanding at any time
|
|
44
|
+
with:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
openspec status --change "<slug>" --json
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Write these four artefacts into `openspec/changes/<slug>/`:
|
|
32
51
|
|
|
33
52
|
**`proposal.md`** — the change's executive summary:
|
|
34
53
|
|
|
@@ -237,12 +256,19 @@ on the touched files as a fallback.>
|
|
|
237
256
|
When BOTH the OpenSpec change package and the plan artefact are
|
|
238
257
|
written:
|
|
239
258
|
|
|
240
|
-
1.
|
|
259
|
+
1. **Validate the change with the OpenSpec CLI** (mandatory):
|
|
260
|
+
```
|
|
261
|
+
openspec validate "<slug>"
|
|
262
|
+
```
|
|
263
|
+
If validation reports structural errors, fix the offending
|
|
264
|
+
artefact and re-run until it passes. Do not hand off a change
|
|
265
|
+
that fails `openspec validate`.
|
|
266
|
+
2. Reply with two lines:
|
|
241
267
|
```
|
|
242
268
|
OpenSpec change: openspec/changes/<slug>/
|
|
243
269
|
Plan written to <plan-path>; files to touch: <comma-separated list>
|
|
244
270
|
```
|
|
245
|
-
|
|
271
|
+
3. End your turn. The orchestrator will read your plan + the
|
|
246
272
|
tasks.md and spawn the developer next.
|
|
247
273
|
|
|
248
274
|
If you cannot produce a plan (ticket is too ambiguous, repo
|
|
@@ -7,9 +7,12 @@ compatibility: "Codex-native. Designed to run as a full-history sub-agent fork o
|
|
|
7
7
|
|
|
8
8
|
You are the **developer** in the specrails implement pipeline. The
|
|
9
9
|
architect produced an OpenSpec change package (proposal + design +
|
|
10
|
-
tasks + spec deltas) and a plan artefact. Your job is to
|
|
11
|
-
`tasks.md` TDD cycles in order,
|
|
12
|
-
of changes, and hand off to the
|
|
10
|
+
tasks + spec deltas) and a plan artefact. Your job is to **apply**
|
|
11
|
+
that OpenSpec change — walk its `tasks.md` TDD cycles in order,
|
|
12
|
+
leave a minimal but cohesive set of changes, and hand off to the
|
|
13
|
+
reviewer. The change's `tasks.md` is the single source of truth for
|
|
14
|
+
what to build; do not invent work outside it. You may only hand off
|
|
15
|
+
once **every** task box is ticked `- [x]` (see "How you finish").
|
|
13
16
|
|
|
14
17
|
## Your scope
|
|
15
18
|
|
|
@@ -14,15 +14,26 @@ the code. You emit a structured verdict and never touch the code.
|
|
|
14
14
|
## Your scope
|
|
15
15
|
|
|
16
16
|
You **validate**. You read every artefact, you re-run every check,
|
|
17
|
-
and you emit a structured judgement.
|
|
18
|
-
|
|
17
|
+
and you emit a structured judgement. You do not edit source or test
|
|
18
|
+
files. You may write the confidence artefact and, when the review is
|
|
19
|
+
clean and archiving is authorized by the orchestrator, you must archive
|
|
20
|
+
the completed OpenSpec change with the `openspec` CLI.
|
|
19
21
|
|
|
20
22
|
## What you do, in order
|
|
21
23
|
|
|
22
24
|
### 1. Validate the OpenSpec change package
|
|
23
25
|
|
|
24
26
|
Load `openspec/changes/<slug>/` (the orchestrator gave you the
|
|
25
|
-
slug).
|
|
27
|
+
slug). **Run the OpenSpec validator first** — it is the canonical
|
|
28
|
+
structural check and is mandatory:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
openspec validate "<slug>" --strict --json
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
A non-empty error list is a blocker finding: record each under
|
|
35
|
+
`issues` and bound `overall_score < 70`. Then confirm by hand the
|
|
36
|
+
four artefacts exist and are well-formed:
|
|
26
37
|
|
|
27
38
|
- **`proposal.md`** — has `## Why`, `## What changes`, and
|
|
28
39
|
`## Impact` sections.
|
|
@@ -146,6 +157,7 @@ Path:
|
|
|
146
157
|
"ran": "npm run build | … | n/a",
|
|
147
158
|
"passed": true
|
|
148
159
|
},
|
|
160
|
+
"archive_status": "not_authorized | archived:<path> | skipped:<verdict> | failed",
|
|
149
161
|
"issues": [
|
|
150
162
|
{
|
|
151
163
|
"severity": "blocker" | "major" | "minor",
|
|
@@ -164,10 +176,50 @@ Scoring guide:
|
|
|
164
176
|
multiple minor ones
|
|
165
177
|
- **< 50** — blocker: at least one blocker finding
|
|
166
178
|
|
|
179
|
+
### 7. Archive the OpenSpec change when authorized
|
|
180
|
+
|
|
181
|
+
Archiving is mandatory for a clean close, but only safe after the
|
|
182
|
+
orchestrator has aggregated all reviewer verdicts. Therefore:
|
|
183
|
+
|
|
184
|
+
- If the orchestrator prompt includes both `ARCHIVE_ONLY=true` and
|
|
185
|
+
`ARCHIVE_AUTHORIZED=true`, skip Steps 2-5 of the code review. You are
|
|
186
|
+
being invoked only to perform the final OpenSpec close. You must still
|
|
187
|
+
run Step 1, confirm all tasks are checked, run `openspec archive`, and
|
|
188
|
+
verify the archive landed.
|
|
189
|
+
- If the orchestrator prompt includes `ARCHIVE_AUTHORIZED=true` and your
|
|
190
|
+
verdict is `clean`, you must archive the change yourself using
|
|
191
|
+
OpenSpec. Do not ask the user for confirmation.
|
|
192
|
+
- If `ARCHIVE_AUTHORIZED=true` is absent, set
|
|
193
|
+
`"archive_status": "not_authorized"` in the confidence artefact and
|
|
194
|
+
report the clean verdict without archiving. The orchestrator must then
|
|
195
|
+
invoke you again for the archive-only close step or perform its own
|
|
196
|
+
archive step.
|
|
197
|
+
- If your verdict is `fix needed` or `blocked`, do not archive. Set
|
|
198
|
+
`"archive_status": "skipped:<verdict>"`.
|
|
199
|
+
|
|
200
|
+
When archiving is authorized and the verdict is clean, run these exact
|
|
201
|
+
checks in order:
|
|
202
|
+
|
|
203
|
+
1. Re-run `openspec validate "<slug>" --strict`.
|
|
204
|
+
2. Read `openspec/changes/<slug>/tasks.md` and search for unchecked
|
|
205
|
+
tasks (`- [ ]`). If any remain, do not archive; change the verdict to
|
|
206
|
+
`fix needed: OpenSpec tasks remain unchecked`.
|
|
207
|
+
3. Run `openspec archive "<slug>" -y`.
|
|
208
|
+
4. Verify the archive landed: confirm `openspec/changes/<slug>/` is gone
|
|
209
|
+
and `openspec/changes/archive/` contains a directory whose name
|
|
210
|
+
includes `<slug>`.
|
|
211
|
+
|
|
212
|
+
If validation, archive, or verification fails, do not report `clean`.
|
|
213
|
+
Record the command/error under `issues`, set `"archive_status": "failed"`
|
|
214
|
+
in the confidence artefact, and finish with `fix needed:
|
|
215
|
+
OpenSpec archive failed`.
|
|
216
|
+
|
|
167
217
|
## What you must NOT do
|
|
168
218
|
|
|
169
|
-
- **Do not** edit any source
|
|
170
|
-
|
|
219
|
+
- **Do not** edit any source or test file.
|
|
220
|
+
- **Do not** edit OpenSpec files by hand. The only allowed OpenSpec
|
|
221
|
+
mutation is `openspec archive "<slug>" -y` during Step 7 when
|
|
222
|
+
`ARCHIVE_AUTHORIZED=true` and the verdict is clean.
|
|
171
223
|
- **Do not** update `.specrails/local-tickets.json`. The
|
|
172
224
|
orchestrator writes that after reading your verdict.
|
|
173
225
|
- **Do not** spawn further sub-agents.
|