specrails-core 5.6.0 → 6.0.1

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 (279) hide show
  1. package/README.md +27 -145
  2. package/bin/specrails-core.mjs +12 -554
  3. package/dist/agent-runtime/capabilities.js +0 -1
  4. package/dist/agent-runtime/change-scope.d.ts +63 -0
  5. package/dist/agent-runtime/change-scope.js +297 -0
  6. package/dist/agent-runtime/cli-executor.d.ts +1 -1
  7. package/dist/agent-runtime/cli-executor.js +1 -2
  8. package/dist/agent-runtime/cli-process.js +0 -1
  9. package/dist/agent-runtime/cli.js +4 -5
  10. package/dist/agent-runtime/codex-schema.js +0 -1
  11. package/dist/agent-runtime/compact/architect.d.ts +3 -272
  12. package/dist/agent-runtime/compact/architect.js +8 -9
  13. package/dist/agent-runtime/compact/chat-client.d.ts +3 -3
  14. package/dist/agent-runtime/compact/chat-client.js +1 -2
  15. package/dist/agent-runtime/compact/developer.d.ts +3 -70
  16. package/dist/agent-runtime/compact/developer.js +13 -14
  17. package/dist/agent-runtime/compact/environment.d.ts +16 -5
  18. package/dist/agent-runtime/compact/environment.js +32 -3
  19. package/dist/agent-runtime/compact/exit-code-honesty.d.ts +2 -1
  20. package/dist/agent-runtime/compact/exit-code-honesty.js +0 -1
  21. package/dist/agent-runtime/compact/guarded-loop.d.ts +2 -18
  22. package/dist/agent-runtime/compact/guarded-loop.js +7 -8
  23. package/dist/agent-runtime/compact/prompt-inputs.d.ts +0 -2
  24. package/dist/agent-runtime/compact/prompt-inputs.js +1 -2
  25. package/dist/agent-runtime/compact/reviewer.d.ts +0 -13
  26. package/dist/agent-runtime/compact/reviewer.js +5 -6
  27. package/dist/agent-runtime/compact/step.d.ts +0 -1
  28. package/dist/agent-runtime/compact/step.js +1 -2
  29. package/dist/agent-runtime/compact/test-reachability.js +6 -3
  30. package/dist/agent-runtime/config.js +0 -1
  31. package/dist/agent-runtime/core-host.d.ts +2 -2
  32. package/dist/agent-runtime/core-host.js +2 -3
  33. package/dist/agent-runtime/durable-store.d.ts +0 -1
  34. package/dist/agent-runtime/durable-store.js +1 -2
  35. package/dist/agent-runtime/efficiency-summary.d.ts +2 -2
  36. package/dist/agent-runtime/efficiency-summary.js +1 -2
  37. package/dist/agent-runtime/efficiency-types.js +0 -1
  38. package/dist/agent-runtime/efficiency.js +0 -1
  39. package/dist/agent-runtime/evaluation-corpus.js +0 -1
  40. package/dist/agent-runtime/evaluation.d.ts +2 -1
  41. package/dist/agent-runtime/evaluation.js +1 -2
  42. package/dist/agent-runtime/executor-types.d.ts +1 -1
  43. package/dist/agent-runtime/executor-types.js +0 -1
  44. package/dist/agent-runtime/executors.js +0 -1
  45. package/dist/agent-runtime/gemini-policy.js +0 -1
  46. package/dist/agent-runtime/graph/artifacts.d.ts +1 -1
  47. package/dist/agent-runtime/graph/artifacts.js +5 -3
  48. package/dist/agent-runtime/graph/convergence.d.ts +26 -0
  49. package/dist/agent-runtime/graph/convergence.js +62 -0
  50. package/dist/agent-runtime/graph/nodes.d.ts +1 -1
  51. package/dist/agent-runtime/graph/nodes.js +170 -24
  52. package/dist/agent-runtime/graph/review-policy.js +0 -1
  53. package/dist/agent-runtime/graph/roles.d.ts +2 -5
  54. package/dist/agent-runtime/graph/roles.js +2 -8
  55. package/dist/agent-runtime/graph/state.d.ts +6 -1
  56. package/dist/agent-runtime/graph/state.js +2 -1
  57. package/dist/agent-runtime/graph-checkpointer.d.ts +2 -1
  58. package/dist/agent-runtime/graph-checkpointer.js +0 -1
  59. package/dist/agent-runtime/guardrails.d.ts +3 -3
  60. package/dist/agent-runtime/guardrails.js +1 -2
  61. package/dist/agent-runtime/index.d.ts +1 -1
  62. package/dist/agent-runtime/index.js +1 -2
  63. package/dist/agent-runtime/kimi-acp.js +1 -2
  64. package/dist/agent-runtime/kimi-model.d.ts +6 -0
  65. package/dist/agent-runtime/kimi-model.js +12 -0
  66. package/dist/agent-runtime/openai-executor.d.ts +0 -9
  67. package/dist/agent-runtime/openai-executor.js +6 -7
  68. package/dist/agent-runtime/openspec-tool-server.js +1 -2
  69. package/dist/agent-runtime/openspec.d.ts +0 -2
  70. package/dist/agent-runtime/openspec.js +1 -6
  71. package/dist/agent-runtime/prompts.d.ts +11 -5
  72. package/dist/agent-runtime/prompts.js +46 -17
  73. package/dist/agent-runtime/provider-diagnostic.js +1 -2
  74. package/dist/agent-runtime/recovery.js +1 -2
  75. package/dist/agent-runtime/repository-context.d.ts +1 -1
  76. package/dist/agent-runtime/repository-context.js +19 -1
  77. package/dist/agent-runtime/review-context.d.ts +1 -1
  78. package/dist/agent-runtime/review-context.js +0 -1
  79. package/dist/agent-runtime/role-routing.js +0 -1
  80. package/dist/agent-runtime/role-state.js +0 -1
  81. package/dist/agent-runtime/runtime-identity.js +1 -2
  82. package/dist/agent-runtime/tool-event.js +0 -1
  83. package/dist/agent-runtime/verification-plan.d.ts +5 -4
  84. package/dist/agent-runtime/verification-plan.js +9 -5
  85. package/dist/agent-runtime/workflow-types.js +0 -1
  86. package/dist/agent-runtime/workflow.js +0 -1
  87. package/dist/agent-runtime/workspace-tools.d.ts +2 -2
  88. package/dist/agent-runtime/workspace-tools.js +1 -2
  89. package/dist/installer/cli.d.ts +3 -32
  90. package/dist/installer/cli.js +26 -101
  91. package/dist/installer/commands/framework.d.ts +4 -3
  92. package/dist/installer/commands/framework.js +0 -1
  93. package/dist/installer/commands/init.d.ts +4 -25
  94. package/dist/installer/commands/init.js +5 -8
  95. package/dist/installer/phases/framework-lifecycle.d.ts +3 -17
  96. package/dist/installer/phases/framework-lifecycle.js +2 -3
  97. package/dist/installer/phases/install-config.d.ts +7 -8
  98. package/dist/installer/phases/install-config.js +2 -7
  99. package/dist/installer/phases/manifest.d.ts +6 -7
  100. package/dist/installer/phases/manifest.js +2 -7
  101. package/dist/installer/phases/prereqs.d.ts +6 -7
  102. package/dist/installer/phases/prereqs.js +4 -6
  103. package/dist/installer/phases/provider-detect.d.ts +6 -7
  104. package/dist/installer/phases/provider-detect.js +2 -4
  105. package/dist/installer/phases/scaffold.d.ts +9 -10
  106. package/dist/installer/phases/scaffold.js +82 -805
  107. package/dist/installer/util/errors.js +0 -1
  108. package/dist/installer/util/exec.d.ts +3 -2
  109. package/dist/installer/util/exec.js +0 -1
  110. package/dist/installer/util/fs.d.ts +0 -10
  111. package/dist/installer/util/fs.js +1 -2
  112. package/dist/installer/util/git.js +0 -1
  113. package/dist/installer/util/install-transaction.d.ts +2 -2
  114. package/dist/installer/util/install-transaction.js +1 -2
  115. package/dist/installer/util/logger.d.ts +1 -3
  116. package/dist/installer/util/logger.js +0 -1
  117. package/dist/installer/util/paths.js +0 -1
  118. package/dist/installer/util/registry.d.ts +4 -8
  119. package/dist/installer/util/registry.js +2 -3
  120. package/dist/{installer/runtime → pipeline}/pipeline-state.d.ts +11 -0
  121. package/dist/{installer/runtime → pipeline}/pipeline-state.js +56 -5
  122. package/dist/shared/args.d.ts +18 -0
  123. package/dist/shared/args.js +53 -0
  124. package/integration-contract.json +11 -47
  125. package/package.json +3 -10
  126. package/templates/agents/sr-architect.md +15 -310
  127. package/templates/agents/sr-developer.md +15 -269
  128. package/templates/agents/sr-reviewer.md +13 -367
  129. package/templates/codex-skills/rails/sr-architect/SKILL.md +14 -308
  130. package/templates/codex-skills/rails/sr-developer/SKILL.md +14 -201
  131. package/templates/codex-skills/rails/sr-reviewer/SKILL.md +15 -289
  132. package/templates/kimi/specrails/run-skill.mjs +91 -2173
  133. package/bin/tui-installer.mjs +0 -430
  134. package/commands/doctor.md +0 -62
  135. package/dist/agent-runtime/capabilities.js.map +0 -1
  136. package/dist/agent-runtime/cli-executor.js.map +0 -1
  137. package/dist/agent-runtime/cli-process.js.map +0 -1
  138. package/dist/agent-runtime/cli.js.map +0 -1
  139. package/dist/agent-runtime/codex-schema.js.map +0 -1
  140. package/dist/agent-runtime/compact/architect.js.map +0 -1
  141. package/dist/agent-runtime/compact/chat-client.js.map +0 -1
  142. package/dist/agent-runtime/compact/developer.js.map +0 -1
  143. package/dist/agent-runtime/compact/environment.js.map +0 -1
  144. package/dist/agent-runtime/compact/exit-code-honesty.js.map +0 -1
  145. package/dist/agent-runtime/compact/guarded-loop.js.map +0 -1
  146. package/dist/agent-runtime/compact/prompt-inputs.js.map +0 -1
  147. package/dist/agent-runtime/compact/reviewer.js.map +0 -1
  148. package/dist/agent-runtime/compact/step.js.map +0 -1
  149. package/dist/agent-runtime/compact/test-reachability.js.map +0 -1
  150. package/dist/agent-runtime/config.js.map +0 -1
  151. package/dist/agent-runtime/core-host.js.map +0 -1
  152. package/dist/agent-runtime/durable-store.js.map +0 -1
  153. package/dist/agent-runtime/efficiency-summary.js.map +0 -1
  154. package/dist/agent-runtime/efficiency-types.js.map +0 -1
  155. package/dist/agent-runtime/efficiency.js.map +0 -1
  156. package/dist/agent-runtime/evaluation-corpus.js.map +0 -1
  157. package/dist/agent-runtime/evaluation.js.map +0 -1
  158. package/dist/agent-runtime/executor-types.js.map +0 -1
  159. package/dist/agent-runtime/executors.js.map +0 -1
  160. package/dist/agent-runtime/gemini-policy.js.map +0 -1
  161. package/dist/agent-runtime/graph/artifacts.js.map +0 -1
  162. package/dist/agent-runtime/graph/nodes.js.map +0 -1
  163. package/dist/agent-runtime/graph/review-policy.js.map +0 -1
  164. package/dist/agent-runtime/graph/roles.js.map +0 -1
  165. package/dist/agent-runtime/graph/state.js.map +0 -1
  166. package/dist/agent-runtime/graph-checkpointer.js.map +0 -1
  167. package/dist/agent-runtime/guardrails.js.map +0 -1
  168. package/dist/agent-runtime/index.js.map +0 -1
  169. package/dist/agent-runtime/kimi-acp.js.map +0 -1
  170. package/dist/agent-runtime/openai-executor.js.map +0 -1
  171. package/dist/agent-runtime/openspec-tool-server.js.map +0 -1
  172. package/dist/agent-runtime/openspec.js.map +0 -1
  173. package/dist/agent-runtime/prompts.js.map +0 -1
  174. package/dist/agent-runtime/provider-diagnostic.js.map +0 -1
  175. package/dist/agent-runtime/recovery.js.map +0 -1
  176. package/dist/agent-runtime/repository-context.js.map +0 -1
  177. package/dist/agent-runtime/review-context.js.map +0 -1
  178. package/dist/agent-runtime/role-routing.js.map +0 -1
  179. package/dist/agent-runtime/role-state.js.map +0 -1
  180. package/dist/agent-runtime/runtime-identity.js.map +0 -1
  181. package/dist/agent-runtime/tool-event.js.map +0 -1
  182. package/dist/agent-runtime/verification-plan.js.map +0 -1
  183. package/dist/agent-runtime/workflow-types.js.map +0 -1
  184. package/dist/agent-runtime/workflow.js.map +0 -1
  185. package/dist/agent-runtime/workspace-tools.js.map +0 -1
  186. package/dist/installer/cli.js.map +0 -1
  187. package/dist/installer/commands/doctor.d.ts +0 -27
  188. package/dist/installer/commands/doctor.js +0 -615
  189. package/dist/installer/commands/doctor.js.map +0 -1
  190. package/dist/installer/commands/framework.js.map +0 -1
  191. package/dist/installer/commands/init.js.map +0 -1
  192. package/dist/installer/commands/update.d.ts +0 -56
  193. package/dist/installer/commands/update.js +0 -257
  194. package/dist/installer/commands/update.js.map +0 -1
  195. package/dist/installer/commands/v5-migration.d.ts +0 -32
  196. package/dist/installer/commands/v5-migration.js +0 -133
  197. package/dist/installer/commands/v5-migration.js.map +0 -1
  198. package/dist/installer/phases/framework-lifecycle.js.map +0 -1
  199. package/dist/installer/phases/install-config.js.map +0 -1
  200. package/dist/installer/phases/manifest.js.map +0 -1
  201. package/dist/installer/phases/prereqs.js.map +0 -1
  202. package/dist/installer/phases/provider-detect.js.map +0 -1
  203. package/dist/installer/phases/scaffold.js.map +0 -1
  204. package/dist/installer/runtime/kimi.d.ts +0 -84
  205. package/dist/installer/runtime/kimi.js +0 -255
  206. package/dist/installer/runtime/kimi.js.map +0 -1
  207. package/dist/installer/runtime/pipeline-state.js.map +0 -1
  208. package/dist/installer/util/errors.js.map +0 -1
  209. package/dist/installer/util/exec.js.map +0 -1
  210. package/dist/installer/util/fs.js.map +0 -1
  211. package/dist/installer/util/git.js.map +0 -1
  212. package/dist/installer/util/install-transaction.js.map +0 -1
  213. package/dist/installer/util/logger.js.map +0 -1
  214. package/dist/installer/util/paths.js.map +0 -1
  215. package/dist/installer/util/prompts.d.ts +0 -23
  216. package/dist/installer/util/prompts.js +0 -49
  217. package/dist/installer/util/prompts.js.map +0 -1
  218. package/dist/installer/util/registry.js.map +0 -1
  219. package/dist/installer/util/template.d.ts +0 -23
  220. package/dist/installer/util/template.js +0 -60
  221. package/dist/installer/util/template.js.map +0 -1
  222. package/docs/README.md +0 -40
  223. package/docs/agent-runtime-efficiency.md +0 -65
  224. package/docs/agent-runtime.md +0 -393
  225. package/docs/agents.md +0 -315
  226. package/docs/changelog.md +0 -168
  227. package/docs/ci-cd.md +0 -60
  228. package/docs/concepts.md +0 -183
  229. package/docs/customization.md +0 -363
  230. package/docs/deployment.md +0 -234
  231. package/docs/getting-started.md +0 -122
  232. package/docs/installation.md +0 -395
  233. package/docs/local-tickets.md +0 -191
  234. package/docs/migration-guide.md +0 -140
  235. package/docs/playbook-oss-maintainer.md +0 -112
  236. package/docs/playbook-parallel-dev.md +0 -124
  237. package/docs/playbook-product-discovery.md +0 -115
  238. package/docs/plugin-architecture.md +0 -144
  239. package/docs/research/codex-compatibility-analysis.md +0 -365
  240. package/docs/research/mcp-feasibility-analysis.md +0 -382
  241. package/docs/testing/test-matrix-codex.md +0 -130
  242. package/docs/updating.md +0 -89
  243. package/docs/user-docs/cli-reference.md +0 -428
  244. package/docs/user-docs/codex-vs-claude-code.md +0 -23
  245. package/docs/user-docs/core-updates.md +0 -70
  246. package/docs/user-docs/faq.md +0 -146
  247. package/docs/user-docs/getting-started-codex.md +0 -194
  248. package/docs/user-docs/getting-started-kimi.md +0 -423
  249. package/docs/user-docs/installation.md +0 -237
  250. package/docs/user-docs/provider-pipelines.md +0 -96
  251. package/docs/user-docs/quick-start.md +0 -161
  252. package/docs/windows.md +0 -78
  253. package/docs/workflows.md +0 -463
  254. package/schemas/profile.v1.json +0 -207
  255. package/templates/claude-md/CLAUDE-quickstart.md +0 -54
  256. package/templates/claude-md/root.md +0 -50
  257. package/templates/codex-skills/batch-implement/SKILL.md +0 -38
  258. package/templates/codex-skills/implement/SKILL.md +0 -38
  259. package/templates/codex-skills/retry/SKILL.md +0 -16
  260. package/templates/commands/specrails/compat-check.md +0 -271
  261. package/templates/commands/specrails/doctor.md +0 -62
  262. package/templates/commands/specrails/explore-spec.md +0 -173
  263. package/templates/commands/specrails/health-check.md +0 -527
  264. package/templates/commands/specrails/memory-inspect.md +0 -261
  265. package/templates/commands/specrails/opsx-diff.md +0 -419
  266. package/templates/commands/specrails/propose-spec.md +0 -102
  267. package/templates/commands/specrails/refactor-recommender.md +0 -169
  268. package/templates/commands/specrails/telemetry.md +0 -553
  269. package/templates/commands/specrails/why.md +0 -96
  270. package/templates/gemini-commands/batch-implement.toml +0 -37
  271. package/templates/gemini-commands/implement.toml +0 -37
  272. package/templates/gemini-commands/retry.toml +0 -15
  273. package/templates/profiles/default.json +0 -14
  274. package/templates/profiles/kimi-default.json +0 -15
  275. package/templates/rules/layer.md +0 -8
  276. package/templates/runtime/provider-pipeline.md +0 -113
  277. package/templates/security/security-exemptions.yaml +0 -20
  278. package/templates/settings/confidence-config.json +0 -17
  279. package/templates/settings/settings.json +0 -15
@@ -1,140 +0,0 @@
1
- # Migration Guide: Switching to Local Tickets
2
-
3
- This guide is for teams currently using GitHub Issues or JIRA as their specrails backlog provider who want to switch to the built-in local ticket system.
4
-
5
- Switching is optional. GitHub Issues and JIRA remain fully supported. Local tickets are the recommended default for new projects.
6
-
7
- ---
8
-
9
- ## Should you switch?
10
-
11
- **Switch to local tickets if:**
12
- - Your team prefers a simple, zero-dependency setup
13
- - You want tickets version-controlled alongside your code
14
- - You don't need GitHub/JIRA for other workflows (project boards, external stakeholders)
15
-
16
- **Stay on GitHub Issues / JIRA if:**
17
- - Other teams or stakeholders manage tickets in those tools
18
- - You rely on GitHub Projects, Milestones, or JIRA sprints
19
- - You want PR auto-close on issue merge (requires GitHub Issues)
20
-
21
- ---
22
-
23
- ## Step 1: Switch the provider
24
-
25
- Edit `.specrails/backlog-config.json` in your project root:
26
-
27
- ```json
28
- {
29
- "provider": "local",
30
- "write_access": true,
31
- "git_auto": true
32
- }
33
- ```
34
-
35
- Then initialize the ticket store if it doesn't exist yet:
36
-
37
- ```bash
38
- # Inside Claude Code or Codex
39
- /specrails:implement --setup-local-tickets
40
- ```
41
-
42
- Or create the file manually:
43
-
44
- ```bash
45
- cat > .specrails/local-tickets.json << 'EOF'
46
- {
47
- "schema_version": "1.0",
48
- "revision": 0,
49
- "last_updated": null,
50
- "next_id": 1,
51
- "tickets": {}
52
- }
53
- EOF
54
- ```
55
-
56
- ---
57
-
58
- ## Step 2: Import existing issues (one-time migration)
59
-
60
- ### From GitHub Issues
61
-
62
- Use the `sr:migrate-from-github` command (requires `gh` CLI):
63
-
64
- ```bash
65
- # Inside Claude Code
66
- /specrails:migrate-from-github
67
- ```
68
-
69
- This command:
70
- 1. Fetches all open issues labeled `product-driven-backlog` (the label specrails uses)
71
- 2. Maps GitHub issue fields to local ticket schema:
72
- - `number` → `id` (uses next available local ID)
73
- - `title` → `title`
74
- - `body` → `description`
75
- - `labels` → `labels`
76
- - `state: open` → `status: todo`
77
- 3. Writes each ticket to `local-tickets.json`
78
- 4. Prints a summary: `Imported 14 tickets from GitHub Issues`
79
-
80
- To import all open issues regardless of label:
81
-
82
- ```bash
83
- /specrails:migrate-from-github --all
84
- ```
85
-
86
- To do a dry run (preview without writing):
87
-
88
- ```bash
89
- /specrails:migrate-from-github --dry-run
90
- ```
91
-
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.
93
-
94
- ### From JIRA
95
-
96
- Use the `sr:migrate-from-jira` command (requires `jira` CLI or REST API credentials in `.specrails/backlog-config.json`):
97
-
98
- ```bash
99
- # Inside Claude Code
100
- /specrails:migrate-from-jira
101
- ```
102
-
103
- This command:
104
- 1. Fetches all open issues from the configured JIRA project
105
- 2. Maps JIRA fields to local ticket schema:
106
- - Issue key (`PROJECT-123`) → stored in `metadata.jira_key`
107
- - `summary` → `title`
108
- - `description` → `description`
109
- - `priority` → `priority` (Critical/High/Medium/Low mapped directly)
110
- - `status: To Do / Backlog` → `status: todo`
111
- - `status: In Progress` → `status: in_progress`
112
- - `labels` → `labels`
113
- 3. Writes each ticket to `local-tickets.json`
114
-
115
- The original JIRA key is preserved in `metadata.jira_key` so you can cross-reference during the transition.
116
-
117
- ---
118
-
119
- ## Step 3: Regenerate commands (optional but recommended)
120
-
121
- Command templates are generated at `/specrails:enrich` 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
-
123
- ```bash
124
- npx specrails-core@latest init --root-dir .
125
- > /specrails:enrich --update
126
- ```
127
-
128
- The `--update` flag regenerates only the backlog commands (`get-backlog-specs`, `auto-propose-backlog-specs`, `implement`) without re-running the full stack analysis.
129
-
130
- ---
131
-
132
- ## Rollback
133
-
134
- To revert to GitHub Issues:
135
-
136
- 1. Edit `.specrails/config.yaml` (or `.specrails/backlog-config.json` for scaffold installs) and set `provider: github`
137
- 2. Re-run `/specrails:enrich --update` to regenerate commands
138
- 3. Your `local-tickets.json` is preserved — switch back any time
139
-
140
- Local tickets and external provider data are independent. Switching providers does not delete tickets from either system.
@@ -1,112 +0,0 @@
1
- # OSS Maintainer Workflow
2
-
3
- > For maintainers who want to merge AI-generated PRs quickly without sacrificing quality — and who want to define the conditions under which they trust the pipeline's output.
4
-
5
- ## The review burden problem
6
-
7
- Without guardrails, AI-generated code requires the same review depth as human code. You read every file, verify every edge case, and check every type. The throughput advantage of automation disappears at review time.
8
-
9
- specrails adds observable quality signals to every PR: a confidence score from the Reviewer, a security scan from the Security Reviewer, CI results (lint, typecheck, tests), and structured reviewer annotations. These signals are machine-generated and reproducible — not "it looks fine to me."
10
-
11
- The goal is not to eliminate code review. It is to define the conditions under which you can trust those signals and reduce manual review to **intent verification**: does this PR do what the original issue asked for? Everything else — correctness, type safety, test coverage, security posture — is covered by the pipeline.
12
-
13
- ## Setting confidence thresholds
14
-
15
- The Reviewer agent scores its own output on a 0–100 scale before creating the PR. You control what happens when that score falls below your threshold via `.claude/confidence-config.json`:
16
-
17
- ```json
18
- {
19
- "threshold": 85,
20
- "on_below_threshold": "block",
21
- "aspects": {
22
- "security": { "threshold": 90, "on_below_threshold": "block" },
23
- "correctness": { "threshold": 80, "on_below_threshold": "warn" }
24
- }
25
- }
26
- ```
27
-
28
- The three modes for `on_below_threshold`:
29
-
30
- - **`block`** — the pipeline stops before creating the PR. The Reviewer surfaces its concerns and waits. You review the specific low-confidence areas, then add an override comment to the issue to resume.
31
- - **`warn`** — the pipeline continues and creates the PR, but the PR description includes a prominently flagged section listing the low-confidence aspects and the Reviewer's reasoning.
32
- - **`override`** — used by the maintainer at runtime. Add a comment to the issue to explicitly bypass a block for a specific run.
33
-
34
- **Recommended starting thresholds for OSS projects**: overall 85 with `block`, security aspect 90 with `block`. The correctness aspect at 80 with `warn` is a reasonable starting point — correctness issues are easier to catch in review than security issues.
35
-
36
- Set thresholds based on your risk tolerance, not aspirationally. A threshold of 95 that constantly blocks the pipeline trains you to lower it. A threshold of 85 that rarely blocks but surfaces genuine concerns trains you to trust it.
37
-
38
- ## Layer convention files as policy
39
-
40
- `.claude/rules/frontend.md` is read by the Frontend Reviewer before every review pass. The equivalent files exist for other layers your setup detected. These files are not documentation — they are review policy that the Reviewer enforces on every PR.
41
-
42
- Put rules in convention files that you would enforce in a human code review:
43
- - Naming conventions that aren't captured by ESLint (`PascalCase` for component files, `use-` prefix for hook files)
44
- - Required patterns (`cn()` for class merging, `@/` path alias for all imports)
45
- - Forbidden patterns (inline styles, hardcoded color values, `any` types)
46
- - Structural requirements (exported functions must have explicit return types)
47
-
48
- What doesn't belong in convention files:
49
- - Style preferences that ESLint or Prettier already enforce (semicolons, trailing commas, quote style)
50
- - Rules that require runtime context to evaluate ("don't use this API in production environments")
51
- - Aspirational guidelines that you don't actually enforce on every PR
52
-
53
- The distinction matters because the Reviewer treats convention files as hard rules. A rule in `.claude/rules/frontend.md` that you don't actually enforce in human review creates noise — the Reviewer will flag violations that you approve anyway, eroding trust in the signal.
54
-
55
- ## The Failure Learning Loop
56
-
57
- When the Reviewer finds a non-trivial issue — a pattern that will recur if not captured — it writes a failure record to `.claude/agent-memory/`. Before implementing, the Developer reads failure records matching the current domain and uses them as guardrails.
58
-
59
- Over time, systematic mistakes stop appearing in PRs. If the Developer consistently produces type errors in a specific module, the Reviewer notes it, and the next Developer run avoids the pattern. This is not perfect — agents have context limits and memory records are text, not code — but it measurably reduces repeating defects in long-running projects.
60
-
61
- As a maintainer, you can seed this loop manually. When you reject a PR for a repeating issue, write a brief failure record in `.claude/agent-memory/` describing the pattern and the correct approach. The Developer will read it on the next relevant implementation. This is particularly effective for project-specific patterns that don't appear in training data — unusual framework choices, internal library conventions, domain-specific invariants.
62
-
63
- The memory directory is part of your repository. Reviewing and pruning it periodically keeps the signal quality high. Outdated failure records from refactored code should be removed so they don't mislead future Developers.
64
-
65
- ## What CI and specrails don't catch
66
-
67
- The confidence gate and CI verify quality — not intent. A PR that scores 92 on confidence and passes all CI checks can still be wrong in ways that require human judgment. As a maintainer, the things that remain your responsibility are:
68
-
69
- - **Product intent**: does this implementation match what the original issue asked for? The Reviewer verifies the implementation against the spec, but the spec may not have captured the full product intent.
70
- - **UX feel**: for UI features, does the result look and behave right? Automated checks don't evaluate visual weight, interaction feel, or whether the layout works in realistic data conditions.
71
- - **Business logic edge cases**: are there edge cases the spec didn't cover that would produce incorrect behavior for real users? Specs are written before implementation — they capture known cases, not unknown ones.
72
- - **PR description accuracy**: does the PR description accurately describe what changed? This matters for changelog generation and future developers reading git history.
73
-
74
- These checks are fast when the pipeline is working well. A PR where the confidence score is high, CI is green, and the implementation is clearly scoped should take 5–10 minutes to verify for intent. That is the target review cost for a well-specced, well-pipelined feature.
75
-
76
- ## The safe-to-merge checklist
77
-
78
- A PR from specrails is safe to merge without deep review when all of the following hold:
79
-
80
- - [ ] Overall confidence score is at or above your configured threshold
81
- - [ ] Security aspect score is at or above your configured threshold
82
- - [ ] CI is green: lint, typecheck, and tests all pass
83
- - [ ] No `TODO` or `FIXME` markers were introduced by the implementation
84
- - [ ] PR description matches the original issue intent (read the issue, then the PR — do they describe the same thing?)
85
- - [ ] No new dependencies added without justification in the PR body
86
-
87
- When any of these conditions fails, do not skip the review — investigate the specific failure. A `TODO` introduced by the Developer is a signal that it encountered a constraint it couldn't resolve. A CI failure that the Reviewer didn't fix is a signal that the pipeline exited early. A PR description that doesn't match the issue is a signal that scope drifted during implementation.
88
-
89
- ## Patterns & Anti-patterns
90
-
91
- | Pattern | Why it works |
92
- |---------|-------------|
93
- | Setting `security` threshold higher than `overall` | Security issues are harder to catch in a quick review pass — the pipeline should surface them before the PR is created |
94
- | Putting naming conventions in `.claude/rules/` files | The Reviewer enforces them consistently on every PR, so you never see naming violations in review |
95
- | Seeding `.claude/agent-memory/` with project-specific failure records | Prevents the same class of defect from appearing repeatedly; teaches the pipeline your codebase's specific constraints |
96
- | Using `warn` for `correctness` and `block` for `security` | Lets low-stakes correctness issues through for quick human review while stopping security concerns cold |
97
-
98
- | Anti-pattern | Why it fails |
99
- |-------------|-------------|
100
- | Treating a high confidence score as a substitute for intent review | Confidence measures implementation quality against the spec, not the spec's alignment with product intent |
101
- | Adding aspirational rules to `.claude/rules/` files | Reviewer flags violations you'd approve anyway, creating noise that erodes trust in the rule set |
102
- | Never pruning `.claude/agent-memory/` | Outdated failure records from refactored code mislead future Developers, causing them to avoid patterns that are now correct |
103
- | Raising thresholds after every blocked PR instead of investigating | The block exists because the pipeline found something; raising the threshold to get the PR through skips the investigation |
104
-
105
- ## What's next?
106
-
107
- - [Customization](customization.md) — configure agents, rules, personas, and confidence thresholds for your project
108
- - [Core Concepts](concepts.md) — understand the pipeline phases and the agent roles that produce the quality signals you're reviewing
109
-
110
- ---
111
-
112
- [← Parallel Development](playbook-parallel-dev.md)
@@ -1,124 +0,0 @@
1
- # Parallel Development
2
-
3
- > For maintainers shipping multiple features in a sprint who want to maximize throughput without introducing merge conflicts.
4
-
5
- ## How specrails parallelizes work
6
-
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
-
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
-
11
- The speed advantage over sequential implementation is significant. For a batch of three medium-effort features, sequential implementation might take 90 minutes. Parallel implementation takes roughly as long as the slowest single feature — often 30–40 minutes. The constraint is wall-clock time, not the number of features.
12
-
13
- ## What's safe to parallelize
14
-
15
- Not every combination of features is safe to run in parallel. A feature is safe to include in a parallel batch when all four conditions hold:
16
-
17
- 1. **File isolation**: the feature touches different files from the other features in the batch. Two features that both modify `src/api/middleware.ts` will produce a merge conflict.
18
-
19
- 2. **No shared data model changes**: the feature does not depend on a schema migration, new database table, or new shared utility introduced by another feature in the same batch. If feature A adds a `users.rate_limit_tier` column and feature B reads that column, B depends on A.
20
-
21
- 3. **Spec is complete**: the feature's OpenSpec change is fully approved before the batch runs. Specs that are still being revised during implementation produce inconsistent results.
22
-
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
-
25
- When in doubt, run `/specrails:get-backlog-specs` to see the dependency ordering before composing your batch.
26
-
27
- ## What's not safe
28
-
29
- Some combinations look independent but are not:
30
-
31
- **Two features that both modify the same schema file.** Even if the migrations are logically independent (adding different columns to different tables), they both touch `db/schema.sql` or the migration directory. The merge will conflict or produce an incorrect combined schema.
32
-
33
- **A feature that requires a utility extracted by another feature in the same batch.** If issue #71 refactors authentication middleware into a shared utility, and issue #85 uses that utility, #85 cannot run in the same batch as #71. At the time #85's Developer runs, the shared utility doesn't exist yet.
34
-
35
- **Features with a `Prerequisites:` relationship to each other.** If issue #85 has `Prerequisites: #71` in its issue body, the Product Analyst's dependency DAG already captures this. Running them together ignores the declared ordering.
36
-
37
- **Features where the spec says "depends on the outcome of X".** This phrasing signals a runtime dependency that may not be captured in the `Prerequisites:` field. Treat it as an explicit exclusion from the current batch.
38
-
39
- ## Reading the dependency DAG
40
-
41
- Run `/specrails:get-backlog-specs` 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
-
43
- ```
44
- /specrails:get-backlog-specs
45
-
46
- ┌─ API ──────────────────────────────────────────┐
47
- │ # Issue Score Effort Description │
48
- │ 1 #85 12/15 Medium Health check endpoint │
49
- │ 2 #71 10/15 Low Rate limiting │
50
- │ 3 #63 8/15 High GraphQL migration │
51
- └─────────────────────────────────────────────────┘
52
-
53
- Top 3 for next sprint:
54
- 1. #71 — Rate limiting (score/effort: 3.33)
55
- 2. #85 — Health check (score/effort: 2.40)
56
- 3. #63 — GraphQL (score/effort: 0.53)
57
- ```
58
-
59
- The backlog output shows effort and score, but it does not explicitly label Wave 1 vs. Wave 2. You determine Wave 1 by reading the `Prerequisites:` field on each issue. Any issue whose prerequisites are all already merged is a Wave 1 candidate.
60
-
61
- Use the Product Analyst's reasoning section (shown when running with verbose output) to confirm the dependency ordering before batching.
62
-
63
- ## Practical example
64
-
65
- Three issues are in your sprint: #85 (health check endpoint), #71 (rate limiting middleware), and #63 (GraphQL migration).
66
-
67
- Reading the issue bodies:
68
- - #85 has `Prerequisites: #71` — the health check reads the rate limit status, so it needs the middleware to exist first.
69
- - #71 has no prerequisites.
70
- - #63 has no prerequisites.
71
-
72
- #71 and #63 are independent of each other and have no prerequisites. They are Wave 1. Run them in parallel:
73
-
74
- ```
75
- /specrails:batch-implement #71, #63
76
- ```
77
-
78
- Both pipelines run concurrently. Each produces a PR. After both PRs are merged, #85 is unblocked. Run it alone:
79
-
80
- ```
81
- /specrails:implement #85
82
- ```
83
-
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.
85
-
86
- ## When auto-merge fails
87
-
88
- After all worktree pipelines complete, specrails attempts to merge each feature branch into the base. When the merge succeeds automatically, each feature gets its own PR. When it fails, specrails surfaces the conflict and stops.
89
-
90
- **Symptom**: merge conflict reported in the worktree merge step, pipeline exits before PR creation for one or more features.
91
-
92
- **Cause**: two features edited the same region of the same file. This happens most often in configuration files, shared utilities, or index files that aggregate exports.
93
-
94
- **Recovery**:
95
- 1. Note which features conflicted.
96
- 2. Pick one feature's branch as the base. Merge it into the base branch first (it will succeed — the conflict is between the two feature branches, not between either and base).
97
- 3. For the conflicting feature branch, manually resolve the conflict by merging the base branch into it.
98
- 4. Once the conflict is resolved, the Developer can rerun from Phase 5 (PR creation) to create the PR with the resolved branch.
99
-
100
- **Prevention**: run the safe parallelization criteria before batching. Index files and configuration files are common conflict sources — if two features both register something in the same registry or config object, consider whether they should be sequenced instead.
101
-
102
- ## Patterns & Anti-patterns
103
-
104
- | Pattern | Why it works |
105
- |---------|-------------|
106
- | Run `/specrails:get-backlog-specs` before composing a batch | Surfaces the dependency DAG so you batch only Wave 1 features |
107
- | Keep batches to 2–4 features | Smaller batches reduce conflict surface area and keep the merge step fast |
108
- | Ensure all specs are approved before starting the batch | Prevents mid-batch spec revisions that invalidate a running pipeline |
109
- | Sequence database migration features before features that consume the schema | Eliminates the most common class of parallel dev failures |
110
-
111
- | Anti-pattern | Why it fails |
112
- |-------------|-------------|
113
- | Batching features that share a configuration or registry file | Almost guarantees a merge conflict in a file that both features modified |
114
- | Including a feature whose prerequisite is also in the batch | The dependent feature's Developer runs before the prerequisite exists, producing broken imports and missing types |
115
- | Running a batch before all specs are written | An incomplete spec causes the Architect to make assumptions; you may get a PR for a feature that was redefined mid-run |
116
- | Treating all "unrelated" features as parallelizable | "Unrelated" at the product level can still mean "touching the same file" at the code level — verify file isolation, not just feature isolation |
117
-
118
- ## What's next?
119
-
120
- - [Workflows & Commands](workflows.md) — full reference for `/specrails:batch-implement`, `/specrails:implement`, and `/specrails:get-backlog-specs`
121
-
122
- ---
123
-
124
- [← Product Discovery](playbook-product-discovery.md) · [OSS Maintainer Workflow →](playbook-oss-maintainer.md)
@@ -1,115 +0,0 @@
1
- # Product Discovery
2
-
3
- > For OSS maintainers using specrails with OpenSpec who want every implementation to land right the first time.
4
-
5
- ## Why spec quality determines implementation quality
6
-
7
- The Architect agent reads your spec before writing a single task. It has no other source of truth. If your proposal is ambiguous, the design it produces will be ambiguous. If the design is ambiguous, the Developer will fill the gaps with assumptions — and those assumptions may not match your intent.
8
-
9
- The pipeline is only as good as the spec that enters it. A vague feature request produces code that technically compiles and tests pass, but misses the product intent entirely. A precise, well-structured spec produces a design artifact that the Developer can follow without guessing.
10
-
11
- This isn't unique to AI agents. The same dynamic plays out in human teams: the clearer the ticket, the fewer the back-and-forths. With specrails, the cost of ambiguity is higher because there is no back-and-forth — the pipeline runs to completion and surfaces a PR. At that point, the cost to correct a wrong assumption is much higher than the cost to write a better spec upfront.
12
-
13
- ## Anatomy of a good OpenSpec proposal
14
-
15
- OpenSpec proposals have four required fields: What, Why, Non-goals, and Success criteria. Each field should be concrete enough that a reader who has never touched your codebase understands the full scope of the change.
16
-
17
- **Vague proposal:**
18
- ```
19
- Add a dashboard page showing user stats.
20
- ```
21
-
22
- This leaves every significant question unanswered: which stats, which users, what layout, what data source, what defines "done"?
23
-
24
- **Good proposal:**
25
- ```
26
- What: Add a /dashboard route that renders a stats panel for the authenticated user.
27
- The panel shows: total API calls in the last 30 days, current rate limit window status,
28
- and top 3 endpoints by call volume. Data comes from the existing /api/usage endpoint.
29
-
30
- Why: OSS users need to self-diagnose rate limit issues without opening a support ticket.
31
- The Product Analyst scored this High on the Developer persona (pain: "I don't know when
32
- I'm about to hit a rate limit").
33
-
34
- Non-goals: Historical charts, export functionality, and admin views are out of scope.
35
- This is a read-only display panel.
36
-
37
- Success criteria: Authenticated user loads /dashboard and sees accurate stats within 2s.
38
- Unauthenticated user is redirected to /login. All three stat types render correctly
39
- in a 375px viewport. Zero console errors.
40
- ```
41
-
42
- The difference is not length — it is specificity. The Architect can produce a task breakdown from the good proposal without making a single assumption.
43
-
44
- ## Writing GitHub Issues the Product Analyst can parse
45
-
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
-
48
- **The `Prerequisites:` field** is how you tell the Product Analyst that one issue depends on another. When you run `/specrails:get-backlog-specs`, 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
-
50
- ```
51
- Prerequisites: #71 (rate limiting middleware must exist before we can display rate limit status)
52
- ```
53
-
54
- Write this field even when the dependency seems obvious. The Product Analyst reads issues in isolation — it doesn't infer dependencies from context.
55
-
56
- **VPC-aligned descriptions** help the Product Analyst score your issue accurately. Mention which persona benefits and describe the pain or gain being addressed. "As a developer debugging API integration issues, I need to see my current rate limit window status without making a test request" gives the Product Analyst enough context to score correctly. "Add rate limit display" does not.
57
-
58
- **Effort labels** (Low / Medium / High) affect priority scoring. The Product Analyst uses the score-to-effort ratio to rank recommendations. A Low-effort feature with a High score ranks above a High-effort feature with the same score. Set realistic effort labels — optimistic labels inflate priority and create scheduling surprises.
59
-
60
- ## Choosing your entry point
61
-
62
- specrails offers two paths into the OpenSpec pipeline:
63
-
64
- **`/opsx:ff` (Fast Forward)** generates all artifacts in one pass: proposal, design, tasks, and context bundle. The Architect runs through each artifact without stopping for review. Use this when:
65
- - You know exactly what you want to build
66
- - The approach is well-understood and not architecturally novel
67
- - You'd approve the design without reading it carefully
68
-
69
- **`/opsx:new` + `/opsx:continue`** creates artifacts one at a time, pausing after each. You review the proposal before the design is written, and the design before tasks are generated. Use this when:
70
- - Requirements are still being refined
71
- - The feature touches sensitive architecture areas
72
- - You want to redirect the design approach before tasks are committed
73
- - The feature has security or data-model implications worth reviewing before code is written
74
-
75
- Rule of thumb: if you'd accept the Architect's first draft without edits, use `/opsx:ff`. If you want a checkpoint between "what we're building" and "how we're building it," use the step-by-step path.
76
-
77
- Once artifacts are complete, `/opsx:apply` hands them to the Developer. After implementation, `/opsx:archive` closes the change.
78
-
79
- ## The context bundle matters
80
-
81
- The context bundle is the set of files, interfaces, and decisions that the Developer reads before writing code. A thin context bundle forces the Developer to explore the codebase independently — and exploration introduces risk. The Developer may read an outdated version of a file, miss a constraint documented elsewhere, or invent types that conflict with existing ones.
82
-
83
- A good context bundle includes:
84
- - **Files to read**: specific file paths, not directory globs
85
- - **Key interfaces**: paste the exact TypeScript interface or API contract, not a link to it
86
- - **Architectural decisions**: what approach was chosen and why, so the Developer doesn't choose a different approach that conflicts with the rest of the system
87
- - **Known constraints**: anything that would make the naive implementation wrong (auth requirements, transaction boundaries, rate limits, backward-compatibility rules)
88
-
89
- The context bundle is generated automatically by `/opsx:ff` and `/opsx:continue`. You can edit it before running `/opsx:apply`. Investing 10 minutes in tightening the context bundle typically saves 30 minutes of review on the resulting PR.
90
-
91
- ## Patterns & Anti-patterns
92
-
93
- | Pattern | Why it works |
94
- |---------|-------------|
95
- | Proposal includes explicit Non-goals | Prevents scope creep during implementation — the Developer doesn't add "nice to have" features that weren't requested |
96
- | Design artifact describes the approach per layer | Developer has no ambiguity about which files to touch and in what order |
97
- | Context bundle includes exact TypeScript interfaces | Developer doesn't invent types that conflict with existing ones, reducing type errors and review cycles |
98
- | Success criteria are binary (pass/fail) | Easier to verify at review time — "redirects to /login when unauthenticated" is verifiable; "handles auth correctly" is not |
99
-
100
- | Anti-pattern | Why it fails |
101
- |-------------|-------------|
102
- | Skipping the design artifact and going straight to tasks | Tasks without design rationale produce code that passes tests but breaks the architecture — the Developer follows the task list without understanding the system intent |
103
- | Spec written after implementation | The spec becomes documentation, not a contract — the pipeline can't use it to validate the implementation against product intent |
104
- | Vague acceptance criteria ("looks good", "works correctly") | The Reviewer can't determine done-ness and the Developer can't verify its own output against a clear bar |
105
- | Missing cross-references in context bundle | Developer reads the wrong version of a file or misses a constraint, producing a PR that requires significant rework |
106
-
107
- ## What's next?
108
-
109
- - [Core Concepts](concepts.md) — understand the pipeline phases and agent roles
110
- - [Workflows & Commands](workflows.md) — the full command reference including OpenSpec commands
111
- - [Customization](customization.md) — adapt the Architect and Developer agents to your project conventions
112
-
113
- ---
114
-
115
- [← Updating](updating.md) · [Parallel Development →](playbook-parallel-dev.md)
@@ -1,144 +0,0 @@
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:enrich 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:enrich` 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:enrich # 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 . # TUI agent selection + copy templates
70
- /specrails:enrich --from-config # AI analysis using your saved config
71
- ```
72
-
73
- The scaffold copies the full agent+command set into `.claude/` — you own and version those files. The `init` command now includes a TUI installer that lets you select agents and model preset. Updates require re-running `npx` and re-running `/specrails:enrich`.
74
-
75
- **Best for:** Teams that want to version the agent prompts themselves, or projects that need full offline control.
76
-
77
- ### 3. Provider scaffold
78
-
79
- ```bash
80
- npx specrails-core@latest init --root-dir . --provider codex
81
- npx specrails-core@latest init --root-dir . --provider gemini
82
- npx specrails-core@latest init --root-dir . --provider kimi
83
- ```
84
-
85
- Codex, Gemini, and Kimi do not use the Claude Code plugin package. The
86
- scaffold renders their native project surfaces under `.codex/`, `.gemini/`,
87
- and `.kimi-code/` respectively. Kimi interactive workflows use
88
- `/skill:specrails-*`; its headless workflows use the managed runner installed
89
- under `.kimi-code/specrails/`.
90
-
91
- **Best for:** Codex, Gemini, or Kimi users and teams that version generated
92
- provider artifacts.
93
-
94
- ## The `/specrails:enrich` wizard
95
-
96
- `/specrails:enrich` is a 5-phase wizard that generates your project data. It runs once (or re-runs to regenerate).
97
-
98
- | Phase | Output |
99
- |-------|--------|
100
- | **1. Analyze** | Detects stack, CI commands, architecture layers |
101
- | **2. Personas** | Researches domain, generates VPC user personas |
102
- | **3. Configure** | Backlog provider, git workflow, agent selection |
103
- | **4. Generate** | Writes `.specrails/config.yaml`, personas, rules, CLAUDE.md |
104
- | **5. Cleanup** | Removes wizard scaffolding |
105
-
106
- Quick mode: `/specrails:enrich --quick` — three questions, done in under a minute.
107
-
108
- From-config mode: `/specrails:enrich --from-config` — reads `.specrails/install-config.yaml` (written by the TUI installer) and runs non-interactively.
109
-
110
- ## OpenSpec skills
111
-
112
- The `sr` plugin bundles the full OpenSpec skill set. These are available as `/opsx:*` commands:
113
-
114
- | Skill | Purpose |
115
- |-------|---------|
116
- | `/opsx:ff` | Fast-forward through all change artifacts |
117
- | `/opsx:apply` | Implement an OpenSpec change |
118
- | `/opsx:verify` | Verify implementation matches spec |
119
- | `/opsx:archive` | Archive a completed change |
120
- | `/opsx:explore` | Explore ideas before writing a spec |
121
-
122
- OpenSpec is the structured design layer that powers `/specrails:implement` — the architect uses it to produce a technical design before the developer begins coding.
123
-
124
- ## Updating
125
-
126
- ### Update plugin logic
127
-
128
- ```bash
129
- claude plugin update sr
130
- ```
131
-
132
- Updates agents, skills, hooks, and references. Does not touch `.specrails/` project data.
133
-
134
- ### Regenerate project data
135
-
136
- ```bash
137
- /specrails:enrich
138
- ```
139
-
140
- Re-runs the wizard and regenerates `.specrails/`. Useful when your stack changes significantly or you want to refresh personas.
141
-
142
- ---
143
-
144
- [← Installation](installation.md) · [Core Concepts →](concepts.md)