specrails-core 4.5.0 → 4.6.2
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/bin/specrails-core.mjs +7 -0
- package/bin/tui-installer.mjs +89 -26
- package/dist/installer/commands/init.js +3 -7
- package/dist/installer/commands/init.js.map +1 -1
- package/dist/installer/phases/install-config.js +2 -5
- package/dist/installer/phases/install-config.js.map +1 -1
- package/dist/installer/phases/provider-detect.js +10 -11
- package/dist/installer/phases/provider-detect.js.map +1 -1
- package/dist/installer/phases/scaffold.js +402 -13
- package/dist/installer/phases/scaffold.js.map +1 -1
- package/package.json +1 -1
- package/templates/codex-skills/batch-implement/SKILL.md +268 -0
- package/templates/codex-skills/enrich/SKILL.md +191 -0
- package/templates/codex-skills/implement/SKILL.md +349 -0
- package/templates/codex-skills/merge-resolve/SKILL.md +88 -0
- package/templates/codex-skills/rails/sr-architect/SKILL.md +254 -0
- package/templates/codex-skills/rails/sr-backend-developer/SKILL.md +90 -0
- package/templates/codex-skills/rails/sr-backend-reviewer/SKILL.md +120 -0
- package/templates/codex-skills/rails/sr-developer/SKILL.md +163 -0
- package/templates/codex-skills/rails/sr-doc-sync/SKILL.md +123 -0
- package/templates/codex-skills/rails/sr-frontend-developer/SKILL.md +103 -0
- package/templates/codex-skills/rails/sr-frontend-reviewer/SKILL.md +111 -0
- package/templates/codex-skills/rails/sr-merge-resolver/SKILL.md +156 -0
- package/templates/codex-skills/rails/sr-performance-reviewer/SKILL.md +109 -0
- package/templates/codex-skills/rails/sr-product-analyst/SKILL.md +85 -0
- package/templates/codex-skills/rails/sr-product-manager/SKILL.md +129 -0
- package/templates/codex-skills/rails/sr-reviewer/SKILL.md +188 -0
- package/templates/codex-skills/rails/sr-security-reviewer/SKILL.md +121 -0
- package/templates/codex-skills/rails/sr-test-writer/SKILL.md +115 -0
- package/templates/codex-skills/retry/SKILL.md +117 -0
- package/templates/settings/codex-config.toml +15 -10
- package/templates/skills/rails/sr-architect/SKILL.md +234 -0
- package/templates/skills/rails/sr-developer/SKILL.md +210 -0
- package/templates/skills/rails/sr-merge-resolver/SKILL.md +197 -0
- package/templates/skills/rails/sr-reviewer/SKILL.md +320 -0
- package/templates/settings/codex-rules.star +0 -12
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: batch-implement
|
|
3
|
+
description: "Run the implement pipeline over multiple backlog tickets in one session. Per ticket: spawn architect → spawn developer → spawn reviewer (the same three-phase pipeline $implement runs), then move to the next. Sequential by default; parallel only when the user explicitly opts in AND the tickets are independent. Reports an aggregated verdict at the end. Use when the user invokes `$batch-implement #N #M #K` or `$batch-implement --status todo`."
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: "Codex-native. Fully headless / non-interactive. Drives architect/developer/reviewer spawns at the ROOT agent level — does NOT spawn a nested $implement sub-agent per ticket (codex's nested-spawn reliability degrades at depth 2, causing sub-agents to skip phases silently). Sub-agents are full-history forks (no agent_type / model / reasoning_effort)."
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are the **batch-implement orchestrator**. The user invoked
|
|
9
|
+
you to apply the implement pipeline to multiple tickets in one
|
|
10
|
+
session.
|
|
11
|
+
|
|
12
|
+
**This skill is fully headless / non-interactive.** Every
|
|
13
|
+
sub-agent invocation must include `--yes` semantics. There is
|
|
14
|
+
no "interactive mode". If you find yourself thinking "the
|
|
15
|
+
batch skill is interactive by design, let me run inline
|
|
16
|
+
instead", you're misreading.
|
|
17
|
+
|
|
18
|
+
## Why this skill drives the pipeline directly
|
|
19
|
+
|
|
20
|
+
An earlier design spawned a `$implement` sub-agent per ticket
|
|
21
|
+
that itself spawned architect/developer/reviewer sub-sub-agents.
|
|
22
|
+
That worked technically but was **unreliable in practice**:
|
|
23
|
+
codex's nested-spawn at depth 2 frequently dropped the reviewer
|
|
24
|
+
phase (and sometimes the architect), leaving tickets reported as
|
|
25
|
+
"done" with no confidence artefact and stale backlog state.
|
|
26
|
+
|
|
27
|
+
This skill therefore runs the **same three-phase pipeline
|
|
28
|
+
`$implement` runs**, but it drives the spawns from the root
|
|
29
|
+
agent (you) instead of nesting. Per ticket you spawn architect,
|
|
30
|
+
developer, and reviewer at depth 1 — three real sub-agents per
|
|
31
|
+
ticket, no more nesting. The contract that `$implement` enforces
|
|
32
|
+
(every phase MUST be a real spawn) applies here too.
|
|
33
|
+
|
|
34
|
+
## How the user invokes you
|
|
35
|
+
|
|
36
|
+
- `$batch-implement #1 #2 #3 --yes` — sequential.
|
|
37
|
+
- `$batch-implement --status todo` — every todo ticket, ascending
|
|
38
|
+
id order.
|
|
39
|
+
- `$batch-implement --status todo --priority high` — combined
|
|
40
|
+
filter.
|
|
41
|
+
- `$batch-implement #1 #2 --parallel` — opt-in parallel, with a
|
|
42
|
+
disjoint-file safety check (see Step 2.b).
|
|
43
|
+
|
|
44
|
+
Default execution mode is sequential.
|
|
45
|
+
|
|
46
|
+
## Steps
|
|
47
|
+
|
|
48
|
+
### 0. Bootstrap
|
|
49
|
+
|
|
50
|
+
1. Confirm `pwd` matches `git rev-parse --show-toplevel`.
|
|
51
|
+
2. Parse argv: collect `#N` tokens + filter flags (`--status`,
|
|
52
|
+
`--priority`, `--parallel`).
|
|
53
|
+
3. Build the target list:
|
|
54
|
+
- Explicit ids → use them in given order.
|
|
55
|
+
- Otherwise filter `.specrails/local-tickets.json` by
|
|
56
|
+
`--status`/`--priority` and sort numeric id ascending.
|
|
57
|
+
4. If empty target list, reply
|
|
58
|
+
`"NO-OP: no tickets match the filter"` and end.
|
|
59
|
+
5. **List installed rails** once:
|
|
60
|
+
`ls .codex/skills/rails/`. Cache the set; you'll reuse it
|
|
61
|
+
for routing each ticket's developer + reviewer phase.
|
|
62
|
+
6. State (≤4 lines) which tickets you're processing, in what
|
|
63
|
+
mode, and the available rails.
|
|
64
|
+
|
|
65
|
+
### 1. Sequential pipeline (default)
|
|
66
|
+
|
|
67
|
+
For each ticket id in order, run the three-phase pipeline at
|
|
68
|
+
ROOT level (do NOT spawn `$implement` as a sub-agent — drive
|
|
69
|
+
the pipeline yourself):
|
|
70
|
+
|
|
71
|
+
#### 1.a Architect phase (per ticket)
|
|
72
|
+
|
|
73
|
+
- `spawn_agent` (full-history, no agent_type / model /
|
|
74
|
+
reasoning_effort).
|
|
75
|
+
- `send_message`:
|
|
76
|
+
|
|
77
|
+
> `$sr-architect`
|
|
78
|
+
>
|
|
79
|
+
> Ticket id: `<TICKET_ID>`
|
|
80
|
+
> Ticket title: `<TICKET_TITLE>`
|
|
81
|
+
>
|
|
82
|
+
> Read `jq '.tickets["<TICKET_ID>"]' .specrails/local-tickets.json`
|
|
83
|
+
> for the full ticket. Follow the `$sr-architect` skill
|
|
84
|
+
> instructions exactly.
|
|
85
|
+
>
|
|
86
|
+
> In `design.md`'s `## Context` section, include a
|
|
87
|
+
> `Scope: <labels>` line drawn from: `frontend`, `backend`,
|
|
88
|
+
> `both`, `security-sensitive`, `performance-sensitive`.
|
|
89
|
+
|
|
90
|
+
- `wait_agent`. Parse reply for the plan path. `close_agent`.
|
|
91
|
+
- Open the plan + design.md, parse the `Scope:` line.
|
|
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
|
+
Routing matrix (mirrors `$implement`):
|
|
99
|
+
|
|
100
|
+
| scope contains | rails available | spawn |
|
|
101
|
+
|---|---|---|
|
|
102
|
+
| `frontend` only | `sr-frontend-developer` | $sr-frontend-developer |
|
|
103
|
+
| `backend` only | `sr-backend-developer` | $sr-backend-developer |
|
|
104
|
+
| `frontend` only | (no fe specialist) | $sr-developer |
|
|
105
|
+
| `backend` only | (no be specialist) | $sr-developer |
|
|
106
|
+
| `both` + both specialists + tagged tasks.md | — | TWO devs parallel |
|
|
107
|
+
| else | — | $sr-developer |
|
|
108
|
+
|
|
109
|
+
- `spawn_agent`. `send_message`:
|
|
110
|
+
|
|
111
|
+
> `$<developer-skill>`
|
|
112
|
+
>
|
|
113
|
+
> Ticket id: `<TICKET_ID>`
|
|
114
|
+
> Plan: `<PLAN_PATH>`
|
|
115
|
+
> Scope: `<comma-separated labels>`
|
|
116
|
+
>
|
|
117
|
+
> Follow the `$<developer-skill>` skill instructions exactly.
|
|
118
|
+
|
|
119
|
+
- `wait_agent`. Capture file list. `close_agent`.
|
|
120
|
+
- If `BLOCKED: …` → mark ticket as failed in the batch report
|
|
121
|
+
and move to next ticket.
|
|
122
|
+
|
|
123
|
+
#### 1.c Reviewer phase (per ticket) — parallel where possible
|
|
124
|
+
|
|
125
|
+
Always spawn `$sr-reviewer`. Additionally if installed AND
|
|
126
|
+
scope matches:
|
|
127
|
+
|
|
128
|
+
| scope flag | additional rail |
|
|
129
|
+
|---|---|
|
|
130
|
+
| `frontend` | `$sr-frontend-reviewer` |
|
|
131
|
+
| `backend` | `$sr-backend-reviewer` |
|
|
132
|
+
| `security-sensitive` | `$sr-security-reviewer` |
|
|
133
|
+
| `performance-sensitive` | `$sr-performance-reviewer` |
|
|
134
|
+
|
|
135
|
+
Spawn ALL reviewers in parallel, then `wait_agent` on each.
|
|
136
|
+
`close_agent` each.
|
|
137
|
+
|
|
138
|
+
Aggregate verdicts (same matrix as `$implement`):
|
|
139
|
+
|
|
140
|
+
- `clean` — every reviewer ≥70, no fix/blocked verdicts.
|
|
141
|
+
- `fix needed` — any "fix needed", OR score <70 with no
|
|
142
|
+
blocked, OR blocked with score 30-69 (recoverable case).
|
|
143
|
+
- `blocked` — blocked with score <30, OR all reviewers blocked.
|
|
144
|
+
|
|
145
|
+
#### 1.d Optional fix loop (single pass per ticket)
|
|
146
|
+
|
|
147
|
+
If the verdict is `fix needed`, run ONE follow-up developer
|
|
148
|
+
pass with the reviewer's issues list, then re-run the
|
|
149
|
+
reviewer set. If still `fix needed` or `blocked`, do NOT
|
|
150
|
+
loop again — record the failure in the batch report and
|
|
151
|
+
continue.
|
|
152
|
+
|
|
153
|
+
#### 1.e Close the ticket (per ticket)
|
|
154
|
+
|
|
155
|
+
If the final verdict is `clean`:
|
|
156
|
+
- Update `.specrails/local-tickets.json` — set
|
|
157
|
+
`tickets["<ID>"].status = "done"`, bump `revision`, set
|
|
158
|
+
`updated_at` to `date -Iseconds`. Preserve every other
|
|
159
|
+
field.
|
|
160
|
+
|
|
161
|
+
If the verdict is `fix needed` or `blocked`:
|
|
162
|
+
- Leave status as `todo`. Still bump `revision` and set
|
|
163
|
+
`updated_at` so the file reflects the run. Record the
|
|
164
|
+
blocker in the batch report's Follow-up section.
|
|
165
|
+
|
|
166
|
+
**Important**: only YOU (the root orchestrator) ever writes
|
|
167
|
+
to `.specrails/local-tickets.json`. None of the sub-agents
|
|
168
|
+
(architect, developer, reviewer) should touch it — the rail
|
|
169
|
+
skills already enforce that on their side.
|
|
170
|
+
|
|
171
|
+
### 2. Parallel pipeline (opt-in via `--parallel`)
|
|
172
|
+
|
|
173
|
+
When the user passed `--parallel`:
|
|
174
|
+
|
|
175
|
+
a. **Pre-spawn architect-only pass**. For each ticket, spawn
|
|
176
|
+
`$sr-architect` in parallel via `spawn_agents_on_csv`
|
|
177
|
+
(cap at 10 concurrent). Wait for each to produce its
|
|
178
|
+
`tasks.md` + plan path.
|
|
179
|
+
b. **Disjoint-file check**. Collect every file path mentioned
|
|
180
|
+
across all `tasks.md` files. If ANY file appears in more
|
|
181
|
+
than one ticket's list, abort parallel mode for the
|
|
182
|
+
overlapping tickets — process them sequentially after the
|
|
183
|
+
non-overlapping batch. State in your reply which tickets
|
|
184
|
+
were re-routed and why.
|
|
185
|
+
c. For the non-overlapping tickets, run their developer +
|
|
186
|
+
reviewer phases (and optional fix-loop) in parallel
|
|
187
|
+
per-ticket. Each ticket is still a sequence
|
|
188
|
+
internally — only the outer per-ticket processing is
|
|
189
|
+
concurrent.
|
|
190
|
+
|
|
191
|
+
The safety net exists because two developer pipelines editing
|
|
192
|
+
the same file would race. If unsure, fall back to sequential.
|
|
193
|
+
|
|
194
|
+
### 3. Aggregate the batch
|
|
195
|
+
|
|
196
|
+
For each ticket, collect:
|
|
197
|
+
|
|
198
|
+
- `ticket_id`
|
|
199
|
+
- `verdict`: `done` | `todo` | `blocked` | `arch_blocked`
|
|
200
|
+
- `score`: overall (or `n/a` if no reviewer ran)
|
|
201
|
+
- `plan_path`, `confidence_path` (omit if `n/a`)
|
|
202
|
+
- `files_changed`: list (or `n/a`)
|
|
203
|
+
- `tests_summary`, `build_summary`
|
|
204
|
+
- Any Follow-up bullets
|
|
205
|
+
|
|
206
|
+
### 4. Report
|
|
207
|
+
|
|
208
|
+
Print ONE consolidated summary (≤30 lines for typical
|
|
209
|
+
batches):
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
batch-implement — <N> tickets attempted
|
|
213
|
+
|
|
214
|
+
Outcomes:
|
|
215
|
+
done: #<id> #<id> ...
|
|
216
|
+
todo: #<id> (reason: …) ...
|
|
217
|
+
blocked: #<id> (reason: …) ...
|
|
218
|
+
|
|
219
|
+
Per-ticket details:
|
|
220
|
+
#<id> → <verdict> (score <N>/100)
|
|
221
|
+
plan: <path>
|
|
222
|
+
confidence: <path>
|
|
223
|
+
files: <count> (<one path>, +N more)
|
|
224
|
+
tests: <pass/fail summary>
|
|
225
|
+
|
|
226
|
+
Aggregate stats:
|
|
227
|
+
Files touched: <total unique count>
|
|
228
|
+
Tests run: <total>, pass <count>, fail <count>
|
|
229
|
+
Build: <count where ran, count ok, count failed>
|
|
230
|
+
|
|
231
|
+
Follow-up across batch:
|
|
232
|
+
- <bullet> (#<id>)
|
|
233
|
+
- ...
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
If every ticket ended in `done`, also print:
|
|
237
|
+
|
|
238
|
+
```
|
|
239
|
+
✓ Batch complete: <N>/<N> tickets done.
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
If some ended in `todo` or `blocked`, finish with the
|
|
243
|
+
re-launch hint:
|
|
244
|
+
|
|
245
|
+
```
|
|
246
|
+
Re-run with: $batch-implement #<id> [#<id> ...] --yes
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## What you must NOT do
|
|
250
|
+
|
|
251
|
+
- **Do NOT spawn `$implement` as a sub-agent** to handle a
|
|
252
|
+
ticket. Drive the architect/developer/reviewer pipeline
|
|
253
|
+
yourself, at depth 1 (root → role-skill). Nested spawning
|
|
254
|
+
at depth 2 drops phases silently and produces "done"
|
|
255
|
+
tickets with no confidence artefact.
|
|
256
|
+
- **Do NOT pass `agent_type`, `model`, or `reasoning_effort`**
|
|
257
|
+
to `spawn_agent` on full-history forks.
|
|
258
|
+
- **Do NOT proceed in parallel mode** without the
|
|
259
|
+
disjoint-file check.
|
|
260
|
+
- **Do NOT exceed 10 parallel sub-agents** in one fan-out.
|
|
261
|
+
- **Do NOT do speculative work** (sed/find/grep/etc.) while
|
|
262
|
+
a sub-agent is running. Wait silently for `wait_agent`.
|
|
263
|
+
- **Do NOT touch `.claude/agent-memory/`** — codex projects
|
|
264
|
+
use `.specrails/agent-memory/`.
|
|
265
|
+
- **Do NOT skip a phase**. Every ticket gets architect →
|
|
266
|
+
developer → reviewer (+ fix loop if needed). A ticket
|
|
267
|
+
reported as "done" without a confidence artefact is a
|
|
268
|
+
contract violation.
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: enrich
|
|
3
|
+
description: "Full-tier install ritual for an existing specrails project. Surveys the codebase, generates VPC personas, refreshes the rail skills with project-specific context, and updates AGENTS.md's managed block. Single-agent flow — does NOT spawn the implement pipeline. Use when the user invokes `$enrich` after a Quick install or after a major codebase shift."
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: "Codex-native. Single-agent loop (no spawn_agent). Mutates `.codex/`, `.specrails/setup-templates/`, and the AGENTS.md managed block. Idempotent: re-running on the same codebase produces a stable result."
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are the **enrich** ritual. The user has a specrails
|
|
9
|
+
installation that was bootstrapped quickly (template defaults)
|
|
10
|
+
and wants the rail skills + agent personas adapted to THIS
|
|
11
|
+
codebase. You read the repo, infer the persona, customise the
|
|
12
|
+
shipped artefacts, and write the result back in place.
|
|
13
|
+
|
|
14
|
+
This is a **single-agent** flow. No `spawn_agent`, no
|
|
15
|
+
sub-agents — enrich is what gives the rail agents their flavour;
|
|
16
|
+
it doesn't run the rail pipeline.
|
|
17
|
+
|
|
18
|
+
## How the user invokes you
|
|
19
|
+
|
|
20
|
+
- `$enrich` — full enrichment (codebase analysis + persona
|
|
21
|
+
generation + rail customisation + AGENTS.md refresh).
|
|
22
|
+
- `$enrich --from-config` — read parameters from
|
|
23
|
+
`.specrails/install-config.yaml` instead of asking. Used by
|
|
24
|
+
the hub during the install wizard's full-tier path.
|
|
25
|
+
- `$enrich --personas-only` — only regenerate personas; leave
|
|
26
|
+
rail skills untouched.
|
|
27
|
+
|
|
28
|
+
## Steps
|
|
29
|
+
|
|
30
|
+
### 1. Survey the codebase
|
|
31
|
+
|
|
32
|
+
Read the repo without modifying anything:
|
|
33
|
+
|
|
34
|
+
- Top-level files: `ls -la`, `cat package.json` /
|
|
35
|
+
`cat pyproject.toml` / `cat Cargo.toml` / etc.
|
|
36
|
+
- Major directories: identify the source tree shape
|
|
37
|
+
(`src/`, `app/`, `pages/`, `lib/`, `tests/`, `docs/`).
|
|
38
|
+
- Stack inference: language(s), build tool, test runner,
|
|
39
|
+
major frameworks (React, Next, FastAPI, Rails, etc.),
|
|
40
|
+
major libraries.
|
|
41
|
+
- Recent activity: `git log --oneline -20` to see what the
|
|
42
|
+
team has been working on lately.
|
|
43
|
+
- Existing docs: `README.md`, `docs/**/*.md` (skim, don't
|
|
44
|
+
re-read every word).
|
|
45
|
+
|
|
46
|
+
State (≤8 lines) your codebase summary so the user sees what
|
|
47
|
+
you inferred BEFORE you start writing.
|
|
48
|
+
|
|
49
|
+
### 2. Generate VPC personas
|
|
50
|
+
|
|
51
|
+
Personas are documents describing TYPES of users this product
|
|
52
|
+
serves. Write each to:
|
|
53
|
+
|
|
54
|
+
`.specrails/personas/<slug>.md`
|
|
55
|
+
|
|
56
|
+
(create the dir if missing). 2-5 personas per project,
|
|
57
|
+
covering: name, role, goals, frustrations, context, success
|
|
58
|
+
criteria. Use the existing
|
|
59
|
+
`.specrails/setup-templates/personas/persona.md` (if present)
|
|
60
|
+
as a shape reference; if absent, use this skeleton:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
# <Persona name>
|
|
64
|
+
|
|
65
|
+
## Role
|
|
66
|
+
<one paragraph>
|
|
67
|
+
|
|
68
|
+
## Goals
|
|
69
|
+
- <bullet>
|
|
70
|
+
- <bullet>
|
|
71
|
+
|
|
72
|
+
## Frustrations
|
|
73
|
+
- <bullet>
|
|
74
|
+
|
|
75
|
+
## Context
|
|
76
|
+
<one paragraph: what tools they use, when they engage the
|
|
77
|
+
product, what success looks like for THEM>
|
|
78
|
+
|
|
79
|
+
## Success criteria
|
|
80
|
+
- <observable signal>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Personas are read-only context for downstream agents. Don't
|
|
84
|
+
reference specific tickets — those churn; personas don't.
|
|
85
|
+
|
|
86
|
+
### 3. Customise the rail skills
|
|
87
|
+
|
|
88
|
+
For each installed rail skill in `.codex/skills/rails/`:
|
|
89
|
+
|
|
90
|
+
- Read the current SKILL.md.
|
|
91
|
+
- Identify any section that says "STACK / framework / test
|
|
92
|
+
runner / etc." with a placeholder hint.
|
|
93
|
+
- Replace with the concrete value from your codebase survey.
|
|
94
|
+
Example: a generic `sr-frontend-developer`'s test
|
|
95
|
+
framework hint becomes `Vitest + React Testing Library`
|
|
96
|
+
if that's what the project ships.
|
|
97
|
+
|
|
98
|
+
Do this conservatively — don't rewrite the prose. Only fill
|
|
99
|
+
in stack-specific details. If a rail's SKILL.md is already
|
|
100
|
+
fully concrete (no placeholders), leave it alone.
|
|
101
|
+
|
|
102
|
+
### 4. Refresh AGENTS.md managed block
|
|
103
|
+
|
|
104
|
+
Open `AGENTS.md` at the repo root. Locate the
|
|
105
|
+
`<!-- specrails-managed:start -->` … `<!-- specrails-managed:end -->`
|
|
106
|
+
block. Rewrite ONLY the content inside the sentinels with:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
<!-- specrails-managed:start -->
|
|
110
|
+
|
|
111
|
+
# <project-name> — agent instructions
|
|
112
|
+
|
|
113
|
+
This project uses **specrails** with the **codex** provider.
|
|
114
|
+
|
|
115
|
+
## Project at a glance
|
|
116
|
+
- Stack: <inferred from step 1, one line>
|
|
117
|
+
- Build: <command>
|
|
118
|
+
- Tests: <command>
|
|
119
|
+
- Layout: <one-line tree summary>
|
|
120
|
+
|
|
121
|
+
## Conventions
|
|
122
|
+
- <one bullet per non-obvious project convention worth
|
|
123
|
+
surfacing to every spawned sub-agent>
|
|
124
|
+
- ...
|
|
125
|
+
|
|
126
|
+
## Personas
|
|
127
|
+
- <persona name> — `.specrails/personas/<slug>.md`
|
|
128
|
+
- ...
|
|
129
|
+
|
|
130
|
+
## Rail skills installed
|
|
131
|
+
- `$implement`, `$batch-implement` — pipeline entry points
|
|
132
|
+
- `$sr-architect`, `$sr-developer`, `$sr-reviewer`,
|
|
133
|
+
`$sr-merge-resolver` — core rails
|
|
134
|
+
- <list any optional rails installed in
|
|
135
|
+
.codex/skills/rails/>
|
|
136
|
+
|
|
137
|
+
<!-- specrails-managed:end -->
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Content OUTSIDE the sentinel block is user-authored — leave
|
|
141
|
+
it intact.
|
|
142
|
+
|
|
143
|
+
### 5. Write a record
|
|
144
|
+
|
|
145
|
+
Path:
|
|
146
|
+
|
|
147
|
+
`.specrails/agent-memory/explanations/YYYY-MM-DD-enrich-{TIMESTAMP}.md`
|
|
148
|
+
|
|
149
|
+
Shape:
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
# Enrich — {DATE}
|
|
153
|
+
|
|
154
|
+
## Codebase
|
|
155
|
+
<your survey summary, copied from step 1>
|
|
156
|
+
|
|
157
|
+
## Personas written
|
|
158
|
+
- .specrails/personas/<slug>.md
|
|
159
|
+
- ...
|
|
160
|
+
|
|
161
|
+
## Rails customised
|
|
162
|
+
- .codex/skills/rails/<name>/SKILL.md — <what was filled in>
|
|
163
|
+
- ...
|
|
164
|
+
|
|
165
|
+
## AGENTS.md
|
|
166
|
+
- Updated managed block: yes / no (unchanged)
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## What you must NOT do
|
|
170
|
+
|
|
171
|
+
- **Do not** spawn sub-agents. Enrich is a single-agent ritual.
|
|
172
|
+
- **Do not** modify the rail skills' core instructions —
|
|
173
|
+
only fill stack placeholders.
|
|
174
|
+
- **Do not** touch content OUTSIDE the `<!-- specrails-managed
|
|
175
|
+
-->` sentinels in `AGENTS.md`.
|
|
176
|
+
- **Do not** create or modify any backlog ticket.
|
|
177
|
+
- **Do not** write to `.claude/agent-memory/`. Codex projects
|
|
178
|
+
use `.specrails/agent-memory/`.
|
|
179
|
+
|
|
180
|
+
## How you finish
|
|
181
|
+
|
|
182
|
+
Reply with:
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
Enriched. Stack: <one-line>. Personas: <N>. Rails
|
|
186
|
+
customised: <count>. AGENTS.md: <updated|unchanged>. Record:
|
|
187
|
+
<report-path>.
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
If you cannot enrich (repo is empty, AGENTS.md is missing,
|
|
191
|
+
etc.), reply `"BLOCKED: <one-sentence reason>"` and end.
|