specrails-core 1.5.0 → 1.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.
Files changed (2) hide show
  1. package/commands/setup.md +109 -22
  2. package/package.json +1 -1
package/commands/setup.md CHANGED
@@ -44,12 +44,21 @@ Read the following files to understand the current installation state:
44
44
 
45
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)`.
46
46
 
47
- 3. List all template files in `.claude/setup-templates/agents/` — these are the NEW templates from the update:
47
+ 3. List all template files in `.claude/setup-templates/agents/` — these are the NEW agent templates from the update:
48
48
  ```bash
49
49
  ls .claude/setup-templates/agents/
50
50
  ```
51
51
  Template files are named with `sr-` prefix (e.g., `sr-architect.md`, `sr-developer.md`).
52
52
 
53
+ 4. List all template files in `.claude/setup-templates/commands/sr/` — these are the NEW command templates from the update:
54
+ ```bash
55
+ ls .claude/setup-templates/commands/sr/
56
+ ```
57
+ Command template files include `implement.md`, `batch-implement.md`, `health-check.md`, `compat-check.md`, `refactor-recommender.md`, `why.md`, `product-backlog.md`, `update-product-driven-backlog.md`.
58
+ If this directory does not exist, skip command template checking for this update.
59
+
60
+ 5. Read `.claude/backlog-config.json` if it exists — contains stored provider configuration needed for command placeholder substitution.
61
+
53
62
  ### Phase U2: Quick Codebase Re-Analysis
54
63
 
55
64
  Perform the same analysis as Phase 1 of the full setup wizard, but silently — do not prompt the user and do not show the findings table. Just execute and store results internally.
@@ -71,39 +80,62 @@ Store all results for use in Phases U4 and U5.
71
80
 
72
81
  ### Phase U3: Identify What Needs Regeneration
73
82
 
74
- 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 `.claude/setup-templates/agents/`:
83
+ **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 `.claude/setup-templates/agents/`:
75
84
 
76
85
  ```bash
77
86
  sha256sum .claude/setup-templates/agents/sr-<name>.md
78
87
  ```
79
88
 
80
- Build three lists:
89
+ Build three lists for agents:
81
90
 
82
91
  1. **Changed agents**: agent name exists in manifest AND the current template checksum differs from the manifest checksum → mark for regeneration
83
92
  2. **New agents**: template file exists in `.claude/setup-templates/agents/` but the agent name is NOT in the manifest → mark for evaluation
84
93
  3. **Unchanged agents**: agent name exists in manifest AND checksum matches → skip
85
94
 
86
- Display the analysis to the user:
95
+ **Command templates:** If `.claude/setup-templates/commands/sr/` exists, for each command template file, find its entry in the manifest's `artifacts` map (keyed as `templates/commands/sr/<name>.md`). Compute the SHA-256 checksum of the corresponding file in `.claude/setup-templates/commands/sr/`:
87
96
 
97
+ ```bash
98
+ sha256sum .claude/setup-templates/commands/sr/<name>.md
88
99
  ```
89
- ## Agent Update Analysis
90
100
 
91
- ### Changed Templates (will be regenerated)
101
+ Build three lists for commands:
102
+
103
+ 1. **Changed commands**: command name exists in manifest AND the current template checksum differs from the manifest checksum → mark for update
104
+ 2. **New commands**: template file exists in `.claude/setup-templates/commands/sr/` but the command name is NOT in the manifest → mark for evaluation
105
+ 3. **Unchanged commands**: command name exists in manifest AND checksum matches → skip
106
+
107
+ Display the combined analysis to the user:
108
+
109
+ ```
110
+ ## Update Analysis
111
+
112
+ ### Agents — Changed Templates (will be regenerated)
92
113
  - sr-architect.md (template modified)
93
114
  - sr-developer.md (template modified)
94
115
 
95
- ### New Templates Available
116
+ ### Agents — New Templates Available
96
117
  - sr-frontend-developer.md
97
118
  - sr-backend-developer.md
98
119
 
99
- ### Unchanged (keeping current)
120
+ ### Agents — Unchanged (keeping current)
100
121
  - sr-reviewer.md
101
122
  - sr-product-manager.md
123
+
124
+ ### Commands — Changed Templates (will be updated)
125
+ - implement.md (template modified)
126
+
127
+ ### Commands — New Templates Available
128
+ - refactor-recommender.md
129
+
130
+ ### Commands — Unchanged (keeping current)
131
+ - health-check.md
132
+ - compat-check.md
133
+ - why.md
102
134
  ```
103
135
 
104
- If there are no changed agents and no new agents, display:
136
+ If there are no changed agents, no new agents, no changed commands, and no new commands, display:
105
137
  ```
106
- All agents are already up to date. Nothing to regenerate.
138
+ All agents and commands are already up to date. Nothing to regenerate.
107
139
  ```
108
140
  Then jump to Phase U7.
109
141
 
@@ -133,6 +165,36 @@ After regenerating all changed agents, verify no unresolved placeholders remain:
133
165
  grep -r '{{[A-Z_]*}}' .claude/agents/sr-*.md 2>/dev/null || echo "OK: no broken placeholders"
134
166
  ```
135
167
 
168
+ ### Phase U4b: Update Changed Commands
169
+
170
+ For each command in the "changed commands" list from Phase U3:
171
+
172
+ 1. Read the NEW template from `.claude/setup-templates/commands/sr/<name>.md`
173
+ 2. Read stored backlog configuration from `.claude/backlog-config.json` (if it exists) to resolve provider-specific placeholders:
174
+ - `BACKLOG_PROVIDER` → `provider` field (`github`, `jira`, or `none`)
175
+ - `BACKLOG_WRITE` → `write_access` field
176
+ - `JIRA_BASE_URL` → `jira_base_url` field
177
+ - `JIRA_PROJECT_KEY` → `jira_project_key` field
178
+ 3. Substitute all `{{PLACEHOLDER}}` values using the same rules as Phase 4.3 of the full setup:
179
+ - `{{CI_COMMANDS_BACKEND}}` → backend CI commands detected in Phase U2
180
+ - `{{CI_COMMANDS_FRONTEND}}` → frontend CI commands detected in Phase U2
181
+ - `{{DEPENDENCY_CHECK_COMMANDS}}` → stack-specific dependency check commands from Phase U2
182
+ - `{{TEST_RUNNER_CHECK}}` → test runner commands from Phase U2
183
+ - `{{BACKLOG_FETCH_CMD}}` → provider-specific fetch command from backlog config
184
+ - `{{BACKLOG_CREATE_CMD}}` → provider-specific create command from backlog config
185
+ - `{{BACKLOG_VIEW_CMD}}` → provider-specific view command from backlog config
186
+ - `{{BACKLOG_PREFLIGHT}}` → provider-specific preflight check from backlog config
187
+ - Any other `{{PLACEHOLDER}}` values → use Phase U2 analysis data
188
+ 4. Write the updated command to `.claude/commands/sr/<name>.md`
189
+ 5. Show: `✓ Updated /sr:<name>`
190
+
191
+ After updating all changed commands, verify no unresolved placeholders remain in the updated files:
192
+ ```bash
193
+ grep -l '{{[A-Z_]*}}' .claude/commands/sr/*.md 2>/dev/null || echo "OK: no broken placeholders"
194
+ ```
195
+ If any placeholders remain unresolved, warn the user:
196
+ > "⚠ Some placeholders in `<filename>` could not be resolved automatically. Please review the file and fill them in manually."
197
+
136
198
  ### Phase U5: Evaluate New Agents
137
199
 
138
200
  For each agent in the "new" list:
@@ -150,6 +212,18 @@ For each agent in the "new" list:
150
212
  4. If the user declines:
151
213
  - Show: `→ Skipped sr-<name>`
152
214
 
215
+ For each command in the "new commands" list from Phase U3:
216
+
217
+ 1. Read the template from `.claude/setup-templates/commands/sr/<name>.md` to understand what it does (read the title and description)
218
+ 2. Prompt the user:
219
+ > "New command available: `/sr:<name>` — [one-line description from template]. Install it? [Y/n]"
220
+ 3. If the user accepts (or presses Enter):
221
+ - Apply placeholder substitution using the same rules as Phase U4b (backlog config + codebase analysis)
222
+ - Write the command to `.claude/commands/sr/<name>.md`
223
+ - Show: `✓ Added /sr:<name>`
224
+ 4. If the user declines:
225
+ - Show: `→ Skipped /sr:<name>`
226
+
153
227
  ### Phase U6: Update Workflow Commands
154
228
 
155
229
  If any new agents were added in Phase U5:
@@ -171,28 +245,41 @@ Display the final summary and stop. Do not continue to Phase 1 of the full setup
171
245
 
172
246
  specrails updated from v<previous> to v<new>.
173
247
 
174
- | Action | Count |
175
- |--------------------|-------|
176
- | Agents regenerated | N |
177
- | Agents added | N |
178
- | Agents skipped | N |
179
- | Commands updated | N |
248
+ | Action | Count |
249
+ |---------------------|-------|
250
+ | Agents regenerated | N |
251
+ | Agents added | N |
252
+ | Agents skipped | N |
253
+ | Commands updated | N |
254
+ | Commands added | N |
255
+ | Commands skipped | N |
180
256
 
181
- All agents are now up to date.
257
+ All agents and commands are now up to date.
182
258
 
183
- ### Regenerated
259
+ ### Agents Regenerated
184
260
  [list agent names, or "(none)"]
185
261
 
186
- ### Added
262
+ ### Agents Added
187
263
  [list agent names, or "(none)"]
188
264
 
189
- ### Skipped
265
+ ### Agents Skipped
190
266
  [list agent names, or "(none)"]
267
+
268
+ ### Commands Updated
269
+ [list command names, or "(none)"]
270
+
271
+ ### Commands Added
272
+ [list command names, or "(none)"]
273
+
274
+ ### Commands Skipped
275
+ [list command names, or "(none)"]
191
276
  ```
192
277
 
193
- Update `.specrails-manifest.json` to reflect the new checksums for all regenerated and added agents:
194
- - For each regenerated agent: update its checksum entry to the new template's checksum
278
+ Update `.specrails-manifest.json` to reflect the new checksums for all regenerated/updated and added agents and commands:
279
+ - For each regenerated agent: update its checksum entry to the new template's checksum (keyed as `templates/agents/sr-<name>.md`)
195
280
  - For each added agent: add a new entry with its checksum
281
+ - For each updated command: update its checksum entry to the new template's checksum (keyed as `templates/commands/sr/<name>.md`)
282
+ - For each added command: add a new entry with its checksum
196
283
  - Update the `version` field to the version read from `.specrails-version`
197
284
 
198
285
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specrails-core",
3
- "version": "1.5.0",
3
+ "version": "1.6.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"