specrails-core 3.5.2 → 3.6.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 +76 -76
- package/docs/customization.md +36 -6
- package/docs/installation.md +4 -4
- package/docs/updating.md +4 -4
- package/docs/user-docs/faq.md +1 -1
- package/docs/user-docs/getting-started-codex.md +1 -1
- package/docs/user-docs/installation.md +2 -2
- package/install.sh +20 -20
- package/package.json +1 -1
- package/templates/commands/specrails/reconfig.md +89 -0
- package/templates/commands/specrails/setup.md +151 -79
- package/update.sh +44 -17
package/commands/setup.md
CHANGED
|
@@ -26,7 +26,7 @@ When `--update` is passed, execute this streamlined flow instead of the full wiz
|
|
|
26
26
|
|
|
27
27
|
Read the following files to understand the current installation state:
|
|
28
28
|
|
|
29
|
-
1. Read `.specrails-manifest.json` — contains agent template checksums from the last install/update. Structure:
|
|
29
|
+
1. Read `.specrails/specrails-manifest.json` — contains agent template checksums from the last install/update. Structure:
|
|
30
30
|
```json
|
|
31
31
|
{
|
|
32
32
|
"version": "0.2.0",
|
|
@@ -39,22 +39,22 @@ Read the following files to understand the current installation state:
|
|
|
39
39
|
}
|
|
40
40
|
```
|
|
41
41
|
If this file does not exist, inform the user:
|
|
42
|
-
> "No `.specrails-manifest.json` found. This looks like a pre-versioning installation. Run `update.sh` first to initialize the manifest, then re-run `/specrails:setup --update`."
|
|
42
|
+
> "No `.specrails/specrails-manifest.json` found. This looks like a pre-versioning installation. Run `update.sh` first to initialize the manifest, then re-run `/specrails:setup --update`."
|
|
43
43
|
Then stop.
|
|
44
44
|
|
|
45
|
-
2. Read `.specrails-version` — contains the current version string (e.g., `0.2.0`). If it does not exist, treat version as `0.1.0 (legacy)`.
|
|
45
|
+
2. Read `.specrails/specrails-version` — contains the current version string (e.g., `0.2.0`). If it does not exist, treat version as `0.1.0 (legacy)`.
|
|
46
46
|
|
|
47
|
-
3. Determine `$SPECRAILS_DIR` by reading
|
|
47
|
+
3. Determine `$SPECRAILS_DIR` by reading `.specrails/setup-templates/.provider-detection.json`. Extract `cli_provider` and `specrails_dir`. If not found, default to `cli_provider = "claude"`, `specrails_dir = ".claude"`.
|
|
48
48
|
|
|
49
|
-
4. List all template files in
|
|
49
|
+
4. List all template files in `.specrails/setup-templates/agents/` — these are the NEW agent templates from the update:
|
|
50
50
|
```bash
|
|
51
|
-
ls
|
|
51
|
+
ls .specrails/setup-templates/agents/
|
|
52
52
|
```
|
|
53
53
|
Template files are named with `sr-` prefix (e.g., `sr-architect.md`, `sr-developer.md`).
|
|
54
54
|
|
|
55
|
-
5. List all template files in
|
|
55
|
+
5. List all template files in `.specrails/setup-templates/commands/specrails/` — these are the NEW command templates from the update:
|
|
56
56
|
```bash
|
|
57
|
-
ls
|
|
57
|
+
ls .specrails/setup-templates/commands/specrails/
|
|
58
58
|
```
|
|
59
59
|
Command template files include `implement.md`, `batch-implement.md`, `compat-check.md`, `refactor-recommender.md`, `why.md`, `get-backlog-specs.md`, `auto-propose-backlog-specs.md`.
|
|
60
60
|
If this directory does not exist, skip command template checking for this update.
|
|
@@ -82,28 +82,28 @@ Store all results for use in Phases U4 and U5.
|
|
|
82
82
|
|
|
83
83
|
### Phase U3: Identify What Needs Regeneration
|
|
84
84
|
|
|
85
|
-
**Agent templates:** For each agent template, find its entry in the manifest's `artifacts` map (keyed as `templates/agents/sr-<name>.md`). Compute the SHA-256 checksum of the corresponding file in `.
|
|
85
|
+
**Agent templates:** For each agent template, find its entry in the manifest's `artifacts` map (keyed as `templates/agents/sr-<name>.md`). Compute the SHA-256 checksum of the corresponding file in `.specrails/setup-templates/agents/`:
|
|
86
86
|
|
|
87
87
|
```bash
|
|
88
|
-
sha256sum .
|
|
88
|
+
sha256sum .specrails/setup-templates/agents/sr-<name>.md
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
Build three lists for agents:
|
|
92
92
|
|
|
93
93
|
1. **Changed agents**: agent name exists in manifest AND the current template checksum differs from the manifest checksum → mark for regeneration
|
|
94
|
-
2. **New agents**: template file exists in `.
|
|
94
|
+
2. **New agents**: template file exists in `.specrails/setup-templates/agents/` but the agent name is NOT in the manifest → mark for evaluation
|
|
95
95
|
3. **Unchanged agents**: agent name exists in manifest AND checksum matches → skip
|
|
96
96
|
|
|
97
|
-
**Command templates:** If `.
|
|
97
|
+
**Command templates:** If `.specrails/setup-templates/commands/specrails/` exists, for each command template file, find its entry in the manifest's `artifacts` map (keyed as `templates/commands/specrails/<name>.md`). Compute the SHA-256 checksum of the corresponding file in `.specrails/setup-templates/commands/specrails/`:
|
|
98
98
|
|
|
99
99
|
```bash
|
|
100
|
-
sha256sum .
|
|
100
|
+
sha256sum .specrails/setup-templates/commands/specrails/<name>.md
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
Build three lists for commands:
|
|
104
104
|
|
|
105
105
|
1. **Changed commands**: command name exists in manifest AND the current template checksum differs from the manifest checksum → mark for update
|
|
106
|
-
2. **New commands**: template file exists in `.
|
|
106
|
+
2. **New commands**: template file exists in `.specrails/setup-templates/commands/specrails/` but the command name is NOT in the manifest → mark for evaluation
|
|
107
107
|
3. **Unchanged commands**: command name exists in manifest AND checksum matches → skip
|
|
108
108
|
|
|
109
109
|
Display the combined analysis to the user:
|
|
@@ -144,7 +144,7 @@ Then jump to Phase U7.
|
|
|
144
144
|
|
|
145
145
|
For each agent in the "changed" list:
|
|
146
146
|
|
|
147
|
-
1. Read the NEW template from
|
|
147
|
+
1. Read the NEW template from `.specrails/setup-templates/agents/sr-<name>.md`
|
|
148
148
|
2. Use the codebase analysis from Phase U2 to fill in all `{{PLACEHOLDER}}` values, using the same substitution rules as Phase 4.1 of the full setup:
|
|
149
149
|
- `{{PROJECT_NAME}}` → project name (from README.md or directory name)
|
|
150
150
|
- `{{ARCHITECTURE_DIAGRAM}}` → detected architecture layers
|
|
@@ -176,8 +176,8 @@ grep -r '{{[A-Z_]*}}' .codex/agents/sr-*.toml 2>/dev/null || echo "OK: no broken
|
|
|
176
176
|
For each command in the "changed commands" list from Phase U3:
|
|
177
177
|
|
|
178
178
|
1. Read the NEW template:
|
|
179
|
-
- If `cli_provider == "claude"`: from
|
|
180
|
-
- If `cli_provider == "codex"`: from
|
|
179
|
+
- If `cli_provider == "claude"`: from `.specrails/setup-templates/commands/specrails/<name>.md`
|
|
180
|
+
- If `cli_provider == "codex"`: from `.specrails/setup-templates/skills/sr-<name>/SKILL.md`
|
|
181
181
|
2. Read stored backlog configuration from `.specrails/backlog-config.json` (if it exists) to resolve provider-specific placeholders:
|
|
182
182
|
- `BACKLOG_PROVIDER` → `provider` field (`github`, `jira`, or `none`)
|
|
183
183
|
- `BACKLOG_WRITE` → `write_access` field
|
|
@@ -214,7 +214,7 @@ If any placeholders remain unresolved, warn the user:
|
|
|
214
214
|
|
|
215
215
|
For each agent in the "new" list:
|
|
216
216
|
|
|
217
|
-
1. Read the template from `.
|
|
217
|
+
1. Read the template from `.specrails/setup-templates/agents/sr-<name>.md` to understand what stack or layer it targets (read its description and any layer-specific comments)
|
|
218
218
|
2. Match against the codebase detected in Phase U2:
|
|
219
219
|
- If the template targets a layer/stack that IS present (e.g., `sr-frontend-developer` and React was detected), prompt:
|
|
220
220
|
> "New agent available: `sr-<name>` — your project uses [detected tech]. Add it? [Y/n]"
|
|
@@ -230,8 +230,8 @@ For each agent in the "new" list:
|
|
|
230
230
|
For each command in the "new commands" list from Phase U3:
|
|
231
231
|
|
|
232
232
|
1. Read the template:
|
|
233
|
-
- If `cli_provider == "claude"`: from
|
|
234
|
-
- If `cli_provider == "codex"`: from
|
|
233
|
+
- If `cli_provider == "claude"`: from `.specrails/setup-templates/commands/specrails/<name>.md`
|
|
234
|
+
- If `cli_provider == "codex"`: from `.specrails/setup-templates/skills/sr-<name>/SKILL.md`
|
|
235
235
|
2. Prompt the user:
|
|
236
236
|
- If `cli_provider == "claude"`: `"New command available: /specrails:<name> — [one-line description]. Install it? [Y/n]"`
|
|
237
237
|
- If `cli_provider == "codex"`: `"New skill available: $sr-<name> — [one-line description]. Install it? [Y/n]"`
|
|
@@ -298,12 +298,12 @@ All agents and commands are now up to date.
|
|
|
298
298
|
[list command names, or "(none)"]
|
|
299
299
|
```
|
|
300
300
|
|
|
301
|
-
Update `.specrails-manifest.json` to reflect the new checksums for all regenerated/updated and added agents and commands:
|
|
301
|
+
Update `.specrails/specrails-manifest.json` to reflect the new checksums for all regenerated/updated and added agents and commands:
|
|
302
302
|
- For each regenerated agent: update its checksum entry to the new template's checksum (keyed as `templates/agents/sr-<name>.md`)
|
|
303
303
|
- For each added agent: add a new entry with its checksum
|
|
304
304
|
- For each updated command: update its checksum entry to the new template's checksum (keyed as `templates/commands/specrails/<name>.md`)
|
|
305
305
|
- For each added command: add a new entry with its checksum
|
|
306
|
-
- Update the `version` field to the version read from `.specrails-version`
|
|
306
|
+
- Update the `version` field to the version read from `.specrails/specrails-version`
|
|
307
307
|
|
|
308
308
|
---
|
|
309
309
|
|
|
@@ -382,7 +382,7 @@ Generate files using the Lite Mode defaults.
|
|
|
382
382
|
|
|
383
383
|
**1. CLAUDE.md**
|
|
384
384
|
|
|
385
|
-
Read
|
|
385
|
+
Read `.specrails/setup-templates/claude-md/CLAUDE-quickstart.md` (or fall back to `.specrails/setup-templates/claude-md/default.md` if quickstart template is not found).
|
|
386
386
|
|
|
387
387
|
Replace placeholders:
|
|
388
388
|
- `{{PROJECT_NAME}}` → derive from directory name or README.md first heading
|
|
@@ -396,7 +396,7 @@ Skip if user says no.
|
|
|
396
396
|
|
|
397
397
|
**2. Agent files**
|
|
398
398
|
|
|
399
|
-
For each default agent (sr-architect, sr-developer, sr-reviewer, sr-product-manager), read the template from
|
|
399
|
+
For each default agent (sr-architect, sr-developer, sr-reviewer, sr-product-manager), read the template from `.specrails/setup-templates/agents/<name>.md` and generate the adapted agent file using the dual-format rules from Phase 4.1:
|
|
400
400
|
- `cli_provider == "claude"`: write to `.claude/agents/<name>.md` (Markdown with frontmatter)
|
|
401
401
|
- `cli_provider == "codex"`: write to `.codex/agents/<name>.toml` (TOML format)
|
|
402
402
|
|
|
@@ -436,7 +436,7 @@ Core commands (always install if missing):
|
|
|
436
436
|
|
|
437
437
|
**If `cli_provider == "claude"`:**
|
|
438
438
|
|
|
439
|
-
If `QS_IS_RERUN=false` (fresh install): for each core command, read the template from
|
|
439
|
+
If `QS_IS_RERUN=false` (fresh install): for each core command, read the template from `.specrails/setup-templates/commands/specrails/<name>.md`, substitute the backlog placeholders with local values (using the same table as Phase 4.3 "Local Tickets"), stub all persona placeholders with `(Lite Mode — run /specrails:setup to configure personas)`, then write to `.claude/commands/specrails/<name>.md`.
|
|
440
440
|
|
|
441
441
|
If `QS_IS_RERUN=true` (gap-fill mode): for each command in the list above, check if `.claude/commands/specrails/<name>.md` already exists:
|
|
442
442
|
- If it exists: skip it — show `✓ Already installed: /specrails:<name>`
|
|
@@ -444,7 +444,7 @@ If `QS_IS_RERUN=true` (gap-fill mode): for each command in the list above, check
|
|
|
444
444
|
|
|
445
445
|
**If `cli_provider == "codex"`:**
|
|
446
446
|
|
|
447
|
-
If `QS_IS_RERUN=false` (fresh install): for each core command, read the corresponding skill template from
|
|
447
|
+
If `QS_IS_RERUN=false` (fresh install): for each core command, read the corresponding skill template from `.specrails/setup-templates/skills/sr-<name>/SKILL.md`, substitute the backlog placeholders with local values and stub persona placeholders with `(Lite Mode — run /specrails:setup to configure personas)`, then write to `.agents/skills/sr-<name>/SKILL.md` (create the directory first).
|
|
448
448
|
|
|
449
449
|
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:
|
|
450
450
|
- If it exists: skip it — show `✓ Already installed: $sr-<name>`
|
|
@@ -452,7 +452,7 @@ If `QS_IS_RERUN=true` (gap-fill mode): for each command in the list above, check
|
|
|
452
452
|
|
|
453
453
|
**4. Cleanup**
|
|
454
454
|
|
|
455
|
-
Remove
|
|
455
|
+
Remove `.specrails/setup-templates/` (same as full wizard cleanup in Phase 5).
|
|
456
456
|
|
|
457
457
|
Remove `commands/setup.md` from `.claude/commands/` if it was copied there by the installer.
|
|
458
458
|
|
|
@@ -560,7 +560,7 @@ Display the detected architecture to the user:
|
|
|
560
560
|
|
|
561
561
|
### OSS Project Detection
|
|
562
562
|
|
|
563
|
-
Read `.
|
|
563
|
+
Read `.specrails/setup-templates/.oss-detection.json` if it exists.
|
|
564
564
|
|
|
565
565
|
| Signal | Status |
|
|
566
566
|
|--------|--------|
|
|
@@ -629,7 +629,7 @@ Search queries to use (adapt to the domain):
|
|
|
629
629
|
|
|
630
630
|
### 2.3 Generate VPC personas
|
|
631
631
|
|
|
632
|
-
For each user type, generate a full Value Proposition Canvas persona file following the template at `.
|
|
632
|
+
For each user type, generate a full Value Proposition Canvas persona file following the template at `.specrails/setup-templates/personas/persona.md`.
|
|
633
633
|
|
|
634
634
|
Each persona must include:
|
|
635
635
|
- **Profile**: Demographics, behaviors, tools used, spending patterns
|
|
@@ -986,9 +986,9 @@ Wait for final confirmation.
|
|
|
986
986
|
|
|
987
987
|
## Phase 4: Generate Files
|
|
988
988
|
|
|
989
|
-
Read each template from `.
|
|
989
|
+
Read each template from `.specrails/setup-templates/` and generate the final files adapted to this project. Use the codebase analysis from Phase 1, personas from Phase 2, and configuration from Phase 3.
|
|
990
990
|
|
|
991
|
-
**Provider detection (required before any file generation):** Read
|
|
991
|
+
**Provider detection (required before any file generation):** Read `.specrails/setup-templates/.provider-detection.json` to determine `cli_provider` (`"claude"` or `"codex"`) and `specrails_dir` (`.claude` or `.codex`). All output paths in Phase 4 use `$SPECRAILS_DIR` as the base directory. If the file is missing, fall back to `cli_provider = "claude"` and `specrails_dir = ".claude"`.
|
|
992
992
|
|
|
993
993
|
### 4.1 Generate agents
|
|
994
994
|
|
|
@@ -997,26 +997,26 @@ For each selected agent, read the template and generate the adapted version.
|
|
|
997
997
|
**Template → Output mapping:**
|
|
998
998
|
|
|
999
999
|
**If `cli_provider == "claude"` (default):**
|
|
1000
|
-
-
|
|
1001
|
-
-
|
|
1002
|
-
-
|
|
1003
|
-
-
|
|
1004
|
-
-
|
|
1005
|
-
-
|
|
1006
|
-
-
|
|
1007
|
-
-
|
|
1008
|
-
-
|
|
1000
|
+
- `.specrails/setup-templates/agents/sr-architect.md` → `.claude/agents/sr-architect.md`
|
|
1001
|
+
- `.specrails/setup-templates/agents/sr-developer.md` → `.claude/agents/sr-developer.md`
|
|
1002
|
+
- `.specrails/setup-templates/agents/sr-reviewer.md` → `.claude/agents/sr-reviewer.md`
|
|
1003
|
+
- `.specrails/setup-templates/agents/sr-test-writer.md` → `.claude/agents/sr-test-writer.md`
|
|
1004
|
+
- `.specrails/setup-templates/agents/sr-security-reviewer.md` → `.claude/agents/sr-security-reviewer.md`
|
|
1005
|
+
- `.specrails/setup-templates/agents/sr-product-manager.md` → `.claude/agents/sr-product-manager.md`
|
|
1006
|
+
- `.specrails/setup-templates/agents/sr-product-analyst.md` → `.claude/agents/sr-product-analyst.md`
|
|
1007
|
+
- `.specrails/setup-templates/agents/sr-backend-developer.md` → `.claude/agents/sr-backend-developer.md` (if backend layer)
|
|
1008
|
+
- `.specrails/setup-templates/agents/sr-frontend-developer.md` → `.claude/agents/sr-frontend-developer.md` (if frontend layer)
|
|
1009
1009
|
|
|
1010
1010
|
**If `cli_provider == "codex"`:**
|
|
1011
|
-
-
|
|
1012
|
-
-
|
|
1013
|
-
-
|
|
1014
|
-
-
|
|
1015
|
-
-
|
|
1016
|
-
-
|
|
1017
|
-
-
|
|
1018
|
-
-
|
|
1019
|
-
-
|
|
1011
|
+
- `.specrails/setup-templates/agents/sr-architect.md` → `.codex/agents/sr-architect.toml`
|
|
1012
|
+
- `.specrails/setup-templates/agents/sr-developer.md` → `.codex/agents/sr-developer.toml`
|
|
1013
|
+
- `.specrails/setup-templates/agents/sr-reviewer.md` → `.codex/agents/sr-reviewer.toml`
|
|
1014
|
+
- `.specrails/setup-templates/agents/sr-test-writer.md` → `.codex/agents/sr-test-writer.toml`
|
|
1015
|
+
- `.specrails/setup-templates/agents/sr-security-reviewer.md` → `.codex/agents/sr-security-reviewer.toml`
|
|
1016
|
+
- `.specrails/setup-templates/agents/sr-product-manager.md` → `.codex/agents/sr-product-manager.toml`
|
|
1017
|
+
- `.specrails/setup-templates/agents/sr-product-analyst.md` → `.codex/agents/sr-product-analyst.toml`
|
|
1018
|
+
- `.specrails/setup-templates/agents/sr-backend-developer.md` → `.codex/agents/sr-backend-developer.toml` (if backend layer)
|
|
1019
|
+
- `.specrails/setup-templates/agents/sr-frontend-developer.md` → `.codex/agents/sr-frontend-developer.toml` (if frontend layer)
|
|
1020
1020
|
|
|
1021
1021
|
When generating each agent:
|
|
1022
1022
|
1. Read the template
|
|
@@ -1058,7 +1058,7 @@ When generating each agent:
|
|
|
1058
1058
|
### 4.2 Generate personas
|
|
1059
1059
|
|
|
1060
1060
|
If IS_OSS=true:
|
|
1061
|
-
1. Copy
|
|
1061
|
+
1. Copy `.specrails/setup-templates/personas/the-maintainer.md` to `$SPECRAILS_DIR/agents/personas/the-maintainer.md`
|
|
1062
1062
|
2. Log: "Maintainer persona included"
|
|
1063
1063
|
3. Set MAINTAINER_INCLUDED=true for use in template substitution
|
|
1064
1064
|
4. Set `{{MAINTAINER_PERSONA_LINE}}` = `- \`$SPECRAILS_DIR/agents/personas/the-maintainer.md\` — "Kai" the Maintainer (open-source maintainer)`
|
|
@@ -1078,26 +1078,26 @@ Write each persona to `$SPECRAILS_DIR/agents/personas/`:
|
|
|
1078
1078
|
For each selected command, read the template and adapt.
|
|
1079
1079
|
|
|
1080
1080
|
**If `cli_provider == "claude"` (default):**
|
|
1081
|
-
-
|
|
1082
|
-
-
|
|
1083
|
-
-
|
|
1084
|
-
-
|
|
1085
|
-
-
|
|
1086
|
-
-
|
|
1087
|
-
-
|
|
1088
|
-
-
|
|
1081
|
+
- `.specrails/setup-templates/commands/specrails/implement.md` → `.claude/commands/specrails/implement.md`
|
|
1082
|
+
- `.specrails/setup-templates/commands/specrails/batch-implement.md` → `.claude/commands/specrails/batch-implement.md`
|
|
1083
|
+
- `.specrails/setup-templates/commands/specrails/propose-spec.md` → `.claude/commands/specrails/propose-spec.md`
|
|
1084
|
+
- `.specrails/setup-templates/commands/specrails/get-backlog-specs.md` → `.claude/commands/specrails/get-backlog-specs.md` (if `BACKLOG_PROVIDER != none`)
|
|
1085
|
+
- `.specrails/setup-templates/commands/specrails/auto-propose-backlog-specs.md` → `.claude/commands/specrails/auto-propose-backlog-specs.md` (if `BACKLOG_PROVIDER != none`)
|
|
1086
|
+
- `.specrails/setup-templates/commands/specrails/compat-check.md` → `.claude/commands/specrails/compat-check.md`
|
|
1087
|
+
- `.specrails/setup-templates/commands/specrails/refactor-recommender.md` → `.claude/commands/specrails/refactor-recommender.md`
|
|
1088
|
+
- `.specrails/setup-templates/commands/specrails/why.md` → `.claude/commands/specrails/why.md`
|
|
1089
1089
|
|
|
1090
1090
|
**If `cli_provider == "codex"`:**
|
|
1091
|
-
-
|
|
1092
|
-
-
|
|
1093
|
-
-
|
|
1094
|
-
-
|
|
1095
|
-
-
|
|
1096
|
-
-
|
|
1097
|
-
-
|
|
1098
|
-
-
|
|
1099
|
-
|
|
1100
|
-
**Codex skill frontmatter wrapping:** When a dedicated skill template does not exist in
|
|
1091
|
+
- `.specrails/setup-templates/skills/sr-implement/SKILL.md` → `.agents/skills/sr-implement/SKILL.md`
|
|
1092
|
+
- `.specrails/setup-templates/skills/sr-batch-implement/SKILL.md` → `.agents/skills/sr-batch-implement/SKILL.md`
|
|
1093
|
+
- `.specrails/setup-templates/commands/specrails/propose-spec.md` → `.agents/skills/sr-propose-spec/SKILL.md` (wrap with YAML frontmatter if no skill template exists)
|
|
1094
|
+
- `.specrails/setup-templates/commands/specrails/get-backlog-specs.md` → `.agents/skills/sr-get-backlog-specs/SKILL.md` (if `BACKLOG_PROVIDER != none`; wrap with frontmatter)
|
|
1095
|
+
- `.specrails/setup-templates/commands/specrails/auto-propose-backlog-specs.md` → `.agents/skills/sr-auto-propose-backlog-specs/SKILL.md` (if `BACKLOG_PROVIDER != none`; wrap with frontmatter)
|
|
1096
|
+
- `.specrails/setup-templates/skills/sr-compat-check/SKILL.md` → `.agents/skills/sr-compat-check/SKILL.md`
|
|
1097
|
+
- `.specrails/setup-templates/skills/sr-refactor-recommender/SKILL.md` → `.agents/skills/sr-refactor-recommender/SKILL.md`
|
|
1098
|
+
- `.specrails/setup-templates/skills/sr-why/SKILL.md` → `.agents/skills/sr-why/SKILL.md`
|
|
1099
|
+
|
|
1100
|
+
**Codex skill frontmatter wrapping:** When a dedicated skill template does not exist in `.specrails/setup-templates/skills/` for a command, generate the `SKILL.md` by prepending YAML frontmatter to the command content:
|
|
1101
1101
|
```yaml
|
|
1102
1102
|
---
|
|
1103
1103
|
name: sr-<name>
|
|
@@ -1199,7 +1199,7 @@ The command templates use `{{BACKLOG_FETCH_CMD}}`, `{{BACKLOG_CREATE_CMD}}`, `{{
|
|
|
1199
1199
|
### 4.4 Generate rules
|
|
1200
1200
|
|
|
1201
1201
|
For each detected layer, read the layer rule template and generate a layer-specific rules file:
|
|
1202
|
-
-
|
|
1202
|
+
- `.specrails/setup-templates/rules/layer.md` → `$SPECRAILS_DIR/rules/{layer-name}.md`
|
|
1203
1203
|
|
|
1204
1204
|
Each rule file must:
|
|
1205
1205
|
- Have the correct `paths:` frontmatter matching the layer's directory
|
|
@@ -1214,7 +1214,7 @@ Each rule file must:
|
|
|
1214
1214
|
|
|
1215
1215
|
### 4.6 Generate settings
|
|
1216
1216
|
|
|
1217
|
-
Read `.
|
|
1217
|
+
Read `.specrails/setup-templates/.provider-detection.json` (written by `install.sh`) to determine `cli_provider` (`"claude"` or `"codex"`).
|
|
1218
1218
|
|
|
1219
1219
|
**If `cli_provider == "claude"` (default):**
|
|
1220
1220
|
|
|
@@ -1227,9 +1227,9 @@ Create or merge `.claude/settings.json` with permissions for:
|
|
|
1227
1227
|
|
|
1228
1228
|
**If `cli_provider == "codex"`:**
|
|
1229
1229
|
|
|
1230
|
-
1. Read
|
|
1230
|
+
1. Read `.specrails/setup-templates/settings/codex-config.toml`. Write it to `.codex/config.toml` as-is (no substitutions needed — the TOML is static).
|
|
1231
1231
|
|
|
1232
|
-
2. Read
|
|
1232
|
+
2. Read `.specrails/setup-templates/settings/codex-rules.star`. Replace `{{CODEX_SHELL_RULES}}` with Starlark `prefix_rule(...)` lines for each detected tool allowance:
|
|
1233
1233
|
|
|
1234
1234
|
| Detected tool/command | Starlark rule |
|
|
1235
1235
|
|----------------------|---------------|
|
|
@@ -1268,7 +1268,7 @@ The setup process installed temporary files that are only needed during installa
|
|
|
1268
1268
|
|
|
1269
1269
|
```bash
|
|
1270
1270
|
# 1. Remove setup templates (used as structural references during generation)
|
|
1271
|
-
rm -rf .
|
|
1271
|
+
rm -rf .specrails/setup-templates/
|
|
1272
1272
|
|
|
1273
1273
|
# 2. Remove the /specrails:setup command itself — it's a one-time installer, not a permanent command
|
|
1274
1274
|
rm -f .claude/commands/setup.md
|
|
@@ -1281,7 +1281,7 @@ rm -f .claude/commands/setup.md
|
|
|
1281
1281
|
**What gets removed:**
|
|
1282
1282
|
| Artifact | Why |
|
|
1283
1283
|
|----------|-----|
|
|
1284
|
-
| `.
|
|
1284
|
+
| `.specrails/setup-templates/` | Temporary — templates already rendered into final files |
|
|
1285
1285
|
| `.claude/commands/setup.md` | One-time installer — running it again would overwrite customized agents |
|
|
1286
1286
|
|
|
1287
1287
|
**What to do with `specrails/`:**
|
|
@@ -1327,7 +1327,7 @@ ls .codex/rules/*.md
|
|
|
1327
1327
|
ls .codex/agent-memory/
|
|
1328
1328
|
|
|
1329
1329
|
# These should NOT exist (scaffolding):
|
|
1330
|
-
#
|
|
1330
|
+
# .specrails/setup-templates/ — GONE
|
|
1331
1331
|
# If cli_provider == "claude": $SPECRAILS_DIR/commands/setup.md — GONE
|
|
1332
1332
|
# If cli_provider == "codex": .agents/skills/setup/ — GONE (installer scaffold, not a generated sr-skill)
|
|
1333
1333
|
```
|
|
@@ -1402,7 +1402,7 @@ Note: Only commands/skills selected during setup are shown. Backlog commands are
|
|
|
1402
1402
|
### Scaffolding Removed
|
|
1403
1403
|
| Artifact | Status |
|
|
1404
1404
|
|----------|--------|
|
|
1405
|
-
|
|
|
1405
|
+
| .specrails/setup-templates/ | Deleted |
|
|
1406
1406
|
[If cli_provider == "claude":] | .claude/commands/setup.md | Deleted |
|
|
1407
1407
|
[If cli_provider == "codex":] | .agents/skills/setup/ | Deleted |
|
|
1408
1408
|
| specrails/ | [User's choice] |
|
package/docs/customization.md
CHANGED
|
@@ -54,20 +54,50 @@ Example — adding a constraint to the developer:
|
|
|
54
54
|
|
|
55
55
|
### Agent model selection
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
Agent models are controlled by `.specrails/agents.yaml`, generated automatically when you first run `/specrails:setup`.
|
|
58
58
|
|
|
59
59
|
```yaml
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
# specrails agent configuration
|
|
61
|
+
# Valid models: opus, sonnet, haiku
|
|
62
|
+
|
|
63
|
+
defaults:
|
|
64
|
+
model: sonnet
|
|
65
|
+
|
|
66
|
+
agents:
|
|
67
|
+
sr-architect:
|
|
68
|
+
model: sonnet
|
|
69
|
+
sr-product-manager:
|
|
70
|
+
model: opus
|
|
71
|
+
sr-product-analyst:
|
|
72
|
+
model: haiku
|
|
73
|
+
# ... all 14 agents listed
|
|
63
74
|
```
|
|
64
75
|
|
|
65
|
-
|
|
76
|
+
**Valid models:**
|
|
66
77
|
- `opus` — best for creative/strategic tasks (Product Manager)
|
|
67
78
|
- `sonnet` — balanced for implementation tasks (most agents)
|
|
68
79
|
- `haiku` — fast and cheap for analysis tasks (Product Analyst)
|
|
69
80
|
|
|
70
|
-
|
|
81
|
+
**Precedence rules:**
|
|
82
|
+
1. Per-agent entry in `agents:` section overrides everything
|
|
83
|
+
2. `defaults.model` applies to any agent not explicitly listed
|
|
84
|
+
3. Template hard-coded value is the fallback when no config exists
|
|
85
|
+
|
|
86
|
+
**Applying config changes:** After editing `.specrails/agents.yaml`, run `/specrails:reconfig` to update the generated agent files without re-running the full setup wizard:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
/specrails:reconfig
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Output example:
|
|
93
|
+
```
|
|
94
|
+
Updated 1 agent(s):
|
|
95
|
+
sr-developer: sonnet → opus
|
|
96
|
+
|
|
97
|
+
Unchanged (13): sr-architect, sr-reviewer, ...
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Important:** `/specrails:reconfig` wins over direct edits to `.claude/agents/sr-*.md`. If you edit an agent file directly, that change will be overwritten the next time you run reconfig or setup. For permanent per-agent overrides, edit `.specrails/agents.yaml` instead.
|
|
71
101
|
|
|
72
102
|
### Adding a new agent
|
|
73
103
|
|
package/docs/installation.md
CHANGED
|
@@ -82,9 +82,9 @@ git clone https://github.com/fjpulidop/specrails-core.git
|
|
|
82
82
|
2. **Detects existing setup** — warns if SpecRails artifacts already exist
|
|
83
83
|
3. **Installs artifacts:**
|
|
84
84
|
- `.claude/commands/specrails/setup.md` — the `/specrails:setup` wizard
|
|
85
|
-
- `.
|
|
85
|
+
- `.specrails/setup-templates/` — agent and command templates (temporary, removed after `/specrails:setup`)
|
|
86
86
|
- `.claude/security-exemptions.yaml` — security scanner config
|
|
87
|
-
4. **Tracks version** — writes `.specrails-version` and `.specrails-manifest.json`
|
|
87
|
+
4. **Tracks version** — writes `.specrails/specrails-version` and `.specrails/specrails-manifest.json`
|
|
88
88
|
|
|
89
89
|
The scaffold installer only copies files. It does not modify your existing code, create commits, or push to any remote.
|
|
90
90
|
|
|
@@ -210,7 +210,7 @@ The wizard fills all templates with your project-specific context:
|
|
|
210
210
|
The wizard removes itself:
|
|
211
211
|
|
|
212
212
|
- Deletes `.claude/commands/specrails/setup.md`
|
|
213
|
-
- Deletes `.
|
|
213
|
+
- Deletes `.specrails/setup-templates/`
|
|
214
214
|
- Leaves only the final generated files
|
|
215
215
|
|
|
216
216
|
After this phase, `/specrails:setup` is no longer available until re-run — your workflow is ready.
|
|
@@ -253,7 +253,7 @@ ls .claude/agents/
|
|
|
253
253
|
grep -r '{{[A-Z_]*}}' .claude/agents/ .claude/commands/ .claude/rules/
|
|
254
254
|
|
|
255
255
|
# Scaffold method: check version
|
|
256
|
-
cat .specrails-version
|
|
256
|
+
cat .specrails/specrails-version
|
|
257
257
|
```
|
|
258
258
|
|
|
259
259
|
---
|
package/docs/updating.md
CHANGED
|
@@ -6,7 +6,7 @@ SpecRails includes an update system that pulls new templates while preserving yo
|
|
|
6
6
|
|
|
7
7
|
The update system uses a **manifest-based approach**:
|
|
8
8
|
|
|
9
|
-
1. During installation, SpecRails generates `.specrails-manifest.json` — a checksum of every installed file
|
|
9
|
+
1. During installation, SpecRails generates `.specrails/specrails-manifest.json` — a checksum of every installed file
|
|
10
10
|
2. On update, it compares the manifest against current files to detect what you've customized
|
|
11
11
|
3. Customized files are preserved; unchanged files are updated to the latest version
|
|
12
12
|
|
|
@@ -25,7 +25,7 @@ bash /path/to/specrails/update.sh
|
|
|
25
25
|
### What happens
|
|
26
26
|
|
|
27
27
|
1. **Backup** — creates `.claude.specrails.backup/` with your current files
|
|
28
|
-
2. **Version check** — compares installed version (`.specrails-version`) with latest
|
|
28
|
+
2. **Version check** — compares installed version (`.specrails/specrails-version`) with latest
|
|
29
29
|
3. **Update files** — replaces unchanged files, preserves customized ones
|
|
30
30
|
4. **Merge settings** — additively merges `settings.json` (your permissions are kept)
|
|
31
31
|
5. **Update version** — writes new version and manifest
|
|
@@ -66,7 +66,7 @@ bash update.sh --only all
|
|
|
66
66
|
|
|
67
67
|
If you installed SpecRails before the versioning system (pre-v0.1.0):
|
|
68
68
|
|
|
69
|
-
- The updater detects missing `.specrails-version` and treats it as a legacy install
|
|
69
|
+
- The updater detects missing `.specrails/specrails-version` and treats it as a legacy install
|
|
70
70
|
- It migrates your installation to the versioned system
|
|
71
71
|
- A manifest is generated from your current files
|
|
72
72
|
- Future updates use the standard manifest comparison
|
|
@@ -78,7 +78,7 @@ If something goes wrong, restore from the automatic backup:
|
|
|
78
78
|
```bash
|
|
79
79
|
# Backups are at .claude.specrails.backup/
|
|
80
80
|
cp -r .claude.specrails.backup/.claude .claude
|
|
81
|
-
cp .claude.specrails.backup/.specrails-version .specrails-version
|
|
81
|
+
cp .claude.specrails.backup/.specrails/specrails-version .specrails/specrails-version
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
---
|
package/docs/user-docs/faq.md
CHANGED
|
@@ -88,7 +88,7 @@ your-project/
|
|
|
88
88
|
└── config.toml # Permissions
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
The installer also writes `.specrails-version` and `.specrails-manifest.json` to track the installed version.
|
|
91
|
+
The installer also writes `.specrails/specrails-version` and `.specrails/specrails-manifest.json` to track the installed version.
|
|
92
92
|
|
|
93
93
|
## Configure with /specrails:setup
|
|
94
94
|
|
|
@@ -131,7 +131,7 @@ ls .claude/agents/
|
|
|
131
131
|
grep -r '{{[A-Z_]*}}' .claude/agents/ .claude/commands/ .claude/rules/
|
|
132
132
|
|
|
133
133
|
# Scaffold method: check the installed version
|
|
134
|
-
cat .specrails-version
|
|
134
|
+
cat .specrails/specrails-version
|
|
135
135
|
```
|
|
136
136
|
|
|
137
137
|
## Troubleshooting
|