sequant 1.12.0 → 1.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +10 -8
  2. package/dist/bin/cli.js +19 -9
  3. package/dist/src/commands/doctor.js +42 -20
  4. package/dist/src/commands/init.js +152 -65
  5. package/dist/src/commands/logs.js +7 -6
  6. package/dist/src/commands/run.d.ts +13 -1
  7. package/dist/src/commands/run.js +122 -32
  8. package/dist/src/commands/stats.js +67 -48
  9. package/dist/src/commands/status.js +30 -12
  10. package/dist/src/commands/sync.d.ts +28 -0
  11. package/dist/src/commands/sync.js +102 -0
  12. package/dist/src/index.d.ts +6 -0
  13. package/dist/src/index.js +4 -0
  14. package/dist/src/lib/cli-ui.d.ts +196 -0
  15. package/dist/src/lib/cli-ui.js +544 -0
  16. package/dist/src/lib/content-analyzer.d.ts +89 -0
  17. package/dist/src/lib/content-analyzer.js +437 -0
  18. package/dist/src/lib/phase-signal.d.ts +94 -0
  19. package/dist/src/lib/phase-signal.js +171 -0
  20. package/dist/src/lib/phase-spinner.d.ts +146 -0
  21. package/dist/src/lib/phase-spinner.js +255 -0
  22. package/dist/src/lib/solve-comment-parser.d.ts +84 -0
  23. package/dist/src/lib/solve-comment-parser.js +200 -0
  24. package/dist/src/lib/stack-config.d.ts +51 -0
  25. package/dist/src/lib/stack-config.js +77 -0
  26. package/dist/src/lib/stacks.d.ts +52 -0
  27. package/dist/src/lib/stacks.js +173 -0
  28. package/dist/src/lib/templates.d.ts +2 -0
  29. package/dist/src/lib/templates.js +9 -2
  30. package/dist/src/lib/upstream/assessment.d.ts +70 -0
  31. package/dist/src/lib/upstream/assessment.js +385 -0
  32. package/dist/src/lib/upstream/index.d.ts +11 -0
  33. package/dist/src/lib/upstream/index.js +14 -0
  34. package/dist/src/lib/upstream/issues.d.ts +38 -0
  35. package/dist/src/lib/upstream/issues.js +267 -0
  36. package/dist/src/lib/upstream/relevance.d.ts +50 -0
  37. package/dist/src/lib/upstream/relevance.js +209 -0
  38. package/dist/src/lib/upstream/report.d.ts +29 -0
  39. package/dist/src/lib/upstream/report.js +391 -0
  40. package/dist/src/lib/upstream/types.d.ts +207 -0
  41. package/dist/src/lib/upstream/types.js +5 -0
  42. package/dist/src/lib/workflow/log-writer.d.ts +1 -1
  43. package/dist/src/lib/workflow/metrics-schema.d.ts +3 -3
  44. package/dist/src/lib/workflow/qa-cache.d.ts +199 -0
  45. package/dist/src/lib/workflow/qa-cache.js +440 -0
  46. package/dist/src/lib/workflow/run-log-schema.d.ts +34 -6
  47. package/dist/src/lib/workflow/run-log-schema.js +12 -1
  48. package/dist/src/lib/workflow/state-schema.d.ts +4 -4
  49. package/dist/src/lib/workflow/types.d.ts +4 -0
  50. package/package.json +6 -1
  51. package/templates/skills/qa/scripts/quality-checks.sh +509 -53
  52. package/templates/skills/solve/SKILL.md +375 -83
  53. package/templates/skills/spec/SKILL.md +107 -5
@@ -50,71 +50,299 @@ gh issue view <issue-number> --json labels --jq '.labels[].name'
50
50
  - Recommend `--quality-loop` flag for auto-retry on failures
51
51
  - Quality loop auto-enables for these labels in `sequant run`
52
52
 
53
- ## Output Format
53
+ **New Features** (labels: `enhancement`, `feature`):
54
+ - Include `testgen` phase when ACs need automated tests
55
+ - Workflow: `spec → testgen → exec → qa`
54
56
 
55
- Provide a clear, actionable response with:
57
+ ### Quality Loop Detection
56
58
 
57
- 1. **Issue Summary Table** showing:
58
- - Issue number
59
- - Title
60
- - Labels
61
- - Recommended workflow
59
+ Quality loop (`--quality-loop` or `-q`) provides automatic fix iterations when phases fail. **Recommend quality loop broadly** for any non-trivial work.
62
60
 
63
- 2. **Recommended Commands** in order
61
+ **Always recommend `--quality-loop` when:**
62
+ - Labels include: `complex`, `refactor`, `breaking`, `major` (auto-enabled)
63
+ - Labels include: `enhancement`, `feature` (new functionality)
64
+ - Issue involves multiple files or components
65
+ - Issue title contains: "add", "implement", "create", "refactor", "update"
66
+ - Issue is NOT a simple bug fix with `bug` or `fix` label only
64
67
 
65
- 3. **CLI Command** - ALWAYS include `npx sequant run <issue>` for terminal/CI usage
68
+ **Skip quality loop recommendation only when:**
69
+ - Simple bug fix (only `bug` or `fix` label, no other labels)
70
+ - Documentation-only changes (`docs` label only)
71
+ - Issue explicitly marked as trivial
66
72
 
67
- 4. **Explanation** of why this workflow was chosen
73
+ **Quality loop benefits:**
74
+ - Auto-retries failed phases up to 3 times
75
+ - Catches intermittent test failures
76
+ - Handles build issues from dependency changes
77
+ - Reduces manual intervention for recoverable errors
68
78
 
69
- ### Example Output
79
+ ### Feature Branch Detection
70
80
 
71
- ```markdown
72
- ## Solve Workflow for Issues: 152, 153
81
+ When analyzing issues, check if `--base` flag should be recommended.
73
82
 
74
- ### Issue Analysis
83
+ **Check for feature branch indicators:**
75
84
 
76
- | Issue | Title | Labels | Workflow |
77
- |-------|-------|--------|----------|
78
- | #152 | Add user dashboard | ui, enhancement | Full (with /test) |
79
- | #153 | Refactor auth module | backend, refactor | Standard + quality loop |
85
+ ```bash
86
+ # Check for feature branch references in issue body
87
+ gh issue view <issue-number> --json body --jq '.body' | grep -iE "(feature/|branch from|based on|part of.*feature)"
80
88
 
81
- ### Recommended Workflow
89
+ # Check issue labels for feature context
90
+ gh issue view <issue-number> --json labels --jq '.labels[].name' | grep -iE "(dashboard|feature-|epic-)"
82
91
 
83
- **For #152 (UI feature):**
84
- ```bash
85
- /spec 152 # Plan the implementation
86
- /exec 152 # Implement the feature
87
- /test 152 # Browser-based UI testing
88
- /qa 152 # Quality review
92
+ # Check if project has defaultBase configured
93
+ cat .sequant/settings.json 2>/dev/null | jq -r '.run.defaultBase // empty'
89
94
  ```
90
95
 
91
- **For #153 (Backend refactor):**
96
+ **Recommend `--base <branch>` when:**
97
+ - Issue body references a feature branch (e.g., "Part of dashboard feature")
98
+ - Issue is labeled with a feature epic label (e.g., `dashboard`, `epic-auth`)
99
+ - Multiple related issues reference the same parent feature
100
+ - Project has `run.defaultBase` configured in settings
101
+
102
+ **Do NOT recommend `--base` when:**
103
+ - Issue should branch from main (default, most common)
104
+ - No feature branch context detected
105
+ - Issue is a standalone bug fix or independent feature
106
+
107
+ ### Chain Mode Detection
108
+
109
+ When analyzing multiple issues, determine if `--chain` flag should be recommended.
110
+
111
+ **Check for chain indicators:**
112
+
92
113
  ```bash
93
- /spec 153 # Plan the refactor
94
- /exec 153 # Implement changes
95
- /qa 153 # Quality review
114
+ # Check for dependency keywords in issue body
115
+ gh issue view <issue-number> --json body --jq '.body' | grep -iE "(depends on|blocked by|requires|after #|builds on)"
116
+
117
+ # Check for sequence labels
118
+ gh issue view <issue-number> --json labels --jq '.labels[].name' | grep -iE "(part-[0-9]|step-[0-9]|phase-[0-9])"
119
+
120
+ # Check for related issue references
121
+ gh issue view <issue-number> --json body --jq '.body' | grep -oE "#[0-9]+"
96
122
  ```
97
123
 
98
- > **Note:** Issue #153 has `refactor` label. Quality loop will **auto-enable** when using `sequant run`, providing automatic fix iterations if phases fail.
124
+ **Recommend `--chain` when:**
125
+ - Multiple issues have explicit dependencies (e.g., "depends on #123")
126
+ - Issues are labeled as parts of a sequence (e.g., `part-1`, `part-2`)
127
+ - Issue titles indicate sequence (e.g., "Part 1:", "Step 2:")
128
+ - Issues reference each other in their bodies
129
+ - Issues modify the same files in a specific order
99
130
 
100
- ### CLI Command
131
+ **Do NOT recommend `--chain` when:**
132
+ - Single issue (chain requires 2+ issues)
133
+ - Issues are independent (no shared files or dependencies)
134
+ - Issues touch completely different areas of codebase
135
+ - Parallel batch mode is more appropriate (unrelated issues)
101
136
 
102
- Run from terminal:
103
- ```bash
104
- npx sequant run 152 153
137
+ ### QA Gate Detection
138
+
139
+ When recommending `--chain`, also consider if `--qa-gate` should be added.
140
+
141
+ **Recommend `--qa-gate` when:**
142
+ - Chain has 3+ issues (longer chains have higher stale code risk)
143
+ - Issues have tight dependencies (later issues heavily rely on earlier ones)
144
+ - Issues modify the same files across the chain
145
+ - Production-critical or high-risk changes
146
+
147
+ **Do NOT recommend `--qa-gate` when:**
148
+ - Chain has only 2 issues (lower risk)
149
+ - Issues are mostly independent despite chain structure
150
+ - Speed is prioritized over safety
151
+ - Simple, low-risk changes
152
+
153
+ **Chain structure visualization:**
105
154
  ```
155
+ origin/main → #10 → #11 → #12
156
+ │ │ │
157
+ └──────┴──────┴── Each branch builds on previous
158
+ ```
159
+
160
+ ## Output Format
161
+
162
+ **Design Principles:**
163
+ - Lead with the recommendation (command first, top-down)
164
+ - Show all flag decisions explicitly with reasoning
165
+ - Be concise — signal over prose
166
+ - Visual hierarchy using ASCII boxes and lines
167
+ - Max ~25 lines (excluding conflict warnings)
168
+
169
+ **Required Sections (in order):**
170
+
171
+ 1. **Header Box** — Command recommendation prominently displayed
172
+ 2. **Issues List** — Compact: `#N Title ··· labels → workflow`
173
+ 3. **Flags Table** — ALL flags with ✓/✗ and one-line reasoning
174
+ 4. **Why Section** — 3-5 bullet points explaining key decisions
175
+ 5. **Also Consider** — Conditional curated alternatives (0-3 items)
176
+ 6. **Conflict Warning** — Only if in-flight work overlaps (conditional)
177
+
178
+ ---
179
+
180
+ ## Conflict Detection
181
+
182
+ Before generating output, check for in-flight work that may conflict:
106
183
 
107
- For issue #153 (or any complex work), quality loop is recommended:
108
184
  ```bash
109
- npx sequant run 153 --quality-loop # Explicit (auto-enabled for refactor label)
185
+ # List open worktrees
186
+ git worktree list --porcelain 2>/dev/null | grep "^worktree" | cut -d' ' -f2
187
+
188
+ # For each worktree, get changed files
189
+ git -C <worktree-path> diff --name-only main...HEAD 2>/dev/null
110
190
  ```
111
191
 
112
- > **Tip:** Install globally with `npm install -g sequant` to omit the `npx` prefix.
192
+ **If overlap detected** with files this issue likely touches, include warning:
193
+ ```
194
+ ⚠ Conflict risk: #45 (open) modifies lib/auth/* — coordinate or wait
195
+ ```
196
+
197
+ ---
198
+
199
+ ## "Also Consider" Logic
200
+
201
+ Only show alternatives representing genuine trade-offs. Max 2-3 items.
113
202
 
114
- ### Notes
115
- - Issue #152 requires UI testing due to `ui` label
116
- - Issue #153 will auto-enable quality loop due to `refactor` label
117
- - Quality loop: auto-retries failed phases up to 3 times
203
+ | Condition | Show Alternative |
204
+ |-----------|------------------|
205
+ | Complex issues OR user unfamiliar with sequant | `--dry-run` (preview before executing) |
206
+ | UI-adjacent AND test phase not included | `--phases +test` (add browser testing) |
207
+ | Mild dependency risk between issues | `--sequential` (run one at a time) |
208
+ | Dependencies ambiguous | Show both parallel and `--chain` options |
209
+
210
+ **Rules:**
211
+ - Omit section entirely if nothing worth showing
212
+ - Never list every flag — only curated, contextual options
213
+ - Each alternative needs one-line explanation
214
+
215
+ ---
216
+
217
+ ## Output Template
218
+
219
+ You MUST use this exact structure:
220
+
221
+ ```
222
+ ╭──────────────────────────────────────────────────────────────╮
223
+ │ sequant solve │
224
+ │ │
225
+ │ npx sequant run <ISSUES> <FLAGS> │
226
+ ╰──────────────────────────────────────────────────────────────╯
227
+
228
+ #<N> <Title truncated to ~35 chars> ·········· <labels> → <workflow>
229
+ #<N> <Title truncated to ~35 chars> ·········· <labels> → <workflow>
230
+
231
+ ┌─ Flags ──────────────────────────────────────────────────────┐
232
+ │ -q quality-loop ✓/✗ <one-line reasoning> │
233
+ │ --chain ✓/✗ <one-line reasoning> │
234
+ │ --qa-gate ✓/✗ <one-line reasoning> │
235
+ │ --base ✓/✗ <one-line reasoning> │
236
+ │ --testgen ✓/✗ <one-line reasoning> │
237
+ └──────────────────────────────────────────────────────────────┘
238
+
239
+ Why this workflow:
240
+ • <reason 1>
241
+ • <reason 2>
242
+ • <reason 3>
243
+
244
+ <!-- CONDITIONAL: Only if alternatives worth showing -->
245
+ Also consider:
246
+ <flag> <one-line explanation>
247
+ <flag> <one-line explanation>
248
+
249
+ <!-- CONDITIONAL: Only if conflict detected -->
250
+ ⚠ Conflict risk: #<N> (open) modifies <path> — coordinate or wait
251
+ ```
252
+
253
+ ---
254
+
255
+ ### Example Output (Independent Issues)
256
+
257
+ ```
258
+ ╭──────────────────────────────────────────────────────────────╮
259
+ │ sequant solve │
260
+ │ │
261
+ │ npx sequant run 152 153 -q │
262
+ ╰──────────────────────────────────────────────────────────────╯
263
+
264
+ #152 Add user dashboard ······················ ui → spec → testgen → exec → test → qa
265
+ #153 Refactor auth module ···················· backend → spec → exec → qa
266
+
267
+ ┌─ Flags ──────────────────────────────────────────────────────┐
268
+ │ -q quality-loop ✓ refactor label auto-enables retry │
269
+ │ --chain ✗ independent (different codepaths) │
270
+ │ --qa-gate ✗ no chain mode │
271
+ │ --base ✗ branching from main │
272
+ │ --testgen ✓ #152 has testable ACs (Unit Tests) │
273
+ └──────────────────────────────────────────────────────────────┘
274
+
275
+ Why this workflow:
276
+ • #152 has ui label → includes /test for browser verification
277
+ • #152 has testable ACs → includes /testgen for test stubs
278
+ • #153 has refactor label → quality loop auto-enabled
279
+ • No shared files → safe to parallelize
280
+
281
+ Also consider:
282
+ --dry-run Preview execution before running
283
+ ```
284
+
285
+ ---
286
+
287
+ ### Example Output (Dependent Issues — Chain)
288
+
289
+ ```
290
+ ╭──────────────────────────────────────────────────────────────╮
291
+ │ sequant solve │
292
+ │ │
293
+ │ npx sequant run 10 11 12 --sequential --chain --qa-gate -q │
294
+ ╰──────────────────────────────────────────────────────────────╯
295
+
296
+ #10 Add auth middleware ······················ backend → spec → testgen → exec → qa
297
+ #11 Add login page ··························· ui → spec → testgen → exec → test → qa
298
+ #12 Add logout functionality ················· ui → spec → exec → test → qa
299
+
300
+ ┌─ Flags ──────────────────────────────────────────────────────┐
301
+ │ -q quality-loop ✓ multi-step implementation │
302
+ │ --chain ✓ #11 depends on #10, #12 depends on #11│
303
+ │ --qa-gate ✓ 3 issues with tight dependencies │
304
+ │ --base ✗ branching from main │
305
+ │ --testgen ✓ #10, #11 have Unit Test ACs │
306
+ └──────────────────────────────────────────────────────────────┘
307
+
308
+ Chain structure:
309
+ main → #10 → #11 → #12
310
+
311
+ Why this workflow:
312
+ • Explicit dependencies detected in issue bodies
313
+ • Chain ensures each branch builds on previous
314
+ • QA gate prevents stale code in downstream issues
315
+ • UI issues (#11, #12) include /test phase
316
+ • #10, #11 have testable ACs → include /testgen
317
+ ```
318
+
319
+ ---
320
+
321
+ ### Example Output (With Conflict Warning)
322
+
323
+ ```
324
+ ╭──────────────────────────────────────────────────────────────╮
325
+ │ sequant solve │
326
+ │ │
327
+ │ npx sequant run 85 -q │
328
+ ╰──────────────────────────────────────────────────────────────╯
329
+
330
+ #85 Update auth cookie handling ·············· bug → exec → qa
331
+
332
+ ┌─ Flags ──────────────────────────────────────────────────────┐
333
+ │ -q quality-loop ✓ auth changes benefit from retry │
334
+ │ --chain ✗ single issue │
335
+ │ --qa-gate ✗ no chain mode │
336
+ │ --base ✗ branching from main │
337
+ │ --testgen ✗ bug fix (targeted tests in exec) │
338
+ └──────────────────────────────────────────────────────────────┘
339
+
340
+ Why this workflow:
341
+ • Bug fix with clear AC → skip /spec
342
+ • Bug fix → skip /testgen (targeted tests added during exec)
343
+ • Single issue → no chain needed
344
+
345
+ ⚠ Conflict risk: #82 (open) modifies lib/auth/cookies.ts — coordinate or wait
118
346
  ```
119
347
 
120
348
  ## Workflow Selection Logic
@@ -128,17 +356,30 @@ npx sequant run 153 --quality-loop # Explicit (auto-enabled for refactor label
128
356
  - UI/frontend changes → Add `test` phase
129
357
  - Complex refactors → Enable quality loop
130
358
  - Security-sensitive → Add `security-review` phase
359
+ - New features with testable ACs → Add `testgen` phase
131
360
 
132
361
  ### Standard Workflow (Most Issues)
133
362
  ```
134
363
  /spec → /exec → /qa
135
364
  ```
136
365
 
366
+ ### Feature with Testable ACs
367
+ ```
368
+ /spec → /testgen → /exec → /qa
369
+ ```
370
+ Include `testgen` when ACs have Unit Test or Integration Test verification methods.
371
+
137
372
  ### UI Feature Workflow
138
373
  ```
139
374
  /spec → /exec → /test → /qa
140
375
  ```
141
376
 
377
+ ### UI Feature with Tests
378
+ ```
379
+ /spec → /testgen → /exec → /test → /qa
380
+ ```
381
+ Combine `testgen` and `test` for UI features with testable ACs.
382
+
142
383
  ### Bug Fix Workflow (Simple)
143
384
  ```
144
385
  /exec → /qa
@@ -156,11 +397,25 @@ Runs complete workflow with automatic fix iterations.
156
397
  | Issue Type | Labels | Workflow |
157
398
  |------------|--------|----------|
158
399
  | UI Feature | ui, frontend, admin | spec → exec → test → qa |
400
+ | UI Feature with Tests | ui + enhancement | spec → testgen → exec → test → qa |
159
401
  | Backend Feature | backend, api | spec → exec → qa |
402
+ | New Feature (testable) | enhancement, feature | spec → testgen → exec → qa |
160
403
  | Bug Fix | bug, fix | exec → qa (or full if complex) |
161
404
  | Complex Feature | complex, refactor | `--quality-loop` or fullsolve |
162
405
  | Documentation | docs | exec → qa |
163
406
 
407
+ ### Testgen Phase Detection
408
+
409
+ **Include `testgen` in workflow when:**
410
+ - Issue has `enhancement` or `feature` label AND
411
+ - Issue is NOT a simple bug fix or docs-only change AND
412
+ - Project has test infrastructure (Jest, Vitest, etc.)
413
+
414
+ **Skip `testgen` when:**
415
+ - Issue is `bug` or `fix` only (targeted tests added during exec)
416
+ - Issue is `docs` only (no code tests needed)
417
+ - All ACs use Manual Test or Browser Test verification
418
+
164
419
  **Quality Loop vs Fullsolve:**
165
420
  - `--quality-loop`: Enables auto-retry within `sequant run` (good for CI/automation)
166
421
  - `/fullsolve`: Interactive single-issue resolution with inline loops (good for manual work)
@@ -179,6 +434,18 @@ npx sequant run 152 153 154
179
434
  # Sequential execution (respects dependencies)
180
435
  npx sequant run 152 153 --sequential
181
436
 
437
+ # Chain mode (each issue branches from previous completed issue)
438
+ npx sequant run 10 11 12 --sequential --chain
439
+
440
+ # Chain mode with QA gate (pause if QA fails, prevent stale code)
441
+ npx sequant run 10 11 12 --sequential --chain --qa-gate
442
+
443
+ # Custom base branch (branch from feature branch instead of main)
444
+ npx sequant run 117 --base feature/dashboard
445
+
446
+ # Chain mode with custom base branch
447
+ npx sequant run 117 118 119 --sequential --chain --base feature/dashboard
448
+
182
449
  # Custom phases
183
450
  npx sequant run 152 --phases spec,exec,qa
184
451
 
@@ -192,6 +459,50 @@ npx sequant run 152 --quality-loop --max-iterations 5
192
459
  npx sequant run 152 --dry-run
193
460
  ```
194
461
 
462
+ ### Custom Base Branch
463
+
464
+ The `--base` flag specifies which branch to create worktrees from:
465
+
466
+ ```
467
+ Without --base: With --base feature/dashboard:
468
+ origin/main feature/dashboard
469
+ ├── #117 ├── #117
470
+ ├── #118 ├── #118
471
+ └── #119 └── #119
472
+ ```
473
+
474
+ **Use `--base` when:**
475
+ - Working on issues for a feature integration branch
476
+ - Issue references a parent branch (e.g., "Part of dashboard feature")
477
+ - Project uses `.sequant/settings.json` with `run.defaultBase` configured
478
+ - Issues should build on an existing feature branch
479
+
480
+ **Do NOT use `--base` when:**
481
+ - Issues should branch from main (default behavior)
482
+ - Working on independent bug fixes or features
483
+
484
+ ### Chain Mode Explained
485
+
486
+ The `--chain` flag (requires `--sequential`) creates dependent branches:
487
+
488
+ ```
489
+ Without --chain: With --chain:
490
+ origin/main origin/main
491
+ ├── #10 └── #10 (merged)
492
+ ├── #11 └── #11 (merged)
493
+ └── #12 └── #12
494
+ ```
495
+
496
+ **Use `--chain` when:**
497
+ - Issues have explicit dependencies
498
+ - Later issues build on earlier implementations
499
+ - Order matters for correctness
500
+
501
+ **Do NOT use `--chain` when:**
502
+ - Issues are independent
503
+ - Parallel execution is appropriate
504
+ - Issues can be merged in any order
505
+
195
506
  > **Tip:** Install globally with `npm install -g sequant` to omit the `npx` prefix.
196
507
 
197
508
  ## Edge Cases
@@ -224,56 +535,37 @@ If issues depend on each other:
224
535
 
225
536
  ---
226
537
 
227
- ## Output Verification
228
-
229
- **Before responding, verify your output includes ALL of these:**
230
-
231
- - [ ] **Issue Summary Table** - Table with Issue, Title, Labels, Workflow columns
232
- - [ ] **Recommended Workflow** - Slash commands in order for each issue
233
- - [ ] **CLI Command** - `npx sequant run <issue-numbers>` command (REQUIRED)
234
- - [ ] **Explanation** - Brief notes explaining workflow choices
235
-
236
- **DO NOT respond until all items are verified.**
237
-
238
- ## Output Template
538
+ ## State Tracking
239
539
 
240
- You MUST use this exact structure:
540
+ **IMPORTANT:** `/solve` initializes issue state when analyzing issues.
241
541
 
242
- ```markdown
243
- ## Solve Workflow for Issues: <ISSUE_NUMBERS>
542
+ ### State Updates
244
543
 
245
- ### Issue Analysis
544
+ When analyzing issues, initialize state tracking so the dashboard can show planned work:
246
545
 
247
- | Issue | Title | Labels | Workflow |
248
- |-------|-------|--------|----------|
249
- <!-- FILL: one row per issue. For complex/refactor/breaking/major labels, add "+ quality loop" to Workflow -->
250
-
251
- ### Recommended Workflow
546
+ **Initialize each issue being analyzed:**
547
+ ```bash
548
+ # Get issue title
549
+ TITLE=$(gh issue view <issue-number> --json title -q '.title')
252
550
 
253
- **For #<N> (<type>):**
254
- \`\`\`bash
255
- <!-- FILL: slash commands in order -->
256
- \`\`\`
551
+ # Initialize state (if not already tracked)
552
+ npx tsx scripts/state/update.ts init <issue-number> "$TITLE"
553
+ ```
257
554
 
258
- <!-- IF any issue has complex/refactor/breaking/major label, include this callout: -->
259
- > **Note:** Issue #<N> has `<label>` label. Quality loop will **auto-enable** when using `sequant run`, providing automatic fix iterations if phases fail.
555
+ **Note:** `/solve` only initializes issues - actual phase tracking happens during workflow execution (`/fullsolve`, `sequant run`, or individual skills).
260
556
 
261
- ### CLI Command
557
+ ---
262
558
 
263
- Run from terminal:
264
- \`\`\`bash
265
- npx sequant run <ISSUE_NUMBERS>
266
- \`\`\`
559
+ ## Output Verification
267
560
 
268
- <!-- IF any issue has complex/refactor/breaking/major label, include: -->
269
- For complex issues, quality loop is recommended:
270
- \`\`\`bash
271
- npx sequant run <ISSUE_NUMBER> --quality-loop # Explicit (auto-enabled for <label> label)
272
- \`\`\`
561
+ **Before responding, verify your output includes ALL of these:**
273
562
 
274
- > **Tip:** Install globally with `npm install -g sequant` to omit the `npx` prefix.
563
+ - [ ] **Header Box** ASCII box with `sequant solve` and full command
564
+ - [ ] **Issues List** — Each issue with dot leaders: `#N Title ··· labels → workflow`
565
+ - [ ] **Flags Table** — ALL five flags (-q, --chain, --qa-gate, --base, --testgen) with ✓/✗ and reasoning
566
+ - [ ] **Why Section** — 3-5 bullet points explaining decisions
567
+ - [ ] **Also Consider** — (conditional) Curated alternatives if applicable
568
+ - [ ] **Conflict Warning** — (conditional) If in-flight work overlaps
569
+ - [ ] **Line Count** — Total ≤25 lines (excluding conflict warnings)
275
570
 
276
- ### Notes
277
- <!-- FILL: explanation of workflow choices -->
278
- <!-- Include note about quality loop auto-enabling if applicable -->
279
- ```
571
+ **DO NOT respond until all items are verified.**