specrails-core 5.6.0 → 6.0.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 (275) 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/cli-executor.d.ts +1 -1
  5. package/dist/agent-runtime/cli-executor.js +1 -2
  6. package/dist/agent-runtime/cli-process.js +0 -1
  7. package/dist/agent-runtime/cli.js +3 -4
  8. package/dist/agent-runtime/codex-schema.js +0 -1
  9. package/dist/agent-runtime/compact/architect.d.ts +3 -272
  10. package/dist/agent-runtime/compact/architect.js +8 -9
  11. package/dist/agent-runtime/compact/chat-client.d.ts +3 -3
  12. package/dist/agent-runtime/compact/chat-client.js +1 -2
  13. package/dist/agent-runtime/compact/developer.d.ts +3 -70
  14. package/dist/agent-runtime/compact/developer.js +13 -14
  15. package/dist/agent-runtime/compact/environment.d.ts +4 -5
  16. package/dist/agent-runtime/compact/environment.js +1 -2
  17. package/dist/agent-runtime/compact/exit-code-honesty.d.ts +2 -1
  18. package/dist/agent-runtime/compact/exit-code-honesty.js +0 -1
  19. package/dist/agent-runtime/compact/guarded-loop.d.ts +2 -18
  20. package/dist/agent-runtime/compact/guarded-loop.js +7 -8
  21. package/dist/agent-runtime/compact/prompt-inputs.d.ts +0 -2
  22. package/dist/agent-runtime/compact/prompt-inputs.js +1 -2
  23. package/dist/agent-runtime/compact/reviewer.d.ts +0 -13
  24. package/dist/agent-runtime/compact/reviewer.js +5 -6
  25. package/dist/agent-runtime/compact/step.d.ts +0 -1
  26. package/dist/agent-runtime/compact/step.js +1 -2
  27. package/dist/agent-runtime/compact/test-reachability.js +0 -1
  28. package/dist/agent-runtime/config.js +0 -1
  29. package/dist/agent-runtime/core-host.d.ts +1 -1
  30. package/dist/agent-runtime/core-host.js +1 -2
  31. package/dist/agent-runtime/durable-store.d.ts +0 -1
  32. package/dist/agent-runtime/durable-store.js +1 -2
  33. package/dist/agent-runtime/efficiency-summary.d.ts +2 -2
  34. package/dist/agent-runtime/efficiency-summary.js +1 -2
  35. package/dist/agent-runtime/efficiency-types.js +0 -1
  36. package/dist/agent-runtime/efficiency.js +0 -1
  37. package/dist/agent-runtime/evaluation-corpus.js +0 -1
  38. package/dist/agent-runtime/evaluation.d.ts +2 -1
  39. package/dist/agent-runtime/evaluation.js +1 -2
  40. package/dist/agent-runtime/executor-types.d.ts +1 -1
  41. package/dist/agent-runtime/executor-types.js +0 -1
  42. package/dist/agent-runtime/executors.js +0 -1
  43. package/dist/agent-runtime/gemini-policy.js +0 -1
  44. package/dist/agent-runtime/graph/artifacts.d.ts +1 -1
  45. package/dist/agent-runtime/graph/artifacts.js +1 -2
  46. package/dist/agent-runtime/graph/nodes.d.ts +1 -1
  47. package/dist/agent-runtime/graph/nodes.js +1 -2
  48. package/dist/agent-runtime/graph/review-policy.js +0 -1
  49. package/dist/agent-runtime/graph/roles.d.ts +2 -5
  50. package/dist/agent-runtime/graph/roles.js +2 -8
  51. package/dist/agent-runtime/graph/state.d.ts +1 -1
  52. package/dist/agent-runtime/graph/state.js +0 -1
  53. package/dist/agent-runtime/graph-checkpointer.d.ts +2 -1
  54. package/dist/agent-runtime/graph-checkpointer.js +0 -1
  55. package/dist/agent-runtime/guardrails.d.ts +3 -3
  56. package/dist/agent-runtime/guardrails.js +1 -2
  57. package/dist/agent-runtime/index.d.ts +1 -1
  58. package/dist/agent-runtime/index.js +1 -2
  59. package/dist/agent-runtime/kimi-acp.js +1 -2
  60. package/dist/agent-runtime/kimi-model.d.ts +6 -0
  61. package/dist/agent-runtime/kimi-model.js +12 -0
  62. package/dist/agent-runtime/openai-executor.d.ts +0 -9
  63. package/dist/agent-runtime/openai-executor.js +6 -7
  64. package/dist/agent-runtime/openspec-tool-server.js +1 -2
  65. package/dist/agent-runtime/openspec.d.ts +0 -2
  66. package/dist/agent-runtime/openspec.js +1 -6
  67. package/dist/agent-runtime/prompts.d.ts +4 -3
  68. package/dist/agent-runtime/prompts.js +0 -1
  69. package/dist/agent-runtime/provider-diagnostic.js +1 -2
  70. package/dist/agent-runtime/recovery.js +1 -2
  71. package/dist/agent-runtime/repository-context.d.ts +1 -1
  72. package/dist/agent-runtime/repository-context.js +0 -1
  73. package/dist/agent-runtime/review-context.d.ts +1 -1
  74. package/dist/agent-runtime/review-context.js +0 -1
  75. package/dist/agent-runtime/role-routing.js +0 -1
  76. package/dist/agent-runtime/role-state.js +0 -1
  77. package/dist/agent-runtime/runtime-identity.js +1 -2
  78. package/dist/agent-runtime/tool-event.js +0 -1
  79. package/dist/agent-runtime/verification-plan.d.ts +5 -4
  80. package/dist/agent-runtime/verification-plan.js +1 -2
  81. package/dist/agent-runtime/workflow-types.js +0 -1
  82. package/dist/agent-runtime/workflow.js +0 -1
  83. package/dist/agent-runtime/workspace-tools.d.ts +2 -2
  84. package/dist/agent-runtime/workspace-tools.js +1 -2
  85. package/dist/installer/cli.d.ts +3 -32
  86. package/dist/installer/cli.js +26 -101
  87. package/dist/installer/commands/framework.d.ts +4 -3
  88. package/dist/installer/commands/framework.js +0 -1
  89. package/dist/installer/commands/init.d.ts +4 -25
  90. package/dist/installer/commands/init.js +5 -8
  91. package/dist/installer/phases/framework-lifecycle.d.ts +3 -17
  92. package/dist/installer/phases/framework-lifecycle.js +2 -3
  93. package/dist/installer/phases/install-config.d.ts +7 -8
  94. package/dist/installer/phases/install-config.js +2 -7
  95. package/dist/installer/phases/manifest.d.ts +6 -7
  96. package/dist/installer/phases/manifest.js +2 -7
  97. package/dist/installer/phases/prereqs.d.ts +6 -7
  98. package/dist/installer/phases/prereqs.js +4 -6
  99. package/dist/installer/phases/provider-detect.d.ts +6 -7
  100. package/dist/installer/phases/provider-detect.js +2 -4
  101. package/dist/installer/phases/scaffold.d.ts +9 -10
  102. package/dist/installer/phases/scaffold.js +82 -805
  103. package/dist/installer/util/errors.js +0 -1
  104. package/dist/installer/util/exec.d.ts +3 -2
  105. package/dist/installer/util/exec.js +0 -1
  106. package/dist/installer/util/fs.d.ts +0 -10
  107. package/dist/installer/util/fs.js +1 -2
  108. package/dist/installer/util/git.js +0 -1
  109. package/dist/installer/util/install-transaction.d.ts +2 -2
  110. package/dist/installer/util/install-transaction.js +1 -2
  111. package/dist/installer/util/logger.d.ts +1 -3
  112. package/dist/installer/util/logger.js +0 -1
  113. package/dist/installer/util/paths.js +0 -1
  114. package/dist/installer/util/registry.d.ts +4 -8
  115. package/dist/installer/util/registry.js +2 -3
  116. package/dist/{installer/runtime → pipeline}/pipeline-state.js +0 -3
  117. package/dist/shared/args.d.ts +18 -0
  118. package/dist/shared/args.js +53 -0
  119. package/integration-contract.json +10 -46
  120. package/package.json +3 -10
  121. package/templates/agents/sr-architect.md +15 -310
  122. package/templates/agents/sr-developer.md +15 -269
  123. package/templates/agents/sr-reviewer.md +13 -367
  124. package/templates/codex-skills/rails/sr-architect/SKILL.md +14 -308
  125. package/templates/codex-skills/rails/sr-developer/SKILL.md +14 -201
  126. package/templates/codex-skills/rails/sr-reviewer/SKILL.md +15 -289
  127. package/templates/kimi/specrails/run-skill.mjs +91 -2173
  128. package/bin/tui-installer.mjs +0 -430
  129. package/commands/doctor.md +0 -62
  130. package/dist/agent-runtime/capabilities.js.map +0 -1
  131. package/dist/agent-runtime/cli-executor.js.map +0 -1
  132. package/dist/agent-runtime/cli-process.js.map +0 -1
  133. package/dist/agent-runtime/cli.js.map +0 -1
  134. package/dist/agent-runtime/codex-schema.js.map +0 -1
  135. package/dist/agent-runtime/compact/architect.js.map +0 -1
  136. package/dist/agent-runtime/compact/chat-client.js.map +0 -1
  137. package/dist/agent-runtime/compact/developer.js.map +0 -1
  138. package/dist/agent-runtime/compact/environment.js.map +0 -1
  139. package/dist/agent-runtime/compact/exit-code-honesty.js.map +0 -1
  140. package/dist/agent-runtime/compact/guarded-loop.js.map +0 -1
  141. package/dist/agent-runtime/compact/prompt-inputs.js.map +0 -1
  142. package/dist/agent-runtime/compact/reviewer.js.map +0 -1
  143. package/dist/agent-runtime/compact/step.js.map +0 -1
  144. package/dist/agent-runtime/compact/test-reachability.js.map +0 -1
  145. package/dist/agent-runtime/config.js.map +0 -1
  146. package/dist/agent-runtime/core-host.js.map +0 -1
  147. package/dist/agent-runtime/durable-store.js.map +0 -1
  148. package/dist/agent-runtime/efficiency-summary.js.map +0 -1
  149. package/dist/agent-runtime/efficiency-types.js.map +0 -1
  150. package/dist/agent-runtime/efficiency.js.map +0 -1
  151. package/dist/agent-runtime/evaluation-corpus.js.map +0 -1
  152. package/dist/agent-runtime/evaluation.js.map +0 -1
  153. package/dist/agent-runtime/executor-types.js.map +0 -1
  154. package/dist/agent-runtime/executors.js.map +0 -1
  155. package/dist/agent-runtime/gemini-policy.js.map +0 -1
  156. package/dist/agent-runtime/graph/artifacts.js.map +0 -1
  157. package/dist/agent-runtime/graph/nodes.js.map +0 -1
  158. package/dist/agent-runtime/graph/review-policy.js.map +0 -1
  159. package/dist/agent-runtime/graph/roles.js.map +0 -1
  160. package/dist/agent-runtime/graph/state.js.map +0 -1
  161. package/dist/agent-runtime/graph-checkpointer.js.map +0 -1
  162. package/dist/agent-runtime/guardrails.js.map +0 -1
  163. package/dist/agent-runtime/index.js.map +0 -1
  164. package/dist/agent-runtime/kimi-acp.js.map +0 -1
  165. package/dist/agent-runtime/openai-executor.js.map +0 -1
  166. package/dist/agent-runtime/openspec-tool-server.js.map +0 -1
  167. package/dist/agent-runtime/openspec.js.map +0 -1
  168. package/dist/agent-runtime/prompts.js.map +0 -1
  169. package/dist/agent-runtime/provider-diagnostic.js.map +0 -1
  170. package/dist/agent-runtime/recovery.js.map +0 -1
  171. package/dist/agent-runtime/repository-context.js.map +0 -1
  172. package/dist/agent-runtime/review-context.js.map +0 -1
  173. package/dist/agent-runtime/role-routing.js.map +0 -1
  174. package/dist/agent-runtime/role-state.js.map +0 -1
  175. package/dist/agent-runtime/runtime-identity.js.map +0 -1
  176. package/dist/agent-runtime/tool-event.js.map +0 -1
  177. package/dist/agent-runtime/verification-plan.js.map +0 -1
  178. package/dist/agent-runtime/workflow-types.js.map +0 -1
  179. package/dist/agent-runtime/workflow.js.map +0 -1
  180. package/dist/agent-runtime/workspace-tools.js.map +0 -1
  181. package/dist/installer/cli.js.map +0 -1
  182. package/dist/installer/commands/doctor.d.ts +0 -27
  183. package/dist/installer/commands/doctor.js +0 -615
  184. package/dist/installer/commands/doctor.js.map +0 -1
  185. package/dist/installer/commands/framework.js.map +0 -1
  186. package/dist/installer/commands/init.js.map +0 -1
  187. package/dist/installer/commands/update.d.ts +0 -56
  188. package/dist/installer/commands/update.js +0 -257
  189. package/dist/installer/commands/update.js.map +0 -1
  190. package/dist/installer/commands/v5-migration.d.ts +0 -32
  191. package/dist/installer/commands/v5-migration.js +0 -133
  192. package/dist/installer/commands/v5-migration.js.map +0 -1
  193. package/dist/installer/phases/framework-lifecycle.js.map +0 -1
  194. package/dist/installer/phases/install-config.js.map +0 -1
  195. package/dist/installer/phases/manifest.js.map +0 -1
  196. package/dist/installer/phases/prereqs.js.map +0 -1
  197. package/dist/installer/phases/provider-detect.js.map +0 -1
  198. package/dist/installer/phases/scaffold.js.map +0 -1
  199. package/dist/installer/runtime/kimi.d.ts +0 -84
  200. package/dist/installer/runtime/kimi.js +0 -255
  201. package/dist/installer/runtime/kimi.js.map +0 -1
  202. package/dist/installer/runtime/pipeline-state.js.map +0 -1
  203. package/dist/installer/util/errors.js.map +0 -1
  204. package/dist/installer/util/exec.js.map +0 -1
  205. package/dist/installer/util/fs.js.map +0 -1
  206. package/dist/installer/util/git.js.map +0 -1
  207. package/dist/installer/util/install-transaction.js.map +0 -1
  208. package/dist/installer/util/logger.js.map +0 -1
  209. package/dist/installer/util/paths.js.map +0 -1
  210. package/dist/installer/util/prompts.d.ts +0 -23
  211. package/dist/installer/util/prompts.js +0 -49
  212. package/dist/installer/util/prompts.js.map +0 -1
  213. package/dist/installer/util/registry.js.map +0 -1
  214. package/dist/installer/util/template.d.ts +0 -23
  215. package/dist/installer/util/template.js +0 -60
  216. package/dist/installer/util/template.js.map +0 -1
  217. package/docs/README.md +0 -40
  218. package/docs/agent-runtime-efficiency.md +0 -65
  219. package/docs/agent-runtime.md +0 -393
  220. package/docs/agents.md +0 -315
  221. package/docs/changelog.md +0 -168
  222. package/docs/ci-cd.md +0 -60
  223. package/docs/concepts.md +0 -183
  224. package/docs/customization.md +0 -363
  225. package/docs/deployment.md +0 -234
  226. package/docs/getting-started.md +0 -122
  227. package/docs/installation.md +0 -395
  228. package/docs/local-tickets.md +0 -191
  229. package/docs/migration-guide.md +0 -140
  230. package/docs/playbook-oss-maintainer.md +0 -112
  231. package/docs/playbook-parallel-dev.md +0 -124
  232. package/docs/playbook-product-discovery.md +0 -115
  233. package/docs/plugin-architecture.md +0 -144
  234. package/docs/research/codex-compatibility-analysis.md +0 -365
  235. package/docs/research/mcp-feasibility-analysis.md +0 -382
  236. package/docs/testing/test-matrix-codex.md +0 -130
  237. package/docs/updating.md +0 -89
  238. package/docs/user-docs/cli-reference.md +0 -428
  239. package/docs/user-docs/codex-vs-claude-code.md +0 -23
  240. package/docs/user-docs/core-updates.md +0 -70
  241. package/docs/user-docs/faq.md +0 -146
  242. package/docs/user-docs/getting-started-codex.md +0 -194
  243. package/docs/user-docs/getting-started-kimi.md +0 -423
  244. package/docs/user-docs/installation.md +0 -237
  245. package/docs/user-docs/provider-pipelines.md +0 -96
  246. package/docs/user-docs/quick-start.md +0 -161
  247. package/docs/windows.md +0 -78
  248. package/docs/workflows.md +0 -463
  249. package/schemas/profile.v1.json +0 -207
  250. package/templates/claude-md/CLAUDE-quickstart.md +0 -54
  251. package/templates/claude-md/root.md +0 -50
  252. package/templates/codex-skills/batch-implement/SKILL.md +0 -38
  253. package/templates/codex-skills/implement/SKILL.md +0 -38
  254. package/templates/codex-skills/retry/SKILL.md +0 -16
  255. package/templates/commands/specrails/compat-check.md +0 -271
  256. package/templates/commands/specrails/doctor.md +0 -62
  257. package/templates/commands/specrails/explore-spec.md +0 -173
  258. package/templates/commands/specrails/health-check.md +0 -527
  259. package/templates/commands/specrails/memory-inspect.md +0 -261
  260. package/templates/commands/specrails/opsx-diff.md +0 -419
  261. package/templates/commands/specrails/propose-spec.md +0 -102
  262. package/templates/commands/specrails/refactor-recommender.md +0 -169
  263. package/templates/commands/specrails/telemetry.md +0 -553
  264. package/templates/commands/specrails/why.md +0 -96
  265. package/templates/gemini-commands/batch-implement.toml +0 -37
  266. package/templates/gemini-commands/implement.toml +0 -37
  267. package/templates/gemini-commands/retry.toml +0 -15
  268. package/templates/profiles/default.json +0 -14
  269. package/templates/profiles/kimi-default.json +0 -15
  270. package/templates/rules/layer.md +0 -8
  271. package/templates/runtime/provider-pipeline.md +0 -113
  272. package/templates/security/security-exemptions.yaml +0 -20
  273. package/templates/settings/confidence-config.json +0 -17
  274. package/templates/settings/settings.json +0 -15
  275. /package/dist/{installer/runtime → pipeline}/pipeline-state.d.ts +0 -0
@@ -1,395 +0,0 @@
1
- # Installation & Setup
2
-
3
- This guide covers the complete installation process in detail. For the quick version, see [Getting Started](getting-started.md).
4
-
5
- ## Installation methods
6
-
7
- SpecRails offers a Claude plugin and a provider-independent scaffold:
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, custom agent edits |
13
- | **Provider scaffold** | `npx specrails-core@latest init` | Claude, Codex, Gemini, or Kimi Code projects |
14
-
15
- ---
16
-
17
- ## Method 1: Claude Code plugin (recommended)
18
-
19
- ### Prerequisites
20
-
21
- | Tool | Why | Install |
22
- |------|-----|---------|
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/) |
25
-
26
- ### Recommended
27
-
28
- | Tool | Why | Install |
29
- |------|-----|---------|
30
- | **GitHub CLI** | Auto-create PRs, manage issues | `brew install gh` or [cli.github.com](https://cli.github.com/) |
31
-
32
- ### Install
33
-
34
- ```bash
35
- claude plugin install sr
36
- ```
37
-
38
- That's it. No cloning, no npm, no Node.js required.
39
-
40
- To update the plugin later:
41
-
42
- ```bash
43
- claude plugin update sr
44
- ```
45
-
46
- ### What the plugin contains
47
-
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 20.19.0+** | Required for the installer and pinned OpenSpec 1.4.1 CLI (macOS, Linux, Windows) | [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
- | **Supported AI CLI** | The runtime that runs the agents | Claude, Codex, Gemini, or [Kimi Code](user-docs/getting-started-kimi.md) |
61
-
62
- ### Install
63
-
64
- ```bash
65
- npx specrails-core@latest init --root-dir <your-project>
66
- ```
67
-
68
- No cloning required. Downloads the latest version and runs the installer automatically.
69
-
70
- ### From a local clone
71
-
72
- ```bash
73
- git clone https://github.com/fjpulidop/specrails-core.git
74
- cd specrails-core
75
- npm install
76
- npm run build
77
- node bin/specrails-core.mjs init --root-dir <your-project>
78
- ```
79
-
80
- > **Important:** Always run the installer from the **target repository** — the project where you want SpecRails installed.
81
-
82
- ### What the scaffold installer does
83
-
84
- The `npx specrails-core@latest init` command now includes a **TUI installer** that runs before copying files:
85
-
86
- 1. **TUI agent selection** — Interactive terminal UI lets you select which agents to install and choose a model preset (balanced/budget/max). Writes `.specrails/install-config.yaml`.
87
- 2. **Checks prerequisites** — validates Git and the selected provider CLI;
88
- optionally installs npm and gh
89
- 3. **Detects existing setup** — warns if SpecRails artifacts already exist
90
- 4. **Installs artifacts:**
91
- - `.claude/commands/specrails/enrich.md` — the `/specrails:enrich` wizard
92
- - `.specrails/setup-templates/` — agent and command templates (temporary, removed after `/specrails:enrich`)
93
- - `.claude/security-exemptions.yaml` — security scanner config
94
- 5. **Tracks version** — writes `.specrails/specrails-version` and `.specrails/specrails-manifest.json`
95
-
96
- To skip the TUI and use an existing config: `npx specrails-core@latest init --from-config`
97
- To skip the TUI and use all defaults: `npx specrails-core@latest init --yes`
98
-
99
- The scaffold installer only copies files. It does not modify your existing code, create commits, or push to any remote.
100
-
101
- ---
102
-
103
- ## The Enrich Wizard
104
-
105
- After either installation method, open the selected AI CLI. Claude and Gemini
106
- use:
107
-
108
- ```
109
- /specrails:enrich
110
- ```
111
-
112
- Kimi uses:
113
-
114
- ```text
115
- /skill:specrails-enrich
116
- ```
117
-
118
- That slash form is Kimi TUI syntax. Automated callers use the managed
119
- `.kimi-code/specrails/run-skill.mjs` helper installed beside the skills; passing
120
- the slash form directly to `kimi -p` does not activate it in Kimi 0.27.
121
- Generated multi-role workflows give that helper one structured foreground
122
- role wave. It owns parallel child processes and reusable worktrees, so no
123
- Kimi daemon or bundled provider binary is required.
124
-
125
- There are three modes:
126
-
127
- | Mode | Command | When to use |
128
- |------|---------|-------------|
129
- | **Full wizard** (default) | `/specrails:enrich` | Deep stack analysis, researched personas, fully adapted agents — takes 5–10 min |
130
- | **Quick** | `/specrails:enrich --quick` | Fastest path — 3 questions, sensible defaults, done in under a minute |
131
- | **From-config** | `/specrails:enrich --from-config` | Non-interactive — reads `.specrails/install-config.yaml` from TUI installer |
132
-
133
- ---
134
-
135
- ### Full Wizard (default)
136
-
137
- The full 5-phase wizard — takes 5–10 minutes and produces deeply adapted agents.
138
-
139
- > **Note:** If the TUI installer already captured agent and model preferences, use `/specrails:enrich --from-config` to apply them non-interactively.
140
-
141
- ### Phase 1: Codebase Analysis
142
-
143
- The wizard scans your project to detect:
144
-
145
- - **Languages & frameworks** — from file extensions, dependency files, imports
146
- - **Architecture layers** — name, path, tech stack, tags (e.g., `backend/` → Python/FastAPI)
147
- - **CI/CD commands** — lint, format, test, build, type-check commands
148
- - **Conventions** — naming, imports, error handling, testing patterns
149
- - **Warnings** — concurrency issues, auth patterns, state management
150
-
151
- **Output:** A YAML analysis used by all subsequent phases.
152
-
153
- ### Phase 2: User Personas
154
-
155
- The wizard researches your project's domain and generates **user personas** with complete VPC profiles. It:
156
-
157
- 1. Identifies your target user segments
158
- 2. Researches competitors and alternatives via web search
159
- 3. Creates 2–4 personas with jobs, pains, and gains
160
- 4. Extracts a key insight per persona
161
-
162
- You can edit these later (see [Customization → Personas](customization.md#personas)).
163
-
164
- ### Phase 3: Configuration
165
-
166
- Interactive prompts for:
167
-
168
- | Setting | Options |
169
- |---------|---------|
170
- | **Backlog provider** | Local tickets (default), GitHub Issues, JIRA, or none |
171
- | **Access mode** | Read-write or read-only |
172
- | **Git workflow** | Trunk-based, Git Flow, or custom |
173
- | **Agents** | Which agents to enable (up to 14) |
174
- | **Commands** | Which commands to install |
175
-
176
- ### Phase 4: File Generation
177
-
178
- The wizard fills all templates with your project-specific context:
179
-
180
- - `{{STACK_OVERVIEW}}` → your detected tech stack
181
- - `{{CI_COMMANDS}}` → your actual CI command list
182
- - `{{LAYER_CONVENTIONS}}` → conventions per layer
183
- - `{{BACKEND_TECH_LIST}}` → your backend technologies
184
- - Every `{{PLACEHOLDER}}` resolved with real data
185
-
186
- **Generated files (full set, plugin method):**
187
-
188
- ```
189
- .specrails/
190
- ├── config.yaml # Stack, CI commands, git workflow
191
- ├── personas/
192
- │ ├── [persona-1].md # Your user personas (VPC profiles)
193
- │ └── [persona-2].md
194
- ├── rules/
195
- │ ├── backend.md # Per-layer coding conventions
196
- │ ├── frontend.md
197
- │ └── ...
198
- ├── agent-memory/ # Persistent agent knowledge
199
- └── pipeline/ # In-flight feature state
200
- ```
201
-
202
- **Generated files (full set, scaffold method):**
203
-
204
- ```
205
- .claude/
206
- ├── agents/
207
- │ ├── sr-architect.md # Adapted to your stack
208
- │ ├── sr-developer.md # Knows your CI commands
209
- │ ├── sr-reviewer.md # Runs your specific checks
210
- │ ├── sr-product-manager.md # Knows your domain
211
- │ ├── sr-product-analyst.md # Reads your backlog
212
- │ ├── sr-test-writer.md # Uses your test framework
213
- │ ├── sr-security-reviewer.md # Scans your patterns
214
- │ ├── sr-doc-sync.md # Updates your doc format
215
- │ ├── sr-backend-developer.md # Backend-specialized
216
- │ ├── sr-frontend-developer.md # Frontend-specialized
217
- │ ├── sr-backend-reviewer.md # Backend quality audit
218
- │ ├── sr-frontend-reviewer.md # Frontend quality audit
219
- │ ├── sr-merge-resolver.md # AI-powered conflict resolution
220
- │ ├── sr-performance-reviewer.md # Performance regression detection
221
- │ └── [personas].md # Your user personas
222
- ├── commands/
223
- │ └── sr/
224
- │ ├── implement.md
225
- │ ├── get-backlog-specs.md
226
- │ ├── batch-implement.md
227
- │ └── ... # 17 commands total
228
- ├── rules/
229
- │ ├── backend.md
230
- │ ├── frontend.md
231
- │ └── ...
232
- └── settings.json
233
- ```
234
-
235
- ### Phase 5: Cleanup
236
-
237
- The wizard removes itself:
238
-
239
- - Deletes `.claude/commands/specrails/enrich.md`
240
- - Deletes `.specrails/setup-templates/`
241
- - Leaves only the final generated files
242
-
243
- After this phase, `/specrails:enrich` is no longer available until re-run — your workflow is ready.
244
-
245
- ---
246
-
247
- ### Quick Install (TUI → `tier: quick`)
248
-
249
- The quick path — select agents in the TUI, answer two context questions, done in seconds. No AI interaction required.
250
-
251
- 1. Select which agents to install (from 14 available)
252
- 2. Choose a model preset (balanced, budget, or max)
253
- 3. Provide a short product description and target users
254
-
255
- **What gets installed:**
256
-
257
- | Item | Detail |
258
- |------|--------|
259
- | Selected agents | Placed directly in `.claude/agents/` with template defaults |
260
- | Workflow commands | `/specrails:implement`, `/specrails:doctor`, and more (18 commands) |
261
- | Rules & settings | Layer conventions, settings.json, security exemptions |
262
- | Agent memory | `.claude/agent-memory/<agent>/` directories |
263
- | Skills | OpenSpec skills in `.claude/skills/` |
264
-
265
- **What is NOT installed (requires full enrichment):**
266
-
267
- | Item | Reason |
268
- |------|--------|
269
- | VPC personas | Require competitive research and AI analysis |
270
- | sr-product-manager | Drives VPC persona creation — needs enrichment |
271
- | sr-product-analyst | Analyzes personas — needs enrichment |
272
- | `/specrails:auto-propose-backlog-specs` | Depends on personas |
273
- | `/specrails:vpc-drift` | Depends on personas |
274
- | `/specrails:get-backlog-specs` | References personas for prioritization |
275
-
276
- Agents work immediately with template defaults. Run `/specrails:enrich` later to add personas, competitive analysis, and codebase-specific customization.
277
-
278
- ---
279
-
280
- ### From-Config Mode (`/specrails:enrich --from-config`)
281
-
282
- Runs a fully automated installation using `.specrails/install-config.yaml`. No interactive prompts — all decisions come from the config file written by the TUI installer.
283
-
284
- **Config schema** (`.specrails/install-config.yaml`):
285
-
286
- ```yaml
287
- version: 1
288
- provider: claude # claude | codex | gemini | kimi
289
- tier: full # full (requires /specrails:enrich) | quick (agents placed directly)
290
- agents:
291
- selected: # unique lowercase kebab-case ids (1-64 chars)
292
- - sr-architect
293
- - sr-developer
294
- - sr-reviewer
295
- - sr-test-writer
296
- - sr-product-manager
297
- excluded: [] # unique ids to skip; must not overlap selected
298
- models:
299
- preset: balanced # balanced | budget | max
300
- defaults:
301
- model: sonnet # exact provider model/alias; Kimi defaults to k3
302
- overrides: {} # exact per-agent models: { sr-architect: opus }
303
- ```
304
-
305
- **Model presets:**
306
-
307
- | Preset | Description |
308
- |--------|-------------|
309
- | `balanced` (default) | Sonnet for all Claude agents |
310
- | `budget` | Haiku for all agents |
311
- | `max` | Opus for Claude architect + PM, Sonnet for all others |
312
-
313
- Other providers resolve the same preset names within their own catalog. Kimi
314
- presets default to `k3`; exact official ids and configured aliases are retained.
315
- Kimi ids must be 1–128 characters matching
316
- `[A-Za-z0-9][A-Za-z0-9._/:-]*`, the same grammar enforced at process launch.
317
-
318
- ---
319
-
320
- ## Verify installation
321
-
322
- After setup, verify everything is in place:
323
-
324
- ```bash
325
- # Plugin method: check generated project data
326
- ls .specrails/
327
-
328
- # Scaffold method: check generated agents
329
- ls .claude/agents/
330
-
331
- # Scaffold method: check for unresolved placeholders (should return nothing)
332
- grep -r '{{[A-Z_]*}}' .claude/agents/ .claude/commands/ .claude/rules/
333
-
334
- # Scaffold method: check version
335
- cat .specrails/specrails-version
336
- ```
337
-
338
- ---
339
-
340
- ## Troubleshooting
341
-
342
- ### Claude Code authentication: OAuth vs API key
343
-
344
- Claude Code supports two authentication modes:
345
-
346
- - **OAuth** — the default for new installs (`claude auth login`). No API key in `claude config`.
347
- - **API key** — explicit key set via `claude config set api_key <key>` or the `ANTHROPIC_API_KEY` environment variable.
348
-
349
- The installer checks for an API key in `claude config` or `ANTHROPIC_API_KEY`. If you are using OAuth (the default), this check fails even though Claude Code is fully authenticated.
350
-
351
- **Workaround:** pass `SPECRAILS_SKIP_PREREQS=1` to bypass the prerequisite gate:
352
-
353
- ```bash
354
- SPECRAILS_SKIP_PREREQS=1 npx specrails-core@latest init --root-dir .
355
- ```
356
-
357
- Or, if you prefer to authenticate with an API key explicitly:
358
-
359
- ```bash
360
- export ANTHROPIC_API_KEY=sk-ant-...
361
- npx specrails-core@latest init --root-dir .
362
- ```
363
-
364
- `SPECRAILS_SKIP_PREREQS=1` skips all hard-exit prerequisite checks (Claude Code presence, API key, and tool availability). Use it only when you know the prerequisites are met.
365
-
366
- ### "This appears to be the specrails source repository"
367
-
368
- You're running the installer from inside the SpecRails repo. Run it from your target project instead:
369
-
370
- ```bash
371
- cd /path/to/your-project
372
- npx specrails-core@latest init
373
- ```
374
-
375
- ### Existing `.claude/` directory detected
376
-
377
- The installer warns if SpecRails artifacts already exist. You can:
378
-
379
- - **Merge** — install alongside existing files (may overwrite conflicts)
380
- - **Abort** — cancel and review manually
381
-
382
- ### Placeholders not resolved
383
-
384
- If you see `{{PLACEHOLDER}}` in generated files (scaffold method), the `/specrails:enrich` wizard didn't complete. Re-run `/specrails:enrich` or manually fill the values.
385
-
386
- ---
387
-
388
- ## What's next?
389
-
390
- - [Core Concepts](concepts.md) — understand the pipeline and agent architecture
391
- - [Getting Started](getting-started.md) — run your first feature implementation
392
-
393
- ---
394
-
395
- [← Getting Started](getting-started.md) · [Core Concepts →](concepts.md)
@@ -1,191 +0,0 @@
1
- # Local Ticket Management
2
-
3
- specrails-core ships with a built-in, file-based ticket management system. It is the **default backlog provider** — no GitHub account, CLI tool, or external service required.
4
-
5
- ---
6
-
7
- ## Overview
8
-
9
- Tickets live in `.specrails/local-tickets.json` at your project root. Because it's a plain JSON file, tickets are:
10
-
11
- - **Version-controlled** — tracked by git, diffable in PRs
12
- - **Offline-first** — no network calls, no rate limits
13
- - **Tool-agnostic** — readable by any script or editor
14
-
15
- The file is read and written by specrails-core during command execution.
16
-
17
- ---
18
-
19
- ## Storage format
20
-
21
- `.specrails/local-tickets.json`:
22
-
23
- ```json
24
- {
25
- "schema_version": "1.0",
26
- "revision": 7,
27
- "last_updated": "2026-03-23T10:00:00.000Z",
28
- "next_id": 8,
29
- "tickets": {
30
- "1": {
31
- "id": 1,
32
- "title": "Add dark mode",
33
- "description": "Support system-level dark mode preference via CSS variables.",
34
- "status": "todo",
35
- "priority": "medium",
36
- "labels": ["area:frontend", "effort:medium"],
37
- "assignee": null,
38
- "prerequisites": [],
39
- "metadata": {
40
- "vpc_scores": { "persona-a": 4, "persona-b": 3 },
41
- "effort_level": "Medium",
42
- "user_story": "As a user working at night, I want dark mode...",
43
- "area": "frontend"
44
- },
45
- "comments": [],
46
- "created_at": "2026-03-20T09:00:00.000Z",
47
- "updated_at": "2026-03-20T09:00:00.000Z",
48
- "created_by": "sr-product-manager",
49
- "source": "get-backlog-specs"
50
- }
51
- }
52
- }
53
- ```
54
-
55
- ### Field reference
56
-
57
- **Root fields**
58
-
59
- | Field | Type | Description |
60
- |-------|------|-------------|
61
- | `schema_version` | string | Always `"1.0"` for the current format |
62
- | `revision` | number | Incremented on every write — used for optimistic concurrency control |
63
- | `last_updated` | ISO-8601 | Timestamp of the most recent mutation |
64
- | `next_id` | number | Auto-increment counter for new ticket IDs |
65
- | `tickets` | object | Map of ticket ID (as string) → ticket object |
66
-
67
- **Ticket fields**
68
-
69
- | Field | Type | Values | Description |
70
- |-------|------|--------|-------------|
71
- | `id` | number | Auto-assigned | Numeric ID, referenced as `#<id>` |
72
- | `title` | string | — | Short title |
73
- | `description` | string | Markdown | Full description |
74
- | `status` | string | `todo`, `in_progress`, `done`, `cancelled` | Current state |
75
- | `priority` | string | `critical`, `high`, `medium`, `low` | Priority level |
76
- | `labels` | string[] | Freeform | Tag strings; convention: `area:*`, `effort:*` |
77
- | `assignee` | string\|null | — | Agent name or user, if assigned |
78
- | `prerequisites` | number[] | — | IDs of tickets that must be done first |
79
- | `metadata` | object | — | VPC scores, effort level, user story, area (set by agents) |
80
- | `comments` | array | — | Progress notes appended during implementation |
81
- | `created_at` | ISO-8601 | — | Creation timestamp |
82
- | `updated_at` | ISO-8601 | — | Last mutation timestamp |
83
- | `created_by` | string | — | Agent name or `"user"` |
84
- | `source` | string | `manual`, `get-backlog-specs`, `propose-spec` | How the ticket was created |
85
-
86
- ---
87
-
88
- ## Setup
89
-
90
- Local tickets become the default during `/specrails:setup`. The wizard prompts:
91
-
92
- ```
93
- ## Backlog Provider
94
-
95
- Use local ticket management or connect an external provider?
96
-
97
- 1. Local tickets (default, recommended) — lightweight JSON-based ticket management.
98
- No external tools or accounts required.
99
- 2. External provider — connect GitHub Issues, JIRA, or disable backlog commands
100
- ```
101
-
102
- Pressing **Enter** or selecting **1** initializes `.specrails/local-tickets.json` with an empty ticket store and writes `.specrails/backlog-config.json`:
103
-
104
- ```json
105
- {
106
- "provider": "local",
107
- "write_access": true,
108
- "git_auto": true
109
- }
110
- ```
111
-
112
- To switch providers later, re-run the setup wizard:
113
-
114
- ```bash
115
- > /specrails:setup
116
- ```
117
-
118
- ---
119
-
120
- ## Concurrency model
121
-
122
- Multiple agents can modify `local-tickets.json` simultaneously. The system uses two complementary mechanisms:
123
-
124
- ### Advisory file lock
125
-
126
- Before every write, the agent creates `.specrails/local-tickets.json.lock`:
127
-
128
- ```json
129
- {
130
- "agent": "sr-product-manager",
131
- "timestamp": "2026-03-23T10:00:00.000Z"
132
- }
133
- ```
134
-
135
- If the lock file already exists:
136
- - **Fresh lock** (< 30 seconds old): wait 500 ms and retry, up to 5 attempts
137
- - **Stale lock** (≥ 30 seconds old): treat as orphaned, delete it, proceed
138
-
139
- The lock is deleted immediately after the write completes. The window is minimal: read → modify in memory → write → release.
140
-
141
- ### Revision counter
142
-
143
- Every write increments `revision`. Readers that want to detect external changes compare the `revision` they last saw against the current value.
144
-
145
- ---
146
-
147
- ## Command integration
148
-
149
- ### `/specrails:implement`
150
-
151
- Pass local ticket IDs the same way you would GitHub issue numbers:
152
-
153
- ```bash
154
- /specrails:implement #1, #4, #7
155
- ```
156
-
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.
158
-
159
- ### `/specrails:get-backlog-specs`
160
-
161
- ```bash
162
- /specrails:get-backlog-specs # all areas
163
- /specrails:get-backlog-specs UI, Backend # filter by area
164
- ```
165
-
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.
167
-
168
- ### `/specrails:auto-propose-backlog-specs`
169
-
170
- ```bash
171
- /specrails:auto-propose-backlog-specs # explore all areas
172
- /specrails:auto-propose-backlog-specs Analytics # focus on one area
173
- ```
174
-
175
- Runs product discovery using your VPC personas. Creates new local tickets for discovered feature ideas, tagged with `source: "get-backlog-specs"` and `labels: ["product-driven-backlog", "area:<area>"]`. Existing tickets are checked for duplicates before creating new ones.
176
-
177
- ### `/specrails:propose-spec`
178
-
179
- When a proposal is finalized, a local ticket is created automatically:
180
-
181
- ```
182
- Created local ticket #12: Add analytics export
183
- ```
184
-
185
- The ticket captures the full proposal as its description and is tagged `source: "propose-spec"` with the label `spec-proposal`.
186
-
187
- ---
188
-
189
- ## Migrating from GitHub Issues or JIRA
190
-
191
- See the [Migration Guide](./migration-guide.md).