specrails-core 5.5.1 → 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 (276) 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 +4 -3
  6. package/dist/agent-runtime/cli-process.js +0 -1
  7. package/dist/agent-runtime/cli.d.ts +8 -0
  8. package/dist/agent-runtime/cli.js +31 -5
  9. package/dist/agent-runtime/codex-schema.js +0 -1
  10. package/dist/agent-runtime/compact/architect.d.ts +3 -272
  11. package/dist/agent-runtime/compact/architect.js +8 -9
  12. package/dist/agent-runtime/compact/chat-client.d.ts +3 -3
  13. package/dist/agent-runtime/compact/chat-client.js +1 -2
  14. package/dist/agent-runtime/compact/developer.d.ts +3 -70
  15. package/dist/agent-runtime/compact/developer.js +13 -14
  16. package/dist/agent-runtime/compact/environment.d.ts +4 -5
  17. package/dist/agent-runtime/compact/environment.js +1 -2
  18. package/dist/agent-runtime/compact/exit-code-honesty.d.ts +2 -1
  19. package/dist/agent-runtime/compact/exit-code-honesty.js +0 -1
  20. package/dist/agent-runtime/compact/guarded-loop.d.ts +2 -18
  21. package/dist/agent-runtime/compact/guarded-loop.js +7 -8
  22. package/dist/agent-runtime/compact/prompt-inputs.d.ts +0 -2
  23. package/dist/agent-runtime/compact/prompt-inputs.js +1 -2
  24. package/dist/agent-runtime/compact/reviewer.d.ts +0 -13
  25. package/dist/agent-runtime/compact/reviewer.js +5 -6
  26. package/dist/agent-runtime/compact/step.d.ts +0 -1
  27. package/dist/agent-runtime/compact/step.js +1 -2
  28. package/dist/agent-runtime/compact/test-reachability.js +0 -1
  29. package/dist/agent-runtime/config.js +0 -1
  30. package/dist/agent-runtime/core-host.d.ts +1 -1
  31. package/dist/agent-runtime/core-host.js +5 -3
  32. package/dist/agent-runtime/durable-store.d.ts +0 -1
  33. package/dist/agent-runtime/durable-store.js +1 -2
  34. package/dist/agent-runtime/efficiency-summary.d.ts +2 -2
  35. package/dist/agent-runtime/efficiency-summary.js +1 -2
  36. package/dist/agent-runtime/efficiency-types.js +0 -1
  37. package/dist/agent-runtime/efficiency.js +0 -1
  38. package/dist/agent-runtime/evaluation-corpus.js +0 -1
  39. package/dist/agent-runtime/evaluation.d.ts +2 -1
  40. package/dist/agent-runtime/evaluation.js +1 -2
  41. package/dist/agent-runtime/executor-types.d.ts +1 -1
  42. package/dist/agent-runtime/executor-types.js +0 -1
  43. package/dist/agent-runtime/executors.js +0 -1
  44. package/dist/agent-runtime/gemini-policy.js +0 -1
  45. package/dist/agent-runtime/graph/artifacts.d.ts +1 -1
  46. package/dist/agent-runtime/graph/artifacts.js +11 -5
  47. package/dist/agent-runtime/graph/nodes.d.ts +1 -1
  48. package/dist/agent-runtime/graph/nodes.js +1 -2
  49. package/dist/agent-runtime/graph/review-policy.js +0 -1
  50. package/dist/agent-runtime/graph/roles.d.ts +2 -5
  51. package/dist/agent-runtime/graph/roles.js +2 -8
  52. package/dist/agent-runtime/graph/state.d.ts +1 -1
  53. package/dist/agent-runtime/graph/state.js +0 -1
  54. package/dist/agent-runtime/graph-checkpointer.d.ts +2 -1
  55. package/dist/agent-runtime/graph-checkpointer.js +0 -1
  56. package/dist/agent-runtime/guardrails.d.ts +3 -3
  57. package/dist/agent-runtime/guardrails.js +1 -2
  58. package/dist/agent-runtime/index.d.ts +2 -1
  59. package/dist/agent-runtime/index.js +2 -2
  60. package/dist/agent-runtime/kimi-acp.js +1 -2
  61. package/dist/agent-runtime/kimi-model.d.ts +6 -0
  62. package/dist/agent-runtime/kimi-model.js +12 -0
  63. package/dist/agent-runtime/openai-executor.d.ts +0 -9
  64. package/dist/agent-runtime/openai-executor.js +6 -7
  65. package/dist/agent-runtime/openspec-tool-server.js +1 -2
  66. package/dist/agent-runtime/openspec.d.ts +0 -2
  67. package/dist/agent-runtime/openspec.js +3 -7
  68. package/dist/agent-runtime/prompts.d.ts +4 -3
  69. package/dist/agent-runtime/prompts.js +0 -1
  70. package/dist/agent-runtime/provider-diagnostic.js +1 -2
  71. package/dist/agent-runtime/recovery.d.ts +46 -0
  72. package/dist/agent-runtime/recovery.js +169 -0
  73. package/dist/agent-runtime/repository-context.d.ts +1 -1
  74. package/dist/agent-runtime/repository-context.js +0 -1
  75. package/dist/agent-runtime/review-context.d.ts +1 -1
  76. package/dist/agent-runtime/review-context.js +0 -1
  77. package/dist/agent-runtime/role-routing.js +0 -1
  78. package/dist/agent-runtime/role-state.js +0 -1
  79. package/dist/agent-runtime/runtime-identity.js +1 -2
  80. package/dist/agent-runtime/tool-event.js +0 -1
  81. package/dist/agent-runtime/verification-plan.d.ts +5 -4
  82. package/dist/agent-runtime/verification-plan.js +1 -2
  83. package/dist/agent-runtime/workflow-types.js +0 -1
  84. package/dist/agent-runtime/workflow.js +0 -1
  85. package/dist/agent-runtime/workspace-tools.d.ts +2 -2
  86. package/dist/agent-runtime/workspace-tools.js +1 -2
  87. package/dist/installer/cli.d.ts +3 -32
  88. package/dist/installer/cli.js +26 -101
  89. package/dist/installer/commands/framework.d.ts +4 -3
  90. package/dist/installer/commands/framework.js +0 -1
  91. package/dist/installer/commands/init.d.ts +4 -25
  92. package/dist/installer/commands/init.js +5 -8
  93. package/dist/installer/phases/framework-lifecycle.d.ts +3 -17
  94. package/dist/installer/phases/framework-lifecycle.js +2 -3
  95. package/dist/installer/phases/install-config.d.ts +7 -8
  96. package/dist/installer/phases/install-config.js +2 -7
  97. package/dist/installer/phases/manifest.d.ts +6 -7
  98. package/dist/installer/phases/manifest.js +2 -7
  99. package/dist/installer/phases/prereqs.d.ts +6 -7
  100. package/dist/installer/phases/prereqs.js +4 -6
  101. package/dist/installer/phases/provider-detect.d.ts +6 -7
  102. package/dist/installer/phases/provider-detect.js +2 -4
  103. package/dist/installer/phases/scaffold.d.ts +9 -10
  104. package/dist/installer/phases/scaffold.js +82 -805
  105. package/dist/installer/util/errors.js +0 -1
  106. package/dist/installer/util/exec.d.ts +3 -2
  107. package/dist/installer/util/exec.js +0 -1
  108. package/dist/installer/util/fs.d.ts +0 -10
  109. package/dist/installer/util/fs.js +1 -2
  110. package/dist/installer/util/git.js +0 -1
  111. package/dist/installer/util/install-transaction.d.ts +2 -2
  112. package/dist/installer/util/install-transaction.js +1 -2
  113. package/dist/installer/util/logger.d.ts +1 -3
  114. package/dist/installer/util/logger.js +0 -1
  115. package/dist/installer/util/paths.js +0 -1
  116. package/dist/installer/util/registry.d.ts +4 -8
  117. package/dist/installer/util/registry.js +2 -3
  118. package/dist/{installer/runtime → pipeline}/pipeline-state.js +0 -3
  119. package/dist/shared/args.d.ts +18 -0
  120. package/dist/shared/args.js +53 -0
  121. package/integration-contract.json +10 -46
  122. package/package.json +3 -10
  123. package/templates/agents/sr-architect.md +15 -310
  124. package/templates/agents/sr-developer.md +15 -269
  125. package/templates/agents/sr-reviewer.md +13 -367
  126. package/templates/codex-skills/rails/sr-architect/SKILL.md +14 -308
  127. package/templates/codex-skills/rails/sr-developer/SKILL.md +14 -201
  128. package/templates/codex-skills/rails/sr-reviewer/SKILL.md +15 -289
  129. package/templates/kimi/specrails/run-skill.mjs +91 -2173
  130. package/bin/tui-installer.mjs +0 -430
  131. package/commands/doctor.md +0 -62
  132. package/dist/agent-runtime/capabilities.js.map +0 -1
  133. package/dist/agent-runtime/cli-executor.js.map +0 -1
  134. package/dist/agent-runtime/cli-process.js.map +0 -1
  135. package/dist/agent-runtime/cli.js.map +0 -1
  136. package/dist/agent-runtime/codex-schema.js.map +0 -1
  137. package/dist/agent-runtime/compact/architect.js.map +0 -1
  138. package/dist/agent-runtime/compact/chat-client.js.map +0 -1
  139. package/dist/agent-runtime/compact/developer.js.map +0 -1
  140. package/dist/agent-runtime/compact/environment.js.map +0 -1
  141. package/dist/agent-runtime/compact/exit-code-honesty.js.map +0 -1
  142. package/dist/agent-runtime/compact/guarded-loop.js.map +0 -1
  143. package/dist/agent-runtime/compact/prompt-inputs.js.map +0 -1
  144. package/dist/agent-runtime/compact/reviewer.js.map +0 -1
  145. package/dist/agent-runtime/compact/step.js.map +0 -1
  146. package/dist/agent-runtime/compact/test-reachability.js.map +0 -1
  147. package/dist/agent-runtime/config.js.map +0 -1
  148. package/dist/agent-runtime/core-host.js.map +0 -1
  149. package/dist/agent-runtime/durable-store.js.map +0 -1
  150. package/dist/agent-runtime/efficiency-summary.js.map +0 -1
  151. package/dist/agent-runtime/efficiency-types.js.map +0 -1
  152. package/dist/agent-runtime/efficiency.js.map +0 -1
  153. package/dist/agent-runtime/evaluation-corpus.js.map +0 -1
  154. package/dist/agent-runtime/evaluation.js.map +0 -1
  155. package/dist/agent-runtime/executor-types.js.map +0 -1
  156. package/dist/agent-runtime/executors.js.map +0 -1
  157. package/dist/agent-runtime/gemini-policy.js.map +0 -1
  158. package/dist/agent-runtime/graph/artifacts.js.map +0 -1
  159. package/dist/agent-runtime/graph/nodes.js.map +0 -1
  160. package/dist/agent-runtime/graph/review-policy.js.map +0 -1
  161. package/dist/agent-runtime/graph/roles.js.map +0 -1
  162. package/dist/agent-runtime/graph/state.js.map +0 -1
  163. package/dist/agent-runtime/graph-checkpointer.js.map +0 -1
  164. package/dist/agent-runtime/guardrails.js.map +0 -1
  165. package/dist/agent-runtime/index.js.map +0 -1
  166. package/dist/agent-runtime/kimi-acp.js.map +0 -1
  167. package/dist/agent-runtime/openai-executor.js.map +0 -1
  168. package/dist/agent-runtime/openspec-tool-server.js.map +0 -1
  169. package/dist/agent-runtime/openspec.js.map +0 -1
  170. package/dist/agent-runtime/prompts.js.map +0 -1
  171. package/dist/agent-runtime/provider-diagnostic.js.map +0 -1
  172. package/dist/agent-runtime/repository-context.js.map +0 -1
  173. package/dist/agent-runtime/review-context.js.map +0 -1
  174. package/dist/agent-runtime/role-routing.js.map +0 -1
  175. package/dist/agent-runtime/role-state.js.map +0 -1
  176. package/dist/agent-runtime/runtime-identity.js.map +0 -1
  177. package/dist/agent-runtime/tool-event.js.map +0 -1
  178. package/dist/agent-runtime/verification-plan.js.map +0 -1
  179. package/dist/agent-runtime/workflow-types.js.map +0 -1
  180. package/dist/agent-runtime/workflow.js.map +0 -1
  181. package/dist/agent-runtime/workspace-tools.js.map +0 -1
  182. package/dist/installer/cli.js.map +0 -1
  183. package/dist/installer/commands/doctor.d.ts +0 -27
  184. package/dist/installer/commands/doctor.js +0 -615
  185. package/dist/installer/commands/doctor.js.map +0 -1
  186. package/dist/installer/commands/framework.js.map +0 -1
  187. package/dist/installer/commands/init.js.map +0 -1
  188. package/dist/installer/commands/update.d.ts +0 -56
  189. package/dist/installer/commands/update.js +0 -257
  190. package/dist/installer/commands/update.js.map +0 -1
  191. package/dist/installer/commands/v5-migration.d.ts +0 -32
  192. package/dist/installer/commands/v5-migration.js +0 -133
  193. package/dist/installer/commands/v5-migration.js.map +0 -1
  194. package/dist/installer/phases/framework-lifecycle.js.map +0 -1
  195. package/dist/installer/phases/install-config.js.map +0 -1
  196. package/dist/installer/phases/manifest.js.map +0 -1
  197. package/dist/installer/phases/prereqs.js.map +0 -1
  198. package/dist/installer/phases/provider-detect.js.map +0 -1
  199. package/dist/installer/phases/scaffold.js.map +0 -1
  200. package/dist/installer/runtime/kimi.d.ts +0 -84
  201. package/dist/installer/runtime/kimi.js +0 -255
  202. package/dist/installer/runtime/kimi.js.map +0 -1
  203. package/dist/installer/runtime/pipeline-state.js.map +0 -1
  204. package/dist/installer/util/errors.js.map +0 -1
  205. package/dist/installer/util/exec.js.map +0 -1
  206. package/dist/installer/util/fs.js.map +0 -1
  207. package/dist/installer/util/git.js.map +0 -1
  208. package/dist/installer/util/install-transaction.js.map +0 -1
  209. package/dist/installer/util/logger.js.map +0 -1
  210. package/dist/installer/util/paths.js.map +0 -1
  211. package/dist/installer/util/prompts.d.ts +0 -23
  212. package/dist/installer/util/prompts.js +0 -49
  213. package/dist/installer/util/prompts.js.map +0 -1
  214. package/dist/installer/util/registry.js.map +0 -1
  215. package/dist/installer/util/template.d.ts +0 -23
  216. package/dist/installer/util/template.js +0 -60
  217. package/dist/installer/util/template.js.map +0 -1
  218. package/docs/README.md +0 -40
  219. package/docs/agent-runtime-efficiency.md +0 -65
  220. package/docs/agent-runtime.md +0 -347
  221. package/docs/agents.md +0 -315
  222. package/docs/changelog.md +0 -168
  223. package/docs/ci-cd.md +0 -60
  224. package/docs/concepts.md +0 -183
  225. package/docs/customization.md +0 -363
  226. package/docs/deployment.md +0 -234
  227. package/docs/getting-started.md +0 -122
  228. package/docs/installation.md +0 -395
  229. package/docs/local-tickets.md +0 -191
  230. package/docs/migration-guide.md +0 -140
  231. package/docs/playbook-oss-maintainer.md +0 -112
  232. package/docs/playbook-parallel-dev.md +0 -124
  233. package/docs/playbook-product-discovery.md +0 -115
  234. package/docs/plugin-architecture.md +0 -144
  235. package/docs/research/codex-compatibility-analysis.md +0 -365
  236. package/docs/research/mcp-feasibility-analysis.md +0 -382
  237. package/docs/testing/test-matrix-codex.md +0 -130
  238. package/docs/updating.md +0 -89
  239. package/docs/user-docs/cli-reference.md +0 -428
  240. package/docs/user-docs/codex-vs-claude-code.md +0 -23
  241. package/docs/user-docs/core-updates.md +0 -70
  242. package/docs/user-docs/faq.md +0 -146
  243. package/docs/user-docs/getting-started-codex.md +0 -194
  244. package/docs/user-docs/getting-started-kimi.md +0 -423
  245. package/docs/user-docs/installation.md +0 -237
  246. package/docs/user-docs/provider-pipelines.md +0 -96
  247. package/docs/user-docs/quick-start.md +0 -161
  248. package/docs/windows.md +0 -78
  249. package/docs/workflows.md +0 -463
  250. package/schemas/profile.v1.json +0 -207
  251. package/templates/claude-md/CLAUDE-quickstart.md +0 -54
  252. package/templates/claude-md/root.md +0 -50
  253. package/templates/codex-skills/batch-implement/SKILL.md +0 -38
  254. package/templates/codex-skills/implement/SKILL.md +0 -38
  255. package/templates/codex-skills/retry/SKILL.md +0 -16
  256. package/templates/commands/specrails/compat-check.md +0 -271
  257. package/templates/commands/specrails/doctor.md +0 -62
  258. package/templates/commands/specrails/explore-spec.md +0 -173
  259. package/templates/commands/specrails/health-check.md +0 -527
  260. package/templates/commands/specrails/memory-inspect.md +0 -261
  261. package/templates/commands/specrails/opsx-diff.md +0 -419
  262. package/templates/commands/specrails/propose-spec.md +0 -102
  263. package/templates/commands/specrails/refactor-recommender.md +0 -169
  264. package/templates/commands/specrails/telemetry.md +0 -552
  265. package/templates/commands/specrails/why.md +0 -96
  266. package/templates/gemini-commands/batch-implement.toml +0 -37
  267. package/templates/gemini-commands/implement.toml +0 -37
  268. package/templates/gemini-commands/retry.toml +0 -15
  269. package/templates/profiles/default.json +0 -14
  270. package/templates/profiles/kimi-default.json +0 -15
  271. package/templates/rules/layer.md +0 -8
  272. package/templates/runtime/provider-pipeline.md +0 -113
  273. package/templates/security/security-exemptions.yaml +0 -20
  274. package/templates/settings/confidence-config.json +0 -17
  275. package/templates/settings/settings.json +0 -15
  276. /package/dist/{installer/runtime → pipeline}/pipeline-state.d.ts +0 -0
@@ -1,382 +0,0 @@
1
- # MCP Server for specrails-core — Feasibility Analysis
2
-
3
- **Date:** 2026-03-21
4
- **Author:** CTO of Engineering
5
- **Status:** Research Complete — Recommendation Included
6
- **Task:** SPEA-480
7
-
8
- ---
9
-
10
- ## Executive Summary
11
-
12
- This document evaluates whether building an MCP (Model Context Protocol) server for specrails-core is strategically sound. After thorough analysis of the current architecture, the MCP protocol capabilities, and the product roadmap, **the recommendation is YES — with a focused, phased scope**.
13
-
14
- An MCP server should expose **read-only knowledge access** and **lightweight utility operations**, while the multi-agent orchestration pipeline stays in Claude Code commands. This approach maximizes cross-client reach with minimal maintenance overhead.
15
-
16
- ---
17
-
18
- ## 1. What is MCP?
19
-
20
- The **Model Context Protocol** is Anthropic's open standard for connecting AI models to external data sources and tools. It defines three primitives:
21
-
22
- | Primitive | Purpose | Direction |
23
- |-----------|---------|-----------|
24
- | **Resources** | Expose read-only data (files, records, configs) | Server → Client |
25
- | **Tools** | Actions that modify state or compute results | Client → Server → Client |
26
- | **Prompts** | Parameterized prompt templates | Server → Client |
27
-
28
- MCP servers run as local processes (stdio) or remote services (HTTP+SSE). Any MCP-compatible client can connect: Claude Desktop, Claude Code, Cursor, Windsurf, VS Code (Copilot), Zed, and others.
29
-
30
- ---
31
-
32
- ## 2. Current specrails-core Architecture (No MCP)
33
-
34
- ### Distribution & Execution Model
35
-
36
- ```
37
- npx specrails-core@latest init → install.sh (bash) → /specrails:setup (Claude Code command)
38
- │ │
39
- ├── Copy templates ├── Detect codebase
40
- ├── Create dirs ├── Generate agents
41
- └── Write manifest └── Substitute placeholders
42
- ```
43
-
44
- ### Runtime Architecture
45
-
46
- ```
47
- Claude Code
48
- ├── Commands (/specrails:implement, /specrails:get-backlog-specs, ...)
49
- ├── Skills (/opsx:new, /opsx:apply, /opsx:ff, ...)
50
- ├── Agents (sr-architect, sr-developer, sr-reviewer, ...)
51
- ├── Rules (.claude/rules/ — layer-specific conventions)
52
- └── Agent Memory (.claude/agent-memory/ — explanations, failures)
53
- ```
54
-
55
- ### Key Characteristics
56
-
57
- - **Zero-daemon**: No running processes — everything is files + CLI commands
58
- - **Claude Code-native**: Tight integration with Agent tool, worktrees, Skills API
59
- - **CLI-based integrations**: GitHub CLI, OpenSpec CLI, npm — no HTTP APIs
60
- - **Local-first**: All state stored on filesystem (JSON, YAML, Markdown)
61
- - **12 specialized agents** with orchestrated multi-phase pipeline
62
- - **80+ template placeholders** for codebase-adaptive generation
63
-
64
- ---
65
-
66
- ## 3. What Would an MCP Server Expose?
67
-
68
- ### 3.1 Resources (Read-Only Data)
69
-
70
- | Resource | URI Pattern | Description |
71
- |----------|-------------|-------------|
72
- | Specs | `specrails://specs/{name}` | OpenSpec specifications (source of truth) |
73
- | Active Changes | `specrails://changes/{name}` | Active OpenSpec changes with status |
74
- | Archived Changes | `specrails://changes/archive/{name}` | Historical change records |
75
- | Personas | `specrails://personas/{name}` | VPC persona profiles (jobs, pains, gains) |
76
- | Agent Config | `specrails://agents/{name}` | Agent personality & configuration |
77
- | Layer Rules | `specrails://rules/{layer}` | Per-layer coding conventions |
78
- | Failure Records | `specrails://memory/failures` | CI failure patterns and prevention rules |
79
- | Explanations | `specrails://memory/explanations` | Implementation decision records |
80
- | Project Config | `specrails://config` | CLAUDE.md, integration contract, manifest |
81
-
82
- ### 3.2 Tools (Actions)
83
-
84
- | Tool | Input | Output | Side Effects |
85
- |------|-------|--------|--------------|
86
- | `specrails_doctor` | (none) | Health check report | None (read-only) |
87
- | `specrails_score_feature` | Feature description | VPC scores per persona | None |
88
- | `specrails_analyze_codebase` | Project root path | Stack, architecture, conventions | None |
89
- | `specrails_list_changes` | (optional filters) | Active changes with status | None |
90
- | `specrails_get_change_status` | Change name | Artifact status, task progress | None |
91
- | `specrails_query_failures` | File glob pattern | Matching failure records | None |
92
- | `specrails_query_backlog` | (optional filters) | GitHub Issues with VPC scores | None |
93
- | `specrails_check_compat` | Version string | Integration contract validation | None |
94
-
95
- ### 3.3 Prompts (Templates)
96
-
97
- | Prompt | Parameters | Purpose |
98
- |--------|------------|---------|
99
- | `review_with_conventions` | `layer`, `files` | Review prompt with auto-loaded layer rules |
100
- | `explore_feature` | `description` | VPC-aware feature exploration prompt |
101
- | `implement_context` | `change_name` | Context bundle for a specific change |
102
-
103
- ---
104
-
105
- ## 4. Strategic Analysis
106
-
107
- ### 4.1 Arguments FOR an MCP Server
108
-
109
- #### A. Cross-Client Reach (High Impact)
110
-
111
- Currently specrails-core **only works inside Claude Code**. An MCP server makes the knowledge layer accessible from:
112
-
113
- - **Claude Desktop** — Product managers can query personas and backlog without a terminal
114
- - **Cursor / Windsurf** — Developers in other IDEs get specrails context
115
- - **VS Code (Copilot)** — Teams using GitHub Copilot can still access specs and conventions
116
- - **Custom tooling** — Any MCP client can connect
117
-
118
- This dramatically expands the addressable market beyond Claude Code-only users.
119
-
120
- #### B. Tool Ecosystem Composability (Medium Impact)
121
-
122
- MCP is becoming the standard protocol for AI tool integration. As an MCP server, specrails-core can be **composed** with:
123
-
124
- - Database MCP servers (query production data alongside specs)
125
- - Monitoring MCP servers (correlate failures with system metrics)
126
- - CI/CD MCP servers (trigger builds with specrails context)
127
-
128
- #### C. Structured API for Hub Integration (High Impact)
129
-
130
- specrails-hub currently uses a rigid `integration-contract.json` for core↔hub communication. An MCP server provides a **dynamic, structured API** that hub can query:
131
-
132
- ```
133
- Current: Hub reads static JSON contract → spawns CLI commands
134
- With MCP: Hub connects as MCP client → queries resources, invokes tools
135
- ```
136
-
137
- This eliminates the version-coupling problem where hub must know core's CLI interface.
138
-
139
- #### D. Separation of Concerns (Medium Impact)
140
-
141
- The current architecture tightly couples specrails to Claude Code's command/skill system. MCP creates a clean **knowledge API layer** separate from the **orchestration layer**:
142
-
143
- ```
144
- ┌─────────────────────────────────────────────┐
145
- │ MCP Server (Knowledge) │
146
- │ Specs, Personas, Memory, Config, Analysis │
147
- ├─────────────────────────────────────────────┤
148
- │ Claude Code (Orchestration) │
149
- │ /specrails:implement, /specrails:batch-implement, agents │
150
- └─────────────────────────────────────────────┘
151
- ```
152
-
153
- #### E. Remote/Multi-Repo Scenarios (Future Value)
154
-
155
- MCP supports HTTP+SSE transport. A centralized specrails MCP server could:
156
-
157
- - Serve specs across multiple repos from one instance
158
- - Enable cross-repo knowledge queries
159
- - Power a team-wide development dashboard
160
-
161
- ### 4.2 Arguments AGAINST an MCP Server
162
-
163
- #### A. Current System Works Well
164
-
165
- Skills and commands already provide strong Claude Code integration. MCP adds complexity for users who only use Claude Code.
166
-
167
- **Counter:** MCP doesn't replace commands/skills — it supplements them with cross-client access.
168
-
169
- #### B. Orchestration Can't Move to MCP
170
-
171
- The `/specrails:implement` pipeline requires Claude Code's Agent tool (subagent spawning, worktree isolation, background execution). MCP tools are request/response — they can't replicate multi-phase orchestration.
172
-
173
- **Counter:** This is exactly why the recommendation is scoped. Orchestration stays in Claude Code; only knowledge access moves to MCP.
174
-
175
- #### C. Maintenance Overhead
176
-
177
- Two interfaces to maintain (skills + MCP). Template changes could require updates in both.
178
-
179
- **Counter:** MCP resources are read-only wrappers around existing files. No template duplication — the MCP server reads the same files that skills read.
180
-
181
- #### D. MCP Server Process Overhead
182
-
183
- Currently specrails-core is zero-daemon. Adding an MCP server means a running process.
184
-
185
- **Counter:** MCP stdio servers start on-demand (launched by the client). No persistent daemon needed. The MCP server binary can ship with the npm package.
186
-
187
- #### E. Protocol Maturity
188
-
189
- MCP is still evolving. Breaking changes in the protocol could require updates.
190
-
191
- **Counter:** MCP has reached stable specification status. Core primitives (resources, tools, prompts) are unlikely to change fundamentally.
192
-
193
- ---
194
-
195
- ## 5. Competitive Landscape
196
-
197
- | Product | MCP Support | Notes |
198
- |---------|-------------|-------|
199
- | **Cursor** | MCP client | Users can connect to any MCP server |
200
- | **Windsurf** | MCP client | Growing MCP ecosystem |
201
- | **Continue.dev** | MCP client | Open-source IDE extension |
202
- | **Cline** | MCP client | VS Code extension with MCP |
203
- | **aider** | No MCP | CLI-only, no extensibility protocol |
204
- | **Devin** | No MCP | Closed platform |
205
- | **specrails-core** | **No MCP (current)** | Claude Code-only |
206
-
207
- Having MCP support positions specrails-core as the **only product-driven development framework accessible from any MCP client**.
208
-
209
- ---
210
-
211
- ## 6. Recommended Architecture
212
-
213
- ### 6.1 Server Design
214
-
215
- ```
216
- specrails-core/
217
- ├── src/
218
- │ └── mcp/
219
- │ ├── server.ts # MCP server entry point
220
- │ ├── resources/
221
- │ │ ├── specs.ts # OpenSpec spec resources
222
- │ │ ├── changes.ts # Change status resources
223
- │ │ ├── personas.ts # VPC persona resources
224
- │ │ ├── agents.ts # Agent config resources
225
- │ │ ├── memory.ts # Memory/failure resources
226
- │ │ └── config.ts # Project config resources
227
- │ ├── tools/
228
- │ │ ├── doctor.ts # Health check tool
229
- │ │ ├── score-feature.ts # VPC scoring tool
230
- │ │ ├── analyze.ts # Codebase analysis tool
231
- │ │ ├── query-backlog.ts # Backlog query tool
232
- │ │ └── change-status.ts # Change status tool
233
- │ └── prompts/
234
- │ ├── review.ts # Review with conventions
235
- │ └── explore.ts # VPC-aware exploration
236
- ├── bin/
237
- │ └── specrails-mcp.js # MCP stdio entry point
238
- └── package.json # Add "specrails-mcp" bin entry
239
- ```
240
-
241
- ### 6.2 Transport & Distribution
242
-
243
- ```json
244
- // Client configuration (e.g., claude_desktop_config.json)
245
- {
246
- "mcpServers": {
247
- "specrails": {
248
- "command": "npx",
249
- "args": ["specrails-core@latest", "mcp"],
250
- "env": {
251
- "SPECRAILS_PROJECT_ROOT": "/path/to/project"
252
- }
253
- }
254
- }
255
- }
256
- ```
257
-
258
- - **Transport**: stdio (launched by client on-demand)
259
- - **Distribution**: Ships with existing npm package — no separate install
260
- - **CLI entry**: `specrails-core mcp` starts the MCP server
261
- - **Project detection**: Uses `SPECRAILS_PROJECT_ROOT` env var or auto-detects from cwd
262
-
263
- ### 6.3 Technology Choice
264
-
265
- | Option | Pros | Cons |
266
- |--------|------|------|
267
- | **TypeScript (recommended)** | Same language as rest of specrails ecosystem, official `@modelcontextprotocol/sdk` package, type safety | Build step required |
268
- | Python | Official SDK, large MCP community | Different language from rest of stack |
269
- | Bash | Consistent with install.sh | No MCP SDK, painful to implement |
270
-
271
- **Recommendation: TypeScript** using `@modelcontextprotocol/sdk`.
272
-
273
- ---
274
-
275
- ## 7. Implementation Phases
276
-
277
- ### Phase 1 — Core Resources (MVP)
278
-
279
- **Effort:** ~2-3 days
280
- **Value:** Immediate cross-client access to specrails knowledge
281
-
282
- | Deliverable | Description |
283
- |-------------|-------------|
284
- | MCP server scaffold | TypeScript server with stdio transport |
285
- | Spec resources | Read OpenSpec specs by name |
286
- | Change resources | List active changes, get status |
287
- | Persona resources | Read VPC personas |
288
- | Config resource | Read project CLAUDE.md and layer rules |
289
- | `specrails-core mcp` CLI | Start MCP server from existing npm package |
290
-
291
- ### Phase 2 — Tools & Memory
292
-
293
- **Effort:** ~2-3 days
294
- **Value:** Actionable intelligence from any MCP client
295
-
296
- | Deliverable | Description |
297
- |-------------|-------------|
298
- | `specrails_doctor` | Health check tool |
299
- | `specrails_score_feature` | VPC scoring tool |
300
- | `specrails_query_failures` | Failure pattern queries |
301
- | `specrails_query_memory` | Agent memory search |
302
- | `specrails_list_changes` | Change listing with filters |
303
-
304
- ### Phase 3 — Hub Integration
305
-
306
- **Effort:** ~3-5 days
307
- **Value:** Replace rigid integration contract with dynamic MCP API
308
-
309
- | Deliverable | Description |
310
- |-------------|-------------|
311
- | Hub MCP client | specrails-hub connects as MCP client |
312
- | Dynamic command discovery | Hub queries available commands via MCP |
313
- | Real-time spec access | Hub reads specs through MCP resources |
314
- | Status streaming | Change progress via MCP notifications |
315
-
316
- ### Phase 4 — Advanced Features
317
-
318
- **Effort:** ~3-5 days
319
- **Value:** Full ecosystem integration
320
-
321
- | Deliverable | Description |
322
- |-------------|-------------|
323
- | `specrails_analyze_codebase` | Codebase analysis tool |
324
- | `specrails_query_backlog` | VPC-scored backlog queries |
325
- | Prompt templates | Review and explore prompts with context |
326
- | Remote transport | HTTP+SSE for multi-repo scenarios |
327
-
328
- ---
329
-
330
- ## 8. What Stays in Claude Code (NOT in MCP)
331
-
332
- These capabilities require Claude Code's runtime and should NOT be exposed via MCP:
333
-
334
- | Capability | Reason |
335
- |------------|--------|
336
- | `/specrails:implement` pipeline | Requires Agent tool (subagent spawning) |
337
- | `/specrails:batch-implement` | Requires git worktree isolation |
338
- | Agent invocation (sr-*) | Requires Claude Code's Agent subagent system |
339
- | OpenSpec artifact creation | Interactive, context-heavy (requires conversation) |
340
- | `/specrails:setup` wizard | Multi-step interactive configuration |
341
- | Template substitution (write) | Modifies project files, requires user consent |
342
-
343
- **Principle:** MCP = knowledge access. Claude Code = orchestration engine.
344
-
345
- ---
346
-
347
- ## 9. Risk Assessment
348
-
349
- | Risk | Probability | Impact | Mitigation |
350
- |------|-------------|--------|------------|
351
- | MCP protocol breaking changes | Low | Medium | Pin SDK version, follow changelog |
352
- | Maintenance burden (two interfaces) | Medium | Low | MCP reads same files as skills — no duplication |
353
- | User confusion (MCP vs commands) | Medium | Low | Clear docs: "MCP for access, commands for action" |
354
- | Security (exposing project data) | Low | Medium | Local stdio only (no remote by default), respect .gitignore |
355
- | Scope creep (adding orchestration to MCP) | Medium | High | Strict scope boundary: no write operations in Phase 1-2 |
356
-
357
- ---
358
-
359
- ## 10. Success Metrics
360
-
361
- | Metric | Target | Measurement |
362
- |--------|--------|-------------|
363
- | Cross-client usage | 3+ MCP clients connect in first month | MCP server logs |
364
- | Hub integration latency | 50% reduction vs CLI spawning | Hub performance metrics |
365
- | Developer adoption | 20% of users configure MCP alongside commands | npm download analytics |
366
- | Knowledge query volume | 100+ resource reads/day across users | MCP server telemetry |
367
-
368
- ---
369
-
370
- ## 11. Conclusion
371
-
372
- Building an MCP server for specrails-core is **strategically sound** because:
373
-
374
- 1. **It opens a new distribution channel** — any MCP client becomes a specrails client
375
- 2. **It improves hub integration** — dynamic API replaces rigid contract
376
- 3. **It positions specrails uniquely** — only product-driven dev framework with MCP support
377
- 4. **It's low-risk** — read-only resources, no orchestration duplication, ships with existing package
378
- 5. **The effort is proportional** — Phase 1 MVP in 2-3 days, full implementation in ~2 weeks
379
-
380
- The key insight is that specrails-core has two layers: **knowledge** (specs, personas, memory, config) and **orchestration** (agent pipeline, worktrees, CI). MCP is the perfect fit for the knowledge layer, while Claude Code commands remain the right tool for orchestration.
381
-
382
- **Recommendation: Proceed with Phase 1 (Core Resources MVP).**
@@ -1,130 +0,0 @@
1
- # Test Matrix — specrails Cross-Platform (Claude Code + Codex)
2
-
3
- Last updated: 2026-03-21
4
- Epic: [SPEA-505](/SPEA/issues/SPEA-505) — Codex Compatibility Approach B
5
-
6
- ## Legend
7
-
8
- | Symbol | Meaning |
9
- |--------|---------|
10
- | ✅ | Works / tested |
11
- | ❌ | Not supported |
12
- | 🔄 | In progress (implementation pending) |
13
- | ⚠️ | Partial / with caveats |
14
- | — | Not applicable |
15
-
16
- ---
17
-
18
- ## Feature Coverage by CLI
19
-
20
- ### Installation & Provider Detection (SPEA-506)
21
-
22
- | Feature | Claude Code only | Codex only | Both CLIs | Neither CLI |
23
- |---------|:-:|:-:|:-:|:-:|
24
- | Auto-detect `claude` binary | ✅ | — | ✅ | — |
25
- | Auto-detect `codex` binary | — | ✅ | ✅ | — |
26
- | Prompt user to choose CLI (dual) | — | — | 🔄 | — |
27
- | Exit with clear error message | — | — | — | 🔄 |
28
- | Output dir `.claude/` created | ✅ | ❌ | 🔄 | — |
29
- | Output dir `.codex/` created | ❌ | 🔄 | 🔄 | — |
30
- | `CLAUDE.md` instruction file | ✅ | ❌ | 🔄 | — |
31
- | `AGENTS.md` instruction file | ❌ | 🔄 | 🔄 | — |
32
- | `--provider claude` flag override | ✅ | — | 🔄 | — |
33
- | `--provider codex` flag override | — | ✅ | 🔄 | — |
34
-
35
- ### Skills & Commands (SPEA-507)
36
-
37
- | Feature | Claude Code | Codex |
38
- |---------|:-:|:-:|
39
- | Legacy slash commands `.claude/commands/specrails/` | ✅ | ❌ |
40
- | SKILL.md format `.claude/skills/sr-*/` | ✅ | ✅ |
41
- | `sr:implement` skill | ✅ | ✅ |
42
- | `sr:get-backlog-specs` skill | ✅ | ✅ |
43
- | `sr:compat-check` skill | ✅ | ✅ |
44
- | `sr:why` skill | ✅ | ✅ |
45
- | `sr:refactor-recommender` skill | ✅ | ✅ |
46
- | `sr:batch-implement` skill | ✅ | ✅ |
47
- | `sr:auto-propose-backlog-specs` skill | ✅ | ✅ |
48
- | Backward compat: slash commands still invoke correctly | ✅ | — |
49
-
50
- ### Permissions Configuration (SPEA-508)
51
-
52
- | Feature | Claude Code | Codex |
53
- |---------|:-:|:-:|
54
- | `.claude/settings.json` generated | ✅ | ❌ |
55
- | `.codex/config.toml` generated | ❌ | 🔄 |
56
- | `.codex/rules/default.rules` (Starlark) generated | ❌ | 🔄 |
57
- | Git permission granted | ✅ | 🔄 |
58
- | GitHub CLI (gh) permission granted | ✅ | 🔄 |
59
- | Read/Write filesystem permission | ✅ | 🔄 |
60
- | Bash tool allowed | ✅ | 🔄 |
61
-
62
- ### Agent Definitions (SPEA-509)
63
-
64
- | Agent | Claude Code (`.md`) | Codex (`.toml`) |
65
- |-------|:-:|:-:|
66
- | `sr-architect` | ✅ | 🔄 |
67
- | `sr-developer` | ✅ | 🔄 |
68
- | `sr-reviewer` | ✅ | 🔄 |
69
- | `sr-product-manager` | ✅ | 🔄 |
70
- | Prompt content identical across formats | ✅ | 🔄 |
71
- | YAML frontmatter valid (Claude Code) | ✅ | — |
72
- | TOML frontmatter valid (Codex) | — | 🔄 |
73
-
74
- ### Hub Integration (SPEA-510, SPEA-511)
75
-
76
- | Feature | Claude Code | Codex |
77
- |---------|:-:|:-:|
78
- | Hub detects claude binary | ✅ | — |
79
- | Hub detects codex binary | — | ✅ |
80
- | `integration-contract.json` v2 schema valid | ✅ | ✅ |
81
- | Hub invokes CLI with correct args | ✅ | ✅ |
82
- | Hub dashboard shows CLI badge | ✅ | ✅ |
83
- | Hub handles "no CLI detected" state | ✅ | ✅ |
84
-
85
- ---
86
-
87
- ## Edge Case Coverage
88
-
89
- | Scenario | Test Coverage | Notes |
90
- |----------|:-:|-------|
91
- | User has both CLIs, picks Claude Code | 🔄 | Interactive prompt or `--provider` flag |
92
- | User has both CLIs, picks Codex | 🔄 | Interactive prompt or `--provider` flag |
93
- | User has neither CLI | 🔄 | Must print install instructions |
94
- | Re-install after switch from claude → codex | 🔄 | Old `.claude/` must not corrupt `.codex/` |
95
- | Re-install after switch from codex → claude | 🔄 | Old `.codex/` must not corrupt `.claude/` |
96
- | Version upgrade: CLI format unchanged | ✅ | Existing regression suite covers this |
97
- | Version upgrade: provider mismatch | 🔄 | New behavior in SPEA-506 |
98
-
99
- ---
100
-
101
- ## Test Files
102
-
103
- The shell-based test suite was retired in v4.2.0 when the installer
104
- moved to native Node. Coverage is now provided by vitest specs
105
- co-located with the installer source:
106
-
107
- | File | Suite | Covers |
108
- |------|-------|--------|
109
- | `src/installer/commands/init.test.ts` | Install | init flow end-to-end (Claude + Codex) |
110
- | `src/installer/commands/update.test.ts` | Update | update flow + reserved paths + --only |
111
- | `src/installer/commands/doctor.test.ts` | Doctor | health checks against fixture repos |
112
- | `src/installer/cli.test.ts` | CLI | Argument parsing, dispatch, exit codes |
113
- | `src/installer/phases/scaffold.test.ts` | Scaffold | template placement, VPC exclusion |
114
- | `src/installer/phases/manifest.test.ts` | Manifest | sha256 stability, sorted output, exclusions |
115
- | `src/installer/phases/install-config.test.ts` | Config validation | YAML round-trip + validation errors |
116
- | `src/installer/phases/provider-detect.test.ts` | Provider | claude vs codex resolution + Codex coming-soon error |
117
- | `src/installer/phases/prereqs.test.ts` | Prereqs | OSS detection + provider auth |
118
- | `src/installer/__tests__/reserved-paths.test.ts` | Reserved paths | profile + custom-* survival across init/update |
119
-
120
- ---
121
-
122
- ## Acceptance Criteria
123
-
124
- Before SPEA-505 can be merged and released:
125
-
126
- 1. `npm run test` — full vitest suite green (currently 168 specs).
127
- 2. CI matrix `[ubuntu, macos, windows] × [node 20, 22]` all green.
128
- 3. No broken placeholders: `grep -r '{{[A-Z_]*}}' .claude/agents/ .codex/agents/ 2>/dev/null` returns empty.
129
- 4. Skills valid: every `SKILL.md` in `.claude/skills/` has required frontmatter.
130
- 5. Agent TOML valid: every `.toml` in `.codex/agents/` is parseable TOML.
package/docs/updating.md DELETED
@@ -1,89 +0,0 @@
1
- # Updating
2
-
3
- SpecRails includes an update system that pulls new templates while preserving your customizations.
4
-
5
- ## How updates work
6
-
7
- The update system uses a **manifest-based approach**:
8
-
9
- 1. During installation, SpecRails generates `.specrails/specrails-manifest.json` — a checksum of every installed file
10
- 2. On update, the new templates from the latest specrails-core release are re-applied
11
- 3. Reserved paths (`.specrails/profiles/**`, provider-specific `custom-*`
12
- roles, OpenSpec skills, and user MCP entries) are preserved by construction
13
-
14
- ## Running an update
15
-
16
- ```bash
17
- npx specrails-core@latest update
18
- ```
19
-
20
- Cross-platform (macOS, Linux, Windows). No bash, no python required — the installer is native Node since v4.2.0.
21
-
22
- ### What happens
23
-
24
- 1. **Version check** — reads existing `.specrails/specrails-version`; aborts if no specrails install is detected
25
- 2. **Provider resolution** — detects Claude (`.claude/`), Codex (`.codex/`),
26
- Gemini (`.gemini/`), or Kimi (`.kimi-code/`). In a multi-provider workspace,
27
- pass `--provider` to select the tree being refreshed.
28
- 3. **Re-scaffold** — re-applies templates from the latest specrails-core into `.specrails/setup-templates/` and the provider directory
29
- 4. **Reserved paths** — profiles and provider-specific custom roles are skipped;
30
- Kimi also preserves `openspec-*`, unknown skill directories, and existing
31
- `.kimi-code/mcp.json` entries
32
- 5. **Manifest refresh** — rewrites `specrails-manifest.json` and `specrails-version` to the new core version
33
-
34
- ## Selective updates (`--only`)
35
-
36
- The `--only <component>` flag is recognised but currently warns and applies the full scaffold. Granular component selection is tracked as a follow-up — the Node installer's transactional behaviour makes a targeted re-apply almost equivalent to a full one for the common case (core version bump).
37
-
38
- ## Dry run
39
-
40
- ```bash
41
- npx specrails-core@latest update --dry-run
42
- ```
43
-
44
- Prints what the update would do without writing any files. Useful for inspecting `previousVersion → currentVersion` before committing.
45
-
46
- ## What gets preserved
47
-
48
- | File type | Behavior |
49
- |-----------|----------|
50
- | **Agent prompts** (`.claude/agents/sr-*.md`) | Re-written from latest templates |
51
- | **Custom agents** (`.claude/agents/custom-*.md`) | **Always preserved** (reserved path) |
52
- | **Profile JSON** (`.specrails/profiles/**`) | **Always preserved** (reserved path) |
53
- | **Commands** (`.claude/commands/specrails/`) | Re-written |
54
- | **Rules** (`.claude/rules/`) | Re-written from latest templates |
55
- | **Agent memory** (`.claude/agent-memory/`) | Untouched (created on first install only) |
56
- | **install-config.yaml** | Untouched |
57
- | **Kimi workflows** (`.kimi-code/skills/specrails-*`) | Re-written from latest templates |
58
- | **Kimi roles** (`.kimi-code/skills/sr-*`) | Re-written according to the selected agent set |
59
- | **Kimi custom roles** (`.kimi-code/skills/custom-*`) | **Always preserved** |
60
- | **Kimi OpenSpec skills** (`.kimi-code/skills/openspec-*`) | Preserved and normalized from legacy `.kimi/skills` when needed |
61
- | **Kimi MCP config** (`.kimi-code/mcp.json`) | Existing entries preserved; SpecRails-owned entries merged additively |
62
- | **Kimi headless runner** (`.kimi-code/specrails/`) | Runner, vendored YAML parser, MIT license, and provenance notice are re-written together from the latest trusted Core template; they are managed code, not user skills |
63
-
64
- Kimi discovers only immediate child directories of `.kimi-code/skills`.
65
- Updates therefore migrate the pre-release
66
- `.kimi-code/skills/rails/custom-*` layout to direct `custom-*` children when
67
- the destination is free, and regenerate managed `sr-*` roles at the direct
68
- level. If both legacy and direct versions of a custom role exist, neither is
69
- overwritten or deleted: `doctor` reports the conflict for manual resolution.
70
-
71
- ## Rolling back
72
-
73
- The Node installer is idempotent: re-running `init` (or pinning an older version with `npx specrails-core@<version> update`) restores the prior layout. Profile and custom-agent files are reserved, so nothing critical is destroyed by a forward-then-backward sequence.
74
-
75
- If you need a true point-in-time rollback, the recommended path is git: commit before updating, `git checkout` to revert.
76
-
77
- ---
78
-
79
- ## What's next?
80
-
81
- That's the end of the docs. Here are some useful starting points:
82
-
83
- - [Getting Started](getting-started.md) — if you haven't installed yet
84
- - [Workflows & Commands](workflows.md) — to start using the pipeline
85
- - [Customization](customization.md) — to make SpecRails yours
86
-
87
- ---
88
-
89
- [← Customization](customization.md) · [Back to Docs](README.md)