specrails-core 3.1.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,19 +693,99 @@ 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?
716
+
717
+ 1. **Local tickets** (recommended) — lightweight JSON-based ticket management built into the project.
718
+ No external tools required. Tickets stored in `.claude/local-tickets.json`, version-controlled and diffable.
719
+ 2. **GitHub Issues** — uses `gh` CLI to read/create issues with labels and VPC scores
720
+ 3. **JIRA** — uses JIRA CLI or REST API to read/create tickets in a JIRA project
721
+ 4. **None** — skip backlog commands (you can still use /implement with text descriptions)
722
+ ```
723
+
724
+ Wait for the user's choice. Set `BACKLOG_PROVIDER` to `local`, `github`, `jira`, or `none`.
725
+
726
+ #### If Local Tickets
727
+
728
+ No external tools or credentials required. Initialize the storage file:
729
+
730
+ 1. Copy `templates/local-tickets-schema.json` to `$SPECRAILS_DIR/local-tickets.json`
731
+ 2. Set `last_updated` to the current ISO-8601 timestamp
732
+
733
+ Store configuration in `$SPECRAILS_DIR/backlog-config.json`:
734
+ ```json
735
+ {
736
+ "provider": "local",
737
+ "write_access": true,
738
+ "git_auto": true
739
+ }
740
+ ```
691
741
 
692
- 1. **GitHub Issues**uses `gh` CLI to read/create issues with labels and VPC scores
693
- 2. **JIRA** — uses JIRA CLI or REST API to read/create tickets in a JIRA project
694
- 3. **None**skip backlog commands (you can still use /implement with text descriptions)
742
+ Local tickets are always read-write there is no "read only" mode since the file is local.
743
+
744
+ **Ticket schema** — each entry in the `tickets` map has these fields:
745
+
746
+ ```json
747
+ {
748
+ "id": 1,
749
+ "title": "Feature title",
750
+ "description": "Markdown description",
751
+ "status": "todo",
752
+ "priority": "medium",
753
+ "labels": ["area:frontend", "effort:medium"],
754
+ "assignee": null,
755
+ "prerequisites": [],
756
+ "metadata": {
757
+ "vpc_scores": {},
758
+ "effort_level": "Medium",
759
+ "user_story": "",
760
+ "area": ""
761
+ },
762
+ "comments": [],
763
+ "created_at": "<ISO-8601>",
764
+ "updated_at": "<ISO-8601>",
765
+ "created_by": "user",
766
+ "source": "manual"
767
+ }
695
768
  ```
696
769
 
697
- Wait for the user's choice. Set `BACKLOG_PROVIDER` to `github`, `jira`, or `none`.
770
+ **Status values:** `todo`, `in_progress`, `done`, `cancelled`
771
+ **Priority values:** `critical`, `high`, `medium`, `low`
772
+ **Labels:** Freeform strings following the `area:*` and `effort:*` convention
773
+ **Source values:** `manual`, `product-backlog`, `propose-spec`
774
+
775
+ **Advisory file locking protocol** (CLI agents and hub server must both follow this):
776
+
777
+ The `revision` counter in the JSON root enables optimistic concurrency — increment it on **every** write. The lock file prevents concurrent corruption:
778
+
779
+ 1. **Acquire lock:** Check for `$SPECRAILS_DIR/local-tickets.json.lock`
780
+ - If the file exists and its `timestamp` is less than 30 seconds old: wait 500ms and retry (max 5 attempts before aborting with an error)
781
+ - If the file exists and its `timestamp` is 30+ seconds old (stale): delete it and proceed
782
+ - If no lock file exists: proceed immediately
783
+ 2. **Create lock file:** Write `{"agent": "<agent-name-or-process>", "timestamp": "<ISO-8601>"}` to `$SPECRAILS_DIR/local-tickets.json.lock`
784
+ 3. **Minimal lock window:** Read the JSON → modify in memory → write back → release
785
+ 4. **Release lock:** Delete `$SPECRAILS_DIR/local-tickets.json.lock`
786
+ 5. **Always increment `revision`** by 1 and update `last_updated` on every successful write
787
+
788
+ The hub server uses `proper-lockfile` (or equivalent) to honor the same protocol via the `.lock` file path.
698
789
 
699
790
  #### If GitHub Issues
700
791
 
@@ -1059,6 +1150,27 @@ When adapting `update-product-driven-backlog.md` and `product-backlog.md`, subst
1059
1150
 
1060
1151
  **When `IS_OSS=false`**: All Kai-related persona references are omitted. `{{MAX_SCORE}}` reduces by 5. Tables and inline scores contain only user-generated personas.
1061
1152
 
1153
+ #### Local Tickets (`BACKLOG_PROVIDER=local`)
1154
+
1155
+ For the local provider, backlog placeholders resolve to **inline file-operation instructions** embedded in the generated command markdown — not shell commands. Agents execute these by reading/writing `$SPECRAILS_DIR/local-tickets.json` directly using their file tools.
1156
+
1157
+ All write operations must follow the **advisory file locking protocol** defined in Phase 3.2. Always increment `revision` and update `last_updated` on every write.
1158
+
1159
+ | Placeholder | Substituted value |
1160
+ |-------------|-------------------|
1161
+ | `{{BACKLOG_PROVIDER_NAME}}` | `Local Tickets` |
1162
+ | `{{BACKLOG_PREFLIGHT}}` | `[[ -f "$SPECRAILS_DIR/local-tickets.json" ]] && echo "Local tickets storage: OK" \|\| echo "WARNING: $SPECRAILS_DIR/local-tickets.json not found — run /setup to initialize"` |
1163
+ | `{{BACKLOG_FETCH_CMD}}` | Read `$SPECRAILS_DIR/local-tickets.json`. Parse the `tickets` map and return all entries where `status` is `"todo"` or `"in_progress"`. |
1164
+ | `{{BACKLOG_FETCH_ALL_CMD}}` | Read `$SPECRAILS_DIR/local-tickets.json`. Parse the `tickets` map and return all entries regardless of status. |
1165
+ | `{{BACKLOG_FETCH_CLOSED_CMD}}` | Read `$SPECRAILS_DIR/local-tickets.json`. Parse the `tickets` map and return all entries where `status` is `"done"` or `"cancelled"`. |
1166
+ | `{{BACKLOG_VIEW_CMD}}` | Read `$SPECRAILS_DIR/local-tickets.json`. Parse JSON and return the full ticket object at `tickets["{id}"]`, or an error if not found. |
1167
+ | `{{BACKLOG_CREATE_CMD}}` | Write to `$SPECRAILS_DIR/local-tickets.json` using the advisory locking protocol: acquire lock → read file → set `id = next_id`, increment `next_id`, set all ticket fields, set `created_at` and `updated_at` to now, bump `revision`, update `last_updated` → write → release lock. |
1168
+ | `{{BACKLOG_UPDATE_CMD}}` | Write to `$SPECRAILS_DIR/local-tickets.json` using the advisory locking protocol: acquire lock → read file → update fields in `tickets["{id}"]`, set `updated_at` to now, bump `revision`, update `last_updated` → write → release lock. |
1169
+ | `{{BACKLOG_DELETE_CMD}}` | Write to `$SPECRAILS_DIR/local-tickets.json` using the advisory locking protocol: acquire lock → read file → delete `tickets["{id}"]`, bump `revision`, update `last_updated` → write → release lock. |
1170
+ | `{{BACKLOG_COMMENT_CMD}}` | Write to `$SPECRAILS_DIR/local-tickets.json` using the advisory locking protocol: acquire lock → read file → append `{"author": "<agent-name>", "body": "<comment>", "created_at": "<ISO-8601>"}` to `tickets["{id}"].comments` (create the array if absent), set `updated_at` to now, bump `revision`, update `last_updated` → write → release lock. |
1171
+ | `{{BACKLOG_PARTIAL_COMMENT_CMD}}` | Same as `{{BACKLOG_COMMENT_CMD}}` but append `{"author": "<agent-name>", "body": "<comment>", "type": "progress", "created_at": "<ISO-8601>"}`. |
1172
+ | `{{BACKLOG_INIT_LABELS_CMD}}` | No label initialization required. Local tickets use freeform label strings. Standard label conventions: `area:frontend`, `area:backend`, `area:api`, `effort:low`, `effort:medium`, `effort:high`. |
1173
+
1062
1174
  #### GitHub Issues (`BACKLOG_PROVIDER=github`)
1063
1175
  - Issue fetch: `gh issue list --label "product-driven-backlog" --state open --limit 100 --json number,title,labels,body`
1064
1176
  - Issue create: `gh issue create --title "..." --label "..." --body "..."`
@@ -1087,7 +1199,7 @@ When adapting `update-product-driven-backlog.md` and `product-backlog.md`, subst
1087
1199
  }
1088
1200
  ```
1089
1201
 
1090
- The command templates use `{{BACKLOG_FETCH_CMD}}`, `{{BACKLOG_CREATE_CMD}}`, `{{BACKLOG_VIEW_CMD}}`, and `{{BACKLOG_PREFLIGHT}}` placeholders that get filled with the provider-specific commands.
1202
+ The command templates use `{{BACKLOG_FETCH_CMD}}`, `{{BACKLOG_CREATE_CMD}}`, `{{BACKLOG_VIEW_CMD}}`, `{{BACKLOG_PREFLIGHT}}`, and related placeholders that get filled with the provider-specific commands (for `local`) or instructions (for `github`, `jira`). The `{{BACKLOG_PROVIDER_NAME}}` placeholder is substituted with a human-readable provider label in all three cases.
1091
1203
 
1092
1204
  ### 4.4 Generate rules
1093
1205
 
@@ -1327,7 +1439,7 @@ Note: Only commands/skills selected during setup are shown. Backlog commands are
1327
1439
  - `$sr-update-product-driven-backlog` — discover new features using VPC
1328
1440
  ```
1329
1441
 
1330
- ## First Task Prompt (Advanced Mode)
1442
+ ## First Task Prompt (Full Wizard)
1331
1443
 
1332
1444
  After displaying the setup complete summary above, detect the project type and output:
1333
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.