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.
- package/README.md +56 -20
- package/bin/specrails-core.mjs +343 -20
- package/bin/tui-installer.mjs +103 -52
- package/dist/installer/cli.js +1 -1
- package/dist/installer/cli.js.map +1 -1
- package/dist/installer/commands/doctor.js +486 -24
- package/dist/installer/commands/doctor.js.map +1 -1
- package/dist/installer/commands/framework.js +49 -7
- package/dist/installer/commands/framework.js.map +1 -1
- package/dist/installer/commands/init.js +423 -25
- package/dist/installer/commands/init.js.map +1 -1
- package/dist/installer/commands/update.js +36 -9
- package/dist/installer/commands/update.js.map +1 -1
- package/dist/installer/phases/framework-lifecycle.js +125 -0
- package/dist/installer/phases/framework-lifecycle.js.map +1 -0
- package/dist/installer/phases/install-config.js +157 -5
- package/dist/installer/phases/install-config.js.map +1 -1
- package/dist/installer/phases/manifest.js +27 -2
- package/dist/installer/phases/manifest.js.map +1 -1
- package/dist/installer/phases/prereqs.js +57 -2
- package/dist/installer/phases/prereqs.js.map +1 -1
- package/dist/installer/phases/provider-detect.js +116 -6
- package/dist/installer/phases/provider-detect.js.map +1 -1
- package/dist/installer/phases/scaffold.js +1222 -12
- package/dist/installer/phases/scaffold.js.map +1 -1
- package/dist/installer/runtime/kimi.js +255 -0
- package/dist/installer/runtime/kimi.js.map +1 -0
- package/dist/installer/util/paths.js +12 -0
- package/dist/installer/util/paths.js.map +1 -1
- package/dist/installer/util/registry.js +234 -14
- package/dist/installer/util/registry.js.map +1 -1
- package/docs/README.md +1 -0
- package/docs/deployment.md +6 -7
- package/docs/getting-started.md +11 -7
- package/docs/installation.md +34 -16
- package/docs/plugin-architecture.md +11 -8
- package/docs/updating.md +21 -3
- package/docs/user-docs/cli-reference.md +43 -22
- package/docs/user-docs/codex-vs-claude-code.md +11 -9
- package/docs/user-docs/faq.md +1 -1
- package/docs/user-docs/getting-started-codex.md +5 -8
- package/docs/user-docs/getting-started-kimi.md +423 -0
- package/docs/user-docs/installation.md +49 -14
- package/docs/user-docs/quick-start.md +11 -8
- package/docs/windows.md +29 -4
- package/integration-contract.json +85 -13
- package/package.json +9 -5
- package/schemas/profile.v1.json +67 -5
- package/templates/codex-skills/batch-implement/SKILL.md +4 -0
- package/templates/commands/specrails/batch-implement.md +11 -0
- package/templates/gemini-commands/batch-implement.toml +4 -0
- package/templates/kimi/specrails/run-skill.mjs +3005 -0
- package/templates/kimi/specrails/vendor/js-yaml/LICENSE +21 -0
- package/templates/kimi/specrails/vendor/js-yaml/NOTICE.md +16 -0
- package/templates/kimi/specrails/vendor/js-yaml/js-yaml.mjs +3856 -0
- package/templates/profiles/kimi-default.json +15 -0
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
# Getting Started with SpecRails + Kimi Code
|
|
2
|
+
|
|
3
|
+
SpecRails supports Kimi Code as an independent AI provider. The integration
|
|
4
|
+
uses the installed `kimi` CLI in non-interactive prompt mode; it does not embed
|
|
5
|
+
Kimi Code, start `kimi web`, or require a SpecRails-owned server.
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
| Tool | Version | Purpose |
|
|
10
|
+
|------|---------|---------|
|
|
11
|
+
| Kimi Code | 0.27.0 or newer | Agentic runtime |
|
|
12
|
+
| Node.js | 20.19.0 or newer | Runs the SpecRails installer and pinned OpenSpec 1.4.1 CLI |
|
|
13
|
+
| Git | 2.25 or newer | Repository and worktree operations |
|
|
14
|
+
|
|
15
|
+
Install Kimi Code using an official method:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# macOS / Linux
|
|
19
|
+
curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
```powershell
|
|
23
|
+
# Windows PowerShell
|
|
24
|
+
irm https://code.kimi.com/kimi-code/install.ps1 | iex
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The optional npm distribution is `@moonshot-ai/kimi-code` and requires the
|
|
28
|
+
Node.js version documented by Kimi Code (22.19 or newer at the time this
|
|
29
|
+
integration was implemented). The standalone installer is preferable when the
|
|
30
|
+
project itself may remain on Node 20.19.0 or newer.
|
|
31
|
+
|
|
32
|
+
Verify the executable and authenticate once:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
kimi --version
|
|
36
|
+
kimi login
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
SpecRails checks installation and version without sending a model prompt. Kimi
|
|
40
|
+
does not expose a non-billing command that conclusively proves every OAuth
|
|
41
|
+
session is usable, so an inconclusive auth probe is allowed and the first real
|
|
42
|
+
invocation will surface any login error.
|
|
43
|
+
|
|
44
|
+
## Install SpecRails
|
|
45
|
+
|
|
46
|
+
From the repository that should receive SpecRails:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npx specrails-core@latest init --root-dir . --provider kimi
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
For a quick, template-only install:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npx specrails-core@latest init --root-dir . --provider kimi --quick
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Without `--provider`, automatic selection preserves the established priority:
|
|
59
|
+
Claude, Codex, Gemini, then Kimi. Pass `--provider kimi` when several CLIs are
|
|
60
|
+
installed and Kimi is the intended runtime.
|
|
61
|
+
|
|
62
|
+
## Generated Kimi layout
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
.kimi-code/
|
|
66
|
+
├── AGENTS.md
|
|
67
|
+
├── mcp.json
|
|
68
|
+
├── personas/
|
|
69
|
+
├── rules/
|
|
70
|
+
├── specrails/
|
|
71
|
+
│ ├── run-skill.mjs
|
|
72
|
+
│ └── vendor/js-yaml/
|
|
73
|
+
│ ├── js-yaml.mjs
|
|
74
|
+
│ ├── LICENSE
|
|
75
|
+
│ └── NOTICE.md
|
|
76
|
+
└── skills/
|
|
77
|
+
├── specrails-enrich/SKILL.md
|
|
78
|
+
├── specrails-implement/SKILL.md
|
|
79
|
+
├── specrails-…/SKILL.md
|
|
80
|
+
├── openspec-…/SKILL.md
|
|
81
|
+
├── sr-architect/SKILL.md
|
|
82
|
+
├── sr-developer/SKILL.md
|
|
83
|
+
└── …
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Kimi's skill loader inspects each immediate child of `.kimi-code/skills`; it
|
|
87
|
+
does not recursively discover grouping directories. SpecRails therefore gives
|
|
88
|
+
every workflow (`specrails-*`), OpenSpec workflow (`openspec-*`), managed role
|
|
89
|
+
(`sr-*`), and custom role (`custom-*`) its own direct-child directory.
|
|
90
|
+
Non-invocable persona data lives separately under `.kimi-code/personas/`, so
|
|
91
|
+
the skill scanner never mistakes it for a skill. The managed headless runner
|
|
92
|
+
also lives outside the scanner.
|
|
93
|
+
|
|
94
|
+
Interactive workflow invocations in Kimi's TUI differ from Claude/Gemini
|
|
95
|
+
syntax:
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
/skill:specrails-enrich
|
|
99
|
+
/skill:specrails-implement add passkey authentication
|
|
100
|
+
/skill:specrails-batch-implement #41 #42
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
OpenSpec workflows use their complete published skill names, for example:
|
|
104
|
+
|
|
105
|
+
```text
|
|
106
|
+
/skill:openspec-ff-change add-passkeys
|
|
107
|
+
/skill:openspec-apply-change add-passkeys
|
|
108
|
+
/skill:openspec-verify-change add-passkeys
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
OpenSpec versions that initially generate `.kimi/skills/openspec-*` are
|
|
112
|
+
normalized into `.kimi-code/skills/` by SpecRails. Existing `.kimi-code`
|
|
113
|
+
content and user-owned skills are preserved. Normalization rejects symlinked
|
|
114
|
+
or special-file sources/destinations, copies only a verified contained tree,
|
|
115
|
+
and uses unpredictable same-filesystem temporary/backup directories for each
|
|
116
|
+
atomic replacement.
|
|
117
|
+
|
|
118
|
+
## Models and reasoning effort
|
|
119
|
+
|
|
120
|
+
SpecRails persists Kimi's public model ids:
|
|
121
|
+
|
|
122
|
+
- `k3` (default)
|
|
123
|
+
- `kimi-for-coding`
|
|
124
|
+
- `kimi-for-coding-highspeed`
|
|
125
|
+
|
|
126
|
+
Managed Kimi login config exposes these as CLI aliases under `kimi-code/`.
|
|
127
|
+
At process launch, SpecRails maps only those known ids:
|
|
128
|
+
|
|
129
|
+
```text
|
|
130
|
+
k3 -> kimi-code/k3
|
|
131
|
+
kimi-for-coding -> kimi-code/kimi-for-coding
|
|
132
|
+
kimi-for-coding-highspeed -> kimi-code/kimi-for-coding-highspeed
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Already-prefixed aliases and custom aliases pass through unchanged. This keeps
|
|
136
|
+
profiles portable without silently rewriting custom Kimi configuration.
|
|
137
|
+
At the process boundary, every model id must be 1–128 characters and match
|
|
138
|
+
`^[A-Za-z0-9][A-Za-z0-9._/:-]*$`. This preserves common configured aliases such
|
|
139
|
+
as `company/Kimi-Custom:v2` while rejecting leading flags, whitespace, control
|
|
140
|
+
characters, and shell syntax before spawn.
|
|
141
|
+
|
|
142
|
+
When profile scaffolding is requested, Kimi's provider-bound fallback is stored
|
|
143
|
+
at `.specrails/profiles/kimi-default.json`. It can coexist with Claude's
|
|
144
|
+
historical `project-default.json` in a multi-provider project.
|
|
145
|
+
|
|
146
|
+
K3 supports `low`, `high`, and `max` reasoning effort. Desktop launches apply
|
|
147
|
+
the selected value only to that child process through
|
|
148
|
+
`KIMI_MODEL_THINKING_EFFORT`; SpecRails never mutates the user's global shell
|
|
149
|
+
environment. The Core invocation overlay removes inherited effort unless the
|
|
150
|
+
caller explicitly selects a valid value for K3. The managed helper preserves
|
|
151
|
+
an inherited `low`, `high`, or `max` only for `k3`/`kimi-code/k3`; it removes
|
|
152
|
+
the variable for every other model and drops invalid values. Kimi's documented
|
|
153
|
+
K3 default is `high`; leaving the variable unset deliberately retains that
|
|
154
|
+
upstream default. SpecRails does not substitute `low`.
|
|
155
|
+
|
|
156
|
+
## Headless and session behavior
|
|
157
|
+
|
|
158
|
+
Kimi 0.27 handles `/skill:...` in its TUI and ACP clients. Prompt mode does not:
|
|
159
|
+
`kimi -p "/skill:specrails-implement ..."` forwards that string directly to
|
|
160
|
+
the model and silently fails to call Kimi's skill activation path.
|
|
161
|
+
|
|
162
|
+
The canonical headless invocation therefore uses Core's managed Node helper:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
node .kimi-code/specrails/run-skill.mjs \
|
|
166
|
+
--skill specrails-implement \
|
|
167
|
+
--model k3 \
|
|
168
|
+
--args "add passkey authentication"
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
The helper validates a direct-child skill id, reads and expands its `SKILL.md`
|
|
172
|
+
using Kimi 0.27's argument and XML rules, and launches the separately installed
|
|
173
|
+
`kimi` executable with `-p` and `--output-format stream-json`. It passes each
|
|
174
|
+
value as an argv element with `shell: false`; it never evaluates skill names,
|
|
175
|
+
model aliases, or multiline arguments as shell source.
|
|
176
|
+
|
|
177
|
+
Provider hosts can submit a plain user turn to the helper with
|
|
178
|
+
`--plain-prompt-stdin`; Core bounds that UTF-8 input to 1 MiB and keeps it out
|
|
179
|
+
of the host-to-helper argv. Kimi 0.27 exposes no native stdin/file equivalent
|
|
180
|
+
to `-p`, so the helper passes the exact turn—not a file-reading envelope—to
|
|
181
|
+
the external CLI. Consequently, an official native Kimi binary still exposes
|
|
182
|
+
the exact prompt in its own process argv. The Windows npm shim is the one
|
|
183
|
+
verified exception described below. Do not place secrets in agent prompts.
|
|
184
|
+
|
|
185
|
+
Generated Kimi skills resolve project-specific stack, CI, layer, persona,
|
|
186
|
+
backlog, and PR context at activation time from `.kimi-code/project-context.md`,
|
|
187
|
+
`.kimi-code/personas/*.md`, and `.specrails/backlog-config.json`. Their
|
|
188
|
+
`KIMI_RUNTIME_*`/`KIMI_BACKLOG_*` markers are semantic operations, never shell
|
|
189
|
+
command names. Missing or read-only backlog configuration fails closed for
|
|
190
|
+
writes instead of fabricating a provider command.
|
|
191
|
+
|
|
192
|
+
Generated workflows use an even stricter boundary for role launches. For each
|
|
193
|
+
single role or parallel group, the orchestrator writes one exact object through
|
|
194
|
+
Kimi's structured WriteFile tool to `.specrails/kimi-role-wave.json`:
|
|
195
|
+
|
|
196
|
+
```json
|
|
197
|
+
{
|
|
198
|
+
"run": "implement-20260719",
|
|
199
|
+
"roles": [
|
|
200
|
+
{
|
|
201
|
+
"key": "developer-feature-a",
|
|
202
|
+
"skill": "sr-developer",
|
|
203
|
+
"model": "k3",
|
|
204
|
+
"profile": "inherit",
|
|
205
|
+
"args": "Complete context for feature A",
|
|
206
|
+
"workspace": "worktree:feature-a"
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
`run`, `key`, the optional profile stem, and the worktree suffix are lowercase
|
|
213
|
+
letters/digits/hyphens, 1–64 characters. `profile` is `inherit` or the stem of
|
|
214
|
+
a validated `.specrails/profiles/<name>.json`; the helper passes its absolute
|
|
215
|
+
path only to that child. A wave contains 1–32 roles and no extra fields. The
|
|
216
|
+
orchestrator then runs one static foreground command with `--role-wave-file`;
|
|
217
|
+
model names and arbitrary multiline context never enter shell source. The
|
|
218
|
+
runner accepts no alternate path, symlink, duplicate role/worktree, unsafe
|
|
219
|
+
identifier, or file above 1 MiB, and deletes the one-shot file before setup.
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
node .kimi-code/specrails/run-skill.mjs \
|
|
223
|
+
--role-wave-file .specrails/kimi-role-wave.json \
|
|
224
|
+
--add-dir "${SPECRAILS_REPO_DIR:-.}"
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
`workspace: "current"` still gives each parallel role a unique execution
|
|
228
|
+
directory, while `SPECRAILS_REPO_DIR` points at the repository it must edit.
|
|
229
|
+
This prevents nested workflow state/request collisions. A
|
|
230
|
+
`worktree:<feature-id>` entry creates or reuses a detached git worktree from a
|
|
231
|
+
private synthetic commit that snapshots the initial dirty tracked and
|
|
232
|
+
non-ignored untracked files without changing the user's index or branch. Reuse the
|
|
233
|
+
same worktree id for that feature's developer, test, and documentation waves.
|
|
234
|
+
The helper excludes managed `.kimi-code`/run-state from the role's git index
|
|
235
|
+
and records source HEAD, immutable synthetic base commit, and every path under
|
|
236
|
+
`.specrails/kimi-role-worktrees/<run>.json`; merge instructions use that commit
|
|
237
|
+
instead of assuming `main`.
|
|
238
|
+
|
|
239
|
+
Before status, merge, reuse, or cleanup, Core recomputes the only valid temp
|
|
240
|
+
worktree/execution/exclude paths from the canonical repository hash and run/id,
|
|
241
|
+
requires every isolated path to be that exact registered worktree, and verifies
|
|
242
|
+
the private baseline ref still equals the manifest commit. Editing the manifest
|
|
243
|
+
cannot redirect `git worktree remove`, status, or merge to another registered
|
|
244
|
+
worktree. A Windows copied `.kimi-code` overlay is likewise accepted only with
|
|
245
|
+
a managed marker and a full deterministic content hash; stale bytes are rebuilt.
|
|
246
|
+
|
|
247
|
+
Child streams are emitted as attributed `specrails.role.*` JSONL frames. The
|
|
248
|
+
helper waits for the whole wave and exits nonzero if any role fails. Termination
|
|
249
|
+
signals reach every live child. A role failure keeps valid worktrees for retry;
|
|
250
|
+
a setup failure removes only worktrees partially created by that setup, and
|
|
251
|
+
retry reuses the manifest's exact run/worktree mapping.
|
|
252
|
+
|
|
253
|
+
Merge begins with `--role-wave-status <run>`, which emits complete A/M/D
|
|
254
|
+
inventories across committed, staged, unstaged, and non-ignored untracked
|
|
255
|
+
changes. Exclusive paths are applied through the fixed
|
|
256
|
+
`.specrails/kimi-role-merge.json` request and `--role-merge-file`; filenames are
|
|
257
|
+
never interpolated into shell source. After a successful merge,
|
|
258
|
+
`--role-wave-cleanup <run>` removes registered worktrees, execution state, the
|
|
259
|
+
manifest, and the private synthetic-baseline ref. Failed or unmerged runs are
|
|
260
|
+
never cleaned automatically.
|
|
261
|
+
|
|
262
|
+
The supported contract is qualified against Kimi 0.27's stable v1 engine.
|
|
263
|
+
SpecRails removes `KIMI_CODE_EXPERIMENTAL_FLAG` from the child environment and
|
|
264
|
+
rejects experimental runner flags instead of silently opting into a different,
|
|
265
|
+
unverified runtime. Every Core-managed child also receives
|
|
266
|
+
`KIMI_DISABLE_CRON=1` and `KIMI_CODE_NO_AUTO_UPDATE=1`: a bounded SpecRails
|
|
267
|
+
invocation must not leave persistent scheduled work behind or self-update the
|
|
268
|
+
external CLI during startup. These controls do not disable Kimi print mode's
|
|
269
|
+
normal foreground task drain or steering lifecycle.
|
|
270
|
+
|
|
271
|
+
On Windows npm installs, large materialized workflows never travel in the
|
|
272
|
+
`CreateProcess` command line. The helper launches the official Kimi JavaScript
|
|
273
|
+
entry through a fixed Node bootstrap, sends the full UTF-8 prompt over stdin,
|
|
274
|
+
and restores that one `-p` argv value before importing Kimi. This preserves the
|
|
275
|
+
complete workflow even when it exceeds Windows' command-line limit. A native
|
|
276
|
+
executable remains direct-spawned only while its command line is at most 30,000
|
|
277
|
+
UTF-16 code units; larger native launches fail with guidance to use the
|
|
278
|
+
standard npm shim.
|
|
279
|
+
|
|
280
|
+
Once that initial skill is running, nested SpecRails and OpenSpec workflows use
|
|
281
|
+
Kimi's built-in `Skill` tool with explicit `skill` and `args` fields. This is
|
|
282
|
+
the native in-session path and retains Kimi's nested activation behavior and
|
|
283
|
+
`skill.activated` telemetry. The external helper reproduces the exact visible
|
|
284
|
+
initial prompt, but cannot emit Kimi-private activation-origin telemetry; no
|
|
285
|
+
such events are synthesized.
|
|
286
|
+
|
|
287
|
+
Kimi emits a `session.resume_hint` record at the end of a successful prompt.
|
|
288
|
+
A host trusts and persists it only when it is the terminal non-empty JSONL
|
|
289
|
+
record, its id passes the grammar below, and the Kimi child exits with code 0.
|
|
290
|
+
When that session id is known, a later skill invocation can resume it explicitly:
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
node .kimi-code/specrails/run-skill.mjs \
|
|
294
|
+
--skill sr-reviewer \
|
|
295
|
+
--model k3 \
|
|
296
|
+
--args "continue with the review feedback" \
|
|
297
|
+
--session=<session-id>
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
`${KIMI_SESSION_ID}` cannot be populated before a fresh prompt emits that hint.
|
|
301
|
+
The helper rejects a fresh invocation of a skill that uses this placeholder
|
|
302
|
+
instead of silently substituting an incorrect empty id. Resume ids are bounded
|
|
303
|
+
to 1–128 characters in `[A-Za-z0-9._-]`, with `.` and `..` rejected, and the
|
|
304
|
+
external Kimi process receives the id as one `--session=<id>` argument.
|
|
305
|
+
|
|
306
|
+
The helper forwards `SIGINT`, `SIGTERM`, and `SIGHUP` to its direct Kimi child
|
|
307
|
+
and removes those handlers when the child exits. Desktop or another embedding
|
|
308
|
+
host remains responsible for its normal platform-specific process-tree
|
|
309
|
+
teardown. There is no background Kimi service for SpecRails to install,
|
|
310
|
+
monitor, or uninstall.
|
|
311
|
+
|
|
312
|
+
One JSONL assistant record may contain text and several tool calls. Consumers
|
|
313
|
+
must retain every event from that record. The telemetry skill reads Kimi's
|
|
314
|
+
persisted `~/.kimi-code/session_index.jsonl`, validated session `state.json`,
|
|
315
|
+
and `agents/*/wire.jsonl` `usage.record` events. Those records expose
|
|
316
|
+
input-other, output, cache-read, and cache-creation tokens per model. They do
|
|
317
|
+
not expose an authoritative USD charge or reliable role outcome, so cost and
|
|
318
|
+
success rate remain unavailable rather than being synthesized.
|
|
319
|
+
|
|
320
|
+
## Permissions and attachments
|
|
321
|
+
|
|
322
|
+
Kimi prompt mode is autonomous: it temporarily uses Kimi's `auto` permission
|
|
323
|
+
policy and still honors static deny rules from the user's Kimi configuration.
|
|
324
|
+
Run agentic workflows only in repositories and worktrees you trust. SpecRails
|
|
325
|
+
does not add `--auto`, `--yolo`, or `--plan`; Kimi rejects those flags when
|
|
326
|
+
combined with `-p`.
|
|
327
|
+
|
|
328
|
+
Kimi has no dedicated image CLI flag. SpecRails accepts only absolute,
|
|
329
|
+
readable, regular, non-symlink attachment files, canonicalizes each path, and
|
|
330
|
+
adds every unique parent as `--add-dir`. It then places those canonical media
|
|
331
|
+
references in the prompt so Kimi can use `ReadMediaFile` or `ReadFile`. Core's
|
|
332
|
+
helper does not read or inline attachment contents. Missing files, directories,
|
|
333
|
+
symlinks, and unreadable inputs fail before spawn.
|
|
334
|
+
|
|
335
|
+
## MCP
|
|
336
|
+
|
|
337
|
+
Kimi reads project MCP declarations from `.kimi-code/mcp.json`. SpecRails
|
|
338
|
+
creates an empty file when none exists and merges its own entries additively.
|
|
339
|
+
It never replaces an existing valid user configuration or copies OAuth/API
|
|
340
|
+
credentials into the repository.
|
|
341
|
+
|
|
342
|
+
## Updating
|
|
343
|
+
|
|
344
|
+
Update a Kimi installation explicitly:
|
|
345
|
+
|
|
346
|
+
```bash
|
|
347
|
+
npx specrails-core@latest update --root-dir . --provider kimi
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
Framework-owned `specrails-*` and `sr-*` skills are refreshed. These remain
|
|
351
|
+
outside the cleanup boundary:
|
|
352
|
+
|
|
353
|
+
- OpenSpec `openspec-*` skills
|
|
354
|
+
- direct-child `custom-*` role skills
|
|
355
|
+
- unknown user skill directories
|
|
356
|
+
- existing MCP servers
|
|
357
|
+
- agent memory and runtime state
|
|
358
|
+
|
|
359
|
+
The managed `.kimi-code/specrails/run-skill.mjs` file is refreshed from the
|
|
360
|
+
trusted Core package and recorded in the manifest. It is executable framework
|
|
361
|
+
code, not a user-authored skill; keep custom helpers outside
|
|
362
|
+
`.kimi-code/specrails/`. Its complete managed bundle includes the unmodified
|
|
363
|
+
`js-yaml` ESM distribution, MIT `LICENSE`, and provenance `NOTICE.md` under
|
|
364
|
+
`.kimi-code/specrails/vendor/js-yaml/`; this gives the helper complete YAML
|
|
365
|
+
frontmatter parsing without using the project's `node_modules`.
|
|
366
|
+
|
|
367
|
+
Pre-release SpecRails builds placed role skills below `skills/rails`, where
|
|
368
|
+
Kimi cannot discover them. Update moves a legacy `custom-*` role to the direct
|
|
369
|
+
level only when no same-named direct role exists, and recreates managed `sr-*`
|
|
370
|
+
roles from the framework. A collision preserves both copies and is reported by
|
|
371
|
+
`doctor` instead of guessing which user-authored role should win.
|
|
372
|
+
|
|
373
|
+
## Troubleshooting
|
|
374
|
+
|
|
375
|
+
### `kimi` is not found
|
|
376
|
+
|
|
377
|
+
Open a new terminal after installation and check:
|
|
378
|
+
|
|
379
|
+
```bash
|
|
380
|
+
kimi --version
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
On Windows, also verify that the directory containing `kimi.cmd` is present in
|
|
384
|
+
`PATH`.
|
|
385
|
+
|
|
386
|
+
### Login or model configuration error
|
|
387
|
+
|
|
388
|
+
Run:
|
|
389
|
+
|
|
390
|
+
```bash
|
|
391
|
+
kimi login
|
|
392
|
+
kimi -p "Reply with OK" --output-format stream-json
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
The second command is a real model request and can consume quota; SpecRails
|
|
396
|
+
does not run it automatically as a setup probe.
|
|
397
|
+
|
|
398
|
+
### Model alias is not configured
|
|
399
|
+
|
|
400
|
+
Complete managed login again, choose an alias configured in
|
|
401
|
+
`~/.kimi-code/config.toml`, or pass one of the managed aliases such as
|
|
402
|
+
`kimi-code/k3`.
|
|
403
|
+
|
|
404
|
+
### Legacy `.kimi/skills` remains
|
|
405
|
+
|
|
406
|
+
Run the Kimi-specific update command. SpecRails moves only recognized
|
|
407
|
+
`openspec-*` output and removes the legacy directory only when it is empty.
|
|
408
|
+
Unknown files are left for manual review.
|
|
409
|
+
|
|
410
|
+
### Doctor reports a nested `skills/rails` layout
|
|
411
|
+
|
|
412
|
+
Run the Kimi-specific update command first. If the diagnostic remains, compare
|
|
413
|
+
the reported legacy `skills/rails/custom-*` role with its direct
|
|
414
|
+
`skills/custom-*` counterpart, keep the intended version at the direct path,
|
|
415
|
+
and remove the nested duplicate. Unknown nested directories are never deleted
|
|
416
|
+
automatically.
|
|
417
|
+
|
|
418
|
+
## Official Kimi references
|
|
419
|
+
|
|
420
|
+
- [Kimi Code documentation](https://www.kimi.com/code/docs/en/)
|
|
421
|
+
- [Getting started](https://www.kimi.com/code/docs/en/kimi-code-cli/guides/getting-started.html)
|
|
422
|
+
- [Environment variables](https://www.kimi.com/code/docs/en/kimi-code-cli/configuration/env-vars.html)
|
|
423
|
+
- [What is new](https://www.kimi.com/code/docs/en/kimi-code/whats-new.html)
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
# Installation
|
|
2
2
|
|
|
3
|
-
Install SpecRails into any git repository in two steps: install, then run
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
>
|
|
7
|
-
> OpenAI Codex integration is currently being **tested in our lab** and **cannot be installed yet**. The installer will refuse any attempt to install with `--provider codex` and will guide you to use Claude Code. Codex-specific sections below describe the **planned behaviour** for when the feature ships.
|
|
8
|
-
|
|
9
|
-
SpecRails supports **Claude Code** today, with **OpenAI Codex** coming soon. The installer detects which CLI you have and configures accordingly. See [Codex vs Claude Code](codex-vs-claude-code.md) for a feature comparison of the upcoming Codex support.
|
|
3
|
+
Install SpecRails into any git repository in two steps: install, then run the
|
|
4
|
+
provider-native enrich workflow. The scaffold supports Claude Code, Codex CLI,
|
|
5
|
+
Gemini CLI, and Kimi Code.
|
|
10
6
|
|
|
11
7
|
> **Looking for the comprehensive reference?** See [Installation & Setup](../installation.md) for full wizard phase details and advanced configuration.
|
|
12
8
|
|
|
@@ -21,12 +17,12 @@ SpecRails supports **Claude Code** today, with **OpenAI Codex** coming soon. The
|
|
|
21
17
|
|
|
22
18
|
No Node.js required.
|
|
23
19
|
|
|
24
|
-
### Scaffold method (npx /
|
|
20
|
+
### Scaffold method (npx / any provider)
|
|
25
21
|
|
|
26
22
|
| Tool | Version | Notes |
|
|
27
23
|
|------|---------|-------|
|
|
28
|
-
| **Node.js** |
|
|
29
|
-
| **
|
|
24
|
+
| **Node.js** | 20.19.0+ | Required for the installer and pinned OpenSpec 1.4.1 CLI |
|
|
25
|
+
| **Supported AI CLI** | Latest compatible version | Claude Code, Codex, Gemini, or Kimi 0.27.0+ |
|
|
30
26
|
| **Git** | Any | Your project must be a git repository |
|
|
31
27
|
|
|
32
28
|
Optional but recommended (both methods):
|
|
@@ -47,7 +43,7 @@ No cloning, no npm, nothing else. The plugin is now ready in all your Claude Cod
|
|
|
47
43
|
|
|
48
44
|
To update later: `claude plugin update sr`
|
|
49
45
|
|
|
50
|
-
### Scaffold method (Claude
|
|
46
|
+
### Scaffold method (Claude, Codex, Gemini, or Kimi)
|
|
51
47
|
|
|
52
48
|
Run from inside your project directory:
|
|
53
49
|
|
|
@@ -56,7 +52,8 @@ cd your-project
|
|
|
56
52
|
npx specrails-core@latest init --root-dir .
|
|
57
53
|
```
|
|
58
54
|
|
|
59
|
-
The installer copies
|
|
55
|
+
The installer copies provider-native artifacts into `.claude/`, `.codex/`,
|
|
56
|
+
`.gemini/`, or `.kimi-code/`. It does not modify your application source.
|
|
60
57
|
|
|
61
58
|
#### Flags
|
|
62
59
|
|
|
@@ -64,7 +61,7 @@ The installer copies templates and commands into `.claude/` (Claude Code) or `.c
|
|
|
64
61
|
|------|--------|
|
|
65
62
|
| `--root-dir <path>` | Target directory (default: current directory) |
|
|
66
63
|
| `--yes` / `-y` | Skip confirmation prompts |
|
|
67
|
-
| `--provider <claude\|codex>` | Force a specific AI CLI (default: auto-detect) |
|
|
64
|
+
| `--provider <claude\|codex\|gemini\|kimi>` | Force a specific AI CLI (default: auto-detect) |
|
|
68
65
|
|
|
69
66
|
#### What gets installed (scaffold method)
|
|
70
67
|
|
|
@@ -80,9 +77,35 @@ your-project/
|
|
|
80
77
|
└── settings.json # Permissions
|
|
81
78
|
```
|
|
82
79
|
|
|
83
|
-
**
|
|
80
|
+
**Kimi Code:**
|
|
84
81
|
|
|
82
|
+
```text
|
|
83
|
+
your-project/
|
|
84
|
+
└── .kimi-code/
|
|
85
|
+
├── AGENTS.md
|
|
86
|
+
├── mcp.json
|
|
87
|
+
├── personas/
|
|
88
|
+
├── rules/
|
|
89
|
+
├── specrails/
|
|
90
|
+
│ ├── run-skill.mjs
|
|
91
|
+
│ └── vendor/js-yaml/ # Managed parser + MIT license/provenance
|
|
92
|
+
└── skills/
|
|
93
|
+
├── specrails-*/SKILL.md
|
|
94
|
+
├── openspec-*/SKILL.md
|
|
95
|
+
└── sr-*/SKILL.md
|
|
85
96
|
```
|
|
97
|
+
|
|
98
|
+
Kimi discovers only direct children of `.kimi-code/skills`, so workflows,
|
|
99
|
+
OpenSpec skills, managed `sr-*` roles, and user `custom-*` roles all live at
|
|
100
|
+
that level rather than inside a `rails/` grouping directory. Non-skill persona
|
|
101
|
+
data and the managed headless runner live outside the scanner root.
|
|
102
|
+
|
|
103
|
+
See [Getting Started with Kimi](getting-started-kimi.md) for installation,
|
|
104
|
+
login, models, effort, sessions, and headless execution details.
|
|
105
|
+
|
|
106
|
+
**Codex (beta):**
|
|
107
|
+
|
|
108
|
+
```text
|
|
86
109
|
your-project/
|
|
87
110
|
├── AGENTS.md # SpecRails agent instructions for Codex
|
|
88
111
|
└── .codex/
|
|
@@ -102,12 +125,24 @@ After either installation method, open your AI CLI in your project and run:
|
|
|
102
125
|
claude # Claude Code
|
|
103
126
|
# or
|
|
104
127
|
codex # Codex
|
|
128
|
+
# or
|
|
129
|
+
gemini # Gemini CLI
|
|
130
|
+
# or
|
|
131
|
+
kimi # Kimi Code
|
|
105
132
|
```
|
|
106
133
|
|
|
134
|
+
Claude and Gemini:
|
|
135
|
+
|
|
107
136
|
```
|
|
108
137
|
/specrails:enrich
|
|
109
138
|
```
|
|
110
139
|
|
|
140
|
+
Kimi:
|
|
141
|
+
|
|
142
|
+
```text
|
|
143
|
+
/skill:specrails-enrich
|
|
144
|
+
```
|
|
145
|
+
|
|
111
146
|
By default, `/specrails:enrich` runs the full 5-phase wizard:
|
|
112
147
|
|
|
113
148
|
| Phase | What happens |
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Get SpecRails running in your project in under 10 minutes.
|
|
4
4
|
|
|
5
|
-
> **🧪 Using OpenAI Codex? — Coming Soon (in Lab).** Codex support is currently being tested in our lab and is not yet available for installation. The installer will refuse Codex installs and guide you to Claude Code. See the [Codex getting started guide](getting-started-codex.md) for a preview of the planned setup.
|
|
6
|
-
|
|
7
5
|
## Before you begin
|
|
8
6
|
|
|
9
7
|
You need:
|
|
10
|
-
- **
|
|
8
|
+
- **One supported AI CLI** — Claude Code, Codex CLI, Gemini CLI, or Kimi Code
|
|
11
9
|
- **A git repository** — your project must have a `.git` directory
|
|
12
10
|
|
|
13
11
|
Optional:
|
|
@@ -21,7 +19,7 @@ Optional:
|
|
|
21
19
|
claude plugin install sr
|
|
22
20
|
```
|
|
23
21
|
|
|
24
|
-
### Scaffold method (
|
|
22
|
+
### Scaffold method (all providers; requires Node.js)
|
|
25
23
|
|
|
26
24
|
```bash
|
|
27
25
|
npx specrails-core@latest init --root-dir .
|
|
@@ -31,18 +29,23 @@ Your existing code is not touched by either method.
|
|
|
31
29
|
|
|
32
30
|
## Step 2: Run the enrich wizard
|
|
33
31
|
|
|
34
|
-
Open
|
|
32
|
+
Open the selected provider in your project. For example:
|
|
35
33
|
|
|
36
34
|
```bash
|
|
37
|
-
|
|
35
|
+
kimi
|
|
38
36
|
```
|
|
39
37
|
|
|
40
|
-
Then
|
|
38
|
+
Then activate enrich using that provider's syntax:
|
|
41
39
|
|
|
42
40
|
```
|
|
43
|
-
/specrails:enrich
|
|
41
|
+
/specrails:enrich # Claude or Gemini
|
|
42
|
+
/skill:specrails-enrich # Kimi interactive TUI
|
|
44
43
|
```
|
|
45
44
|
|
|
45
|
+
Codex activates the generated enrich skill from `.codex/skills/`. For provider
|
|
46
|
+
details and headless Kimi usage, see the [installation guide](installation.md)
|
|
47
|
+
and [Kimi guide](getting-started-kimi.md).
|
|
48
|
+
|
|
46
49
|
The wizard runs the full 5-phase setup (about 5 minutes). It analyzes your codebase and configures SpecRails for your specific project:
|
|
47
50
|
|
|
48
51
|
```
|
package/docs/windows.md
CHANGED
|
@@ -5,12 +5,36 @@ specrails-core runs natively on Windows 10 (1809+) and Windows 11, on both x64 a
|
|
|
5
5
|
## Requirements
|
|
6
6
|
|
|
7
7
|
- **Windows 10 1809+** or **Windows 11** (x64 or ARM64)
|
|
8
|
-
- **Node.js ≥ 20** — install from [nodejs.org](https://nodejs.org/)
|
|
8
|
+
- **Node.js ≥ 20.19.0** — the minimum required by the pinned OpenSpec 1.4.1 CLI; install from [nodejs.org](https://nodejs.org/)
|
|
9
9
|
- **git ≥ 2.25** — install from [git-scm.com](https://git-scm.com/)
|
|
10
|
-
-
|
|
10
|
+
- One supported provider CLI: `claude.cmd`, `codex.cmd`, `gemini.cmd`, or
|
|
11
|
+
`kimi.cmd`
|
|
11
12
|
|
|
12
13
|
`npm install -g @anthropic-ai/claude-code` installs the Claude CLI as `claude.cmd` into your global npm bin (`%APPDATA%\npm\`). Make sure that directory is on your PATH so `where claude` resolves it.
|
|
13
14
|
|
|
15
|
+
For Kimi Code, use the official PowerShell installer:
|
|
16
|
+
|
|
17
|
+
```powershell
|
|
18
|
+
irm https://code.kimi.com/kimi-code/install.ps1 | iex
|
|
19
|
+
kimi login
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Then verify `where kimi` and `kimi --version`. SpecRails does not install or
|
|
23
|
+
start Kimi Server. For headless skills, its managed Node runner resolves the
|
|
24
|
+
external Kimi executable from `PATH`. A native executable is spawned directly.
|
|
25
|
+
For a standard npm `kimi.cmd`/`kimi.bat` shim, the runner extracts Kimi's
|
|
26
|
+
JavaScript entry point and launches it with Node using `shell: false`; it never
|
|
27
|
+
passes user input through `cmd.exe`. A non-standard command shim fails closed.
|
|
28
|
+
The vendored YAML parser is plain ESM and introduces no native dependency.
|
|
29
|
+
|
|
30
|
+
Windows `CreateProcess` cannot carry SpecRails' largest materialized workflow
|
|
31
|
+
as an argv value. For the standard npm shim, a fixed Node bootstrap therefore
|
|
32
|
+
receives the full prompt over stdin, replaces only Core's fixed `-p` marker in
|
|
33
|
+
`process.argv`, and imports Kimi's official entry. Kimi prompt mode does not
|
|
34
|
+
need stdin after startup. The transported command line is capped at 30,000
|
|
35
|
+
UTF-16 code units. Native executables cannot use this npm-entry bootstrap and
|
|
36
|
+
fail with actionable guidance when their argv exceeds that budget.
|
|
37
|
+
|
|
14
38
|
## Install
|
|
15
39
|
|
|
16
40
|
From PowerShell or cmd.exe:
|
|
@@ -22,7 +46,8 @@ npx specrails-core@latest init
|
|
|
22
46
|
|
|
23
47
|
The installer:
|
|
24
48
|
- probes PATH with `where` (instead of the POSIX `which`),
|
|
25
|
-
- spawns `.cmd` shims
|
|
49
|
+
- spawns provider and package-manager `.cmd` shims with the repository's safe
|
|
50
|
+
Windows process wrapper,
|
|
26
51
|
- writes all files with LF line endings regardless of `core.autocrlf` to keep the bundled templates portable.
|
|
27
52
|
|
|
28
53
|
## PowerShell execution policy
|
|
@@ -43,7 +68,7 @@ Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
|
|
|
43
68
|
|
|
44
69
|
## CI
|
|
45
70
|
|
|
46
|
-
The specrails-core GitHub Actions workflow runs the vitest suite on `windows-latest` in a matrix with `ubuntu-latest` and `macos-latest`, on Node 20 and Node 22. Any PR that regresses Windows behaviour fails CI immediately.
|
|
71
|
+
The specrails-core GitHub Actions workflow runs the vitest suite on `windows-latest` in a matrix with `ubuntu-latest` and `macos-latest`, on the exact Node 20.19.0 floor and Node 22. Any PR that regresses Windows behaviour fails CI immediately.
|
|
47
72
|
|
|
48
73
|
## Reporting Windows-specific bugs
|
|
49
74
|
|