specrails-core 3.3.1 → 3.4.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 (56) hide show
  1. package/README.md +76 -48
  2. package/bin/doctor.sh +1 -1
  3. package/commands/doctor.md +1 -1
  4. package/commands/setup.md +70 -70
  5. package/docs/README.md +3 -2
  6. package/docs/agents.md +15 -15
  7. package/docs/changelog.md +20 -20
  8. package/docs/concepts.md +3 -3
  9. package/docs/customization.md +18 -5
  10. package/docs/deployment.md +20 -5
  11. package/docs/getting-started.md +16 -27
  12. package/docs/installation.md +81 -48
  13. package/docs/local-tickets.md +11 -12
  14. package/docs/migration-guide.md +9 -9
  15. package/docs/playbook-parallel-dev.md +8 -8
  16. package/docs/playbook-product-discovery.md +1 -1
  17. package/docs/plugin-architecture.md +137 -0
  18. package/docs/research/codex-compatibility-analysis.md +11 -11
  19. package/docs/research/mcp-feasibility-analysis.md +5 -5
  20. package/docs/testing/test-matrix-codex.md +1 -1
  21. package/docs/user-docs/cli-reference.md +57 -57
  22. package/docs/user-docs/codex-vs-claude-code.md +7 -7
  23. package/docs/user-docs/faq.md +32 -26
  24. package/docs/user-docs/getting-started-codex.md +7 -7
  25. package/docs/user-docs/installation.md +47 -38
  26. package/docs/user-docs/quick-start.md +20 -26
  27. package/docs/workflows.md +62 -62
  28. package/install.sh +3 -3
  29. package/package.json +1 -1
  30. package/templates/agents/sr-merge-resolver.md +1 -1
  31. package/templates/claude-md/CLAUDE-quickstart.md +2 -2
  32. package/templates/commands/{sr → specrails}/batch-implement.md +18 -18
  33. package/templates/commands/{sr → specrails}/implement.md +8 -8
  34. package/templates/commands/{sr → specrails}/memory-inspect.md +3 -3
  35. package/templates/commands/{sr → specrails}/merge-resolve.md +1 -1
  36. package/templates/commands/{sr → specrails}/opsx-diff.md +1 -1
  37. package/templates/commands/{sr → specrails}/product-backlog.md +7 -7
  38. package/templates/commands/{sr → specrails}/propose-spec.md +1 -1
  39. package/templates/commands/{sr → specrails}/refactor-recommender.md +1 -1
  40. package/templates/commands/{sr → specrails}/retry.md +13 -13
  41. package/templates/commands/{sr → specrails}/team-debug.md +5 -5
  42. package/templates/commands/{sr → specrails}/team-review.md +4 -4
  43. package/templates/commands/{sr → specrails}/telemetry.md +2 -2
  44. package/templates/commands/{sr → specrails}/update-product-driven-backlog.md +2 -2
  45. package/templates/commands/{sr → specrails}/vpc-drift.md +4 -4
  46. package/templates/commands/{sr → specrails}/why.md +5 -5
  47. package/templates/commands/test.md +2 -2
  48. package/templates/skills/sr-batch-implement/SKILL.md +18 -18
  49. package/templates/skills/sr-implement/SKILL.md +8 -8
  50. package/templates/skills/sr-product-backlog/SKILL.md +7 -7
  51. package/templates/skills/sr-refactor-recommender/SKILL.md +1 -1
  52. package/templates/skills/sr-update-backlog/SKILL.md +2 -2
  53. package/templates/skills/sr-why/SKILL.md +5 -5
  54. package/update.sh +2 -2
  55. /package/templates/commands/{sr → specrails}/compat-check.md +0 -0
  56. /package/templates/commands/{sr → specrails}/health-check.md +0 -0
@@ -2,15 +2,26 @@
2
2
 
3
3
  This guide covers the complete installation process in detail. For the quick version, see [Getting Started](getting-started.md).
4
4
 
5
- ## Prerequisites
5
+ ## Installation methods
6
6
 
7
- ### Required
7
+ SpecRails supports three distribution channels:
8
+
9
+ | Method | Command | Best for |
10
+ |--------|---------|----------|
11
+ | **Claude Code plugin** (recommended) | `claude plugin install sr` | Most projects — no Node.js required, auto-updates |
12
+ | **Claude Code scaffold** | `npx specrails-core@latest init` | Full offline control, Codex users, custom agent edits |
13
+ | **Codex project** | `npx specrails-core@latest init` | OpenAI Codex CLI users |
14
+
15
+ ---
16
+
17
+ ## Method 1: Claude Code plugin (recommended)
18
+
19
+ ### Prerequisites
8
20
 
9
21
  | Tool | Why | Install |
10
22
  |------|-----|---------|
11
- | **Node.js 18+** | Required for the installer | [nodejs.org](https://nodejs.org/) or via [nvm](https://github.com/nvm-sh/nvm) |
12
- | **Git** | SpecRails operates on git repositories | [git-scm.com](https://git-scm.com/) |
13
23
  | **Claude Code** | The AI CLI that runs the agents | `npm install -g @anthropic-ai/claude-code` |
24
+ | **Git** | SpecRails operates on git repositories | [git-scm.com](https://git-scm.com/) |
14
25
 
15
26
  ### Recommended
16
27
 
@@ -18,78 +29,81 @@ This guide covers the complete installation process in detail. For the quick ver
18
29
  |------|-----|---------|
19
30
  | **GitHub CLI** | Auto-create PRs, manage issues | `brew install gh` or [cli.github.com](https://cli.github.com/) |
20
31
 
21
- ### Optional
32
+ ### Install
22
33
 
23
- | Tool | Why |
24
- |------|-----|
25
- | **JIRA CLI** | If using JIRA for backlog instead of GitHub Issues |
26
-
27
- The installer checks for all of these and offers to install missing tools.
34
+ ```bash
35
+ claude plugin install sr
36
+ ```
28
37
 
29
- ## Installation
38
+ That's it. No cloning, no npm, no Node.js required.
30
39
 
31
- ### From npx (recommended)
40
+ To update the plugin later:
32
41
 
33
42
  ```bash
34
- npx specrails-core@latest init --root-dir <your-project>
43
+ claude plugin update sr
35
44
  ```
36
45
 
37
- No cloning required. Downloads the latest version and runs the installer automatically.
46
+ ### What the plugin contains
38
47
 
39
- ### From a local clone
48
+ The plugin bundles the logic layer — agents, skills, commands, hooks, and references. It does **not** touch your project files.
49
+
50
+ ---
51
+
52
+ ## Method 2: Scaffold (npx)
53
+
54
+ ### Prerequisites
55
+
56
+ | Tool | Why | Install |
57
+ |------|-----|---------|
58
+ | **Node.js 18+** | Required for the installer | [nodejs.org](https://nodejs.org/) or via [nvm](https://github.com/nvm-sh/nvm) |
59
+ | **Git** | SpecRails operates on git repositories | [git-scm.com](https://git-scm.com/) |
60
+ | **Claude Code** or **Codex CLI** | The AI CLI that runs the agents | See [codex-vs-claude-code.md](user-docs/codex-vs-claude-code.md) |
40
61
 
41
- If you prefer to clone the repo first:
62
+ ### Install
42
63
 
43
64
  ```bash
44
- git clone https://github.com/fjpulidop/specrails-core.git
45
- ./specrails-core/install.sh --root-dir <your-project>
65
+ npx specrails-core@latest init --root-dir <your-project>
46
66
  ```
47
67
 
48
- ### From curl
68
+ No cloning required. Downloads the latest version and runs the installer automatically.
49
69
 
50
- Alternatively, pipe the installer directly:
70
+ ### From a local clone
51
71
 
52
72
  ```bash
53
- curl -sL https://raw.githubusercontent.com/fjpulidop/specrails-core/main/install.sh | bash
73
+ git clone https://github.com/fjpulidop/specrails-core.git
74
+ ./specrails-core/install.sh --root-dir <your-project>
54
75
  ```
55
76
 
56
- > **Important:** Always run the installer from the **target repository** — the project where you want SpecRails installed. If you run it from inside the SpecRails source repo, the installer will detect this and prompt you for the correct target path.
77
+ > **Important:** Always run the installer from the **target repository** — the project where you want SpecRails installed.
57
78
 
58
- ### What the installer does
79
+ ### What the scaffold installer does
59
80
 
60
- 1. **Checks prerequisites** — validates Git, Claude Code; optionally installs npm, gh, OpenSpec
61
- 2. **Detects existing setup** — warns if `.claude/agents/`, `.claude/commands/`, or `openspec/` already exist
81
+ 1. **Checks prerequisites** — validates Git, Claude Code; optionally installs npm and gh
82
+ 2. **Detects existing setup** — warns if SpecRails artifacts already exist
62
83
  3. **Installs artifacts:**
63
- - `.claude/commands/setup.md` — the `/setup` wizard
64
- - `.claude/setup-templates/` — agent and command templates (temporary, removed after `/setup`)
84
+ - `.claude/commands/specrails/setup.md` — the `/specrails:setup` wizard
85
+ - `.claude/setup-templates/` — agent and command templates (temporary, removed after `/specrails:setup`)
65
86
  - `.claude/security-exemptions.yaml` — security scanner config
66
- - OpenSpec initialization (if CLI available)
67
87
  4. **Tracks version** — writes `.specrails-version` and `.specrails-manifest.json`
68
88
 
69
- ### What it does NOT do
70
-
71
- The installer only copies files. It does not:
72
-
73
- - Modify your existing code
74
- - Create commits
75
- - Push to any remote
89
+ The scaffold installer only copies files. It does not modify your existing code, create commits, or push to any remote.
76
90
 
77
91
  ---
78
92
 
79
93
  ## The Setup Wizard
80
94
 
81
- After installation, open Claude Code in your project and run:
95
+ After either installation method, open Claude Code (or Codex) in your project and run:
82
96
 
83
97
  ```
84
- /setup
98
+ /specrails:setup
85
99
  ```
86
100
 
87
101
  There are two modes:
88
102
 
89
103
  | Mode | Command | When to use |
90
104
  |------|---------|-------------|
91
- | **Full wizard** (default) | `/setup` | Deep stack analysis, researched personas, fully adapted agents — takes 5–10 min |
92
- | **Lite** | `/setup --lite` | Fastest path — 3 questions, sensible defaults, done in under a minute |
105
+ | **Full wizard** (default) | `/specrails:setup` | Deep stack analysis, researched personas, fully adapted agents — takes 5–10 min |
106
+ | **Lite** | `/specrails:setup --lite` | Fastest path — 3 questions, sensible defaults, done in under a minute |
93
107
 
94
108
  ---
95
109
 
@@ -142,7 +156,23 @@ The wizard fills all templates with your project-specific context:
142
156
  - `{{BACKEND_TECH_LIST}}` → your backend technologies
143
157
  - Every `{{PLACEHOLDER}}` resolved with real data
144
158
 
145
- **Generated files (full set):**
159
+ **Generated files (full set, plugin method):**
160
+
161
+ ```
162
+ .specrails/
163
+ ├── config.yaml # Stack, CI commands, git workflow
164
+ ├── personas/
165
+ │ ├── [persona-1].md # Your user personas (VPC profiles)
166
+ │ └── [persona-2].md
167
+ ├── rules/
168
+ │ ├── backend.md # Per-layer coding conventions
169
+ │ ├── frontend.md
170
+ │ └── ...
171
+ ├── agent-memory/ # Persistent agent knowledge
172
+ └── pipeline/ # In-flight feature state
173
+ ```
174
+
175
+ **Generated files (full set, scaffold method):**
146
176
 
147
177
  ```
148
178
  .claude/
@@ -179,15 +209,15 @@ The wizard fills all templates with your project-specific context:
179
209
 
180
210
  The wizard removes itself:
181
211
 
182
- - Deletes `.claude/commands/setup.md`
212
+ - Deletes `.claude/commands/specrails/setup.md`
183
213
  - Deletes `.claude/setup-templates/`
184
214
  - Leaves only the final generated files
185
215
 
186
- After this phase, `/setup` is no longer available — your workflow is ready.
216
+ After this phase, `/specrails:setup` is no longer available until re-run — your workflow is ready.
187
217
 
188
218
  ---
189
219
 
190
- ### Lite Mode (`/setup --lite`)
220
+ ### Lite Mode (`/specrails:setup --lite`)
191
221
 
192
222
  The quick path — three questions, sensible defaults, done in under a minute.
193
223
 
@@ -200,7 +230,7 @@ The quick path — three questions, sensible defaults, done in under a minute.
200
230
  | Item | Detail |
201
231
  |------|--------|
202
232
  | Core agents | sr-architect, sr-developer, sr-reviewer, sr-product-manager |
203
- | All workflow commands | `/sr:implement`, `/sr:product-backlog`, and 14 more |
233
+ | All workflow commands | `/specrails:implement`, `/specrails:product-backlog`, and 14 more |
204
234
  | Backlog storage | Local tickets (`.claude/local-tickets.json`) — no GitHub or JIRA required |
205
235
  | CLAUDE.md | Project-level context for agents |
206
236
 
@@ -213,13 +243,16 @@ You can run the full wizard later to deepen configuration: personas, stack analy
213
243
  After setup, verify everything is in place:
214
244
 
215
245
  ```bash
216
- # Check generated agents
246
+ # Plugin method: check generated project data
247
+ ls .specrails/
248
+
249
+ # Scaffold method: check generated agents
217
250
  ls .claude/agents/
218
251
 
219
- # Check for unresolved placeholders (should return nothing)
252
+ # Scaffold method: check for unresolved placeholders (should return nothing)
220
253
  grep -r '{{[A-Z_]*}}' .claude/agents/ .claude/commands/ .claude/rules/
221
254
 
222
- # Check version
255
+ # Scaffold method: check version
223
256
  cat .specrails-version
224
257
  ```
225
258
 
@@ -269,7 +302,7 @@ The installer warns if SpecRails artifacts already exist. You can:
269
302
 
270
303
  ### Placeholders not resolved
271
304
 
272
- If you see `{{PLACEHOLDER}}` in generated files, the `/setup` wizard didn't complete. Re-run `/setup` or manually fill the values.
305
+ If you see `{{PLACEHOLDER}}` in generated files (scaffold method), the `/specrails:setup` wizard didn't complete. Re-run `/specrails:setup` or manually fill the values.
273
306
 
274
307
  ---
275
308
 
@@ -87,7 +87,7 @@ The file is read and written by specrails-core during command execution.
87
87
 
88
88
  ## Setup
89
89
 
90
- Local tickets become the default during `/setup`. The wizard prompts:
90
+ Local tickets become the default during `/specrails:setup`. The wizard prompts:
91
91
 
92
92
  ```
93
93
  ## Backlog Provider
@@ -112,8 +112,7 @@ Pressing **Enter** or selecting **1** initializes `.claude/local-tickets.json` w
112
112
  To switch providers later, re-run the setup wizard:
113
113
 
114
114
  ```bash
115
- npx specrails-core@latest init --root-dir .
116
- > /setup
115
+ > /specrails:setup
117
116
  ```
118
117
 
119
118
  ---
@@ -147,35 +146,35 @@ Every write increments `revision`. Readers that want to detect external changes
147
146
 
148
147
  ## Command integration
149
148
 
150
- ### `/sr:implement`
149
+ ### `/specrails:implement`
151
150
 
152
151
  Pass local ticket IDs the same way you would GitHub issue numbers:
153
152
 
154
153
  ```bash
155
- /sr:implement #1, #4, #7
154
+ /specrails:implement #1, #4, #7
156
155
  ```
157
156
 
158
157
  The command reads each ticket from `local-tickets.json`, extracts metadata (area, effort, description), and tracks the ticket through the pipeline — updating status to `in_progress` on start and `done` on successful completion.
159
158
 
160
- ### `/sr:product-backlog`
159
+ ### `/specrails:product-backlog`
161
160
 
162
161
  ```bash
163
- /sr:product-backlog # all areas
164
- /sr:product-backlog UI, Backend # filter by area
162
+ /specrails:product-backlog # all areas
163
+ /specrails:product-backlog UI, Backend # filter by area
165
164
  ```
166
165
 
167
166
  Reads all `todo` and `in_progress` tickets, scores them by VPC match, respects the `prerequisites` dependency graph, and recommends the top 3 for your next sprint.
168
167
 
169
- ### `/sr:update-product-driven-backlog`
168
+ ### `/specrails:update-product-driven-backlog`
170
169
 
171
170
  ```bash
172
- /sr:update-product-driven-backlog # explore all areas
173
- /sr:update-product-driven-backlog Analytics # focus on one area
171
+ /specrails:update-product-driven-backlog # explore all areas
172
+ /specrails:update-product-driven-backlog Analytics # focus on one area
174
173
  ```
175
174
 
176
175
  Runs product discovery using your VPC personas. Creates new local tickets for discovered feature ideas, tagged with `source: "product-backlog"` and `labels: ["product-driven-backlog", "area:<area>"]`. Existing tickets are checked for duplicates before creating new ones.
177
176
 
178
- ### `/sr:propose-spec`
177
+ ### `/specrails:propose-spec`
179
178
 
180
179
  When a proposal is finalized, a local ticket is created automatically:
181
180
 
@@ -36,7 +36,7 @@ Then initialize the ticket store if it doesn't exist yet:
36
36
 
37
37
  ```bash
38
38
  # Inside Claude Code or Codex
39
- /sr:implement --setup-local-tickets
39
+ /specrails:implement --setup-local-tickets
40
40
  ```
41
41
 
42
42
  Or create the file manually:
@@ -63,7 +63,7 @@ Use the `sr:migrate-from-github` command (requires `gh` CLI):
63
63
 
64
64
  ```bash
65
65
  # Inside Claude Code
66
- /sr:migrate-from-github
66
+ /specrails:migrate-from-github
67
67
  ```
68
68
 
69
69
  This command:
@@ -80,13 +80,13 @@ This command:
80
80
  To import all open issues regardless of label:
81
81
 
82
82
  ```bash
83
- /sr:migrate-from-github --all
83
+ /specrails:migrate-from-github --all
84
84
  ```
85
85
 
86
86
  To do a dry run (preview without writing):
87
87
 
88
88
  ```bash
89
- /sr:migrate-from-github --dry-run
89
+ /specrails:migrate-from-github --dry-run
90
90
  ```
91
91
 
92
92
  **After import:** Your GitHub Issues are unchanged. The migration is additive — it only creates local tickets. You can continue using GitHub Issues in parallel until you're ready to stop.
@@ -97,7 +97,7 @@ Use the `sr:migrate-from-jira` command (requires `jira` CLI or REST API credenti
97
97
 
98
98
  ```bash
99
99
  # Inside Claude Code
100
- /sr:migrate-from-jira
100
+ /specrails:migrate-from-jira
101
101
  ```
102
102
 
103
103
  This command:
@@ -118,11 +118,11 @@ The original JIRA key is preserved in `metadata.jira_key` so you can cross-refer
118
118
 
119
119
  ## Step 3: Regenerate commands (optional but recommended)
120
120
 
121
- Command templates are generated at `/setup` time with provider-specific instructions baked in. After switching providers, regenerate them so commands use the local file operations instead of GitHub/JIRA CLI calls:
121
+ Command templates are generated at `/specrails:setup` time with provider-specific instructions baked in. After switching providers, regenerate them so commands use the local file operations instead of GitHub/JIRA CLI calls:
122
122
 
123
123
  ```bash
124
124
  npx specrails-core@latest init --root-dir .
125
- > /setup --update
125
+ > /specrails:setup --update
126
126
  ```
127
127
 
128
128
  The `--update` flag regenerates only the backlog commands (`product-backlog`, `update-product-driven-backlog`, `implement`) without re-running the full stack analysis.
@@ -133,8 +133,8 @@ The `--update` flag regenerates only the backlog commands (`product-backlog`, `u
133
133
 
134
134
  To revert to GitHub Issues:
135
135
 
136
- 1. Edit `.claude/backlog-config.json` and set `"provider": "github"`
137
- 2. Re-run `/setup --update` to regenerate commands
136
+ 1. Edit `.specrails/config.yaml` (or `.claude/backlog-config.json` for scaffold installs) and set `provider: github`
137
+ 2. Re-run `/specrails:setup --update` to regenerate commands
138
138
  3. Your `local-tickets.json` is preserved — switch back any time
139
139
 
140
140
  Local tickets and external provider data are independent. Switching providers does not delete tickets from either system.
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## How specrails parallelizes work
6
6
 
7
- When you pass multiple issue numbers to `/sr:batch-implement`, specrails spawns one git worktree per feature. Each worktree has its own branch, its own isolated copy of the working tree, and its own full agent pipeline running concurrently. Features do not queue — they run in parallel from Phase 3a (Architecture) through Phase 5 (PR creation).
7
+ When you pass multiple issue numbers to `/specrails:batch-implement`, specrails spawns one git worktree per feature. Each worktree has its own branch, its own isolated copy of the working tree, and its own full agent pipeline running concurrently. Features do not queue — they run in parallel from Phase 3a (Architecture) through Phase 5 (PR creation).
8
8
 
9
9
  This is not a simulation of parallelism. Each pipeline is a separate Claude Code session with no shared state. The Architect for issue #71 has no visibility into the Architect for issue #63. Each Developer commits to its own branch. Each Reviewer runs CI independently. The worktrees are merged into the base branch at the end of the batch run.
10
10
 
@@ -22,7 +22,7 @@ Not every combination of features is safe to run in parallel. A feature is safe
22
22
 
23
23
  4. **Wave 1 in the dependency DAG**: the feature has no unimplemented prerequisites. A feature with `Prerequisites: #71` cannot run in the same batch as #71 — it must wait for #71 to ship first.
24
24
 
25
- When in doubt, run `/sr:product-backlog` to see the dependency ordering before composing your batch.
25
+ When in doubt, run `/specrails:product-backlog` to see the dependency ordering before composing your batch.
26
26
 
27
27
  ## What's not safe
28
28
 
@@ -38,10 +38,10 @@ Some combinations look independent but are not:
38
38
 
39
39
  ## Reading the dependency DAG
40
40
 
41
- Run `/sr:product-backlog` before composing any parallel batch. The output includes a prioritized backlog table with dependency metadata. Wave 1 features — those with no unimplemented prerequisites — are your safe parallel batch candidates.
41
+ Run `/specrails:product-backlog` before composing any parallel batch. The output includes a prioritized backlog table with dependency metadata. Wave 1 features — those with no unimplemented prerequisites — are your safe parallel batch candidates.
42
42
 
43
43
  ```
44
- /sr:product-backlog
44
+ /specrails:product-backlog
45
45
 
46
46
  ┌─ API ──────────────────────────────────────────┐
47
47
  │ # Issue Score Effort Description │
@@ -72,13 +72,13 @@ Reading the issue bodies:
72
72
  #71 and #63 are independent of each other and have no prerequisites. They are Wave 1. Run them in parallel:
73
73
 
74
74
  ```
75
- /sr:batch-implement #71, #63
75
+ /specrails:batch-implement #71, #63
76
76
  ```
77
77
 
78
78
  Both pipelines run concurrently. Each produces a PR. After both PRs are merged, #85 is unblocked. Run it alone:
79
79
 
80
80
  ```
81
- /sr:implement #85
81
+ /specrails:implement #85
82
82
  ```
83
83
 
84
84
  Attempting to include #85 in the first batch would have caused the Developer for #85 to run without the rate limiting middleware in place, producing code that imports a module that doesn't exist yet.
@@ -103,7 +103,7 @@ After all worktree pipelines complete, specrails attempts to merge each feature
103
103
 
104
104
  | Pattern | Why it works |
105
105
  |---------|-------------|
106
- | Run `/sr:product-backlog` before composing a batch | Surfaces the dependency DAG so you batch only Wave 1 features |
106
+ | Run `/specrails:product-backlog` before composing a batch | Surfaces the dependency DAG so you batch only Wave 1 features |
107
107
  | Keep batches to 2–4 features | Smaller batches reduce conflict surface area and keep the merge step fast |
108
108
  | Ensure all specs are approved before starting the batch | Prevents mid-batch spec revisions that invalidate a running pipeline |
109
109
  | Sequence database migration features before features that consume the schema | Eliminates the most common class of parallel dev failures |
@@ -117,7 +117,7 @@ After all worktree pipelines complete, specrails attempts to merge each feature
117
117
 
118
118
  ## What's next?
119
119
 
120
- - [Workflows & Commands](workflows.md) — full reference for `/sr:batch-implement`, `/sr:implement`, and `/sr:product-backlog`
120
+ - [Workflows & Commands](workflows.md) — full reference for `/specrails:batch-implement`, `/specrails:implement`, and `/specrails:product-backlog`
121
121
 
122
122
  ---
123
123
 
@@ -45,7 +45,7 @@ The difference is not length — it is specificity. The Architect can produce a
45
45
 
46
46
  The Product Analyst reads your GitHub Issues labeled `product-driven-backlog` to build the dependency DAG and score your backlog. The issue body structure matters.
47
47
 
48
- **The `Prerequisites:` field** is how you tell the Product Analyst that one issue depends on another. When you run `/sr:product-backlog`, the dependency DAG is built from these declarations. Issues without prerequisites are Wave 1 candidates — safe to implement in parallel. Issues with prerequisites are scheduled after their dependencies complete.
48
+ **The `Prerequisites:` field** is how you tell the Product Analyst that one issue depends on another. When you run `/specrails:product-backlog`, the dependency DAG is built from these declarations. Issues without prerequisites are Wave 1 candidates — safe to implement in parallel. Issues with prerequisites are scheduled after their dependencies complete.
49
49
 
50
50
  ```
51
51
  Prerequisites: #71 (rate limiting middleware must exist before we can display rate limit status)
@@ -0,0 +1,137 @@
1
+ # Plugin Architecture
2
+
3
+ SpecRails is distributed as a **Claude Code plugin** (`sr`). This document explains what that means, how the plugin relates to your project, and the three available distribution channels.
4
+
5
+ ## Two-layer model
6
+
7
+ SpecRails separates **logic** (the plugin) from **project data** (your repo).
8
+
9
+ ```
10
+ ┌─────────────────────────────────────┐
11
+ │ sr plugin (logic) │
12
+ │ agents · skills · hooks · refs │
13
+ │ updated via: claude plugin update │
14
+ └────────────────┬────────────────────┘
15
+ │ /specrails:setup generates
16
+
17
+ ┌─────────────────────────────────────┐
18
+ │ .specrails/ (project data) │
19
+ │ config · personas · rules · memory │
20
+ │ lives in your repo, yours to edit │
21
+ └─────────────────────────────────────┘
22
+ ```
23
+
24
+ ### What lives in the plugin
25
+
26
+ The plugin contains everything that doesn't change per project:
27
+
28
+ | Component | Description |
29
+ |-----------|-------------|
30
+ | **Agent prompts** | sr-architect, sr-developer, sr-reviewer, sr-product-manager, and 10 more |
31
+ | **Skills** | OpenSpec skills (`/opsx:*`), workflow commands (`/specrails:*`) |
32
+ | **Hooks** | Pre/post-tool hooks for agent coordination |
33
+ | **References** | Agent reference docs, API patterns, test conventions |
34
+
35
+ You never edit these directly. To update them, run `claude plugin update sr`.
36
+
37
+ ### What lives in your project (`.specrails/`)
38
+
39
+ `/specrails:setup` generates ~8–10 files adapted to your specific codebase:
40
+
41
+ | File | Description |
42
+ |------|-------------|
43
+ | `config.yaml` | Stack overview, CI commands, git workflow, backlog provider |
44
+ | `personas/*.md` | VPC user personas — researched from your domain |
45
+ | `rules/*.md` | Per-layer coding conventions (backend, frontend, etc.) |
46
+ | `agent-memory/` | Persistent agent knowledge — grows across sessions |
47
+ | `pipeline/` | In-flight state for parallel feature builds |
48
+ | `CLAUDE.md` (root) | Project architecture reference for agents |
49
+
50
+ These files are committed to your repo. They are the "project intelligence" that makes agents adapt to your stack.
51
+
52
+ ## Distribution channels
53
+
54
+ SpecRails supports three installation paths:
55
+
56
+ ### 1. Claude Code plugin (recommended)
57
+
58
+ ```bash
59
+ claude plugin install sr # install
60
+ /specrails:setup # configure for your project
61
+ claude plugin update sr # update logic anytime
62
+ ```
63
+
64
+ **Best for:** Most projects. No Node.js required. Plugin updates are one command and don't touch your project data.
65
+
66
+ ### 2. Claude Code scaffold
67
+
68
+ ```bash
69
+ npx specrails-core@latest init --root-dir . # copy templates
70
+ /specrails:setup # configure
71
+ ```
72
+
73
+ The scaffold copies the full agent+command set into `.claude/` — you own and version those files. Updates require re-running `npx` and re-running `/specrails:setup`.
74
+
75
+ **Best for:** Teams that want to version the agent prompts themselves, or projects that need full offline control.
76
+
77
+ ### 3. Codex project
78
+
79
+ ```bash
80
+ npx specrails-core@latest init --root-dir . # same as scaffold
81
+ codex # open Codex
82
+ /specrails:setup # configure
83
+ ```
84
+
85
+ Codex does not support the Claude Code plugin system. Use the scaffold method.
86
+
87
+ **Best for:** OpenAI Codex CLI users.
88
+
89
+ ## The `/specrails:setup` wizard
90
+
91
+ `/specrails:setup` is a 5-phase setup wizard that generates your project data. It runs once (or re-runs to regenerate).
92
+
93
+ | Phase | Output |
94
+ |-------|--------|
95
+ | **1. Analyze** | Detects stack, CI commands, architecture layers |
96
+ | **2. Personas** | Researches domain, generates VPC user personas |
97
+ | **3. Configure** | Backlog provider, git workflow, agent selection |
98
+ | **4. Generate** | Writes `.specrails/config.yaml`, personas, rules, CLAUDE.md |
99
+ | **5. Cleanup** | Removes wizard scaffolding |
100
+
101
+ Quick mode: `/specrails:setup --lite` — three questions, done in under a minute.
102
+
103
+ ## OpenSpec skills
104
+
105
+ The `sr` plugin bundles the full OpenSpec skill set. These are available as `/opsx:*` commands:
106
+
107
+ | Skill | Purpose |
108
+ |-------|---------|
109
+ | `/opsx:ff` | Fast-forward through all change artifacts |
110
+ | `/opsx:apply` | Implement an OpenSpec change |
111
+ | `/opsx:verify` | Verify implementation matches spec |
112
+ | `/opsx:archive` | Archive a completed change |
113
+ | `/opsx:explore` | Explore ideas before writing a spec |
114
+
115
+ OpenSpec is the structured design layer that powers `/specrails:implement` — the architect uses it to produce a technical design before the developer begins coding.
116
+
117
+ ## Updating
118
+
119
+ ### Update plugin logic
120
+
121
+ ```bash
122
+ claude plugin update sr
123
+ ```
124
+
125
+ Updates agents, skills, hooks, and references. Does not touch `.specrails/` project data.
126
+
127
+ ### Regenerate project data
128
+
129
+ ```bash
130
+ /specrails:setup
131
+ ```
132
+
133
+ Re-runs the wizard and regenerates `.specrails/`. Useful when your stack changes significantly or you want to refresh personas.
134
+
135
+ ---
136
+
137
+ [← Installation](installation.md) · [Core Concepts →](concepts.md)
@@ -12,7 +12,7 @@
12
12
 
13
13
  Claude Code y Codex han convergido arquitectónicamente de forma significativa durante 2025–2026. Comparten el mismo formato de Skills (OpenAI adoptó la spec de Anthropic en diciembre 2025), ambos soportan MCP como mecanismo de extensión, ambos usan ficheros Markdown jerárquicos como instrucciones de agente (`AGENTS.md` vs `CLAUDE.md`), y ambos soportan subagentes y ejecución paralela.
14
14
 
15
- El camino de menor resistencia para dar soporte a Codex **no requiere reescribir specrails-core** — requiere refactorizar los comandos `/sr:*` de slash commands Claude Code-only a Skills (formato ya compatible con ambas plataformas), y añadir una capa de abstracción mínima en el instalador.
15
+ El camino de menor resistencia para dar soporte a Codex **no requiere reescribir specrails-core** — requiere refactorizar los comandos `/specrails:*` de slash commands Claude Code-only a Skills (formato ya compatible con ambas plataformas), y añadir una capa de abstracción mínima en el instalador.
16
16
 
17
17
  | Dimensión | Valoración |
18
18
  |-----------|-----------|
@@ -83,7 +83,7 @@ Esta es la finding más importante de la investigación.
83
83
 
84
84
  OpenAI adoptó en diciembre 2025 el **mismo formato `SKILL.md`** que publicó Anthropic. Esto significa que:
85
85
 
86
- > **Todos los Skills de specrails (`/sr:implement`, `/opsx:ff`, etc.) son compatible con Codex sin cambios de formato.**
86
+ > **Todos los Skills de specrails (`/specrails:implement`, `/opsx:ff`, etc.) son compatible con Codex sin cambios de formato.**
87
87
 
88
88
  La implicación práctica: si specrails migra sus comandos de workflow de "slash commands Claude Code-only" a "Skills" (lo que en gran medida ya está ocurriendo), esos Skills funcionan en ambas plataformas.
89
89
 
@@ -103,12 +103,12 @@ La implicación práctica: si specrails migra sus comandos de workflow de "slash
103
103
 
104
104
  #### B. Comandos Slash vs Skills
105
105
 
106
- **Estado actual**: Los comandos `/sr:*` son slash commands Claude Code-only, definidos como markdown en `.claude/commands/sr/`. Codex no permite slash commands user-definables.
106
+ **Estado actual**: Los comandos `/specrails:*` son slash commands Claude Code-only, definidos como markdown en `.claude/commands/specrails/`. Codex no permite slash commands user-definables.
107
107
 
108
- **Solución (crítica)**: Los Skills ya son el mecanismo correcto. specrails ya tiene muchos `/sr:*` implementados como Skills (el `.claude/skills/` directory). La migración es convertir los comandos restantes a formato Skill.
108
+ **Solución (crítica)**: Los Skills ya son el mecanismo correcto. specrails ya tiene muchos `/specrails:*` implementados como Skills (el `.claude/skills/` directory). La migración es convertir los comandos restantes a formato Skill.
109
109
 
110
110
  ```markdown
111
- # Antes: .claude/commands/sr/implement.md (Claude Code-only)
111
+ # Antes: .claude/commands/specrails/implement.md (Claude Code-only)
112
112
  # Después: .claude/skills/sr-implement/SKILL.md (compatible con ambos)
113
113
  ```
114
114
 
@@ -165,7 +165,7 @@ model = "codex-mini-latest"
165
165
 
166
166
  #### F. Variables de entorno Claude Code-specific
167
167
 
168
- **Estado actual**: El comando `/sr:implement` detecta `CLAUDE_CODE_ENTRYPOINT` y `CLAUDE_CODE_REMOTE`.
168
+ **Estado actual**: El comando `/specrails:implement` detecta `CLAUDE_CODE_ENTRYPOINT` y `CLAUDE_CODE_REMOTE`.
169
169
 
170
170
  **Solución**: Abstracción — detectar environment vars de ambas CLIs o usar las propias del runner.
171
171
 
@@ -239,7 +239,7 @@ specrails-hub se comunica con specrails-core vía `integration-contract.json`. E
239
239
 
240
240
  ### Approach B: Skills-First (Recomendado)
241
241
 
242
- **Descripción**: Refactorizar los comandos `/sr:*` como Skills (ya compatibles con ambas plataformas). El core de workflow no depende de la CLI — funciona igual en Claude Code y Codex. La integración de agentes se hace vía Skills y MCP.
242
+ **Descripción**: Refactorizar los comandos `/specrails:*` como Skills (ya compatibles con ambas plataformas). El core de workflow no depende de la CLI — funciona igual en Claude Code y Codex. La integración de agentes se hace vía Skills y MCP.
243
243
 
244
244
  **Por qué es el approach correcto**:
245
245
  - Skills son el mínimo común denominador entre CLIs
@@ -298,7 +298,7 @@ Hay señales claras de que Codex está ganando tracción rápidamente (open sour
298
298
  **Proceder con Approach B (Skills-First) como Phase 1, con roadmap hacia Approach A.**
299
299
 
300
300
  ### Fase 1 — Skills-First (Q2 2026, ~3-4 semanas)
301
- - Migrar comandos `/sr:*` a Skills format
301
+ - Migrar comandos `/specrails:*` a Skills format
302
302
  - Añadir detección de CLI en install.sh
303
303
  - Soporte de `.codex/` directory como alternativa a `.claude/`
304
304
  - Hub detection layer
@@ -323,7 +323,7 @@ Si el board aprueba proceder:
323
323
  1. **Crear epic SPEA-Codex-Support** en specrails-core project
324
324
  2. **Asignar al Tech Lead (specrails-core)** el diseño técnico detallado de la abstracción de provider
325
325
  3. **Crear subtareas**:
326
- - Skills migration completa (`/sr:*` → Skills format)
326
+ - Skills migration completa (`/specrails:*` → Skills format)
327
327
  - install.sh provider detection
328
328
  - Hub detection layer
329
329
  - Integration testing con Codex CLI
@@ -335,8 +335,8 @@ Si el board aprueba proceder:
335
335
 
336
336
  | specrails (actual) | Claude Code invocation | Codex invocation |
337
337
  |-------------------|----------------------|-----------------|
338
- | `/sr:implement` | Slash command | Skill (mismo `SKILL.md`) |
339
- | `/sr:product-backlog` | Slash command | Skill |
338
+ | `/specrails:implement` | Slash command | Skill (mismo `SKILL.md`) |
339
+ | `/specrails:product-backlog` | Slash command | Skill |
340
340
  | `/opsx:ff` | Slash command | Skill |
341
341
  | `/setup` | Slash command | `codex exec "run setup"` |
342
342
  | Agent `sr-architect` | `.claude/agents/sr-architect.md` | `.codex/agents/sr-architect.toml` |