specrails-core 3.2.0 → 3.3.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 CHANGED
@@ -65,7 +65,8 @@ codex # OpenAI Codex (beta)
65
65
 
66
66
  ```bash
67
67
  > /sr:implement "add user authentication"
68
- > /sr:implement #42, #43 # from GitHub Issues
68
+ > /sr:implement #1, #2 # from local tickets (default)
69
+ > /sr:implement #42, #43 # from GitHub Issues (if configured)
69
70
  > /sr:update-product-driven-backlog # discover new features with AI
70
71
  ```
71
72
 
@@ -77,9 +78,9 @@ That's it. The pipeline takes over.
77
78
 
78
79
  | Category | Files | Purpose |
79
80
  |----------|-------|---------|
80
- | **Agents** | `.claude/agents/*.md` | 12 specialized AI agents |
81
+ | **Agents** | `.claude/agents/*.md` | 14 specialized AI agents |
81
82
  | **Personas** | `.claude/agents/personas/*.md` | VPC user profiles, generated from your users |
82
- | **Commands** | `.claude/commands/sr/*.md` | `/sr:implement`, `/sr:product-backlog`, `/sr:update-product-driven-backlog` |
83
+ | **Commands** | `.claude/commands/sr/*.md` | 17 workflow commands: `/sr:implement`, `/sr:product-backlog`, `/sr:health-check`, `/sr:why`, and more |
83
84
  | **Rules** | `.claude/rules/*.md` | Per-layer coding conventions, loaded by file path |
84
85
  | **Memory** | `.claude/agent-memory/` | Persistent knowledge — agents learn across sessions |
85
86
  | **Config** | `.claude/settings.json`, `CLAUDE.md` | Permissions, architecture reference |
@@ -115,6 +116,8 @@ SpecRails is not a chat interface. It's a **development pipeline** that coordina
115
116
  | **sr-test-writer** | Sonnet | Generates unit, integration, and e2e tests |
116
117
  | **sr-security-reviewer** | Sonnet | Secrets detection, OWASP checks, dependency vulnerabilities |
117
118
  | **sr-doc-sync** | Sonnet | Updates changelogs, READMEs, API docs |
119
+ | **sr-merge-resolver** | Sonnet | AI-powered merge conflict resolution for multi-feature pipelines |
120
+ | **sr-performance-reviewer** | Sonnet | Performance regression detection after implementation |
118
121
  | **sr-product-manager** | Opus | Product discovery: competitive analysis, VPC evaluation |
119
122
  | **sr-product-analyst** | Haiku | Read-only backlog analysis and prioritization |
120
123
 
@@ -162,7 +165,7 @@ rm -rf .claude/.dry-run/add-dark-mode/
162
165
  /sr:product-backlog UI, Decks # filter by area
163
166
  ```
164
167
 
165
- Reads your GitHub Issues, scores by VPC persona match, recommends top 3 for next sprint.
168
+ Reads your tickets (local or GitHub Issues), scores by VPC persona match, recommends top 3 for next sprint.
166
169
 
167
170
  ### `/sr:update-product-driven-backlog` — Discover features
168
171
 
@@ -171,7 +174,28 @@ Reads your GitHub Issues, scores by VPC persona match, recommends top 3 for next
171
174
  /sr:update-product-driven-backlog Analytics # focus on one area
172
175
  ```
173
176
 
174
- AI product discovery using your personas. Evaluates ideas, creates GitHub Issues for the best ones.
177
+ AI product discovery using your personas. Evaluates ideas, creates tickets (local or GitHub Issues) for the best ones.
178
+
179
+ ---
180
+
181
+ ## Local ticket management
182
+
183
+ specrails-core ships with a built-in ticket system — no GitHub account or external tools required.
184
+
185
+ Tickets live in `.claude/local-tickets.json` alongside your code. They're plain JSON, git-friendly, and bidirectionally synced with specrails-hub in real time.
186
+
187
+ **Local tickets are the default.** The `/setup` wizard defaults to local tickets and skips GitHub/JIRA credential setup unless you opt in.
188
+
189
+ ```bash
190
+ /sr:implement #1, #4 # implement by ticket ID
191
+ /sr:product-backlog # view prioritized backlog
192
+ /sr:update-product-driven-backlog # discover and create tickets with AI
193
+ /sr:propose-spec # create a ticket from a spec proposal
194
+ ```
195
+
196
+ See [docs/local-tickets.md](./docs/local-tickets.md) for the full schema reference, concurrency model, and command integration details.
197
+
198
+ Migrating from GitHub Issues or JIRA? See [docs/migration-guide.md](./docs/migration-guide.md).
175
199
 
176
200
  ---
177
201
 
@@ -200,8 +224,8 @@ Each persona scores features 0-5. Features are ranked by score/effort ratio. No
200
224
  | **git** | Yes | Repository detection |
201
225
  | **npm / Node 18+** | Recommended | Needed for npx install and OpenSpec CLI |
202
226
  | **OpenSpec CLI** | Recommended | Structured design artifacts for `/sr:implement` |
203
- | **GitHub CLI** (`gh`) | Optional | Backlog sync to GitHub Issues, PR creation |
204
- | **JIRA CLI** (`jira`) | Optional | Backlog sync to JIRA |
227
+ | **GitHub CLI** (`gh`) | Optional | Backlog sync to GitHub Issues, PR creation. Not needed with local tickets. |
228
+ | **JIRA CLI** (`jira`) | Optional | Backlog sync to JIRA. Not needed with local tickets. |
205
229
 
206
230
  The installer checks for each tool and offers to install missing ones.
207
231
 
@@ -242,7 +266,10 @@ Run `npx specrails-core@latest init --root-dir <path>` again to re-scaffold, the
242
266
  Partially. Product discovery commands and individual agents work. `/sr:implement` and sr-architect rely on OpenSpec for structured design artifacts.
243
267
 
244
268
  **Does this work without GitHub CLI?**
245
- Yes. Use JIRA instead, or skip backlog commands. `/sr:implement "description"` works without `gh` — it just skips automated PR creation.
269
+ Yes. Local tickets are the default and need no external tools. `/sr:implement "description"` also works without `gh` — it just skips automated PR creation.
270
+
271
+ **Can I use local tickets and GitHub Issues together?**
272
+ Not simultaneously for the same project — backlog commands use one active provider at a time. You can migrate from GitHub Issues to local tickets using the [migration guide](./docs/migration-guide.md).
246
273
 
247
274
  **How much does it cost to run?**
248
275
  A full `/sr:implement` cycle for one feature typically costs a few dollars in Claude API usage. The sr-product-manager uses Opus; all other agents use Sonnet or Haiku.
package/commands/setup.md CHANGED
@@ -10,11 +10,11 @@ Interactive wizard to configure the full agent workflow system for this reposito
10
10
 
11
11
  Check `$ARGUMENTS` in this order:
12
12
 
13
- 1. If `--update` is present → execute **Update Mode** (below), then stop. Do NOT continue to Phase 1 or Quick Start.
14
- 2. If `--advanced` is present → skip directly to **Phase 1** and execute the full 5-phase wizard.
15
- 3. Otherwise (no flags) → execute **Quick Start Mode** (below), then stop. Do NOT execute Phase 1.
13
+ 1. If `--update` is present → execute **Update Mode** (below), then stop. Do NOT continue to Phase 1 or Lite Mode.
14
+ 2. If `--lite` is present → execute **Lite Mode** (below), then stop. Do NOT execute Phase 1.
15
+ 3. Otherwise (no flags) → skip directly to **Phase 1** and execute the full 5-phase wizard.
16
16
 
17
- **Default is Quick Start.** The full wizard only runs when `--advanced` is explicitly passed.
17
+ **Default is the full wizard.** Lite Mode only runs when `--lite` is explicitly passed.
18
18
 
19
19
  ---
20
20
 
@@ -308,9 +308,9 @@ Update `.specrails-manifest.json` to reflect the new checksums for all regenerat
308
308
 
309
309
  ---
310
310
 
311
- ## Quick Start Mode
311
+ ## Lite Mode
312
312
 
313
- When no flags are passed (the default), run this streamlined 3-question setup. Do NOT run Phase 1–5. When QS4 is complete, stop.
313
+ When `--lite` is passed, run this streamlined 3-question setup. Do NOT run Phase 1–5. When QS4 is complete, stop.
314
314
 
315
315
  ### QS1: Ask the 3 questions
316
316
 
@@ -332,14 +332,14 @@ Store the answers as:
332
332
 
333
333
  Use these defaults for all configuration not asked in QS1:
334
334
 
335
- | Setting | Quick Start Default |
336
- |---------|-------------------|
335
+ | Setting | Lite Mode Default |
336
+ |---------|------------------|
337
337
  | Agents enabled | sr-architect, sr-developer, sr-reviewer, sr-product-manager |
338
338
  | Git mode | Derived from QS_GIT_ACCESS |
339
339
  | CLAUDE.md template | `templates/CLAUDE-quickstart.md` |
340
340
  | OpenSpec enabled | Yes if `openspec` CLI is detected in PATH, No otherwise |
341
341
  | Telemetry | Not configured (deferred to PRD-002) |
342
- | Backlog provider | None (user can configure later with `/setup --advanced`) |
342
+ | Backlog provider | local (lightweight JSON-based, no external tools needed) |
343
343
 
344
344
  Detect whether this is an existing codebase or new project:
345
345
  - **Existing codebase**: `package.json`, `Gemfile`, `pyproject.toml`, `go.mod`, or `pom.xml` found in the repo root
@@ -379,7 +379,7 @@ For CLAUDE.md/AGENTS.md and agent files, the existing per-file prompts already h
379
379
 
380
380
  ### QS3: Generate files
381
381
 
382
- Generate files using the Quick Start defaults.
382
+ Generate files using the Lite Mode defaults.
383
383
 
384
384
  **1. CLAUDE.md**
385
385
 
@@ -406,10 +406,10 @@ Fill placeholders with best-effort values from the limited context available:
406
406
  - `{{PROJECT_DESCRIPTION}}` → `QS_PROJECT_DESCRIPTION`
407
407
  - `{{TARGET_USERS}}` → `QS_TARGET_USERS`
408
408
  - `{{GIT_ACCESS}}` → `QS_GIT_ACCESS`
409
- - `{{ARCHITECTURE_DIAGRAM}}` → "(Quick Start — run `/setup --advanced` for full architecture analysis)"
410
- - `{{TECH_EXPERTISE}}` → "(Quick Start — run `/setup --advanced` for codebase-specific expertise)"
409
+ - `{{ARCHITECTURE_DIAGRAM}}` → "(Lite Mode — run `/setup` for full architecture analysis)"
410
+ - `{{TECH_EXPERTISE}}` → "(Lite Mode — run `/setup` for codebase-specific expertise)"
411
411
  - `{{LAYER_TAGS}}` → detect from package.json / Gemfile / go.mod if present; otherwise leave empty
412
- - All other placeholders → "(not configured — run `/setup --advanced`)"
412
+ - All other placeholders → "(not configured — run `/setup`)"
413
413
 
414
414
  Create memory directories: `$SPECRAILS_DIR/agent-memory/sr-<name>/`
415
415
 
@@ -422,24 +422,35 @@ Core commands (always install if missing):
422
422
  - `health-check.md`
423
423
  - `compat-check.md`
424
424
  - `why.md`
425
+ - `product-backlog.md`
426
+ - `update-product-driven-backlog.md`
425
427
 
426
- Do NOT copy `product-backlog.md` or `update-product-driven-backlog.md` (no backlog provider configured).
428
+ **Initialize local ticket storage** (backlog provider defaults to `local`):
429
+ 1. Copy `templates/local-tickets-schema.json` to `$SPECRAILS_DIR/local-tickets.json` and set `last_updated` to the current ISO-8601 timestamp. Skip if the file already exists.
430
+ 2. Write `$SPECRAILS_DIR/backlog-config.json` (skip if already exists):
431
+ ```json
432
+ {
433
+ "provider": "local",
434
+ "write_access": true,
435
+ "git_auto": true
436
+ }
437
+ ```
427
438
 
428
439
  **If `cli_provider == "claude"`:**
429
440
 
430
- If `QS_IS_RERUN=false` (fresh install): copy all core commands from `$SPECRAILS_DIR/setup-templates/commands/sr/` to `.claude/commands/sr/`.
441
+ If `QS_IS_RERUN=false` (fresh install): for each core command, read the template from `$SPECRAILS_DIR/setup-templates/commands/sr/<name>.md`, substitute the backlog placeholders with local values (using the same table as Phase 4.3 "Local Tickets"), stub all persona placeholders with `(Lite Mode — run /setup to configure personas)`, then write to `.claude/commands/sr/<name>.md`.
431
442
 
432
443
  If `QS_IS_RERUN=true` (gap-fill mode): for each command in the list above, check if `.claude/commands/sr/<name>.md` already exists:
433
444
  - If it exists: skip it — show `✓ Already installed: /sr:<name>`
434
- - If it does NOT exist: copy from `$SPECRAILS_DIR/setup-templates/commands/sr/<name>.md` — show `✓ Added /sr:<name> (was missing)`
445
+ - If it does NOT exist: read template, substitute placeholders as above, write to `.claude/commands/sr/<name>.md` — show `✓ Added /sr:<name> (was missing)`
435
446
 
436
447
  **If `cli_provider == "codex"`:**
437
448
 
438
- If `QS_IS_RERUN=false` (fresh install): for each core command, copy the corresponding skill from `$SPECRAILS_DIR/setup-templates/skills/sr-<name>/SKILL.md` to `.agents/skills/sr-<name>/SKILL.md` (create the directory first).
449
+ If `QS_IS_RERUN=false` (fresh install): for each core command, read the corresponding skill template from `$SPECRAILS_DIR/setup-templates/skills/sr-<name>/SKILL.md`, substitute the backlog placeholders with local values and stub persona placeholders with `(Lite Mode — run /setup to configure personas)`, then write to `.agents/skills/sr-<name>/SKILL.md` (create the directory first).
439
450
 
440
451
  If `QS_IS_RERUN=true` (gap-fill mode): for each command in the list above, check if `.agents/skills/sr-<name>/SKILL.md` already exists:
441
452
  - If it exists: skip it — show `✓ Already installed: $sr-<name>`
442
- - If it does NOT exist: copy from `$SPECRAILS_DIR/setup-templates/skills/sr-<name>/SKILL.md` — show `✓ Added $sr-<name> (was missing)`
453
+ - If it does NOT exist: read template, substitute placeholders as above, write to `.agents/skills/sr-<name>/SKILL.md` — show `✓ Added $sr-<name> (was missing)`
443
454
 
444
455
  **4. Cleanup**
445
456
 
@@ -682,12 +693,26 @@ Which agents do you want to install?
682
693
 
683
694
  ### 3.2 Backlog provider
684
695
 
685
- Ask the user where they manage their product backlog:
696
+ Ask the user how they want to manage their product backlog. Default is local — no external tools or accounts required:
686
697
 
687
698
  ```
688
699
  ## Backlog Provider
689
700
 
690
- Where do you track your product backlog?
701
+ Use local ticket management or connect an external provider?
702
+
703
+ 1. **Local tickets** (default, recommended) — lightweight JSON-based ticket management built into the project.
704
+ No external tools or accounts required. Tickets stored in `.claude/local-tickets.json`, version-controlled and diffable.
705
+ 2. **External provider** — connect GitHub Issues, JIRA, or disable backlog commands
706
+ ```
707
+
708
+ If the user selects **1** or presses Enter without typing anything: set `BACKLOG_PROVIDER=local` and proceed directly to **If Local Tickets** below. Do NOT ask about GitHub CLI, JIRA credentials, or any external provider configuration.
709
+
710
+ If the user selects **2**: display the secondary menu:
711
+
712
+ ```
713
+ ## External Backlog Provider
714
+
715
+ Which external provider?
691
716
 
692
717
  1. **Local tickets** (recommended) — lightweight JSON-based ticket management built into the project.
693
718
  No external tools required. Tickets stored in `.claude/local-tickets.json`, version-controlled and diffable.
@@ -1414,7 +1439,7 @@ Note: Only commands/skills selected during setup are shown. Backlog commands are
1414
1439
  - `$sr-update-product-driven-backlog` — discover new features using VPC
1415
1440
  ```
1416
1441
 
1417
- ## First Task Prompt (Advanced Mode)
1442
+ ## First Task Prompt (Full Wizard)
1418
1443
 
1419
1444
  After displaying the setup complete summary above, detect the project type and output:
1420
1445
 
package/docs/agents.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Agents
2
2
 
3
- SpecRails ships with **12 specialized agents**. Each has a clear role, a dedicated AI model, and knows exactly when to stay in its lane.
3
+ SpecRails ships with **14 specialized agents**. Each has a clear role, a dedicated AI model, and knows exactly when to stay in its lane.
4
4
 
5
5
  ## Why specialized agents?
6
6
 
@@ -245,6 +245,48 @@ The Reviewer is the **last agent before ship**. It:
245
245
 
246
246
  ---
247
247
 
248
+ ### Merge Resolver
249
+
250
+ | | |
251
+ |-|-|
252
+ | **Color** | Yellow |
253
+ | **Model** | Sonnet |
254
+ | **Trigger** | `/sr:merge-resolve`, `/sr:implement` (Phase 4a, after worktree merge) |
255
+ | **Role** | AI-powered merge conflict resolution |
256
+
257
+ When a multi-feature pipeline merges worktrees and produces conflict markers, the Merge Resolver analyzes each conflict block using the OpenSpec context bundles from both features. It applies resolutions where confidence is high enough and leaves clean markers for the conflicts it cannot safely resolve.
258
+
259
+ **Configuration (in `.claude/agents/sr-merge-resolver.md`):**
260
+ - `tone`: `terse` (default) or `verbose`
261
+ - `risk_tolerance`: `conservative` (default) or `aggressive`
262
+ - `confidence_threshold`: 0–100, default `70`
263
+
264
+ **What it produces:**
265
+ - Resolved conflict blocks written in place
266
+ - Structured resolution report (file, block, confidence, resolution or left-as-marker)
267
+
268
+ ---
269
+
270
+ ### Performance Reviewer
271
+
272
+ | | |
273
+ |-|-|
274
+ | **Color** | Yellow |
275
+ | **Model** | Sonnet |
276
+ | **Trigger** | `/sr:implement` (Phase 4, after Security Reviewer) |
277
+ | **Role** | Performance regression detection |
278
+
279
+ The Performance Reviewer benchmarks modified code paths after implementation, compares metrics against configured thresholds, and outputs a structured report. It never fixes code — findings above the threshold trigger the Developer to address them before the pipeline continues.
280
+
281
+ **Configuration:** Create `.specrails/perf-thresholds.yml` to set custom thresholds per metric. The agent falls back to built-in defaults if the file is missing.
282
+
283
+ **What it produces:**
284
+ - Execution time, memory usage, and throughput metrics for modified paths
285
+ - Pass/fail report against configured thresholds
286
+ - `PERF_STATUS` result consumed by the pipeline orchestrator
287
+
288
+ ---
289
+
248
290
  ## Agent memory
249
291
 
250
292
  Every agent stores observations in `.claude/agent-memory/<agent>/MEMORY.md`. This memory persists across sessions, so agents get smarter over time:
@@ -54,17 +54,27 @@ Open Claude Code in your project and run:
54
54
  /setup
55
55
  ```
56
56
 
57
- The wizard walks you through 5 phases:
57
+ By default, `/setup` runs the **full 5-phase wizard** — deep stack analysis, researched user personas, and fully adapted agents.
58
58
 
59
59
  | Phase | What happens |
60
60
  |-------|-------------|
61
61
  | **1. Analyze** | Detects your tech stack, architecture layers, CI commands, and conventions |
62
- | **2. Personas** | Researches your competitive landscape and generates user personas (VPC profiles) |
63
- | **3. Configure** | Asks about your backlog provider, git workflow, and which agents/commands to enable |
62
+ | **2. Personas** | Researches your competitive landscape and generates full VPC user personas |
63
+ | **3. Configure** | Asks about your backlog provider, git workflow, and which agents to enable |
64
64
  | **4. Generate** | Fills all templates with your project-specific context |
65
65
  | **5. Cleanup** | Removes the wizard and templates, leaving only your tailored workflow files |
66
66
 
67
- After setup, your `.claude/` directory contains fully adapted agents, commands, and rules ready to use.
67
+ **In a hurry?** Run `/setup --lite` for the quick version: three questions, sensible defaults, done in under a minute.
68
+
69
+ | Question | What it configures |
70
+ |----------|-------------------|
71
+ | What is this project? | Agent context and CLAUDE.md |
72
+ | Who are the target users? | Persona stubs for product discovery |
73
+ | Git access — read-only or read-write? | Whether agents can commit |
74
+
75
+ Lite mode installs the four core agents (architect, developer, reviewer, product manager), all workflow commands, and local ticket storage. You can run the full wizard later to deepen the configuration.
76
+
77
+ After either mode, your `.claude/` directory contains adapted agents, commands, and rules — ready to use.
68
78
 
69
79
  ## Your first feature
70
80
 
@@ -87,6 +87,19 @@ After installation, open Claude Code in your project and run:
87
87
  /setup
88
88
  ```
89
89
 
90
+ There are two modes:
91
+
92
+ | Mode | Command | When to use |
93
+ |------|---------|-------------|
94
+ | **Full wizard** (default) | `/setup` | Deep stack analysis, researched personas, fully adapted agents — takes 5–10 min |
95
+ | **Lite** | `/setup --lite` | Fastest path — 3 questions, sensible defaults, done in under a minute |
96
+
97
+ ---
98
+
99
+ ### Full Wizard (default)
100
+
101
+ The full 5-phase wizard — takes 5–10 minutes and produces deeply adapted agents.
102
+
90
103
  ### Phase 1: Codebase Analysis
91
104
 
92
105
  The wizard scans your project to detect:
@@ -116,10 +129,10 @@ Interactive prompts for:
116
129
 
117
130
  | Setting | Options |
118
131
  |---------|---------|
119
- | **Backlog provider** | GitHub Issues, JIRA, or none |
132
+ | **Backlog provider** | Local tickets (default), GitHub Issues, JIRA, or none |
120
133
  | **Access mode** | Read-write or read-only |
121
134
  | **Git workflow** | Trunk-based, Git Flow, or custom |
122
- | **Agents** | Which agents to enable |
135
+ | **Agents** | Which agents to enable (up to 14) |
123
136
  | **Commands** | Which commands to install |
124
137
 
125
138
  ### Phase 4: File Generation
@@ -132,7 +145,7 @@ The wizard fills all templates with your project-specific context:
132
145
  - `{{BACKEND_TECH_LIST}}` → your backend technologies
133
146
  - Every `{{PLACEHOLDER}}` resolved with real data
134
147
 
135
- **Generated files:**
148
+ **Generated files (full set):**
136
149
 
137
150
  ```
138
151
  .claude/
@@ -145,13 +158,19 @@ The wizard fills all templates with your project-specific context:
145
158
  │ ├── sr-test-writer.md # Uses your test framework
146
159
  │ ├── sr-security-reviewer.md # Scans your patterns
147
160
  │ ├── sr-doc-sync.md # Updates your doc format
161
+ │ ├── sr-backend-developer.md # Backend-specialized
162
+ │ ├── sr-frontend-developer.md # Frontend-specialized
163
+ │ ├── sr-backend-reviewer.md # Backend quality audit
164
+ │ ├── sr-frontend-reviewer.md # Frontend quality audit
165
+ │ ├── sr-merge-resolver.md # AI-powered conflict resolution
166
+ │ ├── sr-performance-reviewer.md # Performance regression detection
148
167
  │ └── [personas].md # Your user personas
149
168
  ├── commands/
150
169
  │ └── sr/
151
170
  │ ├── implement.md
152
171
  │ ├── product-backlog.md
153
172
  │ ├── batch-implement.md
154
- │ └── ...
173
+ │ └── ... # 17 commands total
155
174
  ├── rules/
156
175
  │ ├── backend.md
157
176
  │ ├── frontend.md
@@ -171,6 +190,27 @@ After this phase, `/setup` is no longer available — your workflow is ready.
171
190
 
172
191
  ---
173
192
 
193
+ ### Lite Mode (`/setup --lite`)
194
+
195
+ The quick path — three questions, sensible defaults, done in under a minute.
196
+
197
+ 1. What is this project? (one sentence)
198
+ 2. Who are the target users?
199
+ 3. Git access for agents — read-only or read-write?
200
+
201
+ **What gets installed:**
202
+
203
+ | Item | Detail |
204
+ |------|--------|
205
+ | Core agents | sr-architect, sr-developer, sr-reviewer, sr-product-manager |
206
+ | All workflow commands | `/sr:implement`, `/sr:health-check`, `/sr:product-backlog`, and 14 more |
207
+ | Backlog storage | Local tickets (`.claude/local-tickets.json`) — no GitHub or JIRA required |
208
+ | CLAUDE.md | Project-level context for agents |
209
+
210
+ You can run the full wizard later to deepen configuration: personas, stack analysis, layer-specific conventions.
211
+
212
+ ---
213
+
174
214
  ## Pipeline Monitor (optional)
175
215
 
176
216
  SpecRails includes a web dashboard for visualizing pipeline execution.
@@ -0,0 +1,218 @@
1
+ # Local Ticket Management
2
+
3
+ specrails-core ships with a built-in, file-based ticket management system. It is the **default backlog provider** — no GitHub account, CLI tool, or external service required.
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ Tickets live in `.claude/local-tickets.json` at your project root. Because it's a plain JSON file, tickets are:
10
+
11
+ - **Version-controlled** — tracked by git, diffable in PRs
12
+ - **Offline-first** — no network calls, no rate limits
13
+ - **Tool-agnostic** — readable by any script or editor
14
+
15
+ The file is shared between specrails-core (which reads and writes tickets during command execution) and specrails-hub (which provides a visual ticket panel with real-time sync).
16
+
17
+ ---
18
+
19
+ ## Storage format
20
+
21
+ `.claude/local-tickets.json`:
22
+
23
+ ```json
24
+ {
25
+ "schema_version": "1.0",
26
+ "revision": 7,
27
+ "last_updated": "2026-03-23T10:00:00.000Z",
28
+ "next_id": 8,
29
+ "tickets": {
30
+ "1": {
31
+ "id": 1,
32
+ "title": "Add dark mode",
33
+ "description": "Support system-level dark mode preference via CSS variables.",
34
+ "status": "todo",
35
+ "priority": "medium",
36
+ "labels": ["area:frontend", "effort:medium"],
37
+ "assignee": null,
38
+ "prerequisites": [],
39
+ "metadata": {
40
+ "vpc_scores": { "persona-a": 4, "persona-b": 3 },
41
+ "effort_level": "Medium",
42
+ "user_story": "As a user working at night, I want dark mode...",
43
+ "area": "frontend"
44
+ },
45
+ "comments": [],
46
+ "created_at": "2026-03-20T09:00:00.000Z",
47
+ "updated_at": "2026-03-20T09:00:00.000Z",
48
+ "created_by": "sr-product-manager",
49
+ "source": "product-backlog"
50
+ }
51
+ }
52
+ }
53
+ ```
54
+
55
+ ### Field reference
56
+
57
+ **Root fields**
58
+
59
+ | Field | Type | Description |
60
+ |-------|------|-------------|
61
+ | `schema_version` | string | Always `"1.0"` for the current format |
62
+ | `revision` | number | Incremented on every write — used for optimistic concurrency control |
63
+ | `last_updated` | ISO-8601 | Timestamp of the most recent mutation |
64
+ | `next_id` | number | Auto-increment counter for new ticket IDs |
65
+ | `tickets` | object | Map of ticket ID (as string) → ticket object |
66
+
67
+ **Ticket fields**
68
+
69
+ | Field | Type | Values | Description |
70
+ |-------|------|--------|-------------|
71
+ | `id` | number | Auto-assigned | Numeric ID, referenced as `#<id>` |
72
+ | `title` | string | — | Short title |
73
+ | `description` | string | Markdown | Full description |
74
+ | `status` | string | `todo`, `in_progress`, `done`, `cancelled` | Current state |
75
+ | `priority` | string | `critical`, `high`, `medium`, `low` | Priority level |
76
+ | `labels` | string[] | Freeform | Tag strings; convention: `area:*`, `effort:*` |
77
+ | `assignee` | string\|null | — | Agent name or user, if assigned |
78
+ | `prerequisites` | number[] | — | IDs of tickets that must be done first |
79
+ | `metadata` | object | — | VPC scores, effort level, user story, area (set by agents) |
80
+ | `comments` | array | — | Progress notes appended during implementation |
81
+ | `created_at` | ISO-8601 | — | Creation timestamp |
82
+ | `updated_at` | ISO-8601 | — | Last mutation timestamp |
83
+ | `created_by` | string | — | Agent name or `"user"` |
84
+ | `source` | string | `manual`, `product-backlog`, `propose-spec` | How the ticket was created |
85
+
86
+ ---
87
+
88
+ ## Setup
89
+
90
+ Local tickets become the default during `/setup`. The wizard prompts:
91
+
92
+ ```
93
+ ## Backlog Provider
94
+
95
+ Use local ticket management or connect an external provider?
96
+
97
+ 1. Local tickets (default, recommended) — lightweight JSON-based ticket management.
98
+ No external tools or accounts required.
99
+ 2. External provider — connect GitHub Issues, JIRA, or disable backlog commands
100
+ ```
101
+
102
+ Pressing **Enter** or selecting **1** initializes `.claude/local-tickets.json` with an empty ticket store and writes `.claude/backlog-config.json`:
103
+
104
+ ```json
105
+ {
106
+ "provider": "local",
107
+ "write_access": true,
108
+ "git_auto": true
109
+ }
110
+ ```
111
+
112
+ To switch providers later, re-run the setup wizard:
113
+
114
+ ```bash
115
+ npx specrails-core@latest init --root-dir .
116
+ > /setup
117
+ ```
118
+
119
+ ---
120
+
121
+ ## Concurrency model
122
+
123
+ Both CLI agents and specrails-hub can modify `local-tickets.json` simultaneously. The system uses two complementary mechanisms:
124
+
125
+ ### Advisory file lock
126
+
127
+ Before every write, the agent creates `.claude/local-tickets.json.lock`:
128
+
129
+ ```json
130
+ {
131
+ "agent": "sr-product-manager",
132
+ "timestamp": "2026-03-23T10:00:00.000Z"
133
+ }
134
+ ```
135
+
136
+ If the lock file already exists:
137
+ - **Fresh lock** (< 30 seconds old): wait 500 ms and retry, up to 5 attempts
138
+ - **Stale lock** (≥ 30 seconds old): treat as orphaned, delete it, proceed
139
+
140
+ The lock is deleted immediately after the write completes. The window is minimal: read → modify in memory → write → release.
141
+
142
+ ### Revision counter
143
+
144
+ Every write increments `revision`. Readers that want to detect external changes compare the `revision` they last saw against the current value. This is how specrails-hub avoids echoing its own writes back through the file watcher.
145
+
146
+ ---
147
+
148
+ ## Command integration
149
+
150
+ ### `/sr:implement`
151
+
152
+ Pass local ticket IDs the same way you would GitHub issue numbers:
153
+
154
+ ```bash
155
+ /sr:implement #1, #4, #7
156
+ ```
157
+
158
+ The command reads each ticket from `local-tickets.json`, extracts metadata (area, effort, description), and tracks the ticket through the pipeline — updating status to `in_progress` on start and `done` on successful completion.
159
+
160
+ ### `/sr:product-backlog`
161
+
162
+ ```bash
163
+ /sr:product-backlog # all areas
164
+ /sr:product-backlog UI, Backend # filter by area
165
+ ```
166
+
167
+ Reads all `todo` and `in_progress` tickets, scores them by VPC match, respects the `prerequisites` dependency graph, and recommends the top 3 for your next sprint.
168
+
169
+ ### `/sr:update-product-driven-backlog`
170
+
171
+ ```bash
172
+ /sr:update-product-driven-backlog # explore all areas
173
+ /sr:update-product-driven-backlog Analytics # focus on one area
174
+ ```
175
+
176
+ Runs product discovery using your VPC personas. Creates new local tickets for discovered feature ideas, tagged with `source: "product-backlog"` and `labels: ["product-driven-backlog", "area:<area>"]`. Existing tickets are checked for duplicates before creating new ones.
177
+
178
+ ### `/sr:propose-spec`
179
+
180
+ When a proposal is finalized, a local ticket is created automatically:
181
+
182
+ ```
183
+ Created local ticket #12: Add analytics export
184
+ ```
185
+
186
+ The ticket captures the full proposal as its description and is tagged `source: "propose-spec"` with the label `spec-proposal`.
187
+
188
+ ---
189
+
190
+ ## integration-contract.json
191
+
192
+ The `ticketProvider` section tells specrails-hub where to find and how to use the ticket store:
193
+
194
+ ```json
195
+ {
196
+ "ticketProvider": {
197
+ "type": "local",
198
+ "storageFile": "local-tickets.json",
199
+ "lockFile": "local-tickets.json.lock",
200
+ "capabilities": ["crud", "labels", "status", "priorities", "dependencies", "comments"]
201
+ }
202
+ }
203
+ ```
204
+
205
+ | Field | Description |
206
+ |-------|-------------|
207
+ | `type` | `"local"` — file-based storage (the only supported type currently) |
208
+ | `storageFile` | Filename relative to the project's specrails dir (`.claude/` or `.codex/`) |
209
+ | `lockFile` | Advisory lock filename, same directory |
210
+ | `capabilities` | Features the hub enables based on what the provider supports |
211
+
212
+ specrails-hub reads this file when it loads a project. If the file is missing or the `ticketProvider` key is absent, hub falls back to safe defaults (`type: "local"`, `storageFile: "local-tickets.json"`).
213
+
214
+ ---
215
+
216
+ ## Migrating from GitHub Issues or JIRA
217
+
218
+ See the [Migration Guide](./migration-guide.md).
@@ -0,0 +1,141 @@
1
+ # Migration Guide: Switching to Local Tickets
2
+
3
+ This guide is for teams currently using GitHub Issues or JIRA as their specrails backlog provider who want to switch to the built-in local ticket system.
4
+
5
+ Switching is optional. GitHub Issues and JIRA remain fully supported. Local tickets are the recommended default for new projects.
6
+
7
+ ---
8
+
9
+ ## Should you switch?
10
+
11
+ **Switch to local tickets if:**
12
+ - Your team prefers a simple, zero-dependency setup
13
+ - You want tickets version-controlled alongside your code
14
+ - You use specrails-hub and want the visual ticket panel
15
+ - You don't need GitHub/JIRA for other workflows (project boards, external stakeholders)
16
+
17
+ **Stay on GitHub Issues / JIRA if:**
18
+ - Other teams or stakeholders manage tickets in those tools
19
+ - You rely on GitHub Projects, Milestones, or JIRA sprints
20
+ - You want PR auto-close on issue merge (requires GitHub Issues)
21
+
22
+ ---
23
+
24
+ ## Step 1: Switch the provider
25
+
26
+ Edit `.claude/backlog-config.json` in your project root:
27
+
28
+ ```json
29
+ {
30
+ "provider": "local",
31
+ "write_access": true,
32
+ "git_auto": true
33
+ }
34
+ ```
35
+
36
+ Then initialize the ticket store if it doesn't exist yet:
37
+
38
+ ```bash
39
+ # Inside Claude Code or Codex
40
+ /sr:implement --setup-local-tickets
41
+ ```
42
+
43
+ Or create the file manually:
44
+
45
+ ```bash
46
+ cat > .claude/local-tickets.json << 'EOF'
47
+ {
48
+ "schema_version": "1.0",
49
+ "revision": 0,
50
+ "last_updated": null,
51
+ "next_id": 1,
52
+ "tickets": {}
53
+ }
54
+ EOF
55
+ ```
56
+
57
+ ---
58
+
59
+ ## Step 2: Import existing issues (one-time migration)
60
+
61
+ ### From GitHub Issues
62
+
63
+ Use the `sr:migrate-from-github` command (requires `gh` CLI):
64
+
65
+ ```bash
66
+ # Inside Claude Code
67
+ /sr:migrate-from-github
68
+ ```
69
+
70
+ This command:
71
+ 1. Fetches all open issues labeled `product-driven-backlog` (the label specrails uses)
72
+ 2. Maps GitHub issue fields to local ticket schema:
73
+ - `number` → `id` (uses next available local ID)
74
+ - `title` → `title`
75
+ - `body` → `description`
76
+ - `labels` → `labels`
77
+ - `state: open` → `status: todo`
78
+ 3. Writes each ticket to `local-tickets.json`
79
+ 4. Prints a summary: `Imported 14 tickets from GitHub Issues`
80
+
81
+ To import all open issues regardless of label:
82
+
83
+ ```bash
84
+ /sr:migrate-from-github --all
85
+ ```
86
+
87
+ To do a dry run (preview without writing):
88
+
89
+ ```bash
90
+ /sr:migrate-from-github --dry-run
91
+ ```
92
+
93
+ **After import:** Your GitHub Issues are unchanged. The migration is additive — it only creates local tickets. You can continue using GitHub Issues in parallel until you're ready to stop.
94
+
95
+ ### From JIRA
96
+
97
+ Use the `sr:migrate-from-jira` command (requires `jira` CLI or REST API credentials in `.claude/backlog-config.json`):
98
+
99
+ ```bash
100
+ # Inside Claude Code
101
+ /sr:migrate-from-jira
102
+ ```
103
+
104
+ This command:
105
+ 1. Fetches all open issues from the configured JIRA project
106
+ 2. Maps JIRA fields to local ticket schema:
107
+ - Issue key (`PROJECT-123`) → stored in `metadata.jira_key`
108
+ - `summary` → `title`
109
+ - `description` → `description`
110
+ - `priority` → `priority` (Critical/High/Medium/Low mapped directly)
111
+ - `status: To Do / Backlog` → `status: todo`
112
+ - `status: In Progress` → `status: in_progress`
113
+ - `labels` → `labels`
114
+ 3. Writes each ticket to `local-tickets.json`
115
+
116
+ The original JIRA key is preserved in `metadata.jira_key` so you can cross-reference during the transition.
117
+
118
+ ---
119
+
120
+ ## Step 3: Regenerate commands (optional but recommended)
121
+
122
+ Command templates are generated at `/setup` time with provider-specific instructions baked in. After switching providers, regenerate them so commands use the local file operations instead of GitHub/JIRA CLI calls:
123
+
124
+ ```bash
125
+ npx specrails-core@latest init --root-dir .
126
+ > /setup --update
127
+ ```
128
+
129
+ The `--update` flag regenerates only the backlog commands (`product-backlog`, `update-product-driven-backlog`, `implement`) without re-running the full stack analysis.
130
+
131
+ ---
132
+
133
+ ## Rollback
134
+
135
+ To revert to GitHub Issues:
136
+
137
+ 1. Edit `.claude/backlog-config.json` and set `"provider": "github"`
138
+ 2. Re-run `/setup --update` to regenerate commands
139
+ 3. Your `local-tickets.json` is preserved — switch back any time
140
+
141
+ Local tickets and external provider data are independent. Switching providers does not delete tickets from either system.
@@ -14,17 +14,20 @@ It creates a `.claude/` directory with agent templates, commands, and configurat
14
14
 
15
15
  Yes. Node 18+ is required to run `npx specrails-core@latest`. Once installed, SpecRails works with any language or framework — the agents adapt to whatever stack your project uses.
16
16
 
17
- **Can I run SpecRails on a project that doesn't have GitHub Issues?**
17
+ **Do I need GitHub Issues?**
18
18
 
19
- Yes. During `/setup`, you can choose "none" as your backlog provider. Commands like `/sr:implement` will accept plain text descriptions instead of issue numbers:
19
+ No. SpecRails ships with a built-in local ticket system no GitHub account required. Local tickets are the default. Commands like `/sr:implement` accept ticket IDs or plain text:
20
20
 
21
21
  ```
22
+ /sr:implement #1, #4
22
23
  /sr:implement "add rate limiting to the API"
23
24
  ```
24
25
 
26
+ You can switch to GitHub Issues or JIRA during `/setup` (Phase 3) if you prefer.
27
+
25
28
  **How long does /setup take?**
26
29
 
27
- About 5 minutes. Most of the time is spent on Phase 2 (persona generation), which does web research on your domain.
30
+ The full wizard takes about 5 minutes most of the time is Phase 2 (persona research via web search). For a faster start, use `/setup --lite`: three questions, under a minute, no web research.
28
31
 
29
32
  ---
30
33
 
@@ -95,7 +95,7 @@ codex # Codex
95
95
  /setup
96
96
  ```
97
97
 
98
- The wizard runs 5 phases:
98
+ By default, `/setup` runs the full 5-phase wizard:
99
99
 
100
100
  | Phase | What happens |
101
101
  |-------|-------------|
@@ -105,6 +105,8 @@ The wizard runs 5 phases:
105
105
  | **4. Generate** | Fills all templates with your project-specific context |
106
106
  | **5. Cleanup** | Removes setup files, leaving only your tailored workflow |
107
107
 
108
+ **In a hurry?** Run `/setup --lite` instead — three questions, sensible defaults, done in under a minute.
109
+
108
110
  After setup, `.claude/` contains fully configured agents and commands ready to use. The `/setup` command removes itself — it only runs once.
109
111
 
110
112
  ## Verify
@@ -46,7 +46,7 @@ Then run:
46
46
  /setup
47
47
  ```
48
48
 
49
- The wizard runs automatically and takes about 5 minutes. It analyzes your codebase and configures SpecRails for your specific project:
49
+ The wizard runs the full 5-phase setup (about 5 minutes). It analyzes your codebase and configures SpecRails for your specific project:
50
50
 
51
51
  ```
52
52
  Phase 1/5 Analyzing codebase...
@@ -59,14 +59,14 @@ Phase 2/5 Generating user personas...
59
59
  → Created 3 VPC profiles
60
60
 
61
61
  Phase 3/5 Configuration...
62
- → Backlog provider: GitHub Issues
62
+ → Backlog provider: local
63
63
  → Git workflow: trunk-based
64
64
 
65
65
  Phase 4/5 Generating files...
66
66
  → sr-architect.md (adapted to your stack)
67
67
  → sr-developer.md (knows your CI commands)
68
68
  → sr-reviewer.md (runs your specific checks)
69
- 9 more agents
69
+ 11 more agents
70
70
 
71
71
  Phase 5/5 Cleanup complete. /setup removed.
72
72
 
@@ -75,6 +75,8 @@ Phase 5/5 Cleanup complete. /setup removed.
75
75
 
76
76
  After setup, the `/setup` command is gone — it's a one-time wizard.
77
77
 
78
+ **In a hurry?** Use `/setup --lite` for a 3-question quick setup (under a minute). You can always run the full wizard later.
79
+
78
80
  ## Step 3: Implement your first feature
79
81
 
80
82
  Pick something small. Either reference a GitHub Issue or describe it in plain text:
@@ -129,7 +131,7 @@ One command. The PR is ready for human review.
129
131
  /sr:product-backlog
130
132
  ```
131
133
 
132
- See your GitHub Issues ranked by persona fit and effort. The top 3 are safe to implement next.
134
+ See your tickets ranked by persona fit and effort. The top 3 are safe to implement next. Uses local tickets by default.
133
135
 
134
136
  **Generate new feature ideas:**
135
137
 
@@ -137,7 +139,7 @@ See your GitHub Issues ranked by persona fit and effort. The top 3 are safe to i
137
139
  /sr:update-product-driven-backlog
138
140
  ```
139
141
 
140
- The Product Manager researches your competitive landscape and creates well-formed GitHub Issues for new features.
142
+ The Product Manager researches your competitive landscape and creates new tickets (local by default, or GitHub Issues if configured).
141
143
 
142
144
  **Run multiple features in parallel:**
143
145
 
package/docs/workflows.md CHANGED
@@ -126,7 +126,7 @@ View your prioritized product backlog, ranked by VPC fit and effort.
126
126
 
127
127
  ### What it shows
128
128
 
129
- The Product Analyst reads your GitHub Issues (labeled `product-driven-backlog`) and produces:
129
+ The Product Analyst reads your backlog (local tickets in `.claude/local-tickets.json` by default, or GitHub Issues labeled `product-driven-backlog` if configured) and produces:
130
130
 
131
131
  - **Backlog table** per area — sorted by Total Persona Score
132
132
  - **Top 3 recommendations** — ranked by VPC score / effort ratio, filtered to Wave 1 of the safe implementation order
@@ -166,7 +166,7 @@ Generate new feature ideas through product discovery. The Product Manager (Opus)
166
166
  2. Researches competitors via web search
167
167
  3. Generates 2–4 feature ideas per area
168
168
  4. Scores each against every persona (0–5)
169
- 5. Creates GitHub Issues (if write access) or displays for manual creation
169
+ 5. Creates tickets in your active backlog provider (local tickets by default; GitHub Issues or JIRA if configured) or displays for manual creation
170
170
 
171
171
  ---
172
172
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specrails-core",
3
- "version": "3.2.0",
3
+ "version": "3.3.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
5
  "bin": {
6
6
  "specrails-core": "bin/specrails-core.js"