specrails-core 5.6.0 → 6.0.1
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 +27 -145
- package/bin/specrails-core.mjs +12 -554
- package/dist/agent-runtime/capabilities.js +0 -1
- package/dist/agent-runtime/change-scope.d.ts +63 -0
- package/dist/agent-runtime/change-scope.js +297 -0
- package/dist/agent-runtime/cli-executor.d.ts +1 -1
- package/dist/agent-runtime/cli-executor.js +1 -2
- package/dist/agent-runtime/cli-process.js +0 -1
- package/dist/agent-runtime/cli.js +4 -5
- package/dist/agent-runtime/codex-schema.js +0 -1
- package/dist/agent-runtime/compact/architect.d.ts +3 -272
- package/dist/agent-runtime/compact/architect.js +8 -9
- package/dist/agent-runtime/compact/chat-client.d.ts +3 -3
- package/dist/agent-runtime/compact/chat-client.js +1 -2
- package/dist/agent-runtime/compact/developer.d.ts +3 -70
- package/dist/agent-runtime/compact/developer.js +13 -14
- package/dist/agent-runtime/compact/environment.d.ts +16 -5
- package/dist/agent-runtime/compact/environment.js +32 -3
- package/dist/agent-runtime/compact/exit-code-honesty.d.ts +2 -1
- package/dist/agent-runtime/compact/exit-code-honesty.js +0 -1
- package/dist/agent-runtime/compact/guarded-loop.d.ts +2 -18
- package/dist/agent-runtime/compact/guarded-loop.js +7 -8
- package/dist/agent-runtime/compact/prompt-inputs.d.ts +0 -2
- package/dist/agent-runtime/compact/prompt-inputs.js +1 -2
- package/dist/agent-runtime/compact/reviewer.d.ts +0 -13
- package/dist/agent-runtime/compact/reviewer.js +5 -6
- package/dist/agent-runtime/compact/step.d.ts +0 -1
- package/dist/agent-runtime/compact/step.js +1 -2
- package/dist/agent-runtime/compact/test-reachability.js +6 -3
- package/dist/agent-runtime/config.js +0 -1
- package/dist/agent-runtime/core-host.d.ts +2 -2
- package/dist/agent-runtime/core-host.js +2 -3
- package/dist/agent-runtime/durable-store.d.ts +0 -1
- package/dist/agent-runtime/durable-store.js +1 -2
- package/dist/agent-runtime/efficiency-summary.d.ts +2 -2
- package/dist/agent-runtime/efficiency-summary.js +1 -2
- package/dist/agent-runtime/efficiency-types.js +0 -1
- package/dist/agent-runtime/efficiency.js +0 -1
- package/dist/agent-runtime/evaluation-corpus.js +0 -1
- package/dist/agent-runtime/evaluation.d.ts +2 -1
- package/dist/agent-runtime/evaluation.js +1 -2
- package/dist/agent-runtime/executor-types.d.ts +1 -1
- package/dist/agent-runtime/executor-types.js +0 -1
- package/dist/agent-runtime/executors.js +0 -1
- package/dist/agent-runtime/gemini-policy.js +0 -1
- package/dist/agent-runtime/graph/artifacts.d.ts +1 -1
- package/dist/agent-runtime/graph/artifacts.js +5 -3
- package/dist/agent-runtime/graph/convergence.d.ts +26 -0
- package/dist/agent-runtime/graph/convergence.js +62 -0
- package/dist/agent-runtime/graph/nodes.d.ts +1 -1
- package/dist/agent-runtime/graph/nodes.js +170 -24
- package/dist/agent-runtime/graph/review-policy.js +0 -1
- package/dist/agent-runtime/graph/roles.d.ts +2 -5
- package/dist/agent-runtime/graph/roles.js +2 -8
- package/dist/agent-runtime/graph/state.d.ts +6 -1
- package/dist/agent-runtime/graph/state.js +2 -1
- package/dist/agent-runtime/graph-checkpointer.d.ts +2 -1
- package/dist/agent-runtime/graph-checkpointer.js +0 -1
- package/dist/agent-runtime/guardrails.d.ts +3 -3
- package/dist/agent-runtime/guardrails.js +1 -2
- package/dist/agent-runtime/index.d.ts +1 -1
- package/dist/agent-runtime/index.js +1 -2
- package/dist/agent-runtime/kimi-acp.js +1 -2
- package/dist/agent-runtime/kimi-model.d.ts +6 -0
- package/dist/agent-runtime/kimi-model.js +12 -0
- package/dist/agent-runtime/openai-executor.d.ts +0 -9
- package/dist/agent-runtime/openai-executor.js +6 -7
- package/dist/agent-runtime/openspec-tool-server.js +1 -2
- package/dist/agent-runtime/openspec.d.ts +0 -2
- package/dist/agent-runtime/openspec.js +1 -6
- package/dist/agent-runtime/prompts.d.ts +11 -5
- package/dist/agent-runtime/prompts.js +46 -17
- package/dist/agent-runtime/provider-diagnostic.js +1 -2
- package/dist/agent-runtime/recovery.js +1 -2
- package/dist/agent-runtime/repository-context.d.ts +1 -1
- package/dist/agent-runtime/repository-context.js +19 -1
- package/dist/agent-runtime/review-context.d.ts +1 -1
- package/dist/agent-runtime/review-context.js +0 -1
- package/dist/agent-runtime/role-routing.js +0 -1
- package/dist/agent-runtime/role-state.js +0 -1
- package/dist/agent-runtime/runtime-identity.js +1 -2
- package/dist/agent-runtime/tool-event.js +0 -1
- package/dist/agent-runtime/verification-plan.d.ts +5 -4
- package/dist/agent-runtime/verification-plan.js +9 -5
- package/dist/agent-runtime/workflow-types.js +0 -1
- package/dist/agent-runtime/workflow.js +0 -1
- package/dist/agent-runtime/workspace-tools.d.ts +2 -2
- package/dist/agent-runtime/workspace-tools.js +1 -2
- package/dist/installer/cli.d.ts +3 -32
- package/dist/installer/cli.js +26 -101
- package/dist/installer/commands/framework.d.ts +4 -3
- package/dist/installer/commands/framework.js +0 -1
- package/dist/installer/commands/init.d.ts +4 -25
- package/dist/installer/commands/init.js +5 -8
- package/dist/installer/phases/framework-lifecycle.d.ts +3 -17
- package/dist/installer/phases/framework-lifecycle.js +2 -3
- package/dist/installer/phases/install-config.d.ts +7 -8
- package/dist/installer/phases/install-config.js +2 -7
- package/dist/installer/phases/manifest.d.ts +6 -7
- package/dist/installer/phases/manifest.js +2 -7
- package/dist/installer/phases/prereqs.d.ts +6 -7
- package/dist/installer/phases/prereqs.js +4 -6
- package/dist/installer/phases/provider-detect.d.ts +6 -7
- package/dist/installer/phases/provider-detect.js +2 -4
- package/dist/installer/phases/scaffold.d.ts +9 -10
- package/dist/installer/phases/scaffold.js +82 -805
- package/dist/installer/util/errors.js +0 -1
- package/dist/installer/util/exec.d.ts +3 -2
- package/dist/installer/util/exec.js +0 -1
- package/dist/installer/util/fs.d.ts +0 -10
- package/dist/installer/util/fs.js +1 -2
- package/dist/installer/util/git.js +0 -1
- package/dist/installer/util/install-transaction.d.ts +2 -2
- package/dist/installer/util/install-transaction.js +1 -2
- package/dist/installer/util/logger.d.ts +1 -3
- package/dist/installer/util/logger.js +0 -1
- package/dist/installer/util/paths.js +0 -1
- package/dist/installer/util/registry.d.ts +4 -8
- package/dist/installer/util/registry.js +2 -3
- package/dist/{installer/runtime → pipeline}/pipeline-state.d.ts +11 -0
- package/dist/{installer/runtime → pipeline}/pipeline-state.js +56 -5
- package/dist/shared/args.d.ts +18 -0
- package/dist/shared/args.js +53 -0
- package/integration-contract.json +11 -47
- package/package.json +3 -10
- package/templates/agents/sr-architect.md +15 -310
- package/templates/agents/sr-developer.md +15 -269
- package/templates/agents/sr-reviewer.md +13 -367
- package/templates/codex-skills/rails/sr-architect/SKILL.md +14 -308
- package/templates/codex-skills/rails/sr-developer/SKILL.md +14 -201
- package/templates/codex-skills/rails/sr-reviewer/SKILL.md +15 -289
- package/templates/kimi/specrails/run-skill.mjs +91 -2173
- package/bin/tui-installer.mjs +0 -430
- package/commands/doctor.md +0 -62
- package/dist/agent-runtime/capabilities.js.map +0 -1
- package/dist/agent-runtime/cli-executor.js.map +0 -1
- package/dist/agent-runtime/cli-process.js.map +0 -1
- package/dist/agent-runtime/cli.js.map +0 -1
- package/dist/agent-runtime/codex-schema.js.map +0 -1
- package/dist/agent-runtime/compact/architect.js.map +0 -1
- package/dist/agent-runtime/compact/chat-client.js.map +0 -1
- package/dist/agent-runtime/compact/developer.js.map +0 -1
- package/dist/agent-runtime/compact/environment.js.map +0 -1
- package/dist/agent-runtime/compact/exit-code-honesty.js.map +0 -1
- package/dist/agent-runtime/compact/guarded-loop.js.map +0 -1
- package/dist/agent-runtime/compact/prompt-inputs.js.map +0 -1
- package/dist/agent-runtime/compact/reviewer.js.map +0 -1
- package/dist/agent-runtime/compact/step.js.map +0 -1
- package/dist/agent-runtime/compact/test-reachability.js.map +0 -1
- package/dist/agent-runtime/config.js.map +0 -1
- package/dist/agent-runtime/core-host.js.map +0 -1
- package/dist/agent-runtime/durable-store.js.map +0 -1
- package/dist/agent-runtime/efficiency-summary.js.map +0 -1
- package/dist/agent-runtime/efficiency-types.js.map +0 -1
- package/dist/agent-runtime/efficiency.js.map +0 -1
- package/dist/agent-runtime/evaluation-corpus.js.map +0 -1
- package/dist/agent-runtime/evaluation.js.map +0 -1
- package/dist/agent-runtime/executor-types.js.map +0 -1
- package/dist/agent-runtime/executors.js.map +0 -1
- package/dist/agent-runtime/gemini-policy.js.map +0 -1
- package/dist/agent-runtime/graph/artifacts.js.map +0 -1
- package/dist/agent-runtime/graph/nodes.js.map +0 -1
- package/dist/agent-runtime/graph/review-policy.js.map +0 -1
- package/dist/agent-runtime/graph/roles.js.map +0 -1
- package/dist/agent-runtime/graph/state.js.map +0 -1
- package/dist/agent-runtime/graph-checkpointer.js.map +0 -1
- package/dist/agent-runtime/guardrails.js.map +0 -1
- package/dist/agent-runtime/index.js.map +0 -1
- package/dist/agent-runtime/kimi-acp.js.map +0 -1
- package/dist/agent-runtime/openai-executor.js.map +0 -1
- package/dist/agent-runtime/openspec-tool-server.js.map +0 -1
- package/dist/agent-runtime/openspec.js.map +0 -1
- package/dist/agent-runtime/prompts.js.map +0 -1
- package/dist/agent-runtime/provider-diagnostic.js.map +0 -1
- package/dist/agent-runtime/recovery.js.map +0 -1
- package/dist/agent-runtime/repository-context.js.map +0 -1
- package/dist/agent-runtime/review-context.js.map +0 -1
- package/dist/agent-runtime/role-routing.js.map +0 -1
- package/dist/agent-runtime/role-state.js.map +0 -1
- package/dist/agent-runtime/runtime-identity.js.map +0 -1
- package/dist/agent-runtime/tool-event.js.map +0 -1
- package/dist/agent-runtime/verification-plan.js.map +0 -1
- package/dist/agent-runtime/workflow-types.js.map +0 -1
- package/dist/agent-runtime/workflow.js.map +0 -1
- package/dist/agent-runtime/workspace-tools.js.map +0 -1
- package/dist/installer/cli.js.map +0 -1
- package/dist/installer/commands/doctor.d.ts +0 -27
- package/dist/installer/commands/doctor.js +0 -615
- package/dist/installer/commands/doctor.js.map +0 -1
- package/dist/installer/commands/framework.js.map +0 -1
- package/dist/installer/commands/init.js.map +0 -1
- package/dist/installer/commands/update.d.ts +0 -56
- package/dist/installer/commands/update.js +0 -257
- package/dist/installer/commands/update.js.map +0 -1
- package/dist/installer/commands/v5-migration.d.ts +0 -32
- package/dist/installer/commands/v5-migration.js +0 -133
- package/dist/installer/commands/v5-migration.js.map +0 -1
- package/dist/installer/phases/framework-lifecycle.js.map +0 -1
- package/dist/installer/phases/install-config.js.map +0 -1
- package/dist/installer/phases/manifest.js.map +0 -1
- package/dist/installer/phases/prereqs.js.map +0 -1
- package/dist/installer/phases/provider-detect.js.map +0 -1
- package/dist/installer/phases/scaffold.js.map +0 -1
- package/dist/installer/runtime/kimi.d.ts +0 -84
- package/dist/installer/runtime/kimi.js +0 -255
- package/dist/installer/runtime/kimi.js.map +0 -1
- package/dist/installer/runtime/pipeline-state.js.map +0 -1
- package/dist/installer/util/errors.js.map +0 -1
- package/dist/installer/util/exec.js.map +0 -1
- package/dist/installer/util/fs.js.map +0 -1
- package/dist/installer/util/git.js.map +0 -1
- package/dist/installer/util/install-transaction.js.map +0 -1
- package/dist/installer/util/logger.js.map +0 -1
- package/dist/installer/util/paths.js.map +0 -1
- package/dist/installer/util/prompts.d.ts +0 -23
- package/dist/installer/util/prompts.js +0 -49
- package/dist/installer/util/prompts.js.map +0 -1
- package/dist/installer/util/registry.js.map +0 -1
- package/dist/installer/util/template.d.ts +0 -23
- package/dist/installer/util/template.js +0 -60
- package/dist/installer/util/template.js.map +0 -1
- package/docs/README.md +0 -40
- package/docs/agent-runtime-efficiency.md +0 -65
- package/docs/agent-runtime.md +0 -393
- package/docs/agents.md +0 -315
- package/docs/changelog.md +0 -168
- package/docs/ci-cd.md +0 -60
- package/docs/concepts.md +0 -183
- package/docs/customization.md +0 -363
- package/docs/deployment.md +0 -234
- package/docs/getting-started.md +0 -122
- package/docs/installation.md +0 -395
- package/docs/local-tickets.md +0 -191
- package/docs/migration-guide.md +0 -140
- package/docs/playbook-oss-maintainer.md +0 -112
- package/docs/playbook-parallel-dev.md +0 -124
- package/docs/playbook-product-discovery.md +0 -115
- package/docs/plugin-architecture.md +0 -144
- package/docs/research/codex-compatibility-analysis.md +0 -365
- package/docs/research/mcp-feasibility-analysis.md +0 -382
- package/docs/testing/test-matrix-codex.md +0 -130
- package/docs/updating.md +0 -89
- package/docs/user-docs/cli-reference.md +0 -428
- package/docs/user-docs/codex-vs-claude-code.md +0 -23
- package/docs/user-docs/core-updates.md +0 -70
- package/docs/user-docs/faq.md +0 -146
- package/docs/user-docs/getting-started-codex.md +0 -194
- package/docs/user-docs/getting-started-kimi.md +0 -423
- package/docs/user-docs/installation.md +0 -237
- package/docs/user-docs/provider-pipelines.md +0 -96
- package/docs/user-docs/quick-start.md +0 -161
- package/docs/windows.md +0 -78
- package/docs/workflows.md +0 -463
- package/schemas/profile.v1.json +0 -207
- package/templates/claude-md/CLAUDE-quickstart.md +0 -54
- package/templates/claude-md/root.md +0 -50
- package/templates/codex-skills/batch-implement/SKILL.md +0 -38
- package/templates/codex-skills/implement/SKILL.md +0 -38
- package/templates/codex-skills/retry/SKILL.md +0 -16
- package/templates/commands/specrails/compat-check.md +0 -271
- package/templates/commands/specrails/doctor.md +0 -62
- package/templates/commands/specrails/explore-spec.md +0 -173
- package/templates/commands/specrails/health-check.md +0 -527
- package/templates/commands/specrails/memory-inspect.md +0 -261
- package/templates/commands/specrails/opsx-diff.md +0 -419
- package/templates/commands/specrails/propose-spec.md +0 -102
- package/templates/commands/specrails/refactor-recommender.md +0 -169
- package/templates/commands/specrails/telemetry.md +0 -553
- package/templates/commands/specrails/why.md +0 -96
- package/templates/gemini-commands/batch-implement.toml +0 -37
- package/templates/gemini-commands/implement.toml +0 -37
- package/templates/gemini-commands/retry.toml +0 -15
- package/templates/profiles/default.json +0 -14
- package/templates/profiles/kimi-default.json +0 -15
- package/templates/rules/layer.md +0 -8
- package/templates/runtime/provider-pipeline.md +0 -113
- package/templates/security/security-exemptions.yaml +0 -20
- package/templates/settings/confidence-config.json +0 -17
- package/templates/settings/settings.json +0 -15
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# {{PROJECT_NAME}}
|
|
2
|
-
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
## Agent Team
|
|
6
|
-
|
|
7
|
-
This project uses the specrails agent workflow. The following agents are active:
|
|
8
|
-
|
|
9
|
-
- **CEO** — product direction and goal-setting
|
|
10
|
-
- **CTO** — architecture decisions and technical standards
|
|
11
|
-
- **Tech Lead** — implementation coordination
|
|
12
|
-
- **Founding Engineer** — full-stack development
|
|
13
|
-
|
|
14
|
-
Git access level: **{{GIT_ACCESS}}**
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## Working with the Agent Team
|
|
19
|
-
|
|
20
|
-
Start with a product backlog to discover what to build first:
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
/specrails:get-backlog-specs
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Then implement features using the full pipeline:
|
|
27
|
-
|
|
28
|
-
```
|
|
29
|
-
/specrails:implement #1 #2 #3
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## Health Check
|
|
35
|
-
|
|
36
|
-
If something seems off, run:
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
specrails doctor
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Or inside Claude Code:
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
/specrails:doctor
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
## Engineering Standards
|
|
51
|
-
|
|
52
|
-
- Write specs before code (OpenSpec for behavioral specs)
|
|
53
|
-
- Conventional commits on all git commits
|
|
54
|
-
- All PRs require review before merge
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# {{PROJECT_NAME}}
|
|
2
|
-
|
|
3
|
-
{{PROJECT_DESCRIPTION}}
|
|
4
|
-
|
|
5
|
-
## Stack
|
|
6
|
-
|
|
7
|
-
| Layer | Tech |
|
|
8
|
-
|-------|------|
|
|
9
|
-
{{STACK_TABLE}}
|
|
10
|
-
|
|
11
|
-
## Repo layout
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
{{REPO_LAYOUT}}
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Dev commands
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
{{DEV_COMMANDS}}
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Environment
|
|
24
|
-
|
|
25
|
-
{{ENVIRONMENT_NOTES}}
|
|
26
|
-
|
|
27
|
-
## Architecture
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
{{ARCHITECTURE_DIAGRAM}}
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Conventions
|
|
34
|
-
|
|
35
|
-
Layer-specific conventions are in `.claude/rules/` (loaded conditionally per layer).
|
|
36
|
-
|
|
37
|
-
{{GIT_CONVENTIONS}}
|
|
38
|
-
|
|
39
|
-
## Warnings
|
|
40
|
-
|
|
41
|
-
{{WARNINGS}}
|
|
42
|
-
|
|
43
|
-
## OpenSpec
|
|
44
|
-
|
|
45
|
-
- **Specs**: `openspec/specs/` is the source of truth. Read relevant specs before implementing.
|
|
46
|
-
- **Changes**: `openspec/changes/<name>/`. Use `/opsx:ff` -> `/opsx:apply` -> `/opsx:archive`.
|
|
47
|
-
|
|
48
|
-
## Scoped context
|
|
49
|
-
|
|
50
|
-
{{SCOPED_CONTEXT_LIST}}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: batch-implement
|
|
3
|
-
description: "Run or resume implementation through the installed programmatic agent runtime."
|
|
4
|
-
license: MIT
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Programmatic implementation
|
|
8
|
-
|
|
9
|
-
Implement the requested spec or batch through the installed agent runtime. The runtime owns architecture, development, verification, review and archive; do not delegate these phases yourself or launch a second coordinator.
|
|
10
|
-
|
|
11
|
-
## Freeze the requested scope
|
|
12
|
-
|
|
13
|
-
Use the supplied absolute `SPECRAILS_EXECUTION_CONTEXT` unchanged. It defines runId, specs and acceptance criteria, artifactRoot, selected repositories and ownership. For standalone use, admit the exact requested tickets once with:
|
|
14
|
-
|
|
15
|
-
```sh
|
|
16
|
-
node .specrails/runtime/pipeline.mjs init --change <stable-change> --tickets "<requested-ids>"
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
For a free-form request use `--scope-request <absolute-json>` with the user's specs and criteria. Use the returned absolute context path. Never select a different run by modification time or replace scope from mutable backlog. Multiple tickets share one aggregate context and one runtime invocation.
|
|
20
|
-
|
|
21
|
-
## Execute
|
|
22
|
-
|
|
23
|
-
```sh
|
|
24
|
-
node .specrails/runtime/agent-runtime.mjs run --context <absolute-context> --config .specrails/agent-runtime.json --change <stable-change>
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Desktop launches this runtime directly and freezes its resolved global connections and project settings. Standalone installations provide a local configuration. If required runtime/configuration files are missing, repair the Core installation; do not fall back to a prompt-orchestrated implementation.
|
|
28
|
-
|
|
29
|
-
Wait for the foreground process. Report its structured status, acceptance and verification evidence. A process failure or pause preserves progress; it does not authorize a replacement run. Resume only the exact saved execution:
|
|
30
|
-
|
|
31
|
-
```sh
|
|
32
|
-
node .specrails/runtime/agent-runtime.mjs status --context <absolute-context>
|
|
33
|
-
node .specrails/runtime/agent-runtime.mjs resume --context <absolute-context>
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Answers, approvals and recovery flags must correspond to the pending request and user authorization. Resume keeps the saved models, scope and configuration. Never manually rewrite phase receipts, bypass review, or treat provider prose as completion.
|
|
37
|
-
|
|
38
|
-
Honor the context's ownership throughout: Desktop owns worktrees, commits, PRs and backlog delivery. Runtime success prepares a reviewed candidate; host delivery remains a separate action. Preview requests must not invoke mutating execution.
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: implement
|
|
3
|
-
description: "Run or resume implementation through the installed programmatic agent runtime."
|
|
4
|
-
license: MIT
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Programmatic implementation
|
|
8
|
-
|
|
9
|
-
Implement the requested spec or batch through the installed agent runtime. The runtime owns architecture, development, verification, review and archive; do not delegate these phases yourself or launch a second coordinator.
|
|
10
|
-
|
|
11
|
-
## Freeze the requested scope
|
|
12
|
-
|
|
13
|
-
Use the supplied absolute `SPECRAILS_EXECUTION_CONTEXT` unchanged. It defines runId, specs and acceptance criteria, artifactRoot, selected repositories and ownership. For standalone use, admit the exact requested tickets once with:
|
|
14
|
-
|
|
15
|
-
```sh
|
|
16
|
-
node .specrails/runtime/pipeline.mjs init --change <stable-change> --tickets "<requested-ids>"
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
For a free-form request use `--scope-request <absolute-json>` with the user's specs and criteria. Use the returned absolute context path. Never select a different run by modification time or replace scope from mutable backlog. Multiple tickets share one aggregate context and one runtime invocation.
|
|
20
|
-
|
|
21
|
-
## Execute
|
|
22
|
-
|
|
23
|
-
```sh
|
|
24
|
-
node .specrails/runtime/agent-runtime.mjs run --context <absolute-context> --config .specrails/agent-runtime.json --change <stable-change>
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Desktop launches this runtime directly and freezes its resolved global connections and project settings. Standalone installations provide a local configuration. If required runtime/configuration files are missing, repair the Core installation; do not fall back to a prompt-orchestrated implementation.
|
|
28
|
-
|
|
29
|
-
Wait for the foreground process. Report its structured status, acceptance and verification evidence. A process failure or pause preserves progress; it does not authorize a replacement run. Resume only the exact saved execution:
|
|
30
|
-
|
|
31
|
-
```sh
|
|
32
|
-
node .specrails/runtime/agent-runtime.mjs status --context <absolute-context>
|
|
33
|
-
node .specrails/runtime/agent-runtime.mjs resume --context <absolute-context>
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Answers, approvals and recovery flags must correspond to the pending request and user authorization. Resume keeps the saved models, scope and configuration. Never manually rewrite phase receipts, bypass review, or treat provider prose as completion.
|
|
37
|
-
|
|
38
|
-
Honor the context's ownership throughout: Desktop owns worktrees, commits, PRs and backlog delivery. Runtime success prepares a reviewed candidate; host delivery remains a separate action. Preview requests must not invoke mutating execution.
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: retry
|
|
3
|
-
description: "Run or resume implementation through the installed programmatic agent runtime."
|
|
4
|
-
license: MIT
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Resume a programmatic implementation
|
|
8
|
-
|
|
9
|
-
Resolve the exact saved context for the requested run. Do not initialize a replacement, guess the latest change, or discard work.
|
|
10
|
-
|
|
11
|
-
```sh
|
|
12
|
-
node .specrails/runtime/agent-runtime.mjs status --context <absolute-context>
|
|
13
|
-
node .specrails/runtime/agent-runtime.mjs resume --context <absolute-context>
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
Use the saved scope and configuration. Pass an answer, approval or recovery flag only for the corresponding pending request with user authorization. The runtime selects the next phase and preserves valid completed work; never invoke roles directly or edit phase receipts. Preserve host ownership of Git, worktrees and backlog. Report the structured result and outstanding delivery actions.
|
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "Compatibility Impact Analyzer"
|
|
3
|
-
description: "Snapshot the current API surface and detect breaking changes against a prior baseline. Generates a migration guide when breaking changes are found."
|
|
4
|
-
category: Workflow
|
|
5
|
-
tags: [workflow, compatibility, breaking-changes, migration]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
Analyze the API surface of **{{PROJECT_NAME}}** for backwards compatibility. Extracts the current contract surface (CLI flags, template placeholders, command names, argument flags, agent names, config keys), compares against a stored baseline, classifies each change by severity, and generates a migration guide when breaking changes are found.
|
|
9
|
-
|
|
10
|
-
**Input:** `$ARGUMENTS` — optional flags:
|
|
11
|
-
- `--diff` — compare current surface to most recent snapshot (default when snapshots exist)
|
|
12
|
-
- `--snapshot` — capture current surface and save without diffing (default on first run)
|
|
13
|
-
- `--since <date>` — diff against snapshot from this date (ISO format: YYYY-MM-DD)
|
|
14
|
-
- `--propose <change-dir>` — diff proposed changes in `openspec/changes/<change-dir>/` against current surface
|
|
15
|
-
- `--dry-run` — run all phases but skip saving the snapshot
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## Phase 0: Argument Parsing
|
|
20
|
-
|
|
21
|
-
Parse `$ARGUMENTS` to set runtime variables.
|
|
22
|
-
|
|
23
|
-
**Variables to set:**
|
|
24
|
-
|
|
25
|
-
- `MODE` — string, one of `"snapshot"`, `"diff"`, `"propose"`. Default: `"diff"` if `.claude/compat-snapshots/` contains any `.json` files; `"snapshot"` otherwise.
|
|
26
|
-
- `COMPARE_DATE` — string (ISO date) or empty string. Default: `""` (use most recent snapshot).
|
|
27
|
-
- `PROPOSE_DIR` — string or empty string. Default: `""`.
|
|
28
|
-
- `DRY_RUN` — boolean. Default: `false`.
|
|
29
|
-
|
|
30
|
-
**Parsing rules:**
|
|
31
|
-
|
|
32
|
-
1. Scan `$ARGUMENTS` for `--snapshot`. If found, set `MODE=snapshot`.
|
|
33
|
-
2. Scan for `--diff`. If found, set `MODE=diff`.
|
|
34
|
-
3. Scan for `--since <date>`. If found, set `COMPARE_DATE=<date>` and (if `MODE` not already set to `snapshot`) set `MODE=diff`.
|
|
35
|
-
4. Scan for `--propose <change-dir>`. If found, set `PROPOSE_DIR=<change-dir>` and `MODE=propose`.
|
|
36
|
-
- Verify `openspec/changes/<change-dir>/` exists. If not: print `Error: no change found at openspec/changes/<change-dir>/` and stop.
|
|
37
|
-
5. Scan for `--dry-run`. If found, set `DRY_RUN=true`.
|
|
38
|
-
6. Apply default-mode logic if `MODE` is not yet set: check whether `.claude/compat-snapshots/` exists and contains `.json` files. If yes: `MODE=diff`. If no: `MODE=snapshot`.
|
|
39
|
-
|
|
40
|
-
**Verify prerequisites:**
|
|
41
|
-
|
|
42
|
-
- Check whether `templates/` directory exists. If not: print `Error: templates/ not found — is this a specrails repo?` and stop.
|
|
43
|
-
- Check whether `bin/specrails-core.mjs` exists. If not: set `INSTALLER_AVAILABLE=false` (installer flags category will be skipped). Otherwise set `INSTALLER_AVAILABLE=true`.
|
|
44
|
-
|
|
45
|
-
**Print active configuration:**
|
|
46
|
-
|
|
47
|
-
```
|
|
48
|
-
Mode: <MODE> | Compare date: <COMPARE_DATE or "latest"> | Dry-run: <true/false>
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
---
|
|
52
|
-
|
|
53
|
-
## Phase 1: Extract Current Surface
|
|
54
|
-
|
|
55
|
-
Read the codebase and build the surface snapshot. Print one progress line as each category completes.
|
|
56
|
-
|
|
57
|
-
**Surface category: installer_flags**
|
|
58
|
-
|
|
59
|
-
If `INSTALLER_AVAILABLE=false`: print ` installer_flags: skipped (bin/specrails-core.mjs not found)` and record as unavailable.
|
|
60
|
-
|
|
61
|
-
Otherwise: read `bin/specrails-core.mjs`. Extract every `--<word>` flag pattern that is accepted by the CLI dispatcher. For each flag, record the flag string and line number.
|
|
62
|
-
|
|
63
|
-
Print: ` installer_flags: N found`
|
|
64
|
-
|
|
65
|
-
**Surface category: template_placeholders**
|
|
66
|
-
|
|
67
|
-
Read all files matching `templates/**/*.md`. For each file, extract all `{{UPPER_SNAKE_CASE}}` patterns (regex: `\{\{[A-Z][A-Z0-9_]*\}\}`). Deduplicate across files. For each unique key, record the list of source files it appears in.
|
|
68
|
-
|
|
69
|
-
Note: Skip patterns inside code fences that are used as documentation examples (i.e., patterns that appear inside triple-backtick blocks describing placeholder syntax rather than actual template usage). Use judgment to distinguish real template placeholders from documented examples.
|
|
70
|
-
|
|
71
|
-
Print: ` template_placeholders: N unique keys found`
|
|
72
|
-
|
|
73
|
-
**Surface category: command_names and command_arguments**
|
|
74
|
-
|
|
75
|
-
Read each file in `templates/commands/`. For each:
|
|
76
|
-
- Extract `name:` value from the YAML frontmatter (between the first `---` and second `---`)
|
|
77
|
-
- Extract the display name from the frontmatter `name:` field (the quoted string)
|
|
78
|
-
- Find all `--<word>` flag patterns in the `$ARGUMENTS` section or argument description prose
|
|
79
|
-
- Record command name, display name, source file, and flags list
|
|
80
|
-
|
|
81
|
-
Print: ` command_names: N commands found`
|
|
82
|
-
Print: ` command_arguments: N commands with flags documented`
|
|
83
|
-
|
|
84
|
-
**Surface category: agent_names**
|
|
85
|
-
|
|
86
|
-
Read each file in `templates/agents/`. Extract `name:` value from the YAML frontmatter.
|
|
87
|
-
|
|
88
|
-
Print: ` agent_names: N agents found`
|
|
89
|
-
|
|
90
|
-
**Surface category: config_keys**
|
|
91
|
-
|
|
92
|
-
Read `openspec/config.yaml`. Extract all top-level YAML keys (lines matching `^<key>:` at zero indentation).
|
|
93
|
-
|
|
94
|
-
Print: ` config_keys: N keys found`
|
|
95
|
-
|
|
96
|
-
**Build the surface object:**
|
|
97
|
-
|
|
98
|
-
Assemble all extracted data into a snapshot object matching the schema:
|
|
99
|
-
|
|
100
|
-
```json
|
|
101
|
-
{
|
|
102
|
-
"schema_version": "1",
|
|
103
|
-
"captured_at": "<ISO 8601 datetime>",
|
|
104
|
-
"git_sha": "<git rev-parse HEAD or 'unknown'>",
|
|
105
|
-
"git_branch": "<git rev-parse --abbrev-ref HEAD or 'unknown'>",
|
|
106
|
-
"surfaces": {
|
|
107
|
-
"installer_flags": [...],
|
|
108
|
-
"template_placeholders": [...],
|
|
109
|
-
"command_names": [...],
|
|
110
|
-
"command_arguments": [...],
|
|
111
|
-
"agent_names": [...],
|
|
112
|
-
"config_keys": [...]
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
Set `CURRENT_SURFACE` to this object.
|
|
118
|
-
|
|
119
|
-
If `MODE=snapshot`: proceed directly to Phase 5 (skip Phases 2–4 diff logic, but still print a surface summary).
|
|
120
|
-
|
|
121
|
-
---
|
|
122
|
-
|
|
123
|
-
## Phase 2: Load Baseline
|
|
124
|
-
|
|
125
|
-
Applies in `diff` and `propose` modes only.
|
|
126
|
-
|
|
127
|
-
**For `diff` mode:**
|
|
128
|
-
|
|
129
|
-
1. Check whether `.claude/compat-snapshots/` exists and contains `.json` files.
|
|
130
|
-
- If empty or missing: print `Advisory: no prior snapshot found. Switching to snapshot mode.` Set `MODE=snapshot`. Proceed to Phase 5.
|
|
131
|
-
2. If `COMPARE_DATE` is empty: select the most recently modified `.json` file.
|
|
132
|
-
3. If `COMPARE_DATE` is set: find the snapshot whose filename date is closest to `COMPARE_DATE` without exceeding it. If no match within 7 days: print `Warning: no snapshot found near <COMPARE_DATE>. Falling back to most recent.` Use most recent.
|
|
133
|
-
4. Load the selected file as `BASELINE_SURFACE`.
|
|
134
|
-
5. Print: `Baseline: <YYYY-MM-DD> (<sha from filename>)`
|
|
135
|
-
|
|
136
|
-
**For `propose` mode:**
|
|
137
|
-
|
|
138
|
-
1. Load the most recent snapshot from `.claude/compat-snapshots/` as `BASELINE_SURFACE` (same selection logic as `diff` mode with `COMPARE_DATE` empty).
|
|
139
|
-
2. Additionally read `openspec/changes/<PROPOSE_DIR>/design.md` to understand the projected surface changes.
|
|
140
|
-
- If `design.md` does not exist: print `Warning: no design.md found in openspec/changes/<PROPOSE_DIR>/. Proceeding with surface extraction only (no projection).`
|
|
141
|
-
- If it exists: read also `openspec/changes/<PROPOSE_DIR>/tasks.md` if present.
|
|
142
|
-
3. Use the proposed changes to project the "after" surface: identify which elements would be added, removed, or modified based on the design document.
|
|
143
|
-
4. Print: `Propose mode: analyzing openspec/changes/<PROPOSE_DIR>/`
|
|
144
|
-
|
|
145
|
-
Set `BASELINE_SURFACE` and `PROJECTED_CHANGES` (in propose mode).
|
|
146
|
-
|
|
147
|
-
---
|
|
148
|
-
|
|
149
|
-
## Phase 3: Diff and Classify
|
|
150
|
-
|
|
151
|
-
Applies in `diff` and `propose` modes. Skipped in `snapshot` mode.
|
|
152
|
-
|
|
153
|
-
For each surface category (`installer_flags`, `template_placeholders`, `command_names`, `command_arguments`, `agent_names`, `config_keys`):
|
|
154
|
-
|
|
155
|
-
1. Build identifier sets from baseline and current (or projected, in propose mode).
|
|
156
|
-
2. Compute:
|
|
157
|
-
- `removed = identifiers in baseline but not in current`
|
|
158
|
-
- `added = identifiers in current but not in baseline`
|
|
159
|
-
- `common = identifiers in both`
|
|
160
|
-
3. For common elements: check whether attributes changed (display name, flags list, file list). Classify attribute changes as Category 3 (Signature Change) if they affect the interface.
|
|
161
|
-
4. Classify each removal:
|
|
162
|
-
- If a similar-looking name appears in `added`: classify as **Category 2: Rename** (BREAKING — MAJOR)
|
|
163
|
-
- Otherwise: classify as **Category 1: Removal** (BREAKING — MAJOR)
|
|
164
|
-
5. Classify additions as non-breaking (new additions do not break existing callers).
|
|
165
|
-
6. Classify behavioral changes detected from the design document (in propose mode) as **Category 4: Behavioral Change** (ADVISORY).
|
|
166
|
-
|
|
167
|
-
Build two lists:
|
|
168
|
-
- `BREAKING_CHANGES` — list of `{ category, element, surface, severity, description }` objects (Categories 1, 2, 3)
|
|
169
|
-
- `ADVISORY_CHANGES` — list of `{ category, element, surface, description }` objects (Category 4)
|
|
170
|
-
|
|
171
|
-
---
|
|
172
|
-
|
|
173
|
-
## Phase 4: Generate Report
|
|
174
|
-
|
|
175
|
-
Print the full compatibility report.
|
|
176
|
-
|
|
177
|
-
```
|
|
178
|
-
## Compatibility Impact Report — {{PROJECT_NAME}}
|
|
179
|
-
Date: <ISO date> | Commit: <git_short_sha or "unknown">
|
|
180
|
-
|
|
181
|
-
### Surface Snapshot
|
|
182
|
-
| Category | Elements Found |
|
|
183
|
-
|----------|---------------|
|
|
184
|
-
| Installer flags | N |
|
|
185
|
-
| Template placeholders | N |
|
|
186
|
-
| Command names | N |
|
|
187
|
-
| Command argument flags | N |
|
|
188
|
-
| Agent names | N |
|
|
189
|
-
| Config keys | N |
|
|
190
|
-
|
|
191
|
-
### Breaking Changes (N found)
|
|
192
|
-
<if BREAKING_CHANGES is empty:>
|
|
193
|
-
None detected.
|
|
194
|
-
|
|
195
|
-
<if BREAKING_CHANGES is non-empty, for each:>
|
|
196
|
-
- [Category <N>: <category-name>] <surface>: `<element>` — <description>
|
|
197
|
-
|
|
198
|
-
### Advisory Changes (N found)
|
|
199
|
-
<if ADVISORY_CHANGES is empty:>
|
|
200
|
-
None detected.
|
|
201
|
-
|
|
202
|
-
<if ADVISORY_CHANGES is non-empty, for each:>
|
|
203
|
-
- [Category 4: Behavioral Change] <surface>: `<element>` — <description>
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
**Migration Guide** (only when `len(BREAKING_CHANGES) > 0`):
|
|
207
|
-
|
|
208
|
-
For each breaking change, append a Migration Guide block:
|
|
209
|
-
|
|
210
|
-
```
|
|
211
|
-
## Migration Guide
|
|
212
|
-
|
|
213
|
-
**Change type:** <Removal | Rename | Signature Change>
|
|
214
|
-
**Severity:** BREAKING
|
|
215
|
-
**Affects:** <who is affected>
|
|
216
|
-
|
|
217
|
-
### What Changed
|
|
218
|
-
<one paragraph describing before and after>
|
|
219
|
-
|
|
220
|
-
### Before
|
|
221
|
-
<concrete example of old usage>
|
|
222
|
-
|
|
223
|
-
### After
|
|
224
|
-
<concrete example of new usage>
|
|
225
|
-
|
|
226
|
-
### Remediation Options
|
|
227
|
-
|
|
228
|
-
**Option A — Backwards-compatible alias (recommended)**
|
|
229
|
-
<how to add an alias or shim>
|
|
230
|
-
|
|
231
|
-
**Option B — Clean break with changelog**
|
|
232
|
-
<what to put in CHANGELOG.md>
|
|
233
|
-
|
|
234
|
-
### Version Strategy
|
|
235
|
-
<MAJOR bump if removing/renaming; MINOR if signature-only>
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
---
|
|
239
|
-
|
|
240
|
-
## Phase 5: Save Snapshot
|
|
241
|
-
|
|
242
|
-
**If `DRY_RUN=true`:**
|
|
243
|
-
|
|
244
|
-
Print: `Snapshot not saved — dry-run mode`
|
|
245
|
-
|
|
246
|
-
Skip the save. Still perform the housekeeping check and `.gitignore` check below.
|
|
247
|
-
|
|
248
|
-
**If `DRY_RUN=false`:**
|
|
249
|
-
|
|
250
|
-
1. Determine filename: `<YYYY-MM-DD>-<git_short_sha>.json`. If git is unavailable: `<YYYY-MM-DD>-unknown.json`.
|
|
251
|
-
2. Create `.claude/compat-snapshots/` if it does not exist.
|
|
252
|
-
3. Write `CURRENT_SURFACE` serialized as JSON to `.claude/compat-snapshots/<filename>`.
|
|
253
|
-
4. Print: `Snapshot saved: .claude/compat-snapshots/<filename>`
|
|
254
|
-
|
|
255
|
-
**Housekeeping notice:**
|
|
256
|
-
|
|
257
|
-
Count `.json` files in `.claude/compat-snapshots/`. If count > 30, print:
|
|
258
|
-
|
|
259
|
-
```
|
|
260
|
-
Note: .claude/compat-snapshots/ has N snapshots. Consider pruning old ones with:
|
|
261
|
-
ls -t .claude/compat-snapshots/ | tail -n +31 | xargs -I{} rm .claude/compat-snapshots/{}
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
**.gitignore suggestion:**
|
|
265
|
-
|
|
266
|
-
Check whether `.claude/compat-snapshots/` appears in `.gitignore` (if `.gitignore` exists). If it does not appear, print:
|
|
267
|
-
|
|
268
|
-
```
|
|
269
|
-
Tip: compat snapshots are local artifacts. Add to .gitignore:
|
|
270
|
-
echo '.claude/compat-snapshots/' >> .gitignore
|
|
271
|
-
```
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
# Doctor: specrails Health Check
|
|
2
|
-
|
|
3
|
-
Run the specrails health check to validate that all prerequisites are correctly configured for this repository.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## What it checks
|
|
8
|
-
|
|
9
|
-
| Check | Pass condition |
|
|
10
|
-
|-------|---------------|
|
|
11
|
-
| Claude Code CLI | `claude` binary found in PATH |
|
|
12
|
-
| Claude API key | `claude config list` shows a key OR `ANTHROPIC_API_KEY` env var set |
|
|
13
|
-
| Agent files | Generated agent files exist under `.claude/agents/` |
|
|
14
|
-
| CLAUDE.md | `CLAUDE.md` present in the repo root |
|
|
15
|
-
| Git initialized | `.git/` directory present |
|
|
16
|
-
| npm | `npm` binary found in PATH |
|
|
17
|
-
|
|
18
|
-
## How to run
|
|
19
|
-
|
|
20
|
-
This command uses the Node-native doctor runtime. Run it directly with:
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
npx specrails-core@latest doctor
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
If `specrails-core` is already on your `PATH`, this works too:
|
|
27
|
-
|
|
28
|
-
```
|
|
29
|
-
specrails-core doctor
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Output
|
|
33
|
-
|
|
34
|
-
Each check is displayed as ✅ (pass) or ❌ (fail with fix instruction).
|
|
35
|
-
|
|
36
|
-
On all checks passed:
|
|
37
|
-
```
|
|
38
|
-
All 6 checks passed. Run /specrails:implement to get started.
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
On failure:
|
|
42
|
-
```
|
|
43
|
-
❌ API key: not configured
|
|
44
|
-
Fix: Run: claude config set api_key <your-key> | Get a key: https://console.anthropic.com/
|
|
45
|
-
|
|
46
|
-
1 check(s) failed.
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Exit codes
|
|
50
|
-
|
|
51
|
-
- `0` — all checks passed
|
|
52
|
-
- `1` — one or more checks failed
|
|
53
|
-
|
|
54
|
-
## Log file
|
|
55
|
-
|
|
56
|
-
Each run appends a timestamped summary to `~/.specrails/doctor.log`:
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
2026-03-20T10:00:00Z checks=6 passed=6 failed=0
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
The `~/.specrails/` directory is created automatically if it does not exist.
|