specrails-core 2.1.2 → 3.0.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/commands/setup.md CHANGED
@@ -176,8 +176,10 @@ grep -r '{{[A-Z_]*}}' .codex/agents/sr-*.toml 2>/dev/null || echo "OK: no broken
176
176
 
177
177
  For each command in the "changed commands" list from Phase U3:
178
178
 
179
- 1. Read the NEW template from `.claude/setup-templates/commands/sr/<name>.md`
180
- 2. Read stored backlog configuration from `.claude/backlog-config.json` (if it exists) to resolve provider-specific placeholders:
179
+ 1. Read the NEW template:
180
+ - If `cli_provider == "claude"`: from `$SPECRAILS_DIR/setup-templates/commands/sr/<name>.md`
181
+ - If `cli_provider == "codex"`: from `$SPECRAILS_DIR/setup-templates/skills/sr-<name>/SKILL.md`
182
+ 2. Read stored backlog configuration from `$SPECRAILS_DIR/backlog-config.json` (if it exists) to resolve provider-specific placeholders:
181
183
  - `BACKLOG_PROVIDER` → `provider` field (`github`, `jira`, or `none`)
182
184
  - `BACKLOG_WRITE` → `write_access` field
183
185
  - `JIRA_BASE_URL` → `jira_base_url` field
@@ -192,12 +194,19 @@ For each command in the "changed commands" list from Phase U3:
192
194
  - `{{BACKLOG_VIEW_CMD}}` → provider-specific view command from backlog config
193
195
  - `{{BACKLOG_PREFLIGHT}}` → provider-specific preflight check from backlog config
194
196
  - Any other `{{PLACEHOLDER}}` values → use Phase U2 analysis data
195
- 4. Write the updated command to `.claude/commands/sr/<name>.md`
196
- 5. Show: `✓ Updated /sr:<name>`
197
-
198
- After updating all changed commands, verify no unresolved placeholders remain in the updated files:
197
+ 4. Write the updated file:
198
+ - If `cli_provider == "claude"`: to `.claude/commands/sr/<name>.md`
199
+ - If `cli_provider == "codex"`: to `.agents/skills/sr-<name>/SKILL.md`
200
+ 5. Show:
201
+ - If `cli_provider == "claude"`: `✓ Updated /sr:<name>`
202
+ - If `cli_provider == "codex"`: `✓ Updated $sr-<name>`
203
+
204
+ After updating all changed commands/skills, verify no unresolved placeholders remain:
199
205
  ```bash
206
+ # If cli_provider == "claude":
200
207
  grep -l '{{[A-Z_]*}}' .claude/commands/sr/*.md 2>/dev/null || echo "OK: no broken placeholders"
208
+ # If cli_provider == "codex":
209
+ grep -rl '{{[A-Z_]*}}' .agents/skills/sr-*/SKILL.md 2>/dev/null || echo "OK: no broken placeholders"
201
210
  ```
202
211
  If any placeholders remain unresolved, warn the user:
203
212
  > "⚠ Some placeholders in `<filename>` could not be resolved automatically. Please review the file and fill them in manually."
@@ -221,24 +230,32 @@ For each agent in the "new" list:
221
230
 
222
231
  For each command in the "new commands" list from Phase U3:
223
232
 
224
- 1. Read the template from `.claude/setup-templates/commands/sr/<name>.md` to understand what it does (read the title and description)
233
+ 1. Read the template:
234
+ - If `cli_provider == "claude"`: from `$SPECRAILS_DIR/setup-templates/commands/sr/<name>.md`
235
+ - If `cli_provider == "codex"`: from `$SPECRAILS_DIR/setup-templates/skills/sr-<name>/SKILL.md`
225
236
  2. Prompt the user:
226
- > "New command available: `/sr:<name>` — [one-line description from template]. Install it? [Y/n]"
237
+ - If `cli_provider == "claude"`: `"New command available: /sr:<name> — [one-line description]. Install it? [Y/n]"`
238
+ - If `cli_provider == "codex"`: `"New skill available: $sr-<name> — [one-line description]. Install it? [Y/n]"`
227
239
  3. If the user accepts (or presses Enter):
228
240
  - Apply placeholder substitution using the same rules as Phase U4b (backlog config + codebase analysis)
229
- - Write the command to `.claude/commands/sr/<name>.md`
230
- - Show: `✓ Added /sr:<name>`
241
+ - If `cli_provider == "claude"`: write to `.claude/commands/sr/<name>.md` — show `✓ Added /sr:<name>`
242
+ - If `cli_provider == "codex"`: write to `.agents/skills/sr-<name>/SKILL.md` — show `✓ Added $sr-<name>`
231
243
  4. If the user declines:
232
- - Show: `→ Skipped /sr:<name>`
244
+ - If `cli_provider == "claude"`: show `→ Skipped /sr:<name>`
245
+ - If `cli_provider == "codex"`: show `→ Skipped $sr-<name>`
233
246
 
234
247
  ### Phase U6: Update Workflow Commands
235
248
 
236
249
  If any new agents were added in Phase U5:
237
250
 
238
- 1. Read `.claude/commands/sr/implement.md`
251
+ 1. Read the implement command/skill:
252
+ - If `cli_provider == "claude"`: `.claude/commands/sr/implement.md`
253
+ - If `cli_provider == "codex"`: `.agents/skills/sr-implement/SKILL.md`
239
254
  2. Check if the file references agent names in its orchestration steps (look for `sr-architect`, `sr-developer`, `sr-reviewer` etc.)
240
255
  3. If newly added agents belong in the implementation pipeline (i.e., they are layer-specific developers such as `sr-frontend-developer` or `sr-backend-developer`), add them to the appropriate step in the implement command — specifically where parallel developer agents are launched
241
- 4. Write the updated `.claude/commands/sr/implement.md` if any changes were made
256
+ 4. Write the updated file if any changes were made:
257
+ - If `cli_provider == "claude"`: `.claude/commands/sr/implement.md`
258
+ - If `cli_provider == "codex"`: `.agents/skills/sr-implement/SKILL.md`
242
259
  5. Show which commands were updated, or "No command updates needed" if nothing changed
243
260
 
244
261
  This is a lightweight check — only update commands where the sr- agent clearly belongs. Do not restructure the entire command.
@@ -341,20 +358,31 @@ Store as `QS_IS_EXISTING_CODEBASE=true/false`.
341
358
 
342
359
  Before generating files, check if this is a re-run:
343
360
 
344
- 1. Check if `.claude/commands/sr/` directory exists with any `.md` files:
345
- ```bash
346
- ls .claude/commands/sr/*.md 2>/dev/null
347
- ```
348
- 2. If `.md` files are found → this is a **re-run**. Store `QS_IS_RERUN=true`.
361
+ 1. Check if commands/skills already exist:
362
+ - If `cli_provider == "claude"`: check if `.claude/commands/sr/` directory exists with any `.md` files:
363
+ ```bash
364
+ ls .claude/commands/sr/*.md 2>/dev/null
365
+ ```
366
+ - If `cli_provider == "codex"`: check if `.agents/skills/sr-*/SKILL.md` files exist:
367
+ ```bash
368
+ ls .agents/skills/sr-*/SKILL.md 2>/dev/null
369
+ ```
370
+ 2. If files are found → this is a **re-run**. Store `QS_IS_RERUN=true`.
349
371
  3. If the directory does not exist or is empty → this is a **fresh install**. Store `QS_IS_RERUN=false`.
350
372
 
351
- In re-run mode, QS3 executes in **gap-fill mode** for command files:
352
- - For each command in the list, check if it already exists at `.claude/commands/sr/<name>.md`
353
- - If it exists: skip it and show `✓ Already installed: /sr:<name>`
354
- - If it does NOT exist: install it and show `✓ Added /sr:<name> (was missing)`
373
+ In re-run mode, QS3 executes in **gap-fill mode** for command/skill files:
374
+ - For each command in the list, check if it already exists:
375
+ - If `cli_provider == "claude"`: at `.claude/commands/sr/<name>.md`
376
+ - If `cli_provider == "codex"`: at `.agents/skills/sr-<name>/SKILL.md`
377
+ - If it exists: skip it and show:
378
+ - Claude: `✓ Already installed: /sr:<name>`
379
+ - Codex: `✓ Already installed: $sr-<name>`
380
+ - If it does NOT exist: install it and show:
381
+ - Claude: `✓ Added /sr:<name> (was missing)`
382
+ - Codex: `✓ Added $sr-<name> (was missing)`
355
383
  - Do NOT prompt the user for confirmation on missing files — install them automatically
356
384
 
357
- For CLAUDE.md and agent files, the existing per-file prompts already handle re-runs (user is asked before overwriting). No change needed there.
385
+ For CLAUDE.md/AGENTS.md and agent files, the existing per-file prompts already handle re-runs (user is asked before overwriting). No change needed there.
358
386
 
359
387
  ### QS3: Generate files
360
388
 
@@ -404,11 +432,21 @@ Core commands (always install if missing):
404
432
 
405
433
  Do NOT copy `product-backlog.md` or `update-product-driven-backlog.md` (no backlog provider configured).
406
434
 
407
- If `QS_IS_RERUN=false` (fresh install): copy all core commands from `setup-templates/commands/sr/` to `.claude/commands/sr/`.
435
+ **If `cli_provider == "claude"`:**
436
+
437
+ If `QS_IS_RERUN=false` (fresh install): copy all core commands from `$SPECRAILS_DIR/setup-templates/commands/sr/` to `.claude/commands/sr/`.
408
438
 
409
439
  If `QS_IS_RERUN=true` (gap-fill mode): for each command in the list above, check if `.claude/commands/sr/<name>.md` already exists:
410
440
  - If it exists: skip it — show `✓ Already installed: /sr:<name>`
411
- - If it does NOT exist: copy from `setup-templates/commands/sr/<name>.md` — show `✓ Added /sr:<name> (was missing)`
441
+ - If it does NOT exist: copy from `$SPECRAILS_DIR/setup-templates/commands/sr/<name>.md` — show `✓ Added /sr:<name> (was missing)`
442
+
443
+ **If `cli_provider == "codex"`:**
444
+
445
+ If `QS_IS_RERUN=false` (fresh install): for each core command, copy the corresponding skill from `$SPECRAILS_DIR/setup-templates/skills/sr-<name>/SKILL.md` to `.agents/skills/sr-<name>/SKILL.md` (create the directory first).
446
+
447
+ If `QS_IS_RERUN=true` (gap-fill mode): for each command in the list above, check if `.agents/skills/sr-<name>/SKILL.md` already exists:
448
+ - If it exists: skip it — show `✓ Already installed: $sr-<name>`
449
+ - If it does NOT exist: copy from `$SPECRAILS_DIR/setup-templates/skills/sr-<name>/SKILL.md` — show `✓ Added $sr-<name> (was missing)`
412
450
 
413
451
  **4. Cleanup**
414
452
 
@@ -954,9 +992,11 @@ Write each persona to `$SPECRAILS_DIR/agents/personas/`:
954
992
  - Use the VPC personas generated in Phase 2
955
993
  - File naming: kebab-case of persona nickname (e.g., `the-developer.md`, `the-admin.md`)
956
994
 
957
- ### 4.3 Generate commands
995
+ ### 4.3 Generate commands / skills
958
996
 
959
- For each selected command, read the template and adapt:
997
+ For each selected command, read the template and adapt.
998
+
999
+ **If `cli_provider == "claude"` (default):**
960
1000
  - `setup-templates/commands/sr/implement.md` → `.claude/commands/sr/implement.md`
961
1001
  - `setup-templates/commands/sr/batch-implement.md` → `.claude/commands/sr/batch-implement.md`
962
1002
  - `setup-templates/commands/sr/propose-spec.md` → `.claude/commands/sr/propose-spec.md`
@@ -967,6 +1007,32 @@ For each selected command, read the template and adapt:
967
1007
  - `setup-templates/commands/sr/refactor-recommender.md` → `.claude/commands/sr/refactor-recommender.md`
968
1008
  - `setup-templates/commands/sr/why.md` → `.claude/commands/sr/why.md`
969
1009
 
1010
+ **If `cli_provider == "codex"`:**
1011
+ - `setup-templates/skills/sr-implement/SKILL.md` → `.agents/skills/sr-implement/SKILL.md`
1012
+ - `setup-templates/skills/sr-batch-implement/SKILL.md` → `.agents/skills/sr-batch-implement/SKILL.md`
1013
+ - `setup-templates/commands/sr/propose-spec.md` → `.agents/skills/sr-propose-spec/SKILL.md` (wrap with YAML frontmatter if no skill template exists)
1014
+ - `setup-templates/commands/sr/product-backlog.md` → `.agents/skills/sr-product-backlog/SKILL.md` (if `BACKLOG_PROVIDER != none`; wrap with frontmatter)
1015
+ - `setup-templates/commands/sr/update-product-driven-backlog.md` → `.agents/skills/sr-update-product-driven-backlog/SKILL.md` (if `BACKLOG_PROVIDER != none`; wrap with frontmatter)
1016
+ - `setup-templates/skills/sr-health-check/SKILL.md` → `.agents/skills/sr-health-check/SKILL.md`
1017
+ - `setup-templates/skills/sr-compat-check/SKILL.md` → `.agents/skills/sr-compat-check/SKILL.md`
1018
+ - `setup-templates/skills/sr-refactor-recommender/SKILL.md` → `.agents/skills/sr-refactor-recommender/SKILL.md`
1019
+ - `setup-templates/skills/sr-why/SKILL.md` → `.agents/skills/sr-why/SKILL.md`
1020
+
1021
+ **Codex skill frontmatter wrapping:** When a dedicated skill template does not exist in `setup-templates/skills/` for a command, generate the `SKILL.md` by prepending YAML frontmatter to the command content:
1022
+ ```yaml
1023
+ ---
1024
+ name: sr-<name>
1025
+ description: "<one-line description from the command's first heading>"
1026
+ license: MIT
1027
+ compatibility: "Requires git."
1028
+ metadata:
1029
+ author: specrails
1030
+ version: "1.0"
1031
+ ---
1032
+ ```
1033
+
1034
+ For both providers, create the output directory before writing (`mkdir -p` for `.claude/commands/sr/` or `.agents/skills/sr-<name>/`).
1035
+
970
1036
  Adapt:
971
1037
  - CI commands to match detected stack
972
1038
  - **Persona references** to match generated personas (see substitution rules below)
@@ -980,7 +1046,7 @@ When adapting `update-product-driven-backlog.md` and `product-backlog.md`, subst
980
1046
 
981
1047
  | Placeholder | Substitution rule |
982
1048
  |-------------|------------------|
983
- | `{{PERSONA_FILE_READ_LIST}}` | One bullet per persona file: `- Read \`.claude/agents/personas/{name}.md\`` |
1049
+ | `{{PERSONA_FILE_READ_LIST}}` | One bullet per persona file: `- Read \`$SPECRAILS_DIR/agents/personas/{name}.md\`` |
984
1050
  | `{{PERSONA_SCORE_HEADERS}}` | Column headers for each persona nickname: e.g., `Alex \| Sara \| Kai` |
985
1051
  | `{{PERSONA_SCORE_SEPARATORS}}` | One `------` separator per persona column |
986
1052
  | `{{PERSONA_FIT_FORMAT}}` | Inline score display: e.g., `Alex: X/5, Sara: X/5, Kai: X/5` |
@@ -1017,7 +1083,7 @@ When adapting `update-product-driven-backlog.md` and `product-backlog.md`, subst
1017
1083
  - Issue view: `jira issue view {key}` or REST API
1018
1084
  - VPC scores stored in the issue description body (same markdown format, parsed from description)
1019
1085
  - Pre-flight check: `jira me` or test API connectivity
1020
- - Store JIRA config in `.claude/backlog-config.json`:
1086
+ - Store JIRA config in `$SPECRAILS_DIR/backlog-config.json`:
1021
1087
  ```json
1022
1088
  {
1023
1089
  "provider": "jira",
@@ -1033,16 +1099,18 @@ The command templates use `{{BACKLOG_FETCH_CMD}}`, `{{BACKLOG_CREATE_CMD}}`, `{{
1033
1099
  ### 4.4 Generate rules
1034
1100
 
1035
1101
  For each detected layer, read the layer rule template and generate a layer-specific rules file:
1036
- - `setup-templates/rules/layer.md` → `.claude/rules/{layer-name}.md`
1102
+ - `setup-templates/rules/layer.md` → `$SPECRAILS_DIR/rules/{layer-name}.md`
1037
1103
 
1038
1104
  Each rule file must:
1039
1105
  - Have the correct `paths:` frontmatter matching the layer's directory
1040
1106
  - Contain conventions specific to that layer (from Phase 1 analysis)
1041
1107
  - Reference actual file paths and patterns from the codebase
1042
1108
 
1043
- ### 4.5 Generate root CLAUDE.md
1109
+ ### 4.5 Generate root instructions file
1044
1110
 
1045
- If no CLAUDE.md exists, generate one from the template. If one already exists, **merge** — add the agent workflow sections without removing existing content.
1111
+ **If `cli_provider == "claude"`:** If no `CLAUDE.md` exists, generate one from the template. If one already exists, **merge** — add the agent workflow sections without removing existing content.
1112
+
1113
+ **If `cli_provider == "codex"`:** If no `AGENTS.md` exists, generate one from the template. If one already exists, **merge** — add the agent workflow sections without removing existing content.
1046
1114
 
1047
1115
  ### 4.6 Generate settings
1048
1116
 
@@ -1154,13 +1222,14 @@ ls .claude/agent-memory/
1154
1222
  # If cli_provider == "codex":
1155
1223
  ls .codex/agents/sr-*.toml
1156
1224
  ls .codex/agents/personas/*.md
1157
- ls .codex/skills/sr-*/SKILL.md
1225
+ ls .agents/skills/sr-*/SKILL.md
1158
1226
  ls .codex/rules/*.md
1159
1227
  ls .codex/agent-memory/
1160
1228
 
1161
1229
  # These should NOT exist (scaffolding):
1162
1230
  # $SPECRAILS_DIR/setup-templates/ — GONE
1163
- # $SPECRAILS_DIR/commands/setup.md — GONE
1231
+ # If cli_provider == "claude": $SPECRAILS_DIR/commands/setup.md — GONE
1232
+ # If cli_provider == "codex": .agents/skills/setup/ — GONE (installer scaffold, not a generated sr-skill)
1164
1233
  ```
1165
1234
 
1166
1235
  If any scaffolding artifact remains, remove it.
@@ -1198,7 +1267,8 @@ Display the complete installation summary:
1198
1267
  [For each user-generated persona:]
1199
1268
  | "[Name]" — The [Role] | $SPECRAILS_DIR/agents/personas/[name].md | Generated |
1200
1269
 
1201
- ### Commands Installed
1270
+ ### Commands / Skills Installed
1271
+ [If cli_provider == "claude":]
1202
1272
  | Command | File |
1203
1273
  |---------|------|
1204
1274
  | /sr:implement | .claude/commands/sr/implement.md |
@@ -1210,33 +1280,58 @@ Display the complete installation summary:
1210
1280
  | /sr:compat-check | .claude/commands/sr/compat-check.md |
1211
1281
  | /sr:refactor-recommender | .claude/commands/sr/refactor-recommender.md |
1212
1282
  | /sr:why | .claude/commands/sr/why.md |
1213
-
1214
- Note: Only commands selected during setup are shown. Backlog commands are excluded if no backlog provider was configured.
1283
+ [If cli_provider == "codex":]
1284
+ | Skill | File |
1285
+ |-------|------|
1286
+ | $sr-implement | .agents/skills/sr-implement/SKILL.md |
1287
+ | $sr-batch-implement | .agents/skills/sr-batch-implement/SKILL.md |
1288
+ | $sr-propose-spec | .agents/skills/sr-propose-spec/SKILL.md |
1289
+ | $sr-product-backlog | .agents/skills/sr-product-backlog/SKILL.md |
1290
+ | $sr-update-product-driven-backlog | .agents/skills/sr-update-product-driven-backlog/SKILL.md |
1291
+ | $sr-health-check | .agents/skills/sr-health-check/SKILL.md |
1292
+ | $sr-compat-check | .agents/skills/sr-compat-check/SKILL.md |
1293
+ | $sr-refactor-recommender | .agents/skills/sr-refactor-recommender/SKILL.md |
1294
+ | $sr-why | .agents/skills/sr-why/SKILL.md |
1295
+
1296
+ Note: Only commands/skills selected during setup are shown. Backlog commands are excluded if no backlog provider was configured.
1215
1297
 
1216
1298
  ### Rules Created
1217
1299
  | Layer | File |
1218
1300
  |-------|------|
1219
- | Backend | .claude/rules/backend.md |
1220
- | Frontend | .claude/rules/frontend.md |
1301
+ | Backend | $SPECRAILS_DIR/rules/backend.md |
1302
+ | Frontend | $SPECRAILS_DIR/rules/frontend.md |
1221
1303
 
1222
1304
  ### Scaffolding Removed
1223
1305
  | Artifact | Status |
1224
1306
  |----------|--------|
1225
- | .claude/setup-templates/ | Deleted |
1226
- | .claude/commands/setup.md | Deleted |
1307
+ | $SPECRAILS_DIR/setup-templates/ | Deleted |
1308
+ [If cli_provider == "claude":] | .claude/commands/setup.md | Deleted |
1309
+ [If cli_provider == "codex":] | .agents/skills/setup/ | Deleted |
1227
1310
  | specrails/ | [User's choice] |
1228
1311
 
1229
1312
  ### Next Steps
1313
+ [If cli_provider == "claude":]
1230
1314
  1. Review the generated files in .claude/
1231
1315
  2. Run `/sr:product-backlog` to see your backlog (if GitHub Issues exist)
1232
1316
  3. Run `/sr:update-product-driven-backlog` to generate feature ideas
1233
1317
  4. Run `/sr:implement #issue-number` to implement a feature
1234
1318
  5. Commit the .claude/ directory to version control
1319
+ [If cli_provider == "codex":]
1320
+ 1. Review the generated files in .codex/ and .agents/skills/
1321
+ 2. Run `$sr-product-backlog` to see your backlog (if GitHub Issues exist)
1322
+ 3. Run `$sr-update-product-driven-backlog` to generate feature ideas
1323
+ 4. Run `$sr-implement #issue-number` to implement a feature
1324
+ 5. Commit the .codex/ and .agents/ directories to version control
1235
1325
 
1236
1326
  ### Quick Start
1327
+ [If cli_provider == "claude":]
1237
1328
  - `/sr:implement "describe a feature"` — implement something right now
1238
1329
  - `/sr:product-backlog` — see prioritized feature ideas
1239
1330
  - `/sr:update-product-driven-backlog` — discover new features using VPC
1331
+ [If cli_provider == "codex":]
1332
+ - `$sr-implement "describe a feature"` — implement something right now
1333
+ - `$sr-product-backlog` — see prioritized feature ideas
1334
+ - `$sr-update-product-driven-backlog` — discover new features using VPC
1240
1335
  ```
1241
1336
 
1242
1337
  ## First Task Prompt (Advanced Mode)
@@ -1248,7 +1343,10 @@ After displaying the setup complete summary above, detect the project type and o
1248
1343
  ✅ Setup complete.
1249
1344
 
1250
1345
  Try your first spec:
1346
+ [If cli_provider == "claude":]
1251
1347
  > /sr:product-backlog
1348
+ [If cli_provider == "codex":]
1349
+ > $sr-product-backlog
1252
1350
  ```
1253
1351
 
1254
1352
  **Existing codebase** (one or more of the above files found in root):
@@ -1256,7 +1354,10 @@ Try your first spec:
1256
1354
  ✅ Setup complete.
1257
1355
 
1258
1356
  Try your first spec:
1357
+ [If cli_provider == "claude":]
1259
1358
  > /sr:health-check
1359
+ [If cli_provider == "codex":]
1360
+ > $sr-health-check
1260
1361
  ```
1261
1362
 
1262
1363
  Then stop.
package/install.sh CHANGED
@@ -456,7 +456,13 @@ step "Phase 3: Installing specrails artifacts"
456
456
 
457
457
  # Create directory structure
458
458
  mkdir -p "$REPO_ROOT/specrails"
459
- mkdir -p "$REPO_ROOT/$SPECRAILS_DIR/commands"
459
+ if [[ "$CLI_PROVIDER" == "codex" ]]; then
460
+ # Codex: install as Agent Skills (Codex doesn't support .codex/commands/)
461
+ mkdir -p "$REPO_ROOT/.agents/skills/setup"
462
+ mkdir -p "$REPO_ROOT/.agents/skills/doctor"
463
+ else
464
+ mkdir -p "$REPO_ROOT/$SPECRAILS_DIR/commands"
465
+ fi
460
466
  mkdir -p "$REPO_ROOT/$SPECRAILS_DIR/setup-templates/agents"
461
467
  mkdir -p "$REPO_ROOT/$SPECRAILS_DIR/setup-templates/commands"
462
468
  mkdir -p "$REPO_ROOT/$SPECRAILS_DIR/setup-templates/skills"
@@ -467,13 +473,46 @@ mkdir -p "$REPO_ROOT/$SPECRAILS_DIR/setup-templates/settings"
467
473
  mkdir -p "$REPO_ROOT/$SPECRAILS_DIR/setup-templates/prompts"
468
474
  mkdir -p "$REPO_ROOT/$SPECRAILS_DIR/agent-memory/explanations"
469
475
 
470
- # Copy the /setup command
471
- cp "$SCRIPT_DIR/commands/setup.md" "$REPO_ROOT/$SPECRAILS_DIR/commands/setup.md"
472
- ok "Installed /setup command"
476
+ # Copy the /setup and /doctor commands (or skills for Codex)
477
+ if [[ "$CLI_PROVIDER" == "codex" ]]; then
478
+ # Codex uses Agent Skills in .agents/skills/<name>/SKILL.md
479
+ {
480
+ echo '---'
481
+ echo 'name: setup'
482
+ echo 'description: "Interactive wizard to configure the full specrails agent workflow system for this repository."'
483
+ echo 'license: MIT'
484
+ echo 'compatibility: "Requires npm, git."'
485
+ echo 'metadata:'
486
+ echo ' author: specrails'
487
+ echo ' version: "1.0"'
488
+ echo '---'
489
+ echo ''
490
+ cat "$SCRIPT_DIR/commands/setup.md"
491
+ } > "$REPO_ROOT/.agents/skills/setup/SKILL.md"
492
+ ok "Installed \$setup skill"
493
+
494
+ {
495
+ echo '---'
496
+ echo 'name: doctor'
497
+ echo 'description: "Health check for the specrails agent workflow system — validates agents, commands, rules, and configuration."'
498
+ echo 'license: MIT'
499
+ echo 'compatibility: "Requires npm, git."'
500
+ echo 'metadata:'
501
+ echo ' author: specrails'
502
+ echo ' version: "1.0"'
503
+ echo '---'
504
+ echo ''
505
+ cat "$SCRIPT_DIR/commands/doctor.md"
506
+ } > "$REPO_ROOT/.agents/skills/doctor/SKILL.md"
507
+ ok "Installed \$doctor skill"
508
+ else
509
+ # Claude Code uses commands in .claude/commands/
510
+ cp "$SCRIPT_DIR/commands/setup.md" "$REPO_ROOT/$SPECRAILS_DIR/commands/setup.md"
511
+ ok "Installed /setup command"
473
512
 
474
- # Copy the /doctor command
475
- cp "$SCRIPT_DIR/commands/doctor.md" "$REPO_ROOT/$SPECRAILS_DIR/commands/doctor.md"
476
- ok "Installed /doctor command"
513
+ cp "$SCRIPT_DIR/commands/doctor.md" "$REPO_ROOT/$SPECRAILS_DIR/commands/doctor.md"
514
+ ok "Installed /doctor command"
515
+ fi
477
516
 
478
517
  # Install bin/doctor.sh for standalone use
479
518
  mkdir -p "$REPO_ROOT/.specrails/bin"
@@ -552,7 +591,12 @@ echo ""
552
591
  echo " Provider: $CLI_PROVIDER → output to $SPECRAILS_DIR/"
553
592
  echo ""
554
593
  echo " Files installed:"
555
- echo " $SPECRAILS_DIR/commands/setup.md ← The /setup command"
594
+ if [[ "$CLI_PROVIDER" == "codex" ]]; then
595
+ echo " .agents/skills/setup/SKILL.md ← The \$setup skill"
596
+ echo " .agents/skills/doctor/SKILL.md ← The \$doctor skill"
597
+ else
598
+ echo " $SPECRAILS_DIR/commands/setup.md ← The /setup command"
599
+ fi
556
600
  echo " $SPECRAILS_DIR/setup-templates/ ← Templates: commands + skills (temporary, removed after setup)"
557
601
  echo " .specrails-version ← Installed specrails version"
558
602
  echo " .specrails-manifest.json ← Artifact checksums for update detection"
@@ -574,7 +618,11 @@ echo -e " ${BOLD}cd $REPO_ROOT && $CLI_PROVIDER${NC}"
574
618
  echo ""
575
619
  echo " 2. Run the setup wizard:"
576
620
  echo ""
577
- echo -e " ${BOLD}/setup${NC}"
621
+ if [[ "$CLI_PROVIDER" == "codex" ]]; then
622
+ echo -e " ${BOLD}\$setup${NC}"
623
+ else
624
+ echo -e " ${BOLD}/setup${NC}"
625
+ fi
578
626
  echo ""
579
627
  if [[ "$CLI_PROVIDER" == "codex" ]]; then
580
628
  echo " Codex will analyze your codebase, ask about your users,"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specrails-core",
3
- "version": "2.1.2",
3
+ "version": "3.0.0",
4
4
  "description": "AI agent workflow system for Claude Code — installs 12 specialized agents, orchestration commands, and persona-driven product discovery into any repository",
5
5
  "bin": {
6
6
  "specrails-core": "bin/specrails-core.js"