specrails-core 4.11.2 → 4.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +56 -20
  2. package/bin/specrails-core.mjs +343 -20
  3. package/bin/tui-installer.mjs +103 -52
  4. package/dist/installer/cli.js +1 -1
  5. package/dist/installer/cli.js.map +1 -1
  6. package/dist/installer/commands/doctor.js +486 -24
  7. package/dist/installer/commands/doctor.js.map +1 -1
  8. package/dist/installer/commands/framework.js +49 -7
  9. package/dist/installer/commands/framework.js.map +1 -1
  10. package/dist/installer/commands/init.js +423 -25
  11. package/dist/installer/commands/init.js.map +1 -1
  12. package/dist/installer/commands/update.js +36 -9
  13. package/dist/installer/commands/update.js.map +1 -1
  14. package/dist/installer/phases/framework-lifecycle.js +125 -0
  15. package/dist/installer/phases/framework-lifecycle.js.map +1 -0
  16. package/dist/installer/phases/install-config.js +157 -5
  17. package/dist/installer/phases/install-config.js.map +1 -1
  18. package/dist/installer/phases/manifest.js +27 -2
  19. package/dist/installer/phases/manifest.js.map +1 -1
  20. package/dist/installer/phases/prereqs.js +57 -2
  21. package/dist/installer/phases/prereqs.js.map +1 -1
  22. package/dist/installer/phases/provider-detect.js +116 -6
  23. package/dist/installer/phases/provider-detect.js.map +1 -1
  24. package/dist/installer/phases/scaffold.js +1222 -12
  25. package/dist/installer/phases/scaffold.js.map +1 -1
  26. package/dist/installer/runtime/kimi.js +255 -0
  27. package/dist/installer/runtime/kimi.js.map +1 -0
  28. package/dist/installer/util/paths.js +12 -0
  29. package/dist/installer/util/paths.js.map +1 -1
  30. package/dist/installer/util/registry.js +234 -14
  31. package/dist/installer/util/registry.js.map +1 -1
  32. package/docs/README.md +1 -0
  33. package/docs/deployment.md +6 -7
  34. package/docs/getting-started.md +11 -7
  35. package/docs/installation.md +34 -16
  36. package/docs/plugin-architecture.md +11 -8
  37. package/docs/updating.md +21 -3
  38. package/docs/user-docs/cli-reference.md +43 -22
  39. package/docs/user-docs/codex-vs-claude-code.md +11 -9
  40. package/docs/user-docs/faq.md +1 -1
  41. package/docs/user-docs/getting-started-codex.md +5 -8
  42. package/docs/user-docs/getting-started-kimi.md +423 -0
  43. package/docs/user-docs/installation.md +49 -14
  44. package/docs/user-docs/quick-start.md +11 -8
  45. package/docs/windows.md +29 -4
  46. package/integration-contract.json +85 -13
  47. package/package.json +9 -5
  48. package/schemas/profile.v1.json +67 -5
  49. package/templates/codex-skills/batch-implement/SKILL.md +4 -0
  50. package/templates/commands/specrails/batch-implement.md +11 -0
  51. package/templates/gemini-commands/batch-implement.toml +4 -0
  52. package/templates/kimi/specrails/run-skill.mjs +3005 -0
  53. package/templates/kimi/specrails/vendor/js-yaml/LICENSE +21 -0
  54. package/templates/kimi/specrails/vendor/js-yaml/NOTICE.md +16 -0
  55. package/templates/kimi/specrails/vendor/js-yaml/js-yaml.mjs +3856 -0
  56. package/templates/profiles/kimi-default.json +15 -0
package/docs/updating.md CHANGED
@@ -8,7 +8,8 @@ The update system uses a **manifest-based approach**:
8
8
 
9
9
  1. During installation, SpecRails generates `.specrails/specrails-manifest.json` — a checksum of every installed file
10
10
  2. On update, the new templates from the latest specrails-core release are re-applied
11
- 3. Reserved paths (`.specrails/profiles/**`, `.claude/agents/custom-*.md`) are preserved by construction — the installer never touches them
11
+ 3. Reserved paths (`.specrails/profiles/**`, provider-specific `custom-*`
12
+ roles, OpenSpec skills, and user MCP entries) are preserved by construction
12
13
 
13
14
  ## Running an update
14
15
 
@@ -21,9 +22,13 @@ Cross-platform (macOS, Linux, Windows). No bash, no python required — the inst
21
22
  ### What happens
22
23
 
23
24
  1. **Version check** — reads existing `.specrails/specrails-version`; aborts if no specrails install is detected
24
- 2. **Provider resolution** — detects whether the project uses Claude (`.claude/`) or Codex (`.codex/`)
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.
25
28
  3. **Re-scaffold** — re-applies templates from the latest specrails-core into `.specrails/setup-templates/` and the provider directory
26
- 4. **Reserved paths** — `.specrails/profiles/**` and `.claude/agents/custom-*.md` are skipped; your team profiles and custom agents survive untouched
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
27
32
  5. **Manifest refresh** — rewrites `specrails-manifest.json` and `specrails-version` to the new core version
28
33
 
29
34
  ## Selective updates (`--only`)
@@ -49,6 +54,19 @@ Prints what the update would do without writing any files. Useful for inspecting
49
54
  | **Rules** (`.claude/rules/`) | Re-written from latest templates |
50
55
  | **Agent memory** (`.claude/agent-memory/`) | Untouched (created on first install only) |
51
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.
52
70
 
53
71
  ## Rolling back
54
72
 
@@ -1,14 +1,14 @@
1
1
  # CLI Reference
2
2
 
3
- > **🧪 Codex (OpenAI) Support — Coming Soon (in Lab).** Codex-specific sections below describe the planned behaviour. Codex installation is currently disabled — only Claude Code is available today.
4
-
5
- SpecRails commands are implemented as Skills (`SKILL.md` format) and are designed to run in both Claude Code and Codex. The command syntax is identical on both platforms. Today only the Claude Code runtime is available; Codex support is being tested in our lab and will ship shortly.
3
+ SpecRails installs provider-native workflows for Claude Code, Codex CLI,
4
+ Gemini CLI, and Kimi Code. The workflow names and flags are shared, while each
5
+ provider uses its own activation syntax and project directory.
6
6
 
7
7
  **Platform support key used in this reference:**
8
8
 
9
9
  | Badge | Meaning |
10
10
  |-------|---------|
11
- | ✅ Both | Works in Claude Code and Codex |
11
+ | ✅ Providers | Works in Claude Code, Codex CLI, Gemini CLI, and Kimi Code |
12
12
  | 🔵 Claude Code | Claude Code only |
13
13
  | ⚠️ Limited | Works, but with known limitations (see notes) |
14
14
 
@@ -17,13 +17,20 @@ Run commands inside your AI CLI from your project directory:
17
17
  ```bash
18
18
  claude # Claude Code
19
19
  codex # Codex
20
+ gemini # Gemini CLI
21
+ kimi # Kimi Code
20
22
  ```
21
23
 
24
+ Claude and Gemini use `/specrails:<command>`. Codex activates the generated
25
+ skill from `.codex/skills/`. Kimi's interactive TUI uses
26
+ `/skill:specrails-<command>`; headless Kimi runs must use the managed
27
+ `.kimi-code/specrails/run-skill.mjs` helper, not a literal `/skill:` prompt.
28
+
22
29
  ---
23
30
 
24
31
  ## Core workflow
25
32
 
26
- ### `/specrails:implement` ✅ Both
33
+ ### `/specrails:implement` ✅ Providers
27
34
 
28
35
  Implement a feature through the full agent pipeline: design → code → tests → docs → review → PR.
29
36
 
@@ -62,10 +69,15 @@ A single issue runs sequentially on the current branch. Multiple issues run in p
62
69
 
63
70
  ---
64
71
 
65
- ### `/specrails:telemetry` ✅ Both
72
+ ### `/specrails:telemetry` ✅ Providers
66
73
 
67
74
  Inspect per-agent execution metrics: token usage, estimated API cost, run count, average duration, and success/failure rate.
68
75
 
76
+ Kimi reads persisted `usage.record` events for real input/output/cache token
77
+ counts and session duration. Its logs do not contain an authoritative USD rate
78
+ or role outcome, so the Kimi dashboard reports cost and success rate as
79
+ unavailable instead of applying another provider's rate card.
80
+
69
81
  ```
70
82
  /specrails:telemetry
71
83
  /specrails:telemetry --period today
@@ -81,11 +93,11 @@ Inspect per-agent execution metrics: token usage, estimated API cost, run count,
81
93
  | `--period <filter>` | Time window: `today`, `week` (default), or `all` |
82
94
  | `--agent <name>` | Focus on a single agent (e.g. `sr-developer`) |
83
95
  | `--format <fmt>` | Output format: `markdown` (default) or `json` |
84
- | `--save` | Write a snapshot to `.claude/telemetry/` after display |
96
+ | `--save` | Write a snapshot under the active provider directory after display |
85
97
 
86
98
  ---
87
99
 
88
- ### `/specrails:merge-resolve` ✅ Both
100
+ ### `/specrails:merge-resolve` ✅ Providers
89
101
 
90
102
  Resolve git conflict markers using AI-powered context analysis.
91
103
 
@@ -107,7 +119,7 @@ Reads OpenSpec context bundles from the features that produced each conflict, in
107
119
 
108
120
  ---
109
121
 
110
- ### `/specrails:retry` ✅ Both
122
+ ### `/specrails:retry` ✅ Providers
111
123
 
112
124
  Resume a failed `/specrails:implement` run from the last successful phase.
113
125
 
@@ -128,7 +140,7 @@ Resume a failed `/specrails:implement` run from the last successful phase.
128
140
 
129
141
  **Valid `--from` values:** `architect`, `developer`, `test-writer`, `doc-sync`, `reviewer`, `ship`, `ci`
130
142
 
131
- Pipeline state is saved to `.claude/pipeline-state/<feature-name>.json` after each phase.
143
+ Pipeline state is saved under the active provider directory after each phase.
132
144
 
133
145
  ---
134
146
 
@@ -148,7 +160,7 @@ Each feature gets its own worktree, its own agent pipeline, and its own PR. Use
148
160
 
149
161
  ## Product and backlog
150
162
 
151
- ### `/specrails:get-backlog-specs` ✅ Both
163
+ ### `/specrails:get-backlog-specs` ✅ Providers
152
164
 
153
165
  View your prioritized product backlog, ranked by VPC persona fit and estimated effort.
154
166
 
@@ -161,7 +173,7 @@ Reads GitHub Issues labeled `product-driven-backlog`. Produces a ranked table pe
161
173
 
162
174
  ---
163
175
 
164
- ### `/specrails:auto-propose-backlog-specs` ✅ Both
176
+ ### `/specrails:auto-propose-backlog-specs` ✅ Providers
165
177
 
166
178
  Generate new feature ideas through product discovery and create GitHub Issues.
167
179
 
@@ -176,7 +188,7 @@ The Product Manager researches your competitive landscape, generates 2–4 featu
176
188
 
177
189
  ## Analysis and inspection
178
190
 
179
- ### `/specrails:refactor-recommender` ✅ Both
191
+ ### `/specrails:refactor-recommender` ✅ Providers
180
192
 
181
193
  Scan the codebase for refactoring opportunities, ranked by impact/effort ratio.
182
194
 
@@ -188,7 +200,7 @@ Identifies duplicates, overly long functions, large files, dead code, outdated p
188
200
 
189
201
  ---
190
202
 
191
- ### `/specrails:compat-check` ✅ Both
203
+ ### `/specrails:compat-check` ✅ Providers
192
204
 
193
205
  Analyze the backwards-compatibility impact of a proposed change.
194
206
 
@@ -205,7 +217,7 @@ The Architect runs this automatically as part of every `/specrails:implement` pi
205
217
 
206
218
  ---
207
219
 
208
- ### `/specrails:why` ✅ Both
220
+ ### `/specrails:why` ✅ Providers
209
221
 
210
222
  Search agent explanation records in plain language.
211
223
 
@@ -215,11 +227,13 @@ Search agent explanation records in plain language.
215
227
  /specrails:why "why is pagination implemented this way"
216
228
  ```
217
229
 
218
- Agents write decision rationale to `.claude/agent-memory/explanations/` as they work. `/specrails:why` searches these records semantically. Useful for onboarding, code review, and revisiting past decisions.
230
+ Agents write decision rationale under the active provider's `agent-memory/`
231
+ directory as they work. `/specrails:why` searches these records semantically.
232
+ Useful for onboarding, code review, and revisiting past decisions.
219
233
 
220
234
  ---
221
235
 
222
- ### `/specrails:vpc-drift` ✅ Both
236
+ ### `/specrails:vpc-drift` ✅ Providers
223
237
 
224
238
  Detect when your VPC personas have drifted from what your product actually delivers.
225
239
 
@@ -234,7 +248,7 @@ Compares persona Jobs/Pains/Gains against your backlog, implemented features, an
234
248
 
235
249
  ---
236
250
 
237
- ### `/specrails:memory-inspect` ✅ Both
251
+ ### `/specrails:memory-inspect` ✅ Providers
238
252
 
239
253
  Inspect and clean up agent memory directories.
240
254
 
@@ -252,11 +266,18 @@ Inspect and clean up agent memory directories.
252
266
  | `--stale <days>` | Flag files older than N days |
253
267
  | `--prune` | Delete stale files (prompts for confirmation) |
254
268
 
255
- Agent memory lives in `.claude/agent-memory/sr-*/` (Claude Code) or `.codex/agent-memory/sr-*/` (Codex).
269
+ Agent memory lives below the provider root:
270
+
271
+ | Provider | Memory root |
272
+ |----------|-------------|
273
+ | Claude Code | `.claude/agent-memory/` |
274
+ | Codex CLI | `.codex/agent-memory/` |
275
+ | Gemini CLI | `.gemini/agent-memory/` |
276
+ | Kimi Code | `.kimi-code/agent-memory/` |
256
277
 
257
278
  ---
258
279
 
259
- ### `/specrails:propose-spec` ✅ Both
280
+ ### `/specrails:propose-spec` ✅ Providers
260
281
 
261
282
  Explore a feature idea and produce a structured proposal ready for the OpenSpec pipeline.
262
283
 
@@ -272,7 +293,7 @@ Produces: problem statement, proposed solution, out-of-scope items, acceptance c
272
293
 
273
294
  OpenSpec is the structured design-to-code workflow. Use these commands when you want explicit control over each artifact: proposal → design → tasks → implementation.
274
295
 
275
- All OpenSpec commands work on both Claude Code and Codex (✅ Both).
296
+ OpenSpec commands are generated for all four providers (✅ Providers).
276
297
 
277
298
  ### `/opsx:ff` — Fast Forward
278
299
 
@@ -400,7 +421,7 @@ The `npx specrails-core@latest init` command accepts:
400
421
  |------|--------|
401
422
  | `--root-dir <path>` | Install into this directory (default: current directory) |
402
423
  | `--yes` / `-y` | Skip confirmation prompts |
403
- | `--provider <claude\|codex>` | Force a specific AI CLI (default: auto-detect) |
424
+ | `--provider <claude\|codex\|gemini\|kimi>` | Force a specific AI CLI (default: auto-detect) |
404
425
 
405
426
  ---
406
427
 
@@ -1,10 +1,8 @@
1
1
  # Codex vs Claude Code
2
2
 
3
- > # 🧪 Codex Support Coming Soon (in Lab)
4
- >
5
- > OpenAI Codex integration is currently being **tested in our lab** and is not available for installation. The installer only accepts Claude Code at this time. This document describes the planned behaviour and will be activated when the feature ships.
6
-
7
- SpecRails supports **Anthropic Claude Code** as an AI agent runtime, with **OpenAI Codex** support coming soon. This page explains the differences so you can choose the right setup for your team when Codex ships.
3
+ SpecRails supports both **Anthropic Claude Code** and **OpenAI Codex** as AI
4
+ agent runtimes. Gemini CLI and Kimi Code are also supported; this page focuses
5
+ only on the Claude/Codex comparison.
8
6
 
9
7
  ---
10
8
 
@@ -12,7 +10,7 @@ SpecRails supports **Anthropic Claude Code** as an AI agent runtime, with **Open
12
10
 
13
11
  | | Claude Code | Codex |
14
12
  |--|-------------|-------|
15
- | **Support status** | Stable | Beta |
13
+ | **Support status** | Supported | Supported |
16
14
  | **CLI** | `claude` | `codex` |
17
15
  | **Config directory** | `.claude/` | `.codex/` |
18
16
  | **Agent instructions** | `CLAUDE.md` | `AGENTS.md` |
@@ -113,7 +111,11 @@ Skills themselves are the same — only the CLI invocation differs.
113
111
  - Different team members use different tools
114
112
  - You want to benchmark agents across platforms
115
113
 
116
- When both CLIs are installed, the SpecRails installer detects which is active. You can override with `CLI_PROVIDER=claude` or `CLI_PROVIDER=codex`.
114
+ When several CLIs are installed, pass `--provider` to choose explicitly:
115
+
116
+ ```bash
117
+ npx specrails-core@latest init --provider codex
118
+ ```
117
119
 
118
120
  ---
119
121
 
@@ -129,8 +131,8 @@ Generating config in .codex/
129
131
  To override:
130
132
 
131
133
  ```bash
132
- CLI_PROVIDER=codex npx specrails-core@latest init --root-dir .
133
- CLI_PROVIDER=claude npx specrails-core@latest init --root-dir .
134
+ npx specrails-core@latest init --provider codex --root-dir .
135
+ npx specrails-core@latest init --provider claude --root-dir .
134
136
  ```
135
137
 
136
138
  ---
@@ -12,7 +12,7 @@ The plugin method (`claude plugin install sr`) installs logic into Claude Code's
12
12
 
13
13
  **Do I need Node.js if my project is not JavaScript?**
14
14
 
15
- Not for the plugin method (`claude plugin install sr`). Node.js 20+ is only required for the scaffold method (`npx specrails-core@latest init`). Once installed, SpecRails works with any language or framework, on macOS, Linux, or Windows.
15
+ Not for the plugin method (`claude plugin install sr`). Node.js 20.19.0+ is only required for the scaffold method (`npx specrails-core@latest init`), because its pinned OpenSpec 1.4.1 CLI uses that runtime floor. Once installed, SpecRails works with any language or framework, on macOS, Linux, or Windows.
16
16
 
17
17
  **Do I need GitHub Issues?**
18
18
 
@@ -1,12 +1,9 @@
1
1
  # Getting Started with SpecRails + Codex
2
2
 
3
- > # 🧪 Coming Soon Currently in Lab
4
- >
5
- > **OpenAI Codex support is being tested in our lab and is not yet available for installation.** The installer will refuse to install Codex and will ask you to use Claude Code. This document describes the planned behaviour and will be activated when the feature ships.
6
- >
7
- > **Current status:** Preview / documentation only. For now, use [Claude Code](https://claude.ai/download) — see the [standard installation guide](installation.md).
8
-
9
- This guide gets you running SpecRails using OpenAI Codex as your AI agent. If you are using Claude Code instead, see the [standard installation guide](installation.md).
3
+ This guide gets you running SpecRails using OpenAI Codex as your AI agent.
4
+ Claude Code, Gemini CLI, and Kimi Code are also supported; see the
5
+ [standard installation guide](installation.md) or the
6
+ [Kimi-specific guide](getting-started-kimi.md).
10
7
 
11
8
  ---
12
9
 
@@ -14,7 +11,7 @@ This guide gets you running SpecRails using OpenAI Codex as your AI agent. If yo
14
11
 
15
12
  | Tool | Version | Notes |
16
13
  |------|---------|-------|
17
- | **Node.js** | 18+ | Required for the installer |
14
+ | **Node.js** | 20.19.0+ | Required for the installer and pinned OpenSpec 1.4.1 CLI |
18
15
  | **Codex CLI** | Latest | `npm i -g @openai/codex` |
19
16
  | **Git** | Any | Your project must be a git repository |
20
17