specrails-core 1.4.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.
package/README.md CHANGED
@@ -1,76 +1,85 @@
1
1
  # specrails-core
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/specrails-core.svg)](https://www.npmjs.com/package/specrails-core)
4
+ [![GitHub Stars](https://img.shields.io/github/stars/fjpulidop/specrails-core?style=social)](https://github.com/fjpulidop/specrails-core)
4
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
- [![Node.js](https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg)](https://nodejs.org)
6
+ [![npm downloads](https://img.shields.io/npm/dw/specrails-core.svg)](https://www.npmjs.com/package/specrails-core)
7
+ [![Claude Code](https://img.shields.io/badge/Built%20for-Claude%20Code-blueviolet)](https://docs.anthropic.com/en/docs/claude-code)
6
8
 
7
- **AI agent workflow system for [Claude Code](https://claude.ai/code).** Installs a complete product-driven development pipeline into any repository — 12 specialized agents, orchestration commands, persona-based product discovery, and per-layer coding conventions — all generated specifically for your codebase.
9
+ **Your AI development team. From idea to production code.**
10
+
11
+ One command gives your repo a full team of specialized AI agents: architect, developer, reviewer, product manager — all working together through a structured pipeline, fully adapted to your codebase.
8
12
 
9
13
  ```bash
10
- npx specrails-core@latest init --root-dir <your-project>
14
+ npx specrails-core@latest init --root-dir .
11
15
  ```
12
16
 
13
- ---
17
+ > **Requirements:** [Claude Code](https://docs.anthropic.com/en/docs/claude-code) (required), Node 18+, git
14
18
 
15
- ## The pipeline
19
+ <!--
20
+ BOARD: Add demo GIF here — this is the #1 conversion driver on Product Hunt and npm.
21
+ Record a 60-90s screen capture showing:
22
+ 1. `npx specrails-core@latest init --root-dir .` running
23
+ 2. The `/setup` wizard completing (phases 1-5)
24
+ 3. `/sr:implement "add dark mode"` → agents working → PR created
25
+ Recommended tools: Loom or QuickTime to record; Kap (https://getkap.co) to export as GIF.
26
+ Then replace this comment with:
16
27
 
17
- ```
18
- Product Discovery → Architecture → Implementation → Review → Ship
19
- (sr-product-manager) (sr-architect) (sr-developer) (sr-reviewer) (PR)
20
- ```
28
+ ![specrails-core demo](./assets/demo.gif)
29
+ -->
21
30
 
22
- One command runs the full cycle:
31
+ ---
32
+
33
+ ## How it works
23
34
 
24
35
  ```
25
- /sr:implement #85, #71 # implement GitHub Issues
26
- /sr:implement "add dark mode" # implement from description
27
- /sr:implement UI, Analytics # explore areas, pick the best ideas
36
+ Idea → Architecture → Implementation → Review → PR
37
+ (sr-architect) (sr-developer) (sr-reviewer)
28
38
  ```
29
39
 
30
- Multiple features run in parallel using git worktrees. Single features run sequentially.
40
+ Run `/sr:implement "add dark mode"` the pipeline designs, builds, reviews, and ships a pull request. No hand-holding required.
41
+
42
+ Every artifact (agents, rules, personas) is generated **specifically for your project** by analyzing your actual codebase, tech stack, and CI setup. Not generic templates.
31
43
 
32
44
  ---
33
45
 
34
46
  ## Quick start
35
47
 
36
- **Step 1 Install into your project**
48
+ **1. Install**
37
49
 
38
50
  ```bash
39
- npx specrails-core@latest init --root-dir /path/to/your/repo
51
+ npx specrails-core@latest init --root-dir .
40
52
  ```
41
53
 
42
- The installer scaffolds temporary setup files into `.claude/` and checks prerequisites (Claude Code, git, npm, GitHub CLI).
43
-
44
- **Step 2 — Run the setup wizard inside Claude Code**
54
+ **2. Run setup inside Claude Code**
45
55
 
46
56
  ```bash
47
- cd /path/to/your/repo
48
- claude # open Claude Code
49
- > /setup # run the interactive setup wizard
57
+ claude # open Claude Code in your project
58
+ > /setup # run the 5-phase wizard (~5 min)
50
59
  ```
51
60
 
52
- Claude runs a 5-phase wizard that reads your actual codebase and generates everything tailored to your stack:
61
+ **3. Start building**
53
62
 
54
- | Phase | What happens |
55
- |-------|-------------|
56
- | **1. Codebase Analysis** | Detects your stack, layers, CI commands, and coding conventions |
57
- | **2. User Personas** | Researches your competitive landscape, generates VPC personas |
58
- | **3. Configuration** | Choose backlog (GitHub Issues / JIRA / none), git workflow, agents |
59
- | **4. File Generation** | Writes all agents, commands, rules — fully contextualized |
60
- | **5. Cleanup** | Self-destructs scaffolding, only final files remain |
63
+ ```bash
64
+ > /sr:implement "add user authentication"
65
+ > /sr:implement #42, #43 # from GitHub Issues
66
+ > /sr:update-product-driven-backlog # discover new features with AI
67
+ ```
68
+
69
+ That's it. The pipeline takes over.
61
70
 
62
71
  ---
63
72
 
64
73
  ## What gets installed
65
74
 
66
- | Category | Location | Description |
67
- |----------|----------|-------------|
75
+ | Category | Files | Purpose |
76
+ |----------|-------|---------|
68
77
  | **Agents** | `.claude/agents/*.md` | 12 specialized AI agents |
69
- | **Personas** | `.claude/agents/personas/*.md` | VPC user profiles from competitive research |
78
+ | **Personas** | `.claude/agents/personas/*.md` | VPC user profiles, generated from your users |
70
79
  | **Commands** | `.claude/commands/sr/*.md` | `/sr:implement`, `/sr:product-backlog`, `/sr:update-product-driven-backlog` |
71
80
  | **Rules** | `.claude/rules/*.md` | Per-layer coding conventions, loaded by file path |
72
- | **Memory** | `.claude/agent-memory/` | Persistent agent knowledge across sessions |
73
- | **Config** | `.claude/settings.json`, `CLAUDE.md` | Permissions, project context, architecture reference |
81
+ | **Memory** | `.claude/agent-memory/` | Persistent knowledge — agents learn across sessions |
82
+ | **Config** | `.claude/settings.json`, `CLAUDE.md` | Permissions, architecture reference |
74
83
 
75
84
  ---
76
85
 
@@ -82,7 +91,6 @@ Claude runs a 5-phase wizard that reads your actual codebase and generates every
82
91
  | Adapts to your codebase | ✅ Reads your actual stack/CI | ⚠️ Prompts only | ❌ |
83
92
  | Product-driven backlog | ✅ VPC persona scoring | ❌ | ❌ |
84
93
  | Parallel feature builds | ✅ Git worktrees | ❌ | ❌ |
85
- | Dry-run / preview mode | ✅ Preview before committing | ❌ | ❌ |
86
94
  | Institutional memory | ✅ Agents learn across sessions | ❌ | ❌ |
87
95
  | Open source | ✅ MIT | N/A | ❌ |
88
96
 
@@ -94,37 +102,32 @@ SpecRails is not a chat interface. It's a **development pipeline** that coordina
94
102
 
95
103
  | Agent | Model | Role |
96
104
  |-------|-------|------|
97
- | **sr-architect** | Sonnet | Designs features proposal, technical design, task breakdown |
98
- | **sr-developer** | Sonnet | Full-stack implementation from architect artifacts |
105
+ | **sr-architect** | Sonnet | Designs features: proposal, technical design, task breakdown |
106
+ | **sr-developer** | Sonnet | Full-stack implementation |
99
107
  | **sr-backend-developer** | Sonnet | Backend-specialized implementation |
100
108
  | **sr-frontend-developer** | Sonnet | Frontend-specialized implementation |
101
- | **sr-reviewer** | Sonnet | Final quality gate runs CI, fixes issues, records learnings |
102
- | **sr-backend-reviewer** | Sonnet | API design, database patterns, performance review |
103
- | **sr-frontend-reviewer** | Sonnet | UX patterns, accessibility, component design review |
109
+ | **sr-reviewer** | Sonnet | Quality gate: runs CI, fixes issues, records learnings |
110
+ | **sr-backend-reviewer** | Sonnet | Backend code review: API design, DB patterns, performance |
111
+ | **sr-frontend-reviewer** | Sonnet | Frontend code review: UX, accessibility, component design |
104
112
  | **sr-test-writer** | Sonnet | Generates unit, integration, and e2e tests |
105
- | **sr-security-reviewer** | Sonnet | Secrets detection, OWASP checks, dependency audit |
106
- | **sr-doc-sync** | Sonnet | Changelogs, READMEs, API docs after every change |
107
- | **sr-product-manager** | Opus | Competitive analysis, VPC evaluation, feature ideation |
113
+ | **sr-security-reviewer** | Sonnet | Secrets detection, OWASP checks, dependency vulnerabilities |
114
+ | **sr-doc-sync** | Sonnet | Updates changelogs, READMEs, API docs |
115
+ | **sr-product-manager** | Opus | Product discovery: competitive analysis, VPC evaluation |
108
116
  | **sr-product-analyst** | Haiku | Read-only backlog analysis and prioritization |
109
117
 
110
- The `/sr:implement` pipeline routes tasks to the right agent automatically based on layer tags.
111
-
112
118
  ---
113
119
 
114
- ## Product discovery commands
120
+ ## Commands
115
121
 
116
- ### `/sr:product-backlog` — Prioritized backlog
122
+ ### `/sr:implement` — Build features
117
123
 
118
- Reads GitHub Issues labeled `product-driven-backlog`, scores them against your VPC personas, and recommends the top 3 for the next sprint.
119
-
120
- ```
121
- /sr:product-backlog # show all areas
122
- /sr:product-backlog UI, Decks # filter by area
124
+ ```bash
125
+ /sr:implement "add dark mode" # from a description
126
+ /sr:implement #85, #71 # from GitHub Issues
127
+ /sr:implement UI, Analytics # explore areas, pick the best ideas
123
128
  ```
124
129
 
125
- ### `/sr:update-product-driven-backlog` Discover new features
126
-
127
- Analyzes your codebase against each persona's jobs/pains/gains, generates new feature ideas, and creates GitHub Issues for the best ones.
130
+ Architect designs developer builds → reviewer validates → PR created. Multiple features run in parallel with git worktrees.
128
131
 
129
132
  #### Dry-run / preview mode
130
133
 
@@ -135,7 +138,7 @@ Not ready to commit? Run the full pipeline without touching git or GitHub:
135
138
  /sr:implement #85 --preview # --preview is an alias for --dry-run
136
139
  ```
137
140
 
138
- All agents run normally (architect, developer, tests, docs, review). Generated files land in `.claude/.dry-run/<feature-name>/` instead of your working tree. No branches, commits, PRs, or issue updates are created.
141
+ All agents run normally. Generated files land in `.claude/.dry-run/<feature-name>/` instead of your working tree. No branches, commits, PRs, or issue updates are created.
139
142
 
140
143
  When you're happy with the preview, apply the cached output:
141
144
 
@@ -151,27 +154,39 @@ rm -rf .claude/.dry-run/add-dark-mode/
151
154
 
152
155
  ### `/sr:product-backlog` — View prioritized backlog
153
156
 
157
+ ```bash
158
+ /sr:product-backlog # show all areas
159
+ /sr:product-backlog UI, Decks # filter by area
154
160
  ```
161
+
162
+ Reads your GitHub Issues, scores by VPC persona match, recommends top 3 for next sprint.
163
+
164
+ ### `/sr:update-product-driven-backlog` — Discover features
165
+
166
+ ```bash
155
167
  /sr:update-product-driven-backlog # explore all areas
156
168
  /sr:update-product-driven-backlog Analytics # focus on one area
157
169
  ```
158
170
 
171
+ AI product discovery using your personas. Evaluates ideas, creates GitHub Issues for the best ones.
172
+
159
173
  ---
160
174
 
161
- ## Value Proposition Canvas scoring
175
+ ## VPC persona scoring
162
176
 
163
- Every feature is evaluated against your user personas before implementation. Features score 0–5 per persona based on jobs-to-be-done, pains, and gains — ranked by score / effort ratio. Product decisions stay grounded in real user needs.
177
+ Features are scored against your user personas using the VPC framework:
164
178
 
165
179
  ```
166
180
  +-----------------------------+ +-----------------------------+
167
181
  | VALUE PROPOSITION | | CUSTOMER SEGMENT |
168
- | | | |
169
182
  | Products & Services <---+--->| Customer Jobs |
170
183
  | Pain Relievers <---+--->| Pains |
171
184
  | Gain Creators <---+--->| Gains |
172
185
  +-----------------------------+ +-----------------------------+
173
186
  ```
174
187
 
188
+ Each persona scores features 0-5. Features are ranked by score/effort ratio. No gut-feel product decisions.
189
+
175
190
  ---
176
191
 
177
192
  ## Prerequisites
@@ -179,27 +194,25 @@ Every feature is evaluated against your user personas before implementation. Fea
179
194
  | Tool | Required | Purpose |
180
195
  |------|----------|---------|
181
196
  | **Claude Code** | Yes | AI agent runtime — [install](https://docs.anthropic.com/en/docs/claude-code) |
182
- | **Git** | Yes | Repository detection |
183
- | **npm** | Recommended | Install OpenSpec CLI |
184
- | **OpenSpec CLI** | Recommended | Spec-driven design workflow |
185
- | **GitHub CLI** (`gh`) | Optional | Backlog sync and PR creation |
186
- | **JIRA CLI** | Optional | JIRA as backlog alternative |
187
-
188
- The installer checks for each tool and offers to install missing ones automatically.
197
+ | **git** | Yes | Repository detection |
198
+ | **npm / Node 18+** | Recommended | Needed for npx install and OpenSpec CLI |
199
+ | **OpenSpec CLI** | Recommended | Structured design artifacts for `/sr:implement` |
200
+ | **GitHub CLI** (`gh`) | Optional | Backlog sync to GitHub Issues, PR creation |
201
+ | **JIRA CLI** (`jira`) | Optional | Backlog sync to JIRA |
189
202
 
190
- > You only need one backlog provider. If you use neither, `/sr:implement "description"` still works.
203
+ The installer checks for each tool and offers to install missing ones.
191
204
 
192
205
  ---
193
206
 
194
207
  ## Supported stacks
195
208
 
196
- specrails-core is stack-agnostic the setup wizard reads your actual files and generates accurate conventions, not generic templates.
209
+ Stack-agnostic. The `/setup` wizard detects and adapts to whatever you're running:
197
210
 
198
- - **Backend**: Python/FastAPI, Node/Express, Go/Gin, Rust/Actix, Java/Spring, Ruby/Rails, .NET
199
- - **Frontend**: React, Vue, Angular, Svelte, Next.js, Nuxt
200
- - **Database**: PostgreSQL, MySQL, SQLite, MongoDB, Redis
201
- - **CI/CD**: GitHub Actions, GitLab CI, Jenkins, Makefile
202
- - **Testing**: pytest, vitest, jest, go test, cargo test, rspec
211
+ **Backend:** Python/FastAPI, Node/Express, Go/Gin, Rust/Actix, Java/Spring, Ruby/Rails, .NET
212
+ **Frontend:** React, Vue, Angular, Svelte, Next.js, Nuxt
213
+ **Database:** PostgreSQL, MySQL, SQLite, MongoDB, Redis
214
+ **CI/CD:** GitHub Actions, GitLab CI, Jenkins, Makefile
215
+ **Testing:** pytest, vitest, jest, go test, cargo test, rspec
203
216
 
204
217
  ---
205
218
 
@@ -217,34 +230,33 @@ specrails-core is stack-agnostic — the setup wizard reads your actual files an
217
230
  ## FAQ
218
231
 
219
232
  **Can I customize the agents after installation?**
220
- Yes. Files in `.claude/` are plain markdown edit agent personalities, adjust CI commands, add rules, create personas.
221
-
222
- **How do I customize an agent's personality?**
223
- Each agent template (`sr-architect`, `sr-developer`, `sr-reviewer`) includes a `## Personality` section with four configurable settings:
224
-
225
- | Setting | Options | What it controls |
226
- |---|---|---|
227
- | `tone` | `terse` / `verbose` | How much explanation the agent includes in its output |
228
- | `risk_tolerance` | `conservative` / `aggressive` | How cautious the agent is when making decisions |
229
- | `detail_level` | `summary` / `full` | Granularity of output artifacts and reports |
230
- | `focus_areas` | comma-separated keywords | Areas the agent prioritizes (e.g. `security, performance`) |
231
-
232
- After running `/setup`, edit `.claude/agents/sr-architect.md` (or `sr-developer.md` / `sr-reviewer.md`) and change the values inline. Existing setups without a `## Personality` section continue to work unchanged — defaults apply.
233
+ Yes. The generated files in `.claude/` are yours to edit — plain markdown. Edit agent personalities, adjust CI commands, add rules, create personas.
233
234
 
234
235
  **Can I re-run setup?**
235
236
  Run `npx specrails-core@latest init --root-dir <path>` again to re-scaffold, then `/setup`.
236
237
 
237
238
  **Does this work without OpenSpec?**
238
- Partially. `/sr:implement` and sr-architect use OpenSpec for structured design artifacts. Product discovery commands and individual agents work without it.
239
+ Partially. Product discovery commands and individual agents work. `/sr:implement` and sr-architect rely on OpenSpec for structured design artifacts.
239
240
 
240
241
  **Does this work without GitHub CLI?**
241
- Yes. If you use GitHub Issues, `gh` is needed for backlog commands. Otherwise use JIRA, skip backlog entirely, or use `/sr:implement "description"` without a PR step.
242
+ Yes. Use JIRA instead, or skip backlog commands. `/sr:implement "description"` works without `gh` — it just skips automated PR creation.
243
+
244
+ **How much does it cost to run?**
245
+ A full `/sr:implement` cycle for one feature typically costs a few dollars in Claude API usage. The sr-product-manager uses Opus; all other agents use Sonnet or Haiku.
246
+
247
+ **Does it work with private repos?**
248
+ Yes. Everything runs locally through Claude Code. No external services beyond the Claude API.
249
+
250
+ ---
251
+
252
+ ## Also in the SpecRails ecosystem
242
253
 
243
- **How much does it cost?**
244
- The sr-product-manager (Opus) is the most expensive agent. All others use Sonnet or Haiku. A full `/sr:implement` cycle for one feature typically costs a few dollars through Claude Code.
254
+ - **[specrails-hub](https://github.com/fjpulidop/specrails-hub)** GUI for specrails-core. Manage your agents, run commands, and view pipeline results from a web interface.
255
+ - **[specrails.dev](https://specrails.dev)** Official website and documentation.
256
+ - **Product Hunt** — [Vote for SpecRails on launch day](https://www.producthunt.com) _(link goes live on launch day — star this repo to get notified)_
245
257
 
246
258
  ---
247
259
 
248
260
  ## License
249
261
 
250
- MIT
262
+ MIT — [fjpulidop](https://github.com/fjpulidop)
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
  ---
@@ -801,11 +888,37 @@ For each selected command, read the template and adapt:
801
888
 
802
889
  Adapt:
803
890
  - CI commands to match detected stack
804
- - Persona references to match generated personas
891
+ - **Persona references** to match generated personas (see substitution rules below)
805
892
  - File paths to match project structure
806
893
  - Layer tags to match detected layers
807
894
  - **Backlog provider commands** based on `BACKLOG_PROVIDER`:
808
895
 
896
+ #### Backlog command persona placeholder substitution
897
+
898
+ When adapting `update-product-driven-backlog.md` and `product-backlog.md`, substitute the persona placeholders based on the full persona set (user-generated personas + Maintainer if `IS_OSS=true`):
899
+
900
+ | Placeholder | Substitution rule |
901
+ |-------------|------------------|
902
+ | `{{PERSONA_FILE_READ_LIST}}` | One bullet per persona file: `- Read \`.claude/agents/personas/{name}.md\`` |
903
+ | `{{PERSONA_SCORE_HEADERS}}` | Column headers for each persona nickname: e.g., `Alex \| Sara \| Kai` |
904
+ | `{{PERSONA_SCORE_SEPARATORS}}` | One `------` separator per persona column |
905
+ | `{{PERSONA_FIT_FORMAT}}` | Inline score display: e.g., `Alex: X/5, Sara: X/5, Kai: X/5` |
906
+ | `{{PERSONA_VPC_SECTIONS}}` | One VPC section block per persona (see format below) |
907
+ | `{{MAX_SCORE}}` | Total max score = 5 × number of personas (e.g., `15` for 3 personas) |
908
+ | `{{PERSONA_NAMES_WITH_ROLES}}` | Comma-separated: e.g., `Alex (Lead Dev), Sara (Product Founder), Kai (OSS Maintainer)` |
909
+
910
+ **`{{PERSONA_VPC_SECTIONS}}` format** — repeat for each persona in order:
911
+ ```
912
+ ### "{Nickname}" — The {Role} (X/5)
913
+ - **Jobs addressed**: {list}
914
+ - **Pains relieved**: {list with severity}
915
+ - **Gains created**: {list with impact}
916
+ ```
917
+
918
+ **Kai inclusion rule**: When `IS_OSS=true`, Kai (`sr-the-maintainer.md`) is always the last entry in persona lists and the rightmost column in scoring tables. Kai uses the evaluation criteria defined in `.claude/agents/personas/sr-the-maintainer.md` — features score high (4-5/5) for Kai when they reduce async review burden, enforce project-specific conventions, or automate release/dependency coordination; features score low (0-1/5) when they add configuration complexity or require paid tiers.
919
+
920
+ **When `IS_OSS=false`**: All Kai-related persona references are omitted. `{{MAX_SCORE}}` reduces by 5. Tables and inline scores contain only user-generated personas.
921
+
809
922
  #### GitHub Issues (`BACKLOG_PROVIDER=github`)
810
923
  - Issue fetch: `gh issue list --label "product-driven-backlog" --state open --limit 100 --json number,title,labels,body`
811
924
  - Issue create: `gh issue create --title "..." --label "..." --body "..."`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specrails-core",
3
- "version": "1.4.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"