specrails-core 4.12.1 → 5.1.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 (97) hide show
  1. package/README.md +103 -339
  2. package/bin/specrails-core.mjs +20 -98
  3. package/bin/tui-installer.mjs +22 -105
  4. package/commands/doctor.md +1 -1
  5. package/dist/installer/cli.js +16 -2
  6. package/dist/installer/cli.js.map +1 -1
  7. package/dist/installer/commands/doctor.js +3 -5
  8. package/dist/installer/commands/doctor.js.map +1 -1
  9. package/dist/installer/commands/framework.js +64 -49
  10. package/dist/installer/commands/framework.js.map +1 -1
  11. package/dist/installer/commands/init.js +122 -82
  12. package/dist/installer/commands/init.js.map +1 -1
  13. package/dist/installer/commands/update.js +90 -83
  14. package/dist/installer/commands/update.js.map +1 -1
  15. package/dist/installer/commands/v5-migration.js +133 -0
  16. package/dist/installer/commands/v5-migration.js.map +1 -0
  17. package/dist/installer/phases/framework-lifecycle.js +2 -0
  18. package/dist/installer/phases/framework-lifecycle.js.map +1 -1
  19. package/dist/installer/phases/install-config.js +3 -6
  20. package/dist/installer/phases/install-config.js.map +1 -1
  21. package/dist/installer/phases/manifest.js +2 -6
  22. package/dist/installer/phases/manifest.js.map +1 -1
  23. package/dist/installer/phases/prereqs.js +0 -1
  24. package/dist/installer/phases/prereqs.js.map +1 -1
  25. package/dist/installer/phases/scaffold.js +228 -405
  26. package/dist/installer/phases/scaffold.js.map +1 -1
  27. package/dist/installer/runtime/pipeline-state.js +801 -0
  28. package/dist/installer/runtime/pipeline-state.js.map +1 -0
  29. package/dist/installer/util/install-transaction.js +246 -0
  30. package/dist/installer/util/install-transaction.js.map +1 -0
  31. package/dist/installer/util/registry.js +20 -0
  32. package/dist/installer/util/registry.js.map +1 -1
  33. package/docs/ci-cd.md +57 -0
  34. package/docs/user-docs/codex-vs-claude-code.md +23 -151
  35. package/docs/user-docs/core-updates.md +70 -0
  36. package/docs/user-docs/provider-pipelines.md +53 -0
  37. package/integration-contract.json +179 -66
  38. package/package.json +5 -2
  39. package/schemas/profile.v1.json +1 -1
  40. package/templates/agents/sr-architect.md +30 -0
  41. package/templates/agents/sr-developer.md +30 -19
  42. package/templates/agents/sr-reviewer.md +70 -64
  43. package/templates/codex-skills/batch-implement/SKILL.md +58 -267
  44. package/templates/codex-skills/implement/SKILL.md +136 -420
  45. package/templates/codex-skills/rails/sr-architect/SKILL.md +45 -20
  46. package/templates/codex-skills/rails/sr-developer/SKILL.md +42 -10
  47. package/templates/codex-skills/rails/sr-reviewer/SKILL.md +60 -15
  48. package/templates/codex-skills/retry/SKILL.md +37 -117
  49. package/templates/commands/specrails/batch-implement.md +16 -288
  50. package/templates/commands/specrails/doctor.md +1 -1
  51. package/templates/commands/specrails/implement.md +94 -1260
  52. package/templates/commands/specrails/memory-inspect.md +6 -4
  53. package/templates/commands/specrails/propose-spec.md +1 -1
  54. package/templates/commands/specrails/refactor-recommender.md +8 -51
  55. package/templates/commands/specrails/retry.md +22 -350
  56. package/templates/commands/specrails/telemetry.md +1 -1
  57. package/templates/gemini-commands/batch-implement.toml +28 -40
  58. package/templates/gemini-commands/implement.toml +55 -105
  59. package/templates/gemini-commands/retry.toml +21 -0
  60. package/templates/kimi/specrails/run-skill.mjs +51 -2
  61. package/templates/profiles/default.json +5 -18
  62. package/templates/runtime/provider-pipeline.md +55 -0
  63. package/commands/enrich.md +0 -1456
  64. package/templates/agents/sr-backend-developer.md +0 -91
  65. package/templates/agents/sr-backend-reviewer.md +0 -152
  66. package/templates/agents/sr-doc-sync.md +0 -247
  67. package/templates/agents/sr-frontend-developer.md +0 -85
  68. package/templates/agents/sr-frontend-reviewer.md +0 -145
  69. package/templates/agents/sr-merge-resolver.md +0 -195
  70. package/templates/agents/sr-performance-reviewer.md +0 -186
  71. package/templates/agents/sr-product-analyst.md +0 -36
  72. package/templates/agents/sr-product-manager.md +0 -148
  73. package/templates/agents/sr-security-reviewer.md +0 -191
  74. package/templates/agents/sr-test-writer.md +0 -176
  75. package/templates/codex-skills/enrich/SKILL.md +0 -191
  76. package/templates/codex-skills/merge-resolve/SKILL.md +0 -88
  77. package/templates/codex-skills/rails/sr-backend-developer/SKILL.md +0 -93
  78. package/templates/codex-skills/rails/sr-backend-reviewer/SKILL.md +0 -120
  79. package/templates/codex-skills/rails/sr-doc-sync/SKILL.md +0 -124
  80. package/templates/codex-skills/rails/sr-frontend-developer/SKILL.md +0 -106
  81. package/templates/codex-skills/rails/sr-frontend-reviewer/SKILL.md +0 -111
  82. package/templates/codex-skills/rails/sr-merge-resolver/SKILL.md +0 -156
  83. package/templates/codex-skills/rails/sr-performance-reviewer/SKILL.md +0 -109
  84. package/templates/codex-skills/rails/sr-product-analyst/SKILL.md +0 -85
  85. package/templates/codex-skills/rails/sr-product-manager/SKILL.md +0 -131
  86. package/templates/codex-skills/rails/sr-security-reviewer/SKILL.md +0 -121
  87. package/templates/codex-skills/rails/sr-test-writer/SKILL.md +0 -115
  88. package/templates/commands/specrails/auto-propose-backlog-specs.md +0 -312
  89. package/templates/commands/specrails/enrich.md +0 -1456
  90. package/templates/commands/specrails/get-backlog-specs.md +0 -226
  91. package/templates/commands/specrails/merge-resolve.md +0 -172
  92. package/templates/commands/specrails/reconfig.md +0 -80
  93. package/templates/commands/specrails/vpc-drift.md +0 -405
  94. package/templates/commands/test.md +0 -58
  95. package/templates/personas/persona.md +0 -43
  96. package/templates/personas/the-maintainer.md +0 -98
  97. package/templates/settings/perf-thresholds.yml +0 -25
@@ -1,151 +1,23 @@
1
- # Codex vs Claude Code
2
-
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.
6
-
7
- ---
8
-
9
- ## Summary
10
-
11
- | | Claude Code | Codex |
12
- |--|-------------|-------|
13
- | **Support status** | Supported | Supported |
14
- | **CLI** | `claude` | `codex` |
15
- | **Config directory** | `.claude/` | `.codex/` |
16
- | **Agent instructions** | `CLAUDE.md` | `AGENTS.md` |
17
- | **Skills (`/specrails:*`, `/opsx:*`)** | ✅ Full support | ✅ Full support |
18
- | **OpenSpec workflow** | ✅ Full support | ✅ Full support |
19
- | **Parallel worktrees** | ✅ Native | ⚠️ Limited |
20
- | **Agent definitions** | Markdown frontmatter | TOML |
21
- | **Permissions config** | `settings.json` | `config.toml` |
22
- | **Agent memory** | File-based | File-based (MEMORY.md) |
23
- | **MCP** | ✅ First-class | ✅ First-class |
24
- | **Codex Cloud (web)** | ✗ | ✅ |
25
-
26
- ---
27
-
28
- ## What works the same
29
-
30
- ### Skills
31
-
32
- SpecRails Skills use `SKILL.md` format, which is shared between Codex and Claude Code. All `/specrails:*` and `/opsx:*` skills run identically on both platforms:
33
-
34
- - `/specrails:implement` — full pipeline (design → code → review → PR)
35
- - `/specrails:get-backlog-specs` — VPC-ranked backlog view
36
- - `/opsx:ff` — OpenSpec fast-forward
37
- - All other workflow skills
38
-
39
- ### OpenSpec
40
-
41
- The full OpenSpec design-to-code workflow works on both platforms. Artifacts (proposals, designs, task lists, context bundles) are plain Markdown files — no platform dependency.
42
-
43
- ### Git and GitHub
44
-
45
- Both platforms use standard `git` and the `gh` CLI. PR creation, branch management, and issue integration work identically.
46
-
47
- ### Agent memory
48
-
49
- Both platforms use file-based memory. Claude Code uses `.claude/agent-memory/`. Codex uses `.codex/agent-memory/`. The format is the same — only the location changes.
50
-
51
- ---
52
-
53
- ## What is different
54
-
55
- ### Parallel execution and worktrees
56
-
57
- `/specrails:batch-implement` (multiple issues in parallel) uses git worktree isolation. On Claude Code this runs locally with full isolation. On Codex:
58
-
59
- - **Codex CLI**: Parallel execution is supported but worktree isolation is limited in the current beta. Multiple issues may share a working directory.
60
- - **Codex Cloud**: Native async parallelism — each task gets an isolated cloud environment. Well-suited for batch work.
61
-
62
- ### Agent definitions
63
-
64
- SpecRails generates agent definitions in the format required by each platform:
65
-
66
- | Platform | Format | Location |
67
- |----------|--------|----------|
68
- | Claude Code | Markdown with YAML frontmatter | `.claude/agents/sr-*.md` |
69
- | Codex | TOML | `.codex/agents/sr-*.toml` |
70
-
71
- The behavior of each agent (Architect, Developer, Reviewer, etc.) is identical — only the definition format differs.
72
-
73
- ### Configuration and permissions
74
-
75
- | Platform | Format | Location |
76
- |----------|--------|----------|
77
- | Claude Code | JSON | `.claude/settings.json` |
78
- | Codex | TOML | `.codex/config.toml` |
79
-
80
- The installer generates the correct format automatically.
81
-
82
- ### Non-interactive invocation
83
-
84
- Claude Code and Codex have different non-interactive modes:
85
-
86
- ```bash
87
- # Claude Code
88
- claude --print "run /specrails:implement #42"
89
-
90
- # Codex
91
- codex exec "run /specrails:implement #42"
92
- ```
93
-
94
- Skills themselves are the same — only the CLI invocation differs.
95
-
96
- ---
97
-
98
- ## Choosing a platform
99
-
100
- **Choose Claude Code if:**
101
- - You want the most stable and fully tested SpecRails experience
102
- - You need reliable parallel worktree isolation for batch feature work
103
- - Your team is already in the Anthropic ecosystem
104
-
105
- **Choose Codex if:**
106
- - Your team is in the OpenAI ecosystem and prefers Codex
107
- - You want to use Codex Cloud for async, web-based agent runs
108
- - You are evaluating SpecRails and already have Codex installed
109
-
110
- **Use both if:**
111
- - Different team members use different tools
112
- - You want to benchmark agents across platforms
113
-
114
- When several CLIs are installed, pass `--provider` to choose explicitly:
115
-
116
- ```bash
117
- npx specrails-core@latest init --provider codex
118
- ```
119
-
120
- ---
121
-
122
- ## Platform detection
123
-
124
- The installer detects your platform automatically:
125
-
126
- ```
127
- Detected CLI: codex (1.2.0)
128
- Generating config in .codex/
129
- ```
130
-
131
- To override:
132
-
133
- ```bash
134
- npx specrails-core@latest init --provider codex --root-dir .
135
- npx specrails-core@latest init --provider claude --root-dir .
136
- ```
137
-
138
- ---
139
-
140
- ## Known limitations (Codex beta)
141
-
142
- | Limitation | Status |
143
- |-----------|--------|
144
- | Parallel worktree isolation | Partial — being improved |
145
- | Windows support | Experimental in Codex CLI |
146
- | Agent memory system maturity | Less mature than Claude Code; use MEMORY.md patterns |
147
- | Codex CLI version stability | Frequent updates; pin your version if needed |
148
-
149
- ---
150
-
151
- [← Getting Started (Codex)](getting-started-codex.md) · [← Installation](installation.md) · [CLI Reference →](cli-reference.md)
1
+ # Codex and Claude Code execution
2
+
3
+ Both providers support the SpecRails design, implementation, review and archive
4
+ workflow. Their adapters differ; native role APIs and conversation memory are not
5
+ interchangeable.
6
+
7
+ | Concern | Claude Code | Codex |
8
+ |---|---|---|
9
+ | Role definitions | `.claude/agents/sr-*.md` | `.codex/skills/rails/sr-*/SKILL.md` |
10
+ | Workflow entry | `/specrails:implement` | `$implement` |
11
+ | Multiple tickets | Aggregate change and shared journal | Routes directly to `$batch-implement` |
12
+ | Retry | Durable pipeline journal | Same journal, direct role calls; no nested coordinator |
13
+ | Role models | Configured role/profile model | Inherited model on full-history forks; overrides require a compatible native transport |
14
+ | Verification | Scoped development checks and candidate-bound full gate | Same evidence contract |
15
+ | Hosted worktrees/delivery | Owned by the host | Owned by the host |
16
+
17
+ The installed `.specrails/runtime/pipeline.mjs` helper coordinates both providers.
18
+ Its execution context identifies the frozen specs, repositories, shared backlog,
19
+ OpenSpec artifact root and ownership. Skills must not infer those roots from cwd.
20
+
21
+ A completed process is not an implementation verdict. Design confidence, checked
22
+ tasks, semantic review, fresh verification and an authorized archive are required
23
+ before success. See [provider pipeline contracts](provider-pipelines.md).
@@ -0,0 +1,70 @@
1
+ # Core installation and update consistency
2
+
3
+ `specrails-core init` and `specrails-core update` use the version of the package
4
+ that actually provides the CLI. Updating an npm package and updating a workspace
5
+ are separate operations: run the selected CLI's `update --root-dir <repository>`
6
+ to refresh that project's managed artifacts. `--provider` selects the additional
7
+ provider to include; existing managed provider selections are preserved and
8
+ reassembled, including in-repository copies and Windows copy fallbacks. Provider
9
+ inventory is checked against installed Core artifacts; an unrelated directory
10
+ containing only user files is not enrolled automatically.
11
+
12
+ Core 5 installation is deterministic. It installs the baseline roles, commands,
13
+ OpenSpec integration and declared local execution helper without an AI enrichment
14
+ phase. `integration-contract.json` describes the supported lifecycle and providers.
15
+
16
+ ## Version and rollback rules
17
+
18
+ A CLI older than the workspace marker or shared active framework refuses ordinary
19
+ init/update. This protects an updated installation from an old global executable.
20
+ Use the intended Core package rather than editing a version marker to bypass the
21
+ check. Low-level explicit pointer changes are administrative rollback operations;
22
+ they do not imply that project copies have been restored.
23
+
24
+ Managed framework bytes are generated in an isolated staging directory, validated
25
+ and stamped before publication. The content/source hashes include the compiled
26
+ pipeline helper, so a same-version development rebuild is repaired when runtime
27
+ bytes change. The previous framework directory is retained as
28
+ `.previous-<version>-<id>` for recovery. A failed generation leaves the active
29
+ framework untouched.
30
+
31
+ Init/update snapshot the managed workspace surfaces and framework pointer. Failure
32
+ restores those snapshots, including symlinks, and does not publish a successful
33
+ workspace version or Core-owned registry version. If restoration itself fails,
34
+ the error identifies the retained backup for recovery. Reserved custom agents
35
+ stay in place during rollback: edits, new custom files and deliberate deletions
36
+ made while OpenSpec runs are preserved. Profiles remain outside the snapshot
37
+ surfaces; provider configuration is restored with the managed workspace snapshot.
38
+
39
+ A separate framework lifecycle lock covers admission, version revalidation,
40
+ snapshots, asynchronous OpenSpec provisioning and final commit or rollback. The
41
+ same lock protects Desktop's low-level install-framework, swap-current and
42
+ assemble commands. A concurrent operation fails immediately with a retry message
43
+ instead of waiting while holding another lock. This prevents a failed installer
44
+ from rolling back a framework that a second installer already reported as ready.
45
+ A positively dead process owner can be recovered; concurrent recovery attempts
46
+ are serialized, and an unidentified or live owner is never taken over.
47
+
48
+ `update --dry-run` reports the intended change without allocating or rewriting
49
+ registry entries. Partial `--only rules` or `--only agents` refreshes do not claim
50
+ that the entire framework has moved to the executing CLI's version. The returned
51
+ `installedVersion` describes the actual workspace marker.
52
+
53
+ The low-level `install-framework --version` command requires the requested label
54
+ to match the package version supplying its bytes. `assemble --version` requires
55
+ the matching complete active framework before recording that version in a project.
56
+
57
+ ## Desktop
58
+
59
+ Desktop keeps the selected package and its dependencies after an update. Its
60
+ Settings page reports runtime, framework, bundled and latest-known versions
61
+ separately. Partial workspace migration remains pending across restart and can be
62
+ retried using the retained package offline. A CLI installed outside Desktop can
63
+ also be discovered through PATH; an explicit `SPECRAILS_CORE_BIN` takes precedence.
64
+
65
+ Changes in this branch require a Core package build and distribution before an
66
+ already installed Desktop can consume them. The source changes alone do not
67
+ upgrade any user installation or publish a new package.
68
+
69
+ See [Provider pipeline contracts](provider-pipelines.md) for the resumable
70
+ implementation journal and verification behavior.
@@ -0,0 +1,53 @@
1
+ # Provider pipeline contracts
2
+
3
+ Core installs a local, self-contained Node helper at
4
+ `.specrails/runtime/pipeline.mjs`. It uses no global Core lookup or network download.
5
+ The shared contract is embedded in the installed Claude, Codex, Gemini and Kimi workflows.
6
+ `SPECRAILS_PIPELINE_RUNTIME` can explicitly identify that helper for a child process.
7
+
8
+ An absolute `SPECRAILS_EXECUTION_CONTEXT` JSON file supplies immutable specs, selected
9
+ repositories, OpenSpec artifactRoot, backlogRoot (the workspace containing
10
+ `.specrails/local-tickets.json`), optional backlogPath, and host/core ownership.
11
+ Batch uses one aggregate OpenSpec change and journal; task groups retain ticket and
12
+ repository identity. Final verification and semantic review cover the whole batch.
13
+
14
+ Standalone invocation admits ticket IDs with `init --tickets "17,18"` or a structured
15
+ `--scope-request` for free-form specs. Reuse the generated context on retry; explicit
16
+ host context always takes precedence. Core-owned delivery requires explicit ownership.
17
+
18
+ Use the helper's init/status/phase/verify/archive-check operations. Status identifies
19
+ the first invalid phase. Retry reuses valid earlier work; blocked remains retriable.
20
+ Explicit role handoffs contain frozen criteria and exact paths, not a promise that
21
+ another provider conversation retained memory. Archive-only execution preserves the
22
+ reviewed confidence file; the gate binds its exact bytes and the candidate.
23
+
24
+ ## Gemini
25
+
26
+ OpenSpec is installed with an isolated complete workflow profile, then Gemini skills
27
+ are placed in the actual execution workspace. Updates preserve custom skill folders.
28
+ The adapter requires invoke_agent and role activate_skill availability. Turn limits
29
+ are capability-dependent: older loaders reject optional metadata. By default Core
30
+ omits it and uses progress-bound continuation handoffs. After verifying loader
31
+ support, an installer may set SPECRAILS_GEMINI_AGENT_LIMITS=supported and
32
+ SPECRAILS_GEMINI_MAX_TURNS (1–200, default 60). This does not confer native session
33
+ continuity; every reinvocation still receives an explicit checkpoint.
34
+
35
+ ## Kimi
36
+
37
+ The managed runner preserves the absolute execution context, shared backlog path,
38
+ helper path and selected repository access across private role working directories.
39
+ SPECRAILS_BACKLOG_PATH is the exact ticket-file path; SPECRAILS_BACKLOG_ROOT is its
40
+ logical workspace. Host-owned contexts reject sibling worktree requests before any
41
+ role process starts. Role models remain exact profile values. Standalone managed
42
+ worktree manifests and their guarded merge/cleanup mechanism remain available.
43
+
44
+ ## Validation limits
45
+
46
+ Local regression fixtures install the real provider artifacts and run the real
47
+ helper against temporary repositories, including failed gates, review retry,
48
+ archive authorization and unchanged frozen scope. Kimi process fixtures additionally
49
+ exercise private cwd, shared-backlog access and host worktree rejection. They do not
50
+ make paid model calls or claim identical behavior across every native CLI release.
51
+
52
+ See [Core installation and update consistency](core-updates.md) for version
53
+ selection, rollback and Desktop integration.
@@ -1,44 +1,74 @@
1
1
  {
2
- "schemaVersion": "3.2",
2
+ "schemaVersion": "4.0",
3
3
  "providers": {
4
4
  "claude": {
5
- "enrichCommand": "/specrails:enrich",
6
- "enrichArgs": ["--from-config"],
7
- "updateCommand": "/specrails:enrich",
8
- "updateArgs": ["--update"],
5
+ "updateCommand": "update",
9
6
  "cli": {
10
- "initArgs": [],
11
- "enrichArgs": ["--dangerously-skip-permissions", "--output-format", "stream-json", "-p", "/specrails:enrich"],
12
- "enrichFromConfigArgs": ["--dangerously-skip-permissions", "--output-format", "stream-json", "-p", "/specrails:enrich --from-config"]
7
+ "initArgs": [
8
+ "init",
9
+ "--yes",
10
+ "--provider",
11
+ "claude"
12
+ ],
13
+ "updateArgs": [
14
+ "update",
15
+ "--provider",
16
+ "claude"
17
+ ]
18
+ },
19
+ "initCommand": "init",
20
+ "workflows": {
21
+ "implement": "/specrails:implement",
22
+ "batch-implement": "/specrails:batch-implement",
23
+ "retry": "/specrails:retry"
13
24
  }
14
25
  },
15
26
  "codex": {
16
- "enrichCommand": "$enrich",
17
- "enrichArgs": ["--from-config"],
18
- "updateCommand": "$enrich",
19
- "updateArgs": ["--update"],
27
+ "updateCommand": "update",
20
28
  "cli": {
21
- "initArgs": [],
22
- "enrichArgs": ["exec", "run enrich"],
23
- "enrichFromConfigArgs": ["exec", "run enrich --from-config"]
29
+ "initArgs": [
30
+ "init",
31
+ "--yes",
32
+ "--provider",
33
+ "codex"
34
+ ],
35
+ "updateArgs": [
36
+ "update",
37
+ "--provider",
38
+ "codex"
39
+ ]
40
+ },
41
+ "initCommand": "init",
42
+ "workflows": {
43
+ "implement": "$implement",
44
+ "batch-implement": "$batch-implement",
45
+ "retry": "$retry"
24
46
  }
25
47
  },
26
48
  "gemini": {
27
- "enrichCommand": "/specrails:enrich",
28
- "enrichArgs": ["--from-config"],
29
- "updateCommand": "/specrails:enrich",
30
- "updateArgs": ["--update"],
49
+ "updateCommand": "update",
31
50
  "cli": {
32
- "initArgs": [],
33
- "enrichArgs": ["-p", "/specrails:enrich", "--output-format", "stream-json"],
34
- "enrichFromConfigArgs": ["-p", "/specrails:enrich --from-config", "--output-format", "stream-json"]
51
+ "initArgs": [
52
+ "init",
53
+ "--yes",
54
+ "--provider",
55
+ "gemini"
56
+ ],
57
+ "updateArgs": [
58
+ "update",
59
+ "--provider",
60
+ "gemini"
61
+ ]
62
+ },
63
+ "initCommand": "init",
64
+ "workflows": {
65
+ "implement": "/specrails:implement",
66
+ "batch-implement": "/specrails:batch-implement",
67
+ "retry": "/specrails:retry"
35
68
  }
36
69
  },
37
70
  "kimi": {
38
- "enrichCommand": "/skill:specrails-enrich",
39
- "enrichArgs": ["--from-config"],
40
- "updateCommand": "/skill:specrails-enrich",
41
- "updateArgs": ["--update"],
71
+ "updateCommand": "update",
42
72
  "cli": {
43
73
  "binary": "node",
44
74
  "providerBinary": "kimi",
@@ -69,89 +99,172 @@
69
99
  "windowsPromptTransport": "For the standard npm kimi.cmd/bat shim, prompt bytes travel over stdin to a fixed Node bootstrap which restores process.argv before importing Kimi; native executables fail above a 30000 UTF-16 command-line budget.",
70
100
  "initialActivationTelemetry": "Visible prompt parity only; the external materializer cannot emit Kimi-private skill.activated/origin telemetry.",
71
101
  "cancellation": "Single-skill mode forwards SIGINT/SIGTERM/SIGHUP to its direct Kimi child. Role-wave mode forwards each termination signal to every live Kimi child and waits for aggregate completion; the embedding host remains responsible for platform process-tree teardown.",
72
- "initArgs": [],
73
- "enrichArgs": [".kimi-code/specrails/run-skill.mjs", "--skill", "specrails-enrich", "--model", "k3"],
74
- "enrichFromConfigArgs": [".kimi-code/specrails/run-skill.mjs", "--skill", "specrails-enrich", "--model", "k3", "--args", "--from-config"],
75
- "resumeArgs": ["--session=<session-id>"],
76
- "notes": "CLI-only integration. enrichCommand/updateCommand are interactive Kimi TUI syntax only. Headless callers must execute binary + enrichArgs; plain `kimi -p \"/skill:...\"` is literal prompt text in Kimi 0.27 and does not activate a skill. The managed Node runner materializes the upstream user-slash prompt, then launches external Kimi with stream-json and no shell. Generated multi-role workflows use one bounded role-wave file so context never enters shell source and parallel roles cannot race on request paths. Do not start kimi web/server; authenticate once with `kimi login`."
102
+ "initArgs": [
103
+ "init",
104
+ "--yes",
105
+ "--provider",
106
+ "kimi"
107
+ ],
108
+ "resumeArgs": [
109
+ "--session=<session-id>"
110
+ ],
111
+ "notes": "CLI-only provider execution. Installation/update uses the deterministic Core CLI above. Headless workflows use the managed Node skill runner, never literal /skill text in kimi -p. Role waves await every child and preserve frozen Core execution context. Authenticate once with kimi login.",
112
+ "updateArgs": [
113
+ "update",
114
+ "--provider",
115
+ "kimi"
116
+ ],
117
+ "workflowArgs": [
118
+ ".kimi-code/specrails/run-skill.mjs",
119
+ "--skill",
120
+ "<skill-id>",
121
+ "--model",
122
+ "<model-id>",
123
+ "--args",
124
+ "<arguments>"
125
+ ]
126
+ },
127
+ "initCommand": "init",
128
+ "workflows": {
129
+ "implement": "/skill:specrails-implement",
130
+ "batch-implement": "/skill:specrails-batch-implement",
131
+ "retry": "/skill:specrails-retry"
77
132
  }
78
133
  }
79
134
  },
80
135
  "tiers": {
81
- "quick": {
82
- "description": "Template-based install with minimal defaults. No AI codebase analysis. Agents are functional immediately.",
83
- "enrichFlag": "--quick",
84
- "checkpoints": ["base_install", "agent_selection", "agent_generation"],
136
+ "standard": {
137
+ "description": "Deterministic installation of the core agents, provider workflows and required skills. No model invocation or enrichment.",
138
+ "checkpoints": [
139
+ "base_install",
140
+ "agent_generation",
141
+ "command_generation"
142
+ ],
85
143
  "requiresEnrich": false
86
- },
87
- "full": {
88
- "description": "Full AI-powered install. Analyzes codebase, generates VPC personas, creates personalized agents.",
89
- "enrichFlag": "--from-config",
90
- "checkpoints": ["codebase_analysis", "vpc_discovery", "persona_synthesis", "agent_generation", "command_generation"],
91
- "requiresEnrich": true
92
144
  }
93
145
  },
94
146
  "configSchema": {
95
147
  "file": ".specrails/install-config.yaml",
96
148
  "version": 1,
97
149
  "fields": {
98
- "version": "number — schema version, currently 1",
99
- "provider": "string — claude | codex | gemini | kimi",
100
- "tier": "string — full | quick",
101
- "agents.selected": "string[] — unique lowercase kebab-case agent ids to install (1-64 characters)",
102
- "agents.excluded": "string[] — unique lowercase kebab-case agent ids to skip; must not overlap agents.selected",
103
- "models.preset": "string — balanced | budget | max; resolved within the selected provider catalog",
104
- "models.defaults.model": "string — exact provider model id or configured alias (overrides preset; Kimi: 1-128 characters matching [A-Za-z0-9][A-Za-z0-9._/:-]*; default: k3)",
105
- "models.overrides": "Record<safe-agent-id, string> — exact per-agent provider model ids or configured aliases with the same provider-specific validation (highest priority)"
150
+ "version": "number \u2014 schema version, currently 1",
151
+ "provider": "string \u2014 claude | codex | gemini | kimi",
152
+ "tier": "Deprecated legacy string, tolerated and ignored; all installs use deterministic placement.",
153
+ "agents.selected": "string[] \u2014 unique lowercase kebab-case agent ids to install (1-64 characters)",
154
+ "agents.excluded": "string[] \u2014 unique lowercase kebab-case agent ids to skip; must not overlap agents.selected",
155
+ "models.preset": "string \u2014 balanced | budget | max; resolved within the selected provider catalog",
156
+ "models.defaults.model": "string \u2014 exact provider model id or configured alias (overrides preset; Kimi: 1-128 characters matching [A-Za-z0-9][A-Za-z0-9._/:-]*; default: k3)",
157
+ "models.overrides": "Record<safe-agent-id, string> \u2014 exact per-agent provider model ids or configured aliases with the same provider-specific validation (highest priority)"
106
158
  }
107
159
  },
108
160
  "checkpoints": {
109
- "base_install": "Templates and directory structure copied",
110
- "agent_selection": "Agent list finalized from config or TUI",
111
- "codebase_analysis": "Codebase language/framework/architecture detected",
112
- "vpc_discovery": "VPC personas researched and drafted",
113
- "persona_synthesis": "Final persona files written",
114
- "agent_generation": "All selected agents generated with placeholders filled",
115
- "command_generation": "All workflow commands installed and configured"
161
+ "base_install": "Runtime prerequisites and artifact workspace resolved",
162
+ "agent_generation": "Core agents and selected custom roles placed",
163
+ "command_generation": "Workflow commands, required skills and installation manifest verified"
116
164
  },
117
165
  "modelPresets": {
118
166
  "balanced": {
119
167
  "scope": "claude",
120
168
  "description": "Legacy Claude preset view retained for existing consumers. Other providers resolve this preset through providerModelCatalogs.",
121
- "defaults": { "model": "sonnet" },
169
+ "defaults": {
170
+ "model": "sonnet"
171
+ },
122
172
  "overrides": {}
123
173
  },
124
174
  "budget": {
125
175
  "scope": "claude",
126
176
  "description": "Legacy Claude preset view retained for existing consumers. Other providers resolve this preset through providerModelCatalogs.",
127
- "defaults": { "model": "haiku" },
177
+ "defaults": {
178
+ "model": "haiku"
179
+ },
128
180
  "overrides": {}
129
181
  },
130
182
  "max": {
131
183
  "scope": "claude",
132
184
  "description": "Legacy Claude preset view retained for existing consumers. Other providers resolve this preset through providerModelCatalogs.",
133
- "defaults": { "model": "sonnet" },
134
- "overrides": { "sr-architect": "opus", "sr-product-manager": "opus" }
185
+ "defaults": {
186
+ "model": "sonnet"
187
+ },
188
+ "overrides": {
189
+ "sr-architect": "opus",
190
+ "sr-product-manager": "opus"
191
+ }
135
192
  }
136
193
  },
137
194
  "providerModelCatalogs": {
138
195
  "kimi": {
139
196
  "default": "k3",
140
- "models": ["k3", "kimi-for-coding", "kimi-for-coding-highspeed"],
197
+ "models": [
198
+ "k3",
199
+ "kimi-for-coding",
200
+ "kimi-for-coding-highspeed"
201
+ ],
141
202
  "presets": {
142
- "balanced": { "defaults": { "model": "k3" }, "overrides": {} },
143
- "budget": { "defaults": { "model": "k3" }, "overrides": {} },
144
- "max": { "defaults": { "model": "k3" }, "overrides": {} }
203
+ "balanced": {
204
+ "defaults": {
205
+ "model": "k3"
206
+ },
207
+ "overrides": {}
208
+ },
209
+ "budget": {
210
+ "defaults": {
211
+ "model": "k3"
212
+ },
213
+ "overrides": {}
214
+ },
215
+ "max": {
216
+ "defaults": {
217
+ "model": "k3"
218
+ },
219
+ "overrides": {}
220
+ }
145
221
  },
146
222
  "cliAliasPrefix": "kimi-code/",
147
223
  "reasoningEfforts": {
148
- "k3": ["low", "high", "max"]
224
+ "k3": [
225
+ "low",
226
+ "high",
227
+ "max"
228
+ ]
149
229
  },
150
230
  "note": "Install config and profiles retain exact ids or safe custom aliases. Preset names do not imply Claude aliases for Kimi. Process launch prefixes only the three documented official short ids with kimi-code/; every custom alias that matches the published model grammar passes through unchanged."
151
231
  }
152
232
  },
153
233
  "legacyCompat": {
154
234
  "setupCommandAlias": false,
155
- "note": "The Node-native installer ships /specrails:enrich only. Existing repos should prune any leftover /specrails:setup alias during re-install or update."
235
+ "enrichCommand": false,
236
+ "note": "Core 5 installs directly. Legacy config tier is tolerated; enrich, --quick and --lite are removed. Hosts must negotiate schema 4 deterministic lifecycle."
237
+ },
238
+ "lifecycle": {
239
+ "mode": "deterministic",
240
+ "requiresEnrich": false,
241
+ "initCommand": "init",
242
+ "updateCommand": "update",
243
+ "minimumCoreMajor": 5,
244
+ "removedCommands": [
245
+ "enrich"
246
+ ],
247
+ "removedFlags": [
248
+ "--quick",
249
+ "--lite"
250
+ ]
251
+ },
252
+ "execution": {
253
+ "schemaVersion": 1,
254
+ "contextEnv": "SPECRAILS_EXECUTION_CONTEXT",
255
+ "context": "Absolute JSON file: runId, backlogRoot, backlogPath?, artifactRoot, artifactRepositoryId, repositories[{id,name,path,baseSha?}], ownership{git,backlog,worktrees:host|core}, specs[{id,title,description,repositoryIds?,acceptanceCriteria?}]",
256
+ "runtime": ".specrails/runtime/pipeline.mjs",
257
+ "operations": [
258
+ "init",
259
+ "status",
260
+ "phase",
261
+ "verify",
262
+ "archive-check",
263
+ "preview",
264
+ "apply-preview"
265
+ ],
266
+ "statePath": "<backlogRoot>/.specrails/pipeline/<runId>/state.json",
267
+ "verification": "Successful argv-based commands captured by the runtime, bound to frozen scope, candidate files and relevant execution environment. Unknown or stale evidence cannot pass archive.",
268
+ "hostOwnership": "Host worktrees are used directly; host git/backlog are not mutated by Core delivery."
156
269
  }
157
270
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specrails-core",
3
- "version": "4.12.1",
3
+ "version": "5.1.0",
4
4
  "description": "Provider-independent AI agent workflow system for Claude Code, Codex, Gemini CLI, and Kimi Code",
5
5
  "type": "module",
6
6
  "bin": {
@@ -61,7 +61,10 @@
61
61
  "test:watch": "vitest",
62
62
  "test:coverage": "npm run build && vitest run --coverage",
63
63
  "dogfood": "npm run build && node bin/specrails-core.mjs init --yes",
64
- "prepack": "npm run build"
64
+ "prepack": "npm run build",
65
+ "test:scripts": "node --test scripts/release-utils.test.mjs",
66
+ "check:package": "npm run build && node scripts/verify-package.mjs",
67
+ "ci": "npm run typecheck && npm run test:scripts && npm run test:coverage && npm run check:package"
65
68
  },
66
69
  "dependencies": {
67
70
  "@inquirer/prompts": "^7.0.0",
@@ -43,7 +43,7 @@
43
43
  "type": "array",
44
44
  "minItems": 1,
45
45
  "items": { "$ref": "#/$defs/agentEntry" },
46
- "description": "Ordered chain of agents that participate in the pipeline when this profile is active. Every profile (default + custom) must include the baseline trio (sr-architect, sr-developer, sr-reviewer) — the pipeline depends on all three. sr-merge-resolver and every other agent are optional add-ons selected at install time. Custom profiles add optional agents on top of the baseline.",
46
+ "description": "Ordered chain of agents that participate in the pipeline when this profile is active. Every profile (default + custom) must include the baseline trio (sr-architect, sr-developer, sr-reviewer) — the pipeline depends on all three, and they are the only agents the installer ships. Additional agents are user-authored 'custom-*' agents added on top of the baseline; a profile entry whose agent file does not exist is warned and skipped at run time.",
47
47
  "allOf": [
48
48
  {
49
49
  "description": "Required baseline agent: sr-architect",