specrails-core 4.12.0 → 5.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.
- package/README.md +49 -78
- package/bin/specrails-core.mjs +18 -98
- package/bin/tui-installer.mjs +22 -105
- package/commands/doctor.md +1 -1
- package/dist/installer/cli.js +12 -2
- package/dist/installer/cli.js.map +1 -1
- package/dist/installer/commands/doctor.js +3 -5
- package/dist/installer/commands/doctor.js.map +1 -1
- package/dist/installer/commands/init.js +23 -19
- package/dist/installer/commands/init.js.map +1 -1
- package/dist/installer/commands/update.js +17 -16
- package/dist/installer/commands/update.js.map +1 -1
- package/dist/installer/commands/v5-migration.js +119 -0
- package/dist/installer/commands/v5-migration.js.map +1 -0
- package/dist/installer/phases/install-config.js +3 -6
- package/dist/installer/phases/install-config.js.map +1 -1
- package/dist/installer/phases/manifest.js +2 -6
- package/dist/installer/phases/manifest.js.map +1 -1
- package/dist/installer/phases/prereqs.js +0 -1
- package/dist/installer/phases/prereqs.js.map +1 -1
- package/dist/installer/phases/scaffold.js +38 -148
- package/dist/installer/phases/scaffold.js.map +1 -1
- package/package.json +1 -1
- package/schemas/profile.v1.json +1 -1
- package/templates/agents/sr-architect.md +30 -0
- package/templates/agents/sr-developer.md +21 -8
- package/templates/agents/sr-reviewer.md +44 -31
- package/templates/codex-skills/batch-implement/SKILL.md +9 -32
- package/templates/codex-skills/implement/SKILL.md +61 -143
- package/templates/codex-skills/rails/sr-architect/SKILL.md +38 -20
- package/templates/codex-skills/rails/sr-developer/SKILL.md +29 -10
- package/templates/codex-skills/rails/sr-reviewer/SKILL.md +21 -10
- package/templates/commands/specrails/doctor.md +1 -1
- package/templates/commands/specrails/implement.md +117 -288
- package/templates/commands/specrails/memory-inspect.md +6 -4
- package/templates/commands/specrails/propose-spec.md +1 -1
- package/templates/commands/specrails/refactor-recommender.md +8 -51
- package/templates/commands/specrails/retry.md +12 -48
- package/templates/commands/specrails/telemetry.md +1 -1
- package/templates/gemini-commands/implement.toml +9 -0
- package/templates/profiles/default.json +5 -18
- package/commands/enrich.md +0 -1456
- package/templates/agents/sr-backend-developer.md +0 -91
- package/templates/agents/sr-backend-reviewer.md +0 -152
- package/templates/agents/sr-doc-sync.md +0 -247
- package/templates/agents/sr-frontend-developer.md +0 -85
- package/templates/agents/sr-frontend-reviewer.md +0 -145
- package/templates/agents/sr-merge-resolver.md +0 -195
- package/templates/agents/sr-performance-reviewer.md +0 -186
- package/templates/agents/sr-product-analyst.md +0 -36
- package/templates/agents/sr-product-manager.md +0 -148
- package/templates/agents/sr-security-reviewer.md +0 -191
- package/templates/agents/sr-test-writer.md +0 -176
- package/templates/codex-skills/enrich/SKILL.md +0 -191
- package/templates/codex-skills/merge-resolve/SKILL.md +0 -88
- package/templates/codex-skills/rails/sr-backend-developer/SKILL.md +0 -93
- package/templates/codex-skills/rails/sr-backend-reviewer/SKILL.md +0 -120
- package/templates/codex-skills/rails/sr-doc-sync/SKILL.md +0 -124
- package/templates/codex-skills/rails/sr-frontend-developer/SKILL.md +0 -106
- package/templates/codex-skills/rails/sr-frontend-reviewer/SKILL.md +0 -111
- package/templates/codex-skills/rails/sr-merge-resolver/SKILL.md +0 -156
- package/templates/codex-skills/rails/sr-performance-reviewer/SKILL.md +0 -109
- package/templates/codex-skills/rails/sr-product-analyst/SKILL.md +0 -85
- package/templates/codex-skills/rails/sr-product-manager/SKILL.md +0 -131
- package/templates/codex-skills/rails/sr-security-reviewer/SKILL.md +0 -121
- package/templates/codex-skills/rails/sr-test-writer/SKILL.md +0 -115
- package/templates/commands/specrails/auto-propose-backlog-specs.md +0 -312
- package/templates/commands/specrails/enrich.md +0 -1456
- package/templates/commands/specrails/get-backlog-specs.md +0 -226
- package/templates/commands/specrails/merge-resolve.md +0 -172
- package/templates/commands/specrails/reconfig.md +0 -80
- package/templates/commands/specrails/vpc-drift.md +0 -405
- package/templates/commands/test.md +0 -58
- package/templates/personas/persona.md +0 -43
- package/templates/personas/the-maintainer.md +0 -98
- package/templates/settings/perf-thresholds.yml +0 -25
package/README.md
CHANGED
|
@@ -8,11 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
**Your agentic development team. From idea to production code.**
|
|
10
10
|
|
|
11
|
-
One command turns your repo into a spec-driven pipeline with
|
|
11
|
+
One command turns your repo into a spec-driven pipeline with three specialized AI agents working together through OpenSpec — architect, developer, reviewer — all adapted to your codebase. Need more specialists? Add your own via a profile.
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npx specrails-core@latest init # install into the current repo
|
|
15
|
-
/specrails:enrich # Claude/Gemini (Kimi: /skill:specrails-enrich)
|
|
14
|
+
npx specrails-core@latest init # install into the current repo — ready to use immediately
|
|
16
15
|
```
|
|
17
16
|
|
|
18
17
|
> **Requirements:** one supported AI CLI, git, and Node 20.19.0+. Cross-platform:
|
|
@@ -30,34 +29,23 @@ Idea → Architecture → Implementation → Review → PR
|
|
|
30
29
|
|
|
31
30
|
Run `/specrails:implement "add dark mode"` — the pipeline designs, builds, reviews, and ships a pull request. No hand-holding.
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
The three core agents are adapted to your project's stack and conventions at install time, and the per-layer rules carry your codebase's patterns. Extend the trio with your own specialists through a [profile](#agent-profiles).
|
|
34
33
|
|
|
35
34
|
---
|
|
36
35
|
|
|
37
36
|
## Quick start
|
|
38
37
|
|
|
39
38
|
```bash
|
|
40
|
-
# 1. Install into the current repo
|
|
39
|
+
# 1. Install into the current repo — one pass, no follow-up step
|
|
41
40
|
npx specrails-core@latest init
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
The TUI asks you to pick a tier:
|
|
45
|
-
|
|
46
|
-
- **Quick** (default) — provider-native agents/skills and commands are installed
|
|
47
|
-
under `.claude/`, `.codex/`, `.gemini/`, or `.kimi-code/`. No AI interaction.
|
|
48
|
-
- **Full** — same as Quick plus `/specrails:enrich` (5-phase deep analysis: stack detection, VPC personas, competitive research). ~5 min.
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
# 2. Optional — run enrich later if you picked Quick
|
|
52
|
-
/specrails:enrich
|
|
53
41
|
|
|
54
|
-
#
|
|
42
|
+
# 2. Start building
|
|
55
43
|
> /specrails:implement "add user authentication"
|
|
56
44
|
> /specrails:implement #1, #2 # from local tickets (default)
|
|
57
45
|
> /specrails:implement #42 # from GitHub Issues (if configured)
|
|
58
46
|
```
|
|
59
47
|
|
|
60
|
-
That's it. The pipeline takes over.
|
|
48
|
+
That's it. Installation places the three agents, commands, rules, and OpenSpec skills directly — no wizard, no AI step. The pipeline takes over.
|
|
61
49
|
|
|
62
50
|
---
|
|
63
51
|
|
|
@@ -84,16 +72,16 @@ Everything lands in your repo — nothing auto-updates, nothing phones home. You
|
|
|
84
72
|
|
|
85
73
|
| Category | Location | Purpose |
|
|
86
74
|
|----------|----------|---------|
|
|
87
|
-
| **
|
|
75
|
+
| **Agents** | `.claude/agents/` (Claude) or the provider-native skills tree (`.codex/`, `.gemini/`, `.kimi-code/`) | The three core agents (sr-architect, sr-developer, sr-reviewer) |
|
|
76
|
+
| **Commands** | `.claude/commands/specrails/` | Workflow commands (`/specrails:implement`, `/specrails:why`, ...) |
|
|
88
77
|
| **Kimi workflow skills** | `.kimi-code/skills/specrails-*/SKILL.md` | `/skill:specrails-*` directory-form skills |
|
|
89
|
-
| **Kimi
|
|
90
|
-
| **
|
|
91
|
-
| **OpenSpec skills** | Provider-native skills directory | Structured proposal/design/tasks/apply workflows |
|
|
78
|
+
| **Kimi headless runner** | `.kimi-code/specrails/run-skill.mjs` | Materializes Kimi's native skill-activation flow for headless runs |
|
|
79
|
+
| **OpenSpec skills** | `.claude/commands/opsx/` (or the provider-native skills directory) | `/opsx:*` commands for spec artefacts |
|
|
92
80
|
| **Config** | `.specrails/config.yaml` | Stack, CI commands, git workflow |
|
|
93
|
-
| **Personas** | `.specrails/personas/*.md` | VPC user profiles, generated from your users |
|
|
94
81
|
| **Rules** | `.specrails/rules/*.md` | Per-layer coding conventions |
|
|
95
82
|
| **Memory** | `.specrails/agent-memory/` | Persistent knowledge — agents learn across sessions |
|
|
96
83
|
| **Pipeline state** | `.specrails/pipeline/` | In-flight feature state for parallel builds |
|
|
84
|
+
| **Profiles** _(optional, yours)_ | `.specrails/profiles/*.json` | Add custom specialists + task routing |
|
|
97
85
|
|
|
98
86
|
To update, re-run the installer:
|
|
99
87
|
|
|
@@ -101,7 +89,7 @@ To update, re-run the installer:
|
|
|
101
89
|
npx specrails-core@latest init
|
|
102
90
|
```
|
|
103
91
|
|
|
104
|
-
|
|
92
|
+
Or run `npx specrails-core@latest update` to refresh in place. Update leaves your `.specrails/` data, profiles, and `custom-*` agents untouched. Upgrading from v4? Update also removes the artefacts v5 no longer ships (the enrich wizard, install tiers, and the non-core agents) and prints exactly what it removed — see [Migrating from v4](#migrating-from-v4).
|
|
105
93
|
|
|
106
94
|
---
|
|
107
95
|
|
|
@@ -111,33 +99,26 @@ It refreshes the agents/commands while leaving your `.specrails/` data untouched
|
|
|
111
99
|
|---|---|---|---|
|
|
112
100
|
| Structured pipeline | ✅ Architect → Dev → Review → PR | ❌ Manual | ❌ Manual |
|
|
113
101
|
| Adapts to your codebase | ✅ Reads your real stack/CI | ⚠️ Prompts only | ❌ |
|
|
114
|
-
|
|
|
102
|
+
| Spec-driven (OpenSpec) | ✅ Proposal → design → tasks → specs | ❌ | ❌ |
|
|
115
103
|
| Parallel feature builds | ✅ Git worktrees | ❌ | ❌ |
|
|
116
104
|
| Institutional memory | ✅ Agents learn across sessions | ❌ | ❌ |
|
|
117
105
|
| Open source | ✅ MIT | N/A | ❌ |
|
|
118
106
|
|
|
119
|
-
specrails is not a chat interface. It's a **development pipeline** that coordinates
|
|
107
|
+
specrails is not a chat interface. It's a **development pipeline** that coordinates specialised agents through your existing tools (GitHub Issues, git, CI).
|
|
120
108
|
|
|
121
109
|
---
|
|
122
110
|
|
|
123
111
|
## The agents
|
|
124
112
|
|
|
113
|
+
Three agents, tightly integrated through the OpenSpec lifecycle (`/opsx:ff` → `/opsx:apply` → `/opsx:archive`):
|
|
114
|
+
|
|
125
115
|
| Agent | Model | Role |
|
|
126
116
|
|-------|-------|------|
|
|
127
117
|
| **sr-architect** | Sonnet | Designs features: proposal, technical design, task breakdown |
|
|
128
|
-
| **sr-developer** | Sonnet | Full-stack implementation |
|
|
129
|
-
| **sr-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
| **sr-backend-reviewer** | Sonnet | Backend code review: API design, DB patterns, performance |
|
|
133
|
-
| **sr-frontend-reviewer** | Sonnet | Frontend code review: UX, accessibility, component design |
|
|
134
|
-
| **sr-test-writer** | Sonnet | Generates unit, integration, and e2e tests |
|
|
135
|
-
| **sr-security-reviewer** | Sonnet | Secrets detection, OWASP checks, dependency vulnerabilities |
|
|
136
|
-
| **sr-doc-sync** | Sonnet | Updates changelogs, READMEs, API docs |
|
|
137
|
-
| **sr-merge-resolver** | Sonnet | AI-powered merge conflict resolution for multi-feature pipelines |
|
|
138
|
-
| **sr-performance-reviewer** | Sonnet | Performance regression detection after implementation |
|
|
139
|
-
| **sr-product-manager** | Opus | Product discovery: competitive analysis, VPC evaluation |
|
|
140
|
-
| **sr-product-analyst** | Haiku | Read-only backlog analysis and prioritisation |
|
|
118
|
+
| **sr-developer** | Sonnet | Full-stack implementation (tests and docs included per task) |
|
|
119
|
+
| **sr-reviewer** | Sonnet | Single quality gate: correctness, TDD/spec completeness, security, and performance; runs CI, fixes issues, records learnings |
|
|
120
|
+
|
|
121
|
+
Need a specialist — a dedicated security reviewer, a data-engineering developer, a docs agent? Author it as a `custom-*` agent and declare it in a [profile](#agent-profiles); the pipeline routes to it. The installer never ships or manages non-core agents, so your custom agents are always yours.
|
|
141
122
|
|
|
142
123
|
---
|
|
143
124
|
|
|
@@ -148,7 +129,6 @@ specrails is not a chat interface. It's a **development pipeline** that coordina
|
|
|
148
129
|
```bash
|
|
149
130
|
/specrails:implement "add dark mode" # from a description
|
|
150
131
|
/specrails:implement #85, #71 # from tickets
|
|
151
|
-
/specrails:implement UI, Analytics # explore areas, pick the best ideas
|
|
152
132
|
```
|
|
153
133
|
|
|
154
134
|
Architect designs → developer builds → reviewer validates → PR created. Multiple features run in parallel with git worktrees.
|
|
@@ -182,31 +162,21 @@ To discard without applying:
|
|
|
182
162
|
rm -rf .claude/.dry-run/add-dark-mode/
|
|
183
163
|
```
|
|
184
164
|
|
|
185
|
-
### `/specrails:
|
|
165
|
+
### `/specrails:retry` — Resume a failed pipeline
|
|
186
166
|
|
|
187
167
|
```bash
|
|
188
|
-
/specrails:
|
|
189
|
-
/specrails:
|
|
168
|
+
/specrails:retry add-dark-mode # resume from the failed phase
|
|
169
|
+
/specrails:retry add-dark-mode --from reviewer
|
|
170
|
+
/specrails:retry --list # show resumable pipeline states
|
|
190
171
|
```
|
|
191
172
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
### `/specrails:auto-propose-backlog-specs` — Discover features
|
|
195
|
-
|
|
196
|
-
```bash
|
|
197
|
-
/specrails:auto-propose-backlog-specs # explore all areas
|
|
198
|
-
/specrails:auto-propose-backlog-specs Analytics # focus on one area
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
AI product discovery using your personas. Evaluates ideas, creates tickets (local or GitHub Issues) for the best ones.
|
|
173
|
+
Picks up a `/specrails:implement` run from where it stopped, reusing the OpenSpec artefacts already produced.
|
|
202
174
|
|
|
203
175
|
---
|
|
204
176
|
|
|
205
177
|
## Agent profiles
|
|
206
178
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
Profiles are declarative JSON files that tell `/specrails:implement` which agents to use, which models to run them with, and how to route tasks to specialists. One project can define many profiles (e.g. `default`, `data-heavy`, `security-heavy`) and run different features with different profiles — useful for concurrent rails in `/specrails:batch-implement`.
|
|
179
|
+
Profiles are **the way to extend the core trio**. They are declarative JSON files that tell `/specrails:implement` which agents to use, which models to run them with, and how to route tasks to specialists. Without a profile the pipeline runs the three baseline agents; with one, you add your own `custom-*` agents and routing. One project can define many profiles (e.g. `default`, `data-heavy`, `security-heavy`) and run different features with different profiles — useful for concurrent rails in `/specrails:batch-implement`.
|
|
210
180
|
|
|
211
181
|
### File layout
|
|
212
182
|
|
|
@@ -225,7 +195,7 @@ When running the pipeline, the active profile is resolved in this order:
|
|
|
225
195
|
1. `$SPECRAILS_PROFILE_PATH` environment variable (absolute path to a JSON snapshot)
|
|
226
196
|
2. Provider default: `<cwd>/.specrails/profiles/project-default.json` for
|
|
227
197
|
Claude, or `<cwd>/.specrails/profiles/kimi-default.json` for Kimi
|
|
228
|
-
3. No profile —
|
|
198
|
+
3. No profile — the three baseline agents (`sr-architect`, `sr-developer`, `sr-reviewer`)
|
|
229
199
|
|
|
230
200
|
Tools such as [specrails-desktop](https://github.com/fjpulidop/specrails-desktop) set `$SPECRAILS_PROFILE_PATH` to a job-scoped snapshot so concurrent rails can run independent profiles.
|
|
231
201
|
|
|
@@ -274,12 +244,10 @@ specrails-core ships with a built-in ticket system — no GitHub account or exte
|
|
|
274
244
|
|
|
275
245
|
Tickets live in `.specrails/local-tickets.json` alongside your code. They're plain JSON and git-friendly.
|
|
276
246
|
|
|
277
|
-
**Local tickets are the default
|
|
247
|
+
**Local tickets are the default** — no GitHub account or credential setup required.
|
|
278
248
|
|
|
279
249
|
```bash
|
|
280
250
|
/specrails:implement #1, #4 # implement by ticket ID
|
|
281
|
-
/specrails:get-backlog-specs # view prioritised backlog
|
|
282
|
-
/specrails:auto-propose-backlog-specs # discover and create tickets with AI
|
|
283
251
|
/specrails:propose-spec # create a ticket from a spec proposal
|
|
284
252
|
```
|
|
285
253
|
|
|
@@ -289,20 +257,21 @@ Migrating from GitHub Issues or JIRA? See [docs/migration-guide.md](./docs/migra
|
|
|
289
257
|
|
|
290
258
|
---
|
|
291
259
|
|
|
292
|
-
##
|
|
260
|
+
## Migrating from v4
|
|
293
261
|
|
|
294
|
-
|
|
262
|
+
v5 is a breaking release. It removes the `/specrails:enrich` wizard, the quick/full install tiers, and the nine non-core agents (product manager/analyst, layer-specific developers and reviewers, test-writer, doc-sync, merge-resolver). The installer is now mode-less: `init` places the three core agents directly, in one pass.
|
|
295
263
|
|
|
264
|
+
To upgrade an existing install:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
npx specrails-core@latest update
|
|
296
268
|
```
|
|
297
|
-
+-----------------------------+ +-----------------------------+
|
|
298
|
-
| VALUE PROPOSITION | | CUSTOMER SEGMENT |
|
|
299
|
-
| Products & Services <---+--->| Customer Jobs |
|
|
300
|
-
| Pain Relievers <---+--->| Pains |
|
|
301
|
-
| Gain Creators <---+--->| Gains |
|
|
302
|
-
+-----------------------------+ +-----------------------------+
|
|
303
|
-
```
|
|
304
269
|
|
|
305
|
-
|
|
270
|
+
Update removes the artefacts v5 no longer ships (installer-owned agents, commands, and enrich staging) and prints the exact list of removed files. It never touches your `.specrails/profiles/**` or `.claude/agents/custom-*.md`.
|
|
271
|
+
|
|
272
|
+
- **Relied on a removed agent?** Its body is plain Markdown — copy the v4 agent to `.claude/agents/custom-<name>.md` and declare it in a [profile](#agent-profiles). Same behaviour, now user-owned.
|
|
273
|
+
- **Have a v4 profile that lists removed agents?** It keeps working: the pipeline warns and skips any profile agent whose file no longer exists, and continues with the rest. The three baseline agents remain required.
|
|
274
|
+
- **Using specrails-desktop?** Pin it to `specrails-core@^4` until a desktop release adopts the mode-less `init --from-config` flow.
|
|
306
275
|
|
|
307
276
|
---
|
|
308
277
|
|
|
@@ -315,7 +284,6 @@ Each persona scores features 0–5. Features are ranked by score / effort ratio.
|
|
|
315
284
|
| **git** | Yes | Repository detection |
|
|
316
285
|
| **Node 20.19.0+** | Yes | Needed for `npx specrails-core@latest init` (the floor required by the pinned OpenSpec 1.4.1 CLI). Cross-platform: macOS, Linux, Windows (10/11, x64 + ARM64 via emulation). |
|
|
317
286
|
| **GitHub CLI** (`gh`) | Optional | Backlog sync to GitHub Issues, PR creation. Not needed with local tickets. |
|
|
318
|
-
| **JIRA CLI** (`jira`) | Optional | Backlog sync to JIRA. Not needed with local tickets. |
|
|
319
287
|
|
|
320
288
|
The installer checks for prerequisites and offers to install missing ones.
|
|
321
289
|
|
|
@@ -323,7 +291,7 @@ The installer checks for prerequisites and offers to install missing ones.
|
|
|
323
291
|
|
|
324
292
|
## Supported stacks
|
|
325
293
|
|
|
326
|
-
Stack-agnostic. The
|
|
294
|
+
Stack-agnostic. The installer detects and adapts the agents and rules to whatever you're running:
|
|
327
295
|
|
|
328
296
|
- **Backend:** Python/FastAPI, Node/Express, Go/Gin, Rust/Actix, Java/Spring, Ruby/Rails, .NET
|
|
329
297
|
- **Frontend:** React, Vue, Angular, Svelte, Next.js, Nuxt
|
|
@@ -336,11 +304,12 @@ Stack-agnostic. The `/specrails:enrich` wizard detects and adapts to whatever yo
|
|
|
336
304
|
## Design principles
|
|
337
305
|
|
|
338
306
|
1. **Local by default** — Everything lives in your repo. No cloud services, no telemetry, no phone home.
|
|
339
|
-
2. **
|
|
307
|
+
2. **Mode-less** — One install path. `init` places everything directly; there is no follow-up wizard.
|
|
340
308
|
3. **Context-first** — Every generated file uses your real paths, patterns, and CI commands.
|
|
341
|
-
4. **
|
|
309
|
+
4. **Spec-driven** — Every feature flows through OpenSpec (proposal → design → tasks → specs), not ad-hoc prompts.
|
|
342
310
|
5. **Institutional memory** — Agents learn across sessions. Reviewer learnings feed back to future developers.
|
|
343
311
|
6. **Parallel-safe** — Multiple features implemented simultaneously via git worktrees with automatic merge.
|
|
312
|
+
7. **Yours to extend** — The core is three agents; specialists come from profiles + `custom-*` agents the installer never touches.
|
|
344
313
|
|
|
345
314
|
---
|
|
346
315
|
|
|
@@ -348,11 +317,13 @@ Stack-agnostic. The `/specrails:enrich` wizard detects and adapts to whatever yo
|
|
|
348
317
|
|
|
349
318
|
**Can I customise the agents after installation?**
|
|
350
319
|
Yes. Everything in the selected provider tree and `.specrails/` is yours to
|
|
351
|
-
edit. For Kimi, customize `.kimi-code/skills/`,
|
|
352
|
-
managed block in `.kimi-code/AGENTS.md`;
|
|
320
|
+
edit — agent prompts, rules, config. For Kimi, customize `.kimi-code/skills/`,
|
|
321
|
+
`.kimi-code/rules/`, and the managed block in `.kimi-code/AGENTS.md`;
|
|
322
|
+
`custom-*` role skills are preserved. To add a specialist, declare a
|
|
323
|
+
`custom-*` agent in a profile.
|
|
353
324
|
|
|
354
|
-
**
|
|
355
|
-
Run
|
|
325
|
+
**How do I update an install?**
|
|
326
|
+
Run `npx specrails-core@latest update` (or re-run `init`) to refresh the agents/commands. Both leave your `.specrails/` data, profiles, and `custom-*` agents untouched.
|
|
356
327
|
|
|
357
328
|
**Does this work without GitHub CLI?**
|
|
358
329
|
Yes. Local tickets are the default and need no external tools. `/specrails:implement "description"` also works without `gh` — it just skips automated PR creation.
|
package/bin/specrails-core.mjs
CHANGED
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
* in-process via the Node installer under dist/installer/. This file
|
|
7
7
|
* only keeps logic that is local to the dispatcher:
|
|
8
8
|
* - `profile validate` / `profile show` — schema validation via ajv.
|
|
9
|
-
* - `enrich` — launches the installed provider's
|
|
10
|
-
* native enrich workflow.
|
|
11
9
|
* - `init` TUI short-circuit — spawns tui-installer.mjs
|
|
12
10
|
* then re-enters init with
|
|
13
11
|
* --from-config.
|
|
@@ -48,6 +46,15 @@ if (!subcommand) {
|
|
|
48
46
|
process.exit(0)
|
|
49
47
|
}
|
|
50
48
|
|
|
49
|
+
// ─── Removed-in-v5 subcommands (clear error, not a generic "unknown") ────────
|
|
50
|
+
|
|
51
|
+
const REMOVED_SUBCOMMANDS = new Set(['enrich'])
|
|
52
|
+
|
|
53
|
+
if (REMOVED_SUBCOMMANDS.has(subcommand)) {
|
|
54
|
+
console.error(`${subcommand} was removed in v5 — init now installs everything directly.`)
|
|
55
|
+
process.exit(1)
|
|
56
|
+
}
|
|
57
|
+
|
|
51
58
|
// ─── Subcommand allowlist (kept for backwards compatibility) ─────────────────
|
|
52
59
|
|
|
53
60
|
const KNOWN_SUBCOMMANDS = new Set([
|
|
@@ -57,7 +64,6 @@ const KNOWN_SUBCOMMANDS = new Set([
|
|
|
57
64
|
'install-framework',
|
|
58
65
|
'swap-current',
|
|
59
66
|
'assemble',
|
|
60
|
-
'enrich',
|
|
61
67
|
'version',
|
|
62
68
|
'profile',
|
|
63
69
|
'help',
|
|
@@ -66,11 +72,18 @@ const KNOWN_SUBCOMMANDS = new Set([
|
|
|
66
72
|
if (!KNOWN_SUBCOMMANDS.has(subcommand)) {
|
|
67
73
|
console.error(`Unknown command: ${subcommand}\n`)
|
|
68
74
|
console.error(
|
|
69
|
-
'Available commands: init, update, doctor, install-framework, swap-current, assemble,
|
|
75
|
+
'Available commands: init, update, doctor, install-framework, swap-current, assemble, version, profile, help',
|
|
70
76
|
)
|
|
71
77
|
process.exit(1)
|
|
72
78
|
}
|
|
73
79
|
|
|
80
|
+
// ─── Removed-in-v5 flags (clear error) ───────────────────────────────────────
|
|
81
|
+
|
|
82
|
+
if (args.includes('--quick') || args.includes('--lite')) {
|
|
83
|
+
console.error('--quick was removed in v5 — init now installs everything directly.')
|
|
84
|
+
process.exit(1)
|
|
85
|
+
}
|
|
86
|
+
|
|
74
87
|
const subargs = args.slice(1)
|
|
75
88
|
|
|
76
89
|
// ─── help / version handled by the dispatcher ────────────────────────────────
|
|
@@ -94,98 +107,6 @@ if (subcommand === 'profile') {
|
|
|
94
107
|
process.exit(0)
|
|
95
108
|
}
|
|
96
109
|
|
|
97
|
-
// ─── enrich ──────────────────────────────────────────────────────────────────
|
|
98
|
-
// Launches the configured provider's native enrich workflow.
|
|
99
|
-
|
|
100
|
-
if (subcommand === 'enrich') {
|
|
101
|
-
const workspace = await resolveEnrichWorkspace(process.cwd())
|
|
102
|
-
const { provider, model: explicitModel, workflowArgs } = resolveEnrichOptions(
|
|
103
|
-
workspace.codeRoot,
|
|
104
|
-
subargs,
|
|
105
|
-
workspace.artifactRoot,
|
|
106
|
-
)
|
|
107
|
-
const model =
|
|
108
|
-
explicitModel ??
|
|
109
|
-
resolveConfiguredEnrichModel(workspace.codeRoot, workspace.artifactRoot) ??
|
|
110
|
-
'k3'
|
|
111
|
-
const enrichFlags = serializeWorkflowArgs(workflowArgs)
|
|
112
|
-
const launch =
|
|
113
|
-
provider === 'kimi'
|
|
114
|
-
? {
|
|
115
|
-
command: process.execPath,
|
|
116
|
-
args: [
|
|
117
|
-
path.resolve(
|
|
118
|
-
workspace.artifactRoot,
|
|
119
|
-
'.kimi-code',
|
|
120
|
-
'specrails',
|
|
121
|
-
'run-skill.mjs',
|
|
122
|
-
),
|
|
123
|
-
'--skill',
|
|
124
|
-
'specrails-enrich',
|
|
125
|
-
'--model',
|
|
126
|
-
model,
|
|
127
|
-
'--add-dir',
|
|
128
|
-
workspace.codeRoot,
|
|
129
|
-
...(enrichFlags ? ['--args', enrichFlags] : []),
|
|
130
|
-
],
|
|
131
|
-
label: 'Kimi Code',
|
|
132
|
-
}
|
|
133
|
-
: provider === 'gemini'
|
|
134
|
-
? {
|
|
135
|
-
command: 'gemini',
|
|
136
|
-
args: [
|
|
137
|
-
'-p',
|
|
138
|
-
`/specrails:enrich${enrichFlags ? ` ${enrichFlags}` : ''}`,
|
|
139
|
-
'--output-format',
|
|
140
|
-
'stream-json',
|
|
141
|
-
],
|
|
142
|
-
label: 'Gemini CLI',
|
|
143
|
-
}
|
|
144
|
-
: provider === 'codex'
|
|
145
|
-
? {
|
|
146
|
-
command: 'codex',
|
|
147
|
-
args: [
|
|
148
|
-
'exec',
|
|
149
|
-
`run enrich${enrichFlags ? ` ${enrichFlags}` : ''}`,
|
|
150
|
-
],
|
|
151
|
-
label: 'Codex CLI',
|
|
152
|
-
}
|
|
153
|
-
: {
|
|
154
|
-
command: 'claude',
|
|
155
|
-
args: [
|
|
156
|
-
'--command',
|
|
157
|
-
`/specrails:enrich${enrichFlags ? ` ${enrichFlags}` : ''}`,
|
|
158
|
-
'--dangerously-skip-permissions',
|
|
159
|
-
],
|
|
160
|
-
label: 'Claude Code',
|
|
161
|
-
}
|
|
162
|
-
const result = spawnSync(
|
|
163
|
-
launch.command,
|
|
164
|
-
launch.args,
|
|
165
|
-
{
|
|
166
|
-
stdio: 'inherit',
|
|
167
|
-
cwd: provider === 'kimi' ? workspace.artifactRoot : process.cwd(),
|
|
168
|
-
env:
|
|
169
|
-
provider === 'kimi'
|
|
170
|
-
? {
|
|
171
|
-
...process.env,
|
|
172
|
-
SPECRAILS_REPO_DIR: workspace.codeRoot,
|
|
173
|
-
}
|
|
174
|
-
: process.env,
|
|
175
|
-
shell: process.platform === 'win32' && provider !== 'kimi',
|
|
176
|
-
},
|
|
177
|
-
)
|
|
178
|
-
if (result.error) {
|
|
179
|
-
console.error(
|
|
180
|
-
`\nFailed to launch ${launch.label} for enrich:`,
|
|
181
|
-
result.error.message,
|
|
182
|
-
`\nEnsure the configured ${provider} provider is installed and initialized.\n`,
|
|
183
|
-
)
|
|
184
|
-
process.exit(1)
|
|
185
|
-
}
|
|
186
|
-
process.exit(result.status ?? (result.error ? 1 : 0))
|
|
187
|
-
}
|
|
188
|
-
|
|
189
110
|
// ─── init: optional TUI short-circuit ────────────────────────────────────────
|
|
190
111
|
// Default flow runs the TUI to collect agent/model configuration and
|
|
191
112
|
// write .specrails/install-config.yaml, then falls through to the Node
|
|
@@ -235,7 +156,7 @@ if (subcommand === 'init') {
|
|
|
235
156
|
}
|
|
236
157
|
|
|
237
158
|
// TUI succeeded — re-enter init with --from-config so the Node
|
|
238
|
-
// command reads provider/
|
|
159
|
+
// command reads provider/agents from install-config.yaml.
|
|
239
160
|
const nextArgs = subargs
|
|
240
161
|
.filter((a) => a !== '--no-tui' && a !== '--no-direct')
|
|
241
162
|
.concat(['--yes', '--from-config'])
|
|
@@ -272,7 +193,6 @@ Usage:
|
|
|
272
193
|
specrails-core swap-current --framework-dir <path> --version <value> [--providers <csv>]
|
|
273
194
|
Validate and atomically expose a framework version
|
|
274
195
|
specrails-core assemble --workspace <path> --framework-dir <path> Assemble a workspace from the framework
|
|
275
|
-
specrails-core enrich [--provider <value>] [workflow flags] Run the configured provider's enrich workflow
|
|
276
196
|
specrails-core profile <validate|show> [<path>] Validate or pretty-print a profile JSON
|
|
277
197
|
specrails-core version Show installed version
|
|
278
198
|
|