specrails-core 4.1.1 → 4.2.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 +4 -4
- package/bin/specrails-core.mjs +302 -0
- package/commands/doctor.md +5 -5
- package/commands/enrich.md +9 -9
- package/dist/installer/cli.js +167 -0
- package/dist/installer/cli.js.map +1 -0
- package/dist/installer/commands/doctor.js +144 -0
- package/dist/installer/commands/doctor.js.map +1 -0
- package/dist/installer/commands/init.js +182 -0
- package/dist/installer/commands/init.js.map +1 -0
- package/dist/installer/commands/perf-check.js +16 -0
- package/dist/installer/commands/perf-check.js.map +1 -0
- package/dist/installer/commands/update.js +170 -0
- package/dist/installer/commands/update.js.map +1 -0
- package/dist/installer/phases/install-config.js +120 -0
- package/dist/installer/phases/install-config.js.map +1 -0
- package/dist/installer/phases/manifest.js +93 -0
- package/dist/installer/phases/manifest.js.map +1 -0
- package/dist/installer/phases/prereqs.js +116 -0
- package/dist/installer/phases/prereqs.js.map +1 -0
- package/dist/installer/phases/provider-detect.js +111 -0
- package/dist/installer/phases/provider-detect.js.map +1 -0
- package/dist/installer/phases/scaffold.js +373 -0
- package/dist/installer/phases/scaffold.js.map +1 -0
- package/dist/installer/util/errors.js +79 -0
- package/dist/installer/util/errors.js.map +1 -0
- package/dist/installer/util/exec.js +151 -0
- package/dist/installer/util/exec.js.map +1 -0
- package/dist/installer/util/fs.js +153 -0
- package/dist/installer/util/fs.js.map +1 -0
- package/dist/installer/util/git.js +113 -0
- package/dist/installer/util/git.js.map +1 -0
- package/dist/installer/util/logger.js +55 -0
- package/dist/installer/util/logger.js.map +1 -0
- package/dist/installer/util/paths.js +66 -0
- package/dist/installer/util/paths.js.map +1 -0
- package/dist/installer/util/prompts.js +49 -0
- package/dist/installer/util/prompts.js.map +1 -0
- package/dist/installer/util/template.js +60 -0
- package/dist/installer/util/template.js.map +1 -0
- package/docs/deployment.md +2 -1
- package/docs/installation.md +6 -3
- package/docs/testing/test-matrix-codex.md +19 -11
- package/docs/updating.md +24 -49
- package/docs/user-docs/faq.md +1 -1
- package/docs/windows.md +53 -0
- package/{templates/settings/integration-contract.json → integration-contract.json} +2 -2
- package/package.json +25 -10
- package/pinned-versions.json +4 -0
- package/schemas/profile.v1.json +11 -3
- package/templates/agents/sr-architect.md +1 -1
- package/templates/agents/sr-reviewer.md +1 -1
- package/templates/commands/specrails/compat-check.md +3 -3
- package/templates/commands/specrails/doctor.md +5 -5
- package/templates/commands/specrails/enrich.md +9 -9
- package/templates/commands/specrails/reconfig.md +2 -2
- package/templates/commands/specrails/refactor-recommender.md +2 -2
- package/templates/commands/specrails/vpc-drift.md +1 -1
- package/templates/skills/sr-compat-check/SKILL.md +3 -3
- package/templates/skills/sr-refactor-recommender/SKILL.md +2 -2
- package/bin/doctor.sh +0 -127
- package/bin/perf-check.sh +0 -21
- package/bin/specrails-core.js +0 -262
- package/commands/setup.md +0 -1461
- package/install.sh +0 -1231
- package/update.sh +0 -870
package/docs/updating.md
CHANGED
|
@@ -7,79 +7,54 @@ SpecRails includes an update system that pulls new templates while preserving yo
|
|
|
7
7
|
The update system uses a **manifest-based approach**:
|
|
8
8
|
|
|
9
9
|
1. During installation, SpecRails generates `.specrails/specrails-manifest.json` — a checksum of every installed file
|
|
10
|
-
2. On update,
|
|
11
|
-
3.
|
|
10
|
+
2. On update, the new templates from the latest specrails-core release are re-applied
|
|
11
|
+
3. Reserved paths (`.specrails/profiles/**`, `.claude/agents/custom-*.md`) are preserved by construction — the installer never touches them
|
|
12
12
|
|
|
13
13
|
## Running an update
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
|
|
16
|
+
npx specrails-core@latest update
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
bash /path/to/specrails/update.sh
|
|
23
|
-
```
|
|
19
|
+
Cross-platform (macOS, Linux, Windows). No bash, no python required — the installer is native Node since v4.2.0.
|
|
24
20
|
|
|
25
21
|
### What happens
|
|
26
22
|
|
|
27
|
-
1. **
|
|
28
|
-
2. **
|
|
29
|
-
3. **
|
|
30
|
-
4. **
|
|
31
|
-
5. **
|
|
23
|
+
1. **Version check** — reads existing `.specrails/specrails-version`; aborts if no specrails install is detected
|
|
24
|
+
2. **Provider resolution** — detects whether the project uses Claude (`.claude/`) or Codex (`.codex/`)
|
|
25
|
+
3. **Re-scaffold** — re-applies templates from the latest specrails-core into `.specrails/setup-templates/` and the provider directory
|
|
26
|
+
4. **Reserved paths** — `.specrails/profiles/**` and `.claude/agents/custom-*.md` are skipped; your team profiles and custom agents survive untouched
|
|
27
|
+
5. **Manifest refresh** — rewrites `specrails-manifest.json` and `specrails-version` to the new core version
|
|
32
28
|
|
|
33
|
-
|
|
29
|
+
## Selective updates (`--only`)
|
|
34
30
|
|
|
35
|
-
|
|
31
|
+
The `--only <component>` flag is recognised but currently warns and applies the full scaffold. Granular component selection is tracked as a follow-up — the Node installer's transactional behaviour makes a targeted re-apply almost equivalent to a full one for the common case (core version bump).
|
|
36
32
|
|
|
37
|
-
|
|
33
|
+
## Dry run
|
|
38
34
|
|
|
39
35
|
```bash
|
|
40
|
-
|
|
41
|
-
bash update.sh --only core
|
|
42
|
-
|
|
43
|
-
# Update Pipeline Monitor dashboard
|
|
44
|
-
bash update.sh --only web-manager
|
|
45
|
-
|
|
46
|
-
# Regenerate agents (prompts for confirmation if templates changed)
|
|
47
|
-
bash update.sh --only agents
|
|
48
|
-
|
|
49
|
-
# Full update (default)
|
|
50
|
-
bash update.sh --only all
|
|
36
|
+
npx specrails-core@latest update --dry-run
|
|
51
37
|
```
|
|
52
38
|
|
|
39
|
+
Prints what the update would do without writing any files. Useful for inspecting `previousVersion → currentVersion` before committing.
|
|
40
|
+
|
|
53
41
|
## What gets preserved
|
|
54
42
|
|
|
55
43
|
| File type | Behavior |
|
|
56
44
|
|-----------|----------|
|
|
57
|
-
| **Agent prompts** (`.claude/agents
|
|
58
|
-
| **
|
|
59
|
-
| **
|
|
60
|
-
| **
|
|
61
|
-
| **
|
|
62
|
-
| **
|
|
63
|
-
| **
|
|
64
|
-
|
|
65
|
-
## Legacy installations
|
|
66
|
-
|
|
67
|
-
If you installed SpecRails before the versioning system (pre-v0.1.0):
|
|
68
|
-
|
|
69
|
-
- The updater detects missing `.specrails/specrails-version` and treats it as a legacy install
|
|
70
|
-
- It migrates your installation to the versioned system
|
|
71
|
-
- A manifest is generated from your current files
|
|
72
|
-
- Future updates use the standard manifest comparison
|
|
45
|
+
| **Agent prompts** (`.claude/agents/sr-*.md`) | Re-written from latest templates |
|
|
46
|
+
| **Custom agents** (`.claude/agents/custom-*.md`) | **Always preserved** (reserved path) |
|
|
47
|
+
| **Profile JSON** (`.specrails/profiles/**`) | **Always preserved** (reserved path) |
|
|
48
|
+
| **Commands** (`.claude/commands/specrails/`) | Re-written |
|
|
49
|
+
| **Rules** (`.claude/rules/`) | Re-written from latest templates |
|
|
50
|
+
| **Agent memory** (`.claude/agent-memory/`) | Untouched (created on first install only) |
|
|
51
|
+
| **install-config.yaml** | Untouched |
|
|
73
52
|
|
|
74
53
|
## Rolling back
|
|
75
54
|
|
|
76
|
-
|
|
55
|
+
The Node installer is idempotent: re-running `init` (or pinning an older version with `npx specrails-core@<version> update`) restores the prior layout. Profile and custom-agent files are reserved, so nothing critical is destroyed by a forward-then-backward sequence.
|
|
77
56
|
|
|
78
|
-
|
|
79
|
-
# Backups are at .claude.specrails.backup/
|
|
80
|
-
cp -r .claude.specrails.backup/.claude .claude
|
|
81
|
-
cp .claude.specrails.backup/.specrails/specrails-version .specrails/specrails-version
|
|
82
|
-
```
|
|
57
|
+
If you need a true point-in-time rollback, the recommended path is git: commit before updating, `git checkout` to revert.
|
|
83
58
|
|
|
84
59
|
---
|
|
85
60
|
|
package/docs/user-docs/faq.md
CHANGED
|
@@ -12,7 +12,7 @@ The plugin method (`claude plugin install sr`) installs logic into Claude Code's
|
|
|
12
12
|
|
|
13
13
|
**Do I need Node.js if my project is not JavaScript?**
|
|
14
14
|
|
|
15
|
-
Not for the plugin method (`claude plugin install sr`). Node.js
|
|
15
|
+
Not for the plugin method (`claude plugin install sr`). Node.js 20+ is only required for the scaffold method (`npx specrails-core@latest init`). Once installed, SpecRails works with any language or framework, on macOS, Linux, or Windows.
|
|
16
16
|
|
|
17
17
|
**Do I need GitHub Issues?**
|
|
18
18
|
|
package/docs/windows.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Windows support
|
|
2
|
+
|
|
3
|
+
specrails-core runs natively on Windows 10 (1809+) and Windows 11, on both x64 and ARM64 (via the built-in x64 emulation layer). There is **no dependency on `bash`, `python3`, or any POSIX-only tooling** — the installer is pure Node.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- **Windows 10 1809+** or **Windows 11** (x64 or ARM64)
|
|
8
|
+
- **Node.js ≥ 20** — install from [nodejs.org](https://nodejs.org/)
|
|
9
|
+
- **git ≥ 2.25** — install from [git-scm.com](https://git-scm.com/)
|
|
10
|
+
- **Claude Code** (`claude.cmd`) — install from [claude.ai/download](https://claude.ai/download)
|
|
11
|
+
|
|
12
|
+
`npm install -g @anthropic-ai/claude-code` installs the Claude CLI as `claude.cmd` into your global npm bin (`%APPDATA%\npm\`). Make sure that directory is on your PATH so `where claude` resolves it.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
From PowerShell or cmd.exe:
|
|
17
|
+
|
|
18
|
+
```powershell
|
|
19
|
+
cd C:\path\to\your\project
|
|
20
|
+
npx specrails-core@latest init
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The installer:
|
|
24
|
+
- probes PATH with `where` (instead of the POSIX `which`),
|
|
25
|
+
- spawns `.cmd` shims (`claude.cmd`, `npm.cmd`, `gh.cmd`) with `shell: true` — required by Node.js since CVE-2024-27980,
|
|
26
|
+
- writes all files with LF line endings regardless of `core.autocrlf` to keep the bundled templates portable.
|
|
27
|
+
|
|
28
|
+
## PowerShell execution policy
|
|
29
|
+
|
|
30
|
+
If `npm` errors with `npm.ps1 cannot be loaded because running scripts is disabled on this system`, relax the policy for your user:
|
|
31
|
+
|
|
32
|
+
```powershell
|
|
33
|
+
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`RemoteSigned` is the MSFT-recommended minimum for dev tooling.
|
|
37
|
+
|
|
38
|
+
## Known limitations
|
|
39
|
+
|
|
40
|
+
- **PATH refresh after installing new tools.** Windows GUI shells (Explorer, launcher-started apps) do not re-read PATH until logout/login. If you install `claude.cmd` and launch specrails-hub immediately, the hub's sidecar may not see it. Restart the app after changes to the Env Vars dialog, or launch from a fresh PowerShell.
|
|
41
|
+
- **CRLF checkouts.** If you clone specrails-core with `core.autocrlf=true`, the repo's `.gitattributes` forces LF on every text file at checkout so the Node installer writes byte-identical artefacts across platforms. Running `git add --renormalize .` once after cloning fixes any pre-existing CRLF contamination.
|
|
42
|
+
- **ARM64.** The x64 Node binary runs under Windows 11's native x64 emulation. All native dependencies we use (`better-sqlite3`, `node-pty`, etc.) resolve to their x64 prebuilts; performance hit is ~10-20% vs native ARM64 but fully functional.
|
|
43
|
+
|
|
44
|
+
## CI
|
|
45
|
+
|
|
46
|
+
The specrails-core GitHub Actions workflow runs the vitest suite on `windows-latest` in a matrix with `ubuntu-latest` and `macos-latest`, on Node 20 and Node 22. Any PR that regresses Windows behaviour fails CI immediately.
|
|
47
|
+
|
|
48
|
+
## Reporting Windows-specific bugs
|
|
49
|
+
|
|
50
|
+
[GitHub Issues](https://github.com/fjpulidop/specrails-core/issues). Include:
|
|
51
|
+
- Windows version (`winver`)
|
|
52
|
+
- Node version (`node --version`)
|
|
53
|
+
- Full output of `npx specrails-core doctor` (run inside the affected project)
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
"legacyCompat": {
|
|
83
|
-
"setupCommandAlias":
|
|
84
|
-
"note": "
|
|
83
|
+
"setupCommandAlias": false,
|
|
84
|
+
"note": "The Node-native installer ships /specrails:enrich only. Existing repos should prune any leftover /specrails:setup alias during re-install or update."
|
|
85
85
|
}
|
|
86
86
|
}
|
package/package.json
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "specrails-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "AI agent workflow system for Claude Code — installs 12 specialized agents, orchestration commands, and persona-driven product discovery into any repository",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"bin": {
|
|
6
|
-
"specrails-core": "bin/specrails-core.
|
|
7
|
+
"specrails-core": "bin/specrails-core.mjs"
|
|
7
8
|
},
|
|
8
9
|
"files": [
|
|
9
10
|
"bin/",
|
|
10
|
-
"
|
|
11
|
-
"update.sh",
|
|
11
|
+
"dist/",
|
|
12
12
|
"templates/",
|
|
13
13
|
".claude/skills/",
|
|
14
14
|
"commands/",
|
|
15
15
|
"docs/",
|
|
16
16
|
"schemas/",
|
|
17
|
-
"VERSION"
|
|
17
|
+
"VERSION",
|
|
18
|
+
"integration-contract.json",
|
|
19
|
+
"pinned-versions.json"
|
|
18
20
|
],
|
|
19
21
|
"engines": {
|
|
20
|
-
"node": ">=
|
|
22
|
+
"node": ">=20.0.0"
|
|
21
23
|
},
|
|
22
24
|
"repository": {
|
|
23
25
|
"type": "git",
|
|
@@ -50,17 +52,30 @@
|
|
|
50
52
|
"url": "https://github.com/fjpulidop/specrails-core/issues"
|
|
51
53
|
},
|
|
52
54
|
"scripts": {
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
+
"build": "tsc -p tsconfig.json",
|
|
56
|
+
"build:watch": "tsc -p tsconfig.json --watch",
|
|
57
|
+
"typecheck": "tsc -p tsconfig.test.json --noEmit",
|
|
58
|
+
"test": "npm run typecheck && npm run build && vitest run",
|
|
59
|
+
"test:watch": "vitest",
|
|
60
|
+
"test:coverage": "vitest run --coverage",
|
|
61
|
+
"prepare": "npm run build",
|
|
62
|
+
"prepack": "npm run build"
|
|
55
63
|
},
|
|
56
64
|
"specrails": {
|
|
57
65
|
"openspecVersion": "1.2.0"
|
|
58
66
|
},
|
|
59
67
|
"dependencies": {
|
|
60
|
-
"@inquirer/prompts": "^7.0.0"
|
|
68
|
+
"@inquirer/prompts": "^7.0.0",
|
|
69
|
+
"js-yaml": "^4.1.0",
|
|
70
|
+
"picocolors": "^1.1.1"
|
|
61
71
|
},
|
|
62
72
|
"devDependencies": {
|
|
63
|
-
"
|
|
73
|
+
"@types/js-yaml": "^4.0.9",
|
|
74
|
+
"@types/node": "^22.10.2",
|
|
75
|
+
"@vitest/coverage-v8": "^2.1.8",
|
|
76
|
+
"ajv": "^8.18.0",
|
|
77
|
+
"typescript": "^5.7.2",
|
|
78
|
+
"vitest": "^2.1.8"
|
|
64
79
|
},
|
|
65
80
|
"license": "MIT",
|
|
66
81
|
"author": "fjpulidop"
|
package/schemas/profile.v1.json
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"type": "array",
|
|
39
39
|
"minItems": 1,
|
|
40
40
|
"items": { "$ref": "#/$defs/agentEntry" },
|
|
41
|
-
"description": "Ordered chain of agents that participate in the pipeline when this profile is active.",
|
|
41
|
+
"description": "Ordered chain of agents that participate in the pipeline when this profile is active. Every profile (default + custom) must include the baseline quartet (sr-architect, sr-developer, sr-reviewer, sr-merge-resolver) — the pipeline depends on all four. Custom profiles add optional agents on top of the baseline.",
|
|
42
42
|
"allOf": [
|
|
43
43
|
{
|
|
44
44
|
"description": "Required baseline agent: sr-architect",
|
|
@@ -63,13 +63,21 @@
|
|
|
63
63
|
"properties": { "id": { "const": "sr-reviewer" } },
|
|
64
64
|
"required": ["id"]
|
|
65
65
|
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"description": "Required baseline agent: sr-merge-resolver",
|
|
69
|
+
"contains": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"properties": { "id": { "const": "sr-merge-resolver" } },
|
|
72
|
+
"required": ["id"]
|
|
73
|
+
}
|
|
66
74
|
}
|
|
67
75
|
]
|
|
68
76
|
},
|
|
69
77
|
"routing": {
|
|
70
78
|
"type": "array",
|
|
71
|
-
"minItems":
|
|
72
|
-
"description": "Ordered routing rules. The first rule whose `tags` intersects the task's tag set wins.
|
|
79
|
+
"minItems": 0,
|
|
80
|
+
"description": "Ordered routing rules. The first rule whose `tags` intersects the task's tag set wins. If a `default: true` entry is present it MUST be the last element. Custom profiles may omit routing entirely — tasks then fall through to the first developer-shaped agent in the chain.",
|
|
73
81
|
"items": { "$ref": "#/$defs/routingRule" }
|
|
74
82
|
}
|
|
75
83
|
},
|
|
@@ -86,7 +86,7 @@ After producing the task breakdown and before finalizing output:
|
|
|
86
86
|
1. **Extract the proposed surface changes** from your implementation design: which commands, agents, placeholders, flags, or config keys are being added, removed, renamed, or modified?
|
|
87
87
|
|
|
88
88
|
2. **Compare against the current surface** by reading:
|
|
89
|
-
- `
|
|
89
|
+
- `bin/specrails-core.mjs` for CLI flags
|
|
90
90
|
- `templates/commands/*.md` for command names and argument flags
|
|
91
91
|
- `templates/agents/*.md` for agent names
|
|
92
92
|
- `templates/**/*.md` for `{{PLACEHOLDER}}` keys
|
|
@@ -59,7 +59,7 @@ These are the most common reasons code passes locally but fails in CI:
|
|
|
59
59
|
|
|
60
60
|
The orchestrator runs specialized layer reviewers in parallel before you launch. Their reports are injected here. A value of `"SKIPPED"` means no files of that layer type were in the changeset.
|
|
61
61
|
|
|
62
|
-
**These are NOT `/specrails:
|
|
62
|
+
**These are NOT `/specrails:enrich` placeholders. They use `[injected]` notation, not `{{...}}` notation.** The `[injected]` markers below are replaced by the actual report text when the orchestrator launches you.
|
|
63
63
|
|
|
64
64
|
FRONTEND_REVIEW_REPORT:
|
|
65
65
|
[injected]
|
|
@@ -40,7 +40,7 @@ Parse `$ARGUMENTS` to set runtime variables.
|
|
|
40
40
|
**Verify prerequisites:**
|
|
41
41
|
|
|
42
42
|
- Check whether `templates/` directory exists. If not: print `Error: templates/ not found — is this a specrails repo?` and stop.
|
|
43
|
-
- Check whether `
|
|
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
44
|
|
|
45
45
|
**Print active configuration:**
|
|
46
46
|
|
|
@@ -56,9 +56,9 @@ Read the codebase and build the surface snapshot. Print one progress line as eac
|
|
|
56
56
|
|
|
57
57
|
**Surface category: installer_flags**
|
|
58
58
|
|
|
59
|
-
If `INSTALLER_AVAILABLE=false`: print ` installer_flags: skipped (
|
|
59
|
+
If `INSTALLER_AVAILABLE=false`: print ` installer_flags: skipped (bin/specrails-core.mjs not found)` and record as unavailable.
|
|
60
60
|
|
|
61
|
-
Otherwise: read `
|
|
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
62
|
|
|
63
63
|
Print: ` installer_flags: N found`
|
|
64
64
|
|
|
@@ -10,23 +10,23 @@ Run the specrails health check to validate that all prerequisites are correctly
|
|
|
10
10
|
|-------|---------------|
|
|
11
11
|
| Claude Code CLI | `claude` binary found in PATH |
|
|
12
12
|
| Claude API key | `claude config list` shows a key OR `ANTHROPIC_API_KEY` env var set |
|
|
13
|
-
| Agent files |
|
|
13
|
+
| Agent files | Generated agent files exist under `.claude/agents/` |
|
|
14
14
|
| CLAUDE.md | `CLAUDE.md` present in the repo root |
|
|
15
15
|
| Git initialized | `.git/` directory present |
|
|
16
16
|
| npm | `npm` binary found in PATH |
|
|
17
17
|
|
|
18
18
|
## How to run
|
|
19
19
|
|
|
20
|
-
This command
|
|
20
|
+
This command uses the Node-native doctor runtime. Run it directly with:
|
|
21
21
|
|
|
22
22
|
```
|
|
23
|
-
|
|
23
|
+
npx specrails-core@latest doctor
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
If `specrails-core` is already on your `PATH`, this works too:
|
|
27
27
|
|
|
28
28
|
```
|
|
29
|
-
|
|
29
|
+
specrails-core doctor
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
## Output
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Interactive wizard to configure the full agent workflow system for this repository. Analyzes the codebase, discovers target users, generates VPC personas, and creates all agents, commands, rules, and configuration adapted to this project. Supports config-driven mode for direct installation from a pre-built config file.
|
|
4
4
|
|
|
5
|
-
**Prerequisites:**
|
|
5
|
+
**Prerequisites:** Ensure this repo was initialized with `npx specrails-core@latest init` (or via specrails-hub) so `.specrails/setup-templates/` exists.
|
|
6
6
|
|
|
7
7
|
### Hub Checkpoint Protocol
|
|
8
8
|
|
|
@@ -69,7 +69,7 @@ To resolve the model for any given agent:
|
|
|
69
69
|
|
|
70
70
|
### FC2: Provider Setup
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
Use `FC_provider` from the config as the source of truth. Set `CLI_PROVIDER = FC_provider`, and set `SPECRAILS_DIR` to `.codex` when `CLI_PROVIDER == "codex"`, otherwise `.claude`.
|
|
73
73
|
|
|
74
74
|
Set `SPECRAILS_DIR` and `CLI_PROVIDER` from resolved provider.
|
|
75
75
|
|
|
@@ -139,12 +139,12 @@ Read the following files to understand the current installation state:
|
|
|
139
139
|
}
|
|
140
140
|
```
|
|
141
141
|
If this file does not exist, inform the user:
|
|
142
|
-
> "No `.specrails/specrails-manifest.json` found. This
|
|
142
|
+
> "No `.specrails/specrails-manifest.json` found. This repo predates the Node-native installer. Re-run `npx specrails-core@latest init` to refresh the install, then re-run `/specrails:enrich --update`."
|
|
143
143
|
Then stop.
|
|
144
144
|
|
|
145
145
|
2. Read `.specrails/specrails-version` — contains the current version string (e.g., `0.2.0`). If it does not exist, treat version as `0.1.0 (legacy)`.
|
|
146
146
|
|
|
147
|
-
3. Determine `$SPECRAILS_DIR`
|
|
147
|
+
3. Determine `$SPECRAILS_DIR` from the existing install layout. If `.codex/` exists, use `cli_provider = "codex"` and `specrails_dir = ".codex"`. Otherwise use `cli_provider = "claude"` and `specrails_dir = ".claude"`.
|
|
148
148
|
|
|
149
149
|
4. List all template files in `.specrails/setup-templates/agents/` — these are the NEW agent templates from the update:
|
|
150
150
|
```bash
|
|
@@ -1029,7 +1029,7 @@ How should we interact with JIRA?
|
|
|
1029
1029
|
|
|
1030
1030
|
Set `BACKLOG_WRITE=true/false`.
|
|
1031
1031
|
|
|
1032
|
-
<!--
|
|
1032
|
+
<!-- This command is mirrored from commands/enrich.md for staged installs. -->
|
|
1033
1033
|
|
|
1034
1034
|
#### Project Label
|
|
1035
1035
|
|
|
@@ -1155,7 +1155,7 @@ Wait for final confirmation.
|
|
|
1155
1155
|
|
|
1156
1156
|
Read each template from `.specrails/setup-templates/` and generate the final files adapted to this project. Use the codebase analysis from Phase 1, personas from Phase 2, and configuration from Phase 3.
|
|
1157
1157
|
|
|
1158
|
-
**Provider detection (required before any file generation):**
|
|
1158
|
+
**Provider detection (required before any file generation):** Determine `cli_provider` from the existing install layout: use `"codex"` when `.codex/` exists, otherwise `"claude"`. Set `specrails_dir` to `.codex` or `.claude` accordingly. All output paths in Phase 4 use `$SPECRAILS_DIR` as the base directory.
|
|
1159
1159
|
|
|
1160
1160
|
### 4.1 Generate agents
|
|
1161
1161
|
|
|
@@ -1388,7 +1388,7 @@ Each rule file must:
|
|
|
1388
1388
|
|
|
1389
1389
|
### 4.6 Generate settings
|
|
1390
1390
|
|
|
1391
|
-
|
|
1391
|
+
Resolve `cli_provider` from the existing install layout (`.codex/` => `codex`, otherwise `claude`).
|
|
1392
1392
|
|
|
1393
1393
|
**If `cli_provider == "claude"` (default):**
|
|
1394
1394
|
|
|
@@ -1448,7 +1448,7 @@ rm -rf .specrails/setup-templates/
|
|
|
1448
1448
|
rm -f .claude/commands/enrich.md
|
|
1449
1449
|
|
|
1450
1450
|
# 3. Remove the specrails/ directory from the repo if it exists at the root
|
|
1451
|
-
# (it was only needed for
|
|
1451
|
+
# (it was only needed for the retired shell installer and staging templates — everything is now in .claude/)
|
|
1452
1452
|
# NOTE: Only remove if it's inside this repo. Ask the user if unsure.
|
|
1453
1453
|
```
|
|
1454
1454
|
|
|
@@ -1485,7 +1485,7 @@ Apply the user's choice.
|
|
|
1485
1485
|
After cleanup, verify that only the intended files remain:
|
|
1486
1486
|
|
|
1487
1487
|
```bash
|
|
1488
|
-
# These should exist (the actual system) — use $SPECRAILS_DIR
|
|
1488
|
+
# These should exist (the actual system) — use the resolved $SPECRAILS_DIR:
|
|
1489
1489
|
# If cli_provider == "claude":
|
|
1490
1490
|
ls .claude/agents/sr-*.md
|
|
1491
1491
|
ls .claude/agents/personas/*.md
|
|
@@ -8,8 +8,8 @@ Reads `.specrails/agents.yaml` and updates the `model:` frontmatter field in all
|
|
|
8
8
|
|
|
9
9
|
Determine `$SPECRAILS_DIR`:
|
|
10
10
|
|
|
11
|
-
1.
|
|
12
|
-
2.
|
|
11
|
+
1. If `.codex/agents/` exists, set `cli_provider = "codex"` and `specrails_dir = ".codex"`.
|
|
12
|
+
2. Otherwise set `cli_provider = "claude"` and `specrails_dir = ".claude"`.
|
|
13
13
|
3. Set `$AGENTS_DIR = $SPECRAILS_DIR/agents`
|
|
14
14
|
|
|
15
15
|
## Step 2: Read agent config
|
|
@@ -40,7 +40,7 @@ Always exclude the following from all analysis:
|
|
|
40
40
|
|
|
41
41
|
## Phase 1.5: VPC Context
|
|
42
42
|
|
|
43
|
-
Check whether persona files exist at `.claude/agents/personas/`. This path is present in any repo that has run `/specrails:
|
|
43
|
+
Check whether persona files exist at `.claude/agents/personas/`. This path is present in any repo that has run `/specrails:enrich`.
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
46
|
ls .claude/agents/personas/ 2>/dev/null
|
|
@@ -208,5 +208,5 @@ Issues created: {N} (or "dry-run: no issues created")
|
|
|
208
208
|
```
|
|
209
209
|
|
|
210
210
|
Where:
|
|
211
|
-
- `{vpc_header}` is `VPC personas loaded: {persona names}` when `VPC_AVAILABLE=true`, or `VPC personas: not found (run /specrails:
|
|
211
|
+
- `{vpc_header}` is `VPC personas loaded: {persona names}` when `VPC_AVAILABLE=true`, or `VPC personas: not found (run /specrails:enrich to enable)` otherwise.
|
|
212
212
|
- `{vpc_detail}` is `**VPC Value**: {vpc_value}/5 — {vpc_persona}: {vpc_rationale}` when `VPC_AVAILABLE=true`, omitted otherwise.
|
|
@@ -57,7 +57,7 @@ If no persona files are found in either location:
|
|
|
57
57
|
Error: No VPC persona files found.
|
|
58
58
|
Expected location: .claude/agents/*.md or {{PERSONA_DIR}}/*.md
|
|
59
59
|
Each persona file must contain a ## Value Proposition Canvas section.
|
|
60
|
-
Run /specrails:
|
|
60
|
+
Run /specrails:enrich to generate persona files from templates.
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
Stop.
|
|
@@ -44,7 +44,7 @@ Parse `$ARGUMENTS` to set runtime variables.
|
|
|
44
44
|
**Verify prerequisites:**
|
|
45
45
|
|
|
46
46
|
- Check whether `templates/` directory exists. If not: print `Error: templates/ not found — is this a specrails repo?` and stop.
|
|
47
|
-
- Check whether `
|
|
47
|
+
- Check whether `bin/specrails-core.mjs` exists. If not: set `INSTALLER_AVAILABLE=false` (installer flags category will be skipped). Otherwise set `INSTALLER_AVAILABLE=true`.
|
|
48
48
|
|
|
49
49
|
**Print active configuration:**
|
|
50
50
|
|
|
@@ -60,9 +60,9 @@ Read the codebase and build the surface snapshot. Print one progress line as eac
|
|
|
60
60
|
|
|
61
61
|
**Surface category: installer_flags**
|
|
62
62
|
|
|
63
|
-
If `INSTALLER_AVAILABLE=false`: print ` installer_flags: skipped (
|
|
63
|
+
If `INSTALLER_AVAILABLE=false`: print ` installer_flags: skipped (bin/specrails-core.mjs not found)` and record as unavailable.
|
|
64
64
|
|
|
65
|
-
Otherwise: read `
|
|
65
|
+
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.
|
|
66
66
|
|
|
67
67
|
Print: ` installer_flags: N found`
|
|
68
68
|
|
|
@@ -44,7 +44,7 @@ Always exclude the following from all analysis:
|
|
|
44
44
|
|
|
45
45
|
## Phase 1.5: VPC Context
|
|
46
46
|
|
|
47
|
-
Check whether persona files exist at `.claude/agents/personas/`. This path is present in any repo that has run `/specrails:
|
|
47
|
+
Check whether persona files exist at `.claude/agents/personas/`. This path is present in any repo that has run `/specrails:enrich`.
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
50
|
ls .claude/agents/personas/ 2>/dev/null
|
|
@@ -212,5 +212,5 @@ Issues created: {N} (or "dry-run: no issues created")
|
|
|
212
212
|
```
|
|
213
213
|
|
|
214
214
|
Where:
|
|
215
|
-
- `{vpc_header}` is `VPC personas loaded: {persona names}` when `VPC_AVAILABLE=true`, or `VPC personas: not found (run /specrails:
|
|
215
|
+
- `{vpc_header}` is `VPC personas loaded: {persona names}` when `VPC_AVAILABLE=true`, or `VPC personas: not found (run /specrails:enrich to enable)` otherwise.
|
|
216
216
|
- `{vpc_detail}` is `**VPC Value**: {vpc_value}/5 — {vpc_persona}: {vpc_rationale}` when `VPC_AVAILABLE=true`, omitted otherwise.
|