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
package/docs/concepts.md DELETED
@@ -1,183 +0,0 @@
1
- # Core Concepts
2
-
3
- Before diving into commands and agents, it helps to understand the ideas behind SpecRails.
4
-
5
- ## The pipeline
6
-
7
- SpecRails organizes development as a **linear pipeline** where each phase produces artifacts for the next:
8
-
9
- ```
10
- Discovery → Architecture → Implementation → Quality → Ship
11
- ```
12
-
13
- | Phase | Agent | Input | Output |
14
- |-------|-------|-------|--------|
15
- | Discovery | Product Manager | User personas, market research | Feature ideas with VPC scores |
16
- | Architecture | Architect | Feature spec | Design doc + task breakdown |
17
- | Implementation | Developer(s) | Tasks + conventions | Production code |
18
- | Quality | Test Writer → Doc Sync → Security → Reviewer | Code changes | Tests, docs, security report, CI pass |
19
- | Ship | Reviewer | Verified code | Pull Request |
20
-
21
- Each phase has a **dedicated agent** with a narrow scope. Agents don't step on each other — the architect never writes code, the developer never runs CI, the reviewer never designs architecture.
22
-
23
- ## Product-driven development
24
-
25
- Most AI coding tools start from code. SpecRails starts from **users**.
26
-
27
- ### Value Proposition Canvas (VPC)
28
-
29
- Every feature is evaluated against user personas using the [Value Proposition Canvas](https://www.strategyzer.com/library/the-value-proposition-canvas) framework:
30
-
31
- ```
32
- ┌─────────────────────────────────┐
33
- │ Customer Segment │
34
- │ ┌─────────┬────────┬────────┐ │
35
- │ │ Jobs │ Pains │ Gains │ │
36
- │ └─────────┴────────┴────────┘ │
37
- └─────────────────────────────────┘
38
- ↕ fit
39
- ┌─────────────────────────────────┐
40
- │ Value Proposition │
41
- │ ┌─────────┬────────┬────────┐ │
42
- │ │Products │ Pain │ Gain │ │
43
- │ │& Svc │Relievers│Creators│ │
44
- │ └─────────┴────────┴────────┘ │
45
- └─────────────────────────────────┘
46
- ```
47
-
48
- - **Customer Jobs** — what your users need to accomplish (functional, social, emotional)
49
- - **Pains** — frustrations, risks, and obstacles they face
50
- - **Gains** — outcomes and benefits they desire
51
-
52
- Each persona scores features 0–5 on how well they address their needs. Features with high scores across multiple personas get prioritized.
53
-
54
- ### Personas
55
-
56
- During setup, SpecRails generates **user personas** based on competitive research. Each persona has a complete VPC profile. When the Product Manager proposes features, they're evaluated against these personas — not gut feelings.
57
-
58
- See [Customization → Personas](customization.md#personas) for how to edit and add personas.
59
-
60
- ## Agents, not prompts
61
-
62
- SpecRails doesn't use generic prompts. It uses **specialized agents** — each with:
63
-
64
- - A **narrow role** (architect designs, developer codes, reviewer validates)
65
- - A **persistent memory** that grows across sessions
66
- - **Layer-aware conventions** loaded per file path
67
- - A specific **AI model** matched to the task complexity
68
-
69
- This specialization means each agent is optimized for its job. The architect thinks in terms of systems and trade-offs. The developer thinks in terms of implementation patterns. The reviewer thinks in terms of CI pipelines and edge cases.
70
-
71
- See [Agents](agents.md) for the full roster.
72
-
73
- ## OpenSpec
74
-
75
- SpecRails uses [OpenSpec](https://openspec.dev) as its specification system. OpenSpec provides a structured way to go from idea to implementation:
76
-
77
- ```
78
- Spec (source of truth)
79
- └── Change
80
- ├── Proposal — what and why
81
- ├── Design — how (technical approach)
82
- ├── Tasks — ordered implementation steps
83
- ├── Context Bundle — files the developer needs
84
- └── Delta Spec — spec updates after implementation
85
- ```
86
-
87
- The architect reads specs before designing. The developer reads the design before coding. After shipping, the change is archived and the spec is updated.
88
-
89
- This creates a **paper trail** from product decision to shipped code.
90
-
91
- ## Layer conventions
92
-
93
- Different parts of your codebase have different rules. Your backend might use snake_case while your frontend uses camelCase. Your API layer might require OpenAPI annotations while your tests just need clear naming.
94
-
95
- SpecRails detects your **architecture layers** during setup and generates per-layer convention files:
96
-
97
- ```
98
- .claude/rules/
99
- ├── backend.md # Loaded for backend/**
100
- ├── frontend.md # Loaded for frontend/**
101
- └── shared.md # Loaded for shared/**
102
- ```
103
-
104
- Agents automatically load the right conventions based on which files they're modifying. No manual context-switching needed.
105
-
106
- ## Agent memory
107
-
108
- Each agent maintains a **persistent memory** at `.claude/agent-memory/<agent>/MEMORY.md`. This memory survives across sessions, so agents learn from past work:
109
-
110
- - The architect remembers architectural decisions and trade-offs
111
- - The developer remembers patterns and gotchas in your codebase
112
- - The reviewer remembers common CI failures and fixes
113
-
114
- Memory is automatic — agents write observations as they work and read them in future sessions.
115
-
116
- In addition to per-agent memory, two shared directories accumulate institutional knowledge over time:
117
-
118
- ```
119
- .claude/agent-memory/
120
- ├── failures/ # Structured failure records (see Failure Learning Loop)
121
- └── explanations/ # Decision rationale records (see Explanation Recording)
122
- ```
123
-
124
- ## Confidence Scoring
125
-
126
- After every review cycle, the Reviewer outputs a **confidence score** (0–100%) across five quality aspects:
127
-
128
- | Aspect | What it measures |
129
- |--------|-----------------|
130
- | Correctness | Does the implementation match the spec? |
131
- | Test Coverage | Are edge cases and failure modes covered? |
132
- | Security | No secrets, injections, or OWASP vulnerabilities? |
133
- | Performance | No obvious bottlenecks introduced? |
134
- | Maintainability | Is the code readable, consistent, and well-structured? |
135
-
136
- The pipeline behavior at Phase 4b-conf is controlled by `.claude/confidence-config.json`. Scores below the configured threshold can warn, block, or require an explicit override. See [Confidence thresholds](customization.md#confidence-thresholds).
137
-
138
- ## Failure Learning Loop
139
-
140
- When the Reviewer finds a non-trivial issue during Phase 4b, it writes a structured failure record to `.claude/agent-memory/failures/`. Each record captures:
141
-
142
- ```json
143
- {
144
- "error_type": "missing-index",
145
- "root_cause": "Foreign key column added without a corresponding index",
146
- "prevention_rule": "Always create an index for every new foreign key column"
147
- }
148
- ```
149
-
150
- Before starting implementation, the Developer reads matching failure records as **guardrails** — so the same class of mistake is not repeated. Over time this creates an institutional memory of what has gone wrong and how to avoid it.
151
-
152
- ## Explanation Recording
153
-
154
- The Architect, Developer, and Reviewer record **decision rationale** in `.claude/agent-memory/explanations/` as they work. These records capture the "why" behind implementation choices — which library was chosen and why, which trade-off was accepted, which alternative was rejected.
155
-
156
- Use `/specrails:why` to search this memory in plain language:
157
-
158
- ```
159
- /specrails:why "why did we switch to event sourcing"
160
- ```
161
-
162
- This gives you an audit trail from product decision to implementation choice, without digging through git history or asking the original author.
163
-
164
- ## Dependency-Aware Ordering
165
-
166
- When `/specrails:get-backlog-specs` is run, the Product Analyst parses `Prerequisites:` fields from GitHub Issue bodies and builds a **dependency DAG** (directed acyclic graph). It then:
167
-
168
- 1. Detects cycles and reports them as errors (circular dependencies block ordering)
169
- 2. Computes a safe implementation order via topological sort
170
- 3. Presents the top 3 Wave 1 issues — features with no unimplemented prerequisites
171
-
172
- This prevents shipping features that depend on other features not yet built, and makes sprint planning safe by default.
173
-
174
- ## What's next?
175
-
176
- Now that you understand the concepts, meet the agents:
177
-
178
- - [Agents](agents.md) — every agent explained in detail
179
- - [Workflows & Commands](workflows.md) — the commands that orchestrate the pipeline
180
-
181
- ---
182
-
183
- [← Getting Started](getting-started.md) · [Agents →](agents.md)
@@ -1,363 +0,0 @@
1
- # Customization
2
-
3
- Everything SpecRails generates is editable markdown. Here's how to adapt it to your project.
4
-
5
- ## What gets generated
6
-
7
- After running `/specrails:enrich`, your project data lives in `.specrails/` (plugin method) or `.claude/` (scaffold method):
8
-
9
- **Plugin method — `.specrails/`**
10
-
11
- ```
12
- .specrails/
13
- ├── config.yaml # Stack, CI commands, git workflow
14
- ├── personas/ # VPC user personas
15
- ├── rules/ # Per-layer conventions
16
- ├── agent-memory/ # Persistent agent memory
17
- └── pipeline/ # In-flight feature state
18
- ```
19
-
20
- **Scaffold method — `.claude/`**
21
-
22
- ```
23
- .claude/
24
- ├── agents/ # Agent prompts (one per agent)
25
- ├── commands/ # Workflow commands
26
- ├── rules/ # Per-layer conventions
27
- ├── skills/ # OpenSpec skills
28
- ├── agent-memory/ # Persistent agent memory
29
- ├── settings.json # Permissions
30
- └── security-exemptions.yaml
31
- ```
32
-
33
- All files are standard Markdown or YAML. Edit them directly — no special tools needed.
34
-
35
- ## Agents
36
-
37
- Agent prompts live in `.claude/agents/<name>.md`. Each file is the full system prompt for that agent.
38
-
39
- ### Editing an agent
40
-
41
- Open any agent file and modify it. Common customizations:
42
-
43
- - **Add domain knowledge** — tell the architect about your microservice boundaries, or the developer about your ORM patterns
44
- - **Change behavior** — make the reviewer stricter, or the test writer target a different coverage threshold
45
- - **Add constraints** — "never use library X", "always use repository pattern for data access"
46
-
47
- Example — adding a constraint to the developer:
48
-
49
- ```markdown
50
- ## Additional Rules
51
- - Always use the repository pattern for database access
52
- - Never import directly from internal packages — use the public API
53
- ```
54
-
55
- ### Agent model selection
56
-
57
- Agent models are controlled by `.specrails/agents.yaml`, generated automatically when you first run `/specrails:enrich`. The model preset can also be set ahead of time in `.specrails/install-config.yaml` (written by the TUI installer).
58
-
59
- ```yaml
60
- # specrails agent configuration
61
- # Valid models: opus, sonnet, haiku
62
-
63
- defaults:
64
- model: sonnet
65
-
66
- agents:
67
- sr-architect:
68
- model: sonnet
69
- sr-product-manager:
70
- model: opus
71
- sr-product-analyst:
72
- model: haiku
73
- # ... all 14 agents listed
74
- ```
75
-
76
- **Valid models:**
77
- - `opus` — best for creative/strategic tasks (Product Manager)
78
- - `sonnet` — balanced for implementation tasks (most agents)
79
- - `haiku` — fast and cheap for analysis tasks (Product Analyst)
80
-
81
- **Precedence rules:**
82
- 1. Per-agent entry in `agents:` section overrides everything
83
- 2. `defaults.model` applies to any agent not explicitly listed
84
- 3. Template hard-coded value is the fallback when no config exists
85
-
86
- **Applying config changes:** After editing `.specrails/agents.yaml`, run `/specrails:reconfig` to update the generated agent files without re-running the full setup wizard:
87
-
88
- ```
89
- /specrails:reconfig
90
- ```
91
-
92
- Output example:
93
- ```
94
- Updated 1 agent(s):
95
- sr-developer: sonnet → opus
96
-
97
- Unchanged (13): sr-architect, sr-reviewer, ...
98
- ```
99
-
100
- **Important:** `/specrails:reconfig` wins over direct edits to `.claude/agents/sr-*.md`. If you edit an agent file directly, that change will be overwritten the next time you run reconfig or setup. For permanent per-agent overrides, edit `.specrails/agents.yaml` instead.
101
-
102
- ### Adding a new agent
103
-
104
- Create a new file in `.claude/agents/`:
105
-
106
- ```markdown
107
- ---
108
- model: sonnet
109
- ---
110
-
111
- # My Custom Agent
112
-
113
- You are a specialized agent for [your purpose].
114
-
115
- ## Role
116
- [What this agent does]
117
-
118
- ## Rules
119
- [What this agent must follow]
120
- ```
121
-
122
- Reference it from a command using the Agent tool with `subagent_type: "your-agent-name"`.
123
-
124
- ---
125
-
126
- ## Layer conventions
127
-
128
- Convention files live in `.claude/rules/<layer>.md`. They're loaded automatically based on file paths.
129
-
130
- ### How rules are scoped
131
-
132
- Each rule file has a `paths` field in its frontmatter:
133
-
134
- ```yaml
135
- ---
136
- paths:
137
- - "backend/**"
138
- ---
139
- ```
140
-
141
- When an agent modifies a file matching `backend/**`, this rule is automatically loaded into its context. No manual loading needed.
142
-
143
- ### Editing conventions
144
-
145
- Add or modify rules for any layer:
146
-
147
- ```markdown
148
- ---
149
- paths:
150
- - "src/api/**"
151
- ---
152
-
153
- # API Layer Conventions
154
-
155
- - All endpoints must return JSON with `{ data, error, meta }` envelope
156
- - Use middleware for authentication — never check tokens in handlers
157
- - Rate limiting is handled at the gateway level — don't implement it per-endpoint
158
- - Error responses must include a machine-readable `code` field
159
- ```
160
-
161
- ### Adding a new layer
162
-
163
- Create a new file in `.claude/rules/`:
164
-
165
- ```markdown
166
- ---
167
- paths:
168
- - "infrastructure/**"
169
- ---
170
-
171
- # Infrastructure Conventions
172
-
173
- - Use Terraform for all cloud resources
174
- - Never hardcode region or account IDs
175
- - All resources must be tagged with `team` and `environment`
176
- ```
177
-
178
- ---
179
-
180
- ## Personas
181
-
182
- Persona files live in `.claude/agents/` (generated during setup). Each persona is a complete VPC profile used for feature evaluation.
183
-
184
- ### Editing a persona
185
-
186
- Personas have three key sections for feature scoring:
187
-
188
- ```markdown
189
- ### Customer Jobs
190
- | Type | Job |
191
- |------|-----|
192
- | Functional | Deploy changes without downtime |
193
- | Social | Be seen as technically competent by the team |
194
- | Emotional | Feel confident that deploys won't break production |
195
-
196
- ### Pains
197
- | Severity | Pain |
198
- |----------|------|
199
- | High | Manual deploys take 2+ hours |
200
- | Medium | Rollback process is undocumented |
201
-
202
- ### Gains
203
- | Impact | Gain |
204
- |--------|------|
205
- | High | Zero-downtime deployments |
206
- | Medium | Automated rollback on failure |
207
- ```
208
-
209
- Edit jobs, pains, and gains to match your actual users. The more accurate these are, the better the Product Manager's recommendations.
210
-
211
- ### Adding a persona
212
-
213
- Create a new persona file following the template structure. Include:
214
-
215
- 1. **Profile** — name, role, age range, behaviors
216
- 2. **Customer Jobs** — functional, social, and emotional jobs
217
- 3. **Pains** — graded by severity (High/Medium/Low)
218
- 4. **Gains** — graded by impact (High/Medium/Low)
219
- 5. **Key Insight** — the single most important unmet need
220
-
221
- ---
222
-
223
- ## Confidence thresholds
224
-
225
- The confidence gate at Phase 4b-conf is controlled by `.claude/confidence-config.json`:
226
-
227
- ```json
228
- {
229
- "thresholds": {
230
- "overall": 80,
231
- "correctness": 85,
232
- "test_coverage": 75,
233
- "security": 90,
234
- "performance": 70,
235
- "maintainability": 75
236
- },
237
- "on_failure": "block"
238
- }
239
- ```
240
-
241
- | `on_failure` value | Behavior |
242
- |--------------------|---------|
243
- | `"block"` | Pipeline stops; fix required before PR creation |
244
- | `"warn"` | Pipeline continues; warning added to PR description |
245
- | `"override"` | Always continue regardless of score |
246
-
247
- Adjust thresholds per aspect to match your team's quality bar. Set `"on_failure": "warn"` during initial rollout if you want visibility without blocking.
248
-
249
- ---
250
-
251
- ## Layer reviewers
252
-
253
- The Frontend Reviewer and Backend Reviewer agents live in `.claude/agents/`:
254
-
255
- - `.claude/agents/frontend-reviewer.md`
256
- - `.claude/agents/backend-reviewer.md`
257
-
258
- Customize them the same way as any other agent — add domain-specific checks, change what's flagged as a finding, or adjust severity thresholds.
259
-
260
- Example — adding a project-specific frontend rule:
261
-
262
- ```markdown
263
- ## Additional Checks
264
- - Flag any component that fetches data directly (use React Query hooks instead)
265
- - Warn on inline styles with more than 3 properties (extract to CSS module)
266
- ```
267
-
268
- Both agents run in parallel during Phase 4b and feed their findings into the generalist Reviewer's final report.
269
-
270
- ---
271
-
272
- ## Backwards compatibility baseline
273
-
274
- Use `/specrails:compat-check --save` to snapshot your current API surface as a baseline:
275
-
276
- ```
277
- /specrails:compat-check --save
278
- ```
279
-
280
- This writes the current API surface to `.claude/compat-baseline.json`. Future runs of `/specrails:compat-check` and the Architect's Phase 6 auto-check compare against this baseline to detect breaking changes. Re-run `--save` after any intentional breaking release to advance the baseline.
281
-
282
- ---
283
-
284
- ## Security exemptions
285
-
286
- The Security Reviewer can produce false positives. Suppress known safe patterns in `.claude/security-exemptions.yaml`:
287
-
288
- ```yaml
289
- exemptions:
290
- - pattern: "NEXT_PUBLIC_.*"
291
- reason: "Next.js public env vars are intentionally client-exposed"
292
- - file: "tests/fixtures/mock-keys.json"
293
- reason: "Test fixtures with fake keys"
294
- - severity_override:
295
- pattern: "console\\.log"
296
- from: "medium"
297
- to: "info"
298
- reason: "Dev-only logging, stripped in production build"
299
- ```
300
-
301
- ---
302
-
303
- ## Settings
304
-
305
- `.claude/settings.json` controls tool permissions:
306
-
307
- ```json
308
- {
309
- "permissions": {
310
- "allow": [
311
- "Read", "Write", "Edit",
312
- "Glob", "Grep", "Agent",
313
- "Skill", "ToolSearch"
314
- ]
315
- }
316
- }
317
- ```
318
-
319
- Add or remove tools to control what agents can do. The update system preserves your permission customizations when pulling new versions.
320
-
321
- ---
322
-
323
- ## Agent memory
324
-
325
- Agent memory at `.claude/agent-memory/<agent>/MEMORY.md` is automatic but editable.
326
-
327
- ### Clearing memory
328
-
329
- Delete entries from an agent's `MEMORY.md` to reset specific knowledge:
330
-
331
- ```bash
332
- # Clear all architect memory
333
- > .claude/agent-memory/architect/MEMORY.md
334
-
335
- # Or edit selectively
336
- code .claude/agent-memory/architect/MEMORY.md
337
- ```
338
-
339
- ### Seeding memory
340
-
341
- Pre-populate agent memory with project knowledge:
342
-
343
- ```markdown
344
- # Memory Index
345
-
346
- ## Architecture decisions
347
- - [adr-001.md](adr-001.md) — We use event sourcing for the order domain
348
-
349
- ## Known gotchas
350
- - [gotcha-db.md](gotcha-db.md) — PostgreSQL connection pool maxes at 20 in dev
351
- ```
352
-
353
- This is useful when onboarding SpecRails to a complex project.
354
-
355
- ---
356
-
357
- ## What's next?
358
-
359
- - [Updating](updating.md) — keep SpecRails up to date without losing your customizations
360
-
361
- ---
362
-
363
- [← Workflows & Commands](workflows.md) · [Updating →](updating.md)