sequant 2.1.0 → 2.1.2
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/.claude-plugin/plugin.json +1 -1
- package/dist/src/commands/init.js +4 -3
- package/dist/src/commands/run-compat.d.ts +14 -0
- package/dist/src/commands/run-compat.js +12 -0
- package/dist/src/commands/run.d.ts +4 -26
- package/dist/src/commands/run.js +92 -765
- package/dist/src/commands/status.js +9 -0
- package/dist/src/index.d.ts +11 -0
- package/dist/src/index.js +9 -0
- package/dist/src/lib/errors.d.ts +93 -0
- package/dist/src/lib/errors.js +97 -0
- package/dist/src/lib/mcp-config.js +1 -1
- package/dist/src/lib/settings.d.ts +236 -0
- package/dist/src/lib/settings.js +482 -37
- package/dist/src/lib/workflow/batch-executor.js +12 -4
- package/dist/src/lib/workflow/config-resolver.d.ts +50 -0
- package/dist/src/lib/workflow/config-resolver.js +167 -0
- package/dist/src/lib/workflow/error-classifier.d.ts +17 -7
- package/dist/src/lib/workflow/error-classifier.js +113 -15
- package/dist/src/lib/workflow/phase-executor.js +14 -2
- package/dist/src/lib/workflow/run-log-schema.d.ts +12 -0
- package/dist/src/lib/workflow/run-log-schema.js +7 -1
- package/dist/src/lib/workflow/run-orchestrator.d.ts +124 -0
- package/dist/src/lib/workflow/run-orchestrator.js +482 -0
- package/package.json +1 -1
- package/templates/skills/assess/SKILL.md +84 -35
- package/templates/skills/exec/SKILL.md +7 -27
- package/templates/skills/fullsolve/SKILL.md +329 -137
- package/templates/skills/qa/SKILL.md +23 -46
|
@@ -22,14 +22,18 @@ allowed-tools:
|
|
|
22
22
|
- Bash(gh issue comment:*)
|
|
23
23
|
- Bash(gh issue edit:*)
|
|
24
24
|
- Bash(gh pr create:*)
|
|
25
|
+
- Bash(gh pr list:*)
|
|
26
|
+
- Bash(gh pr merge:*)
|
|
25
27
|
- Bash(npm test:*)
|
|
26
28
|
- Bash(npm run build:*)
|
|
27
29
|
- Bash(git diff:*)
|
|
28
30
|
- Bash(git status:*)
|
|
31
|
+
- Bash(git log:*)
|
|
29
32
|
- Bash(git add:*)
|
|
30
33
|
- Bash(git commit:*)
|
|
31
34
|
- Bash(git push:*)
|
|
32
35
|
- Bash(git worktree:*)
|
|
36
|
+
- Bash(./scripts/dev/*:*)
|
|
33
37
|
---
|
|
34
38
|
|
|
35
39
|
# Full Solve Command
|
|
@@ -40,6 +44,26 @@ You are the "Full Solve Agent" for the current repository.
|
|
|
40
44
|
|
|
41
45
|
When invoked as `/fullsolve <issue-number>`, execute the complete issue resolution workflow with integrated quality loops. This command orchestrates all phases and automatically iterates until quality gates pass.
|
|
42
46
|
|
|
47
|
+
## CRITICAL: Auto-Progression Between Phases
|
|
48
|
+
|
|
49
|
+
**DO NOT wait for user confirmation between phases.** This is an autonomous workflow.
|
|
50
|
+
|
|
51
|
+
After each phase completes successfully, **immediately proceed** to the next phase:
|
|
52
|
+
1. `/spec` completes → **immediately** invoke `/exec`
|
|
53
|
+
2. `/exec` completes → **immediately** invoke `/test` (if UI) or `/qa`
|
|
54
|
+
3. `/test` completes → **immediately** invoke `/qa`
|
|
55
|
+
4. `/qa` completes → **immediately** create PR
|
|
56
|
+
|
|
57
|
+
**The user invoked `/fullsolve` expecting end-to-end automation.** Only stop for:
|
|
58
|
+
- Unrecoverable errors (after retry attempts exhausted)
|
|
59
|
+
- Final summary after PR creation
|
|
60
|
+
- Explicit user interruption
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
WRONG: "Spec complete. Ready for exec phase." [waits]
|
|
64
|
+
RIGHT: "Spec complete. Proceeding to exec..." [invokes /exec immediately]
|
|
65
|
+
```
|
|
66
|
+
|
|
43
67
|
## Workflow Overview
|
|
44
68
|
|
|
45
69
|
```
|
|
@@ -88,8 +112,59 @@ When invoked as `/fullsolve <issue-number>`, execute the complete issue resoluti
|
|
|
88
112
|
/fullsolve 218 # Standard full solve
|
|
89
113
|
/fullsolve 218 --skip-test # Skip testing phase (backend issues)
|
|
90
114
|
/fullsolve 218 --max-iterations 5 # Override max fix iterations
|
|
115
|
+
/fullsolve 218 --parallel # Force parallel agent execution (faster, higher token usage)
|
|
116
|
+
/fullsolve 218 --sequential # Force sequential agent execution (slower, lower token usage)
|
|
91
117
|
```
|
|
92
118
|
|
|
119
|
+
## Agent Execution Mode
|
|
120
|
+
|
|
121
|
+
When spawning sub-agents for quality checks, determine the execution mode:
|
|
122
|
+
|
|
123
|
+
1. **Check for CLI flag override:**
|
|
124
|
+
- `--parallel` → Run sub-agents in parallel
|
|
125
|
+
- `--sequential` → Run sub-agents one at a time
|
|
126
|
+
|
|
127
|
+
2. **If no flag, read project settings:**
|
|
128
|
+
Use the Read tool to check project settings:
|
|
129
|
+
```
|
|
130
|
+
Read(file_path=".sequant/settings.json")
|
|
131
|
+
# Parse JSON and extract agents.parallel (default: false)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
3. **Default:** Sequential (cost-optimized)
|
|
135
|
+
|
|
136
|
+
| Mode | Token Usage | Speed | Best For |
|
|
137
|
+
|------|-------------|-------|----------|
|
|
138
|
+
| Sequential | 1x (baseline) | Slower | Limited API plans, single issues |
|
|
139
|
+
| Parallel | ~2-3x | ~50% faster | Unlimited plans, batch operations |
|
|
140
|
+
|
|
141
|
+
**Pass execution mode to child skills:** When invoking `/qa` or other skills that spawn agents, pass the `--parallel` or `--sequential` flag to maintain consistency.
|
|
142
|
+
|
|
143
|
+
## Orchestration Context
|
|
144
|
+
|
|
145
|
+
This skill acts as an **orchestrator** and sets environment variables for child skills to optimize their behavior:
|
|
146
|
+
|
|
147
|
+
| Environment Variable | Description | Example Value |
|
|
148
|
+
|---------------------|-------------|---------------|
|
|
149
|
+
| `SEQUANT_ORCHESTRATOR` | Identifies the orchestrator | `sequant-run` |
|
|
150
|
+
| `SEQUANT_PHASE` | Current phase being executed | `spec`, `exec`, `test`, `qa`, `loop` |
|
|
151
|
+
| `SEQUANT_ISSUE` | Issue number being processed | `218` |
|
|
152
|
+
| `SEQUANT_WORKTREE` | Path to the feature worktree | `/path/to/worktrees/feature/218-...` |
|
|
153
|
+
|
|
154
|
+
**Benefits of orchestration context:**
|
|
155
|
+
|
|
156
|
+
1. **Faster execution** - Child skills skip redundant pre-flight checks
|
|
157
|
+
2. **Cleaner GitHub comments** - Only orchestrator posts progress updates
|
|
158
|
+
3. **Better coordination** - Skills can trust worktree and issue context
|
|
159
|
+
4. **Reduced API calls** - Issue fetch happens once, not per-phase
|
|
160
|
+
|
|
161
|
+
**Child skills detect orchestration via `SEQUANT_ORCHESTRATOR` and adjust behavior:**
|
|
162
|
+
- `/spec`: Runs normally (first phase, no prior context)
|
|
163
|
+
- `/exec`: Skips worktree creation, uses provided path
|
|
164
|
+
- `/test`: Skips issue fetch, trusts orchestrator context
|
|
165
|
+
- `/qa`: Skips pre-flight sync, defers GitHub updates
|
|
166
|
+
- `/loop`: Uses provided worktree, defers GitHub updates
|
|
167
|
+
|
|
93
168
|
## Phase Detection (Smart Resumption)
|
|
94
169
|
|
|
95
170
|
**Before starting any phase**, detect the current workflow state from GitHub issue comments to enable smart resumption:
|
|
@@ -171,142 +246,153 @@ Before creating any files, check if they already exist:
|
|
|
171
246
|
|
|
172
247
|
## Phase 1: Planning (SPEC)
|
|
173
248
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
### 1.1 Fetch Issue Context
|
|
249
|
+
**Invoke the `/spec` skill** to plan implementation and extract acceptance criteria.
|
|
177
250
|
|
|
178
|
-
|
|
179
|
-
gh issue view <issue-number> --json title,body,labels
|
|
180
|
-
gh issue view <issue-number> --comments
|
|
181
|
-
```
|
|
251
|
+
### 1.1 Invoke Spec Skill
|
|
182
252
|
|
|
183
|
-
|
|
253
|
+
Use the `Skill` tool to invoke `/spec`:
|
|
184
254
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
- Note open questions
|
|
255
|
+
```
|
|
256
|
+
Skill(skill: "spec", args: "<issue-number>")
|
|
257
|
+
```
|
|
189
258
|
|
|
190
|
-
|
|
259
|
+
The `/spec` skill will:
|
|
260
|
+
- Fetch issue context from GitHub
|
|
261
|
+
- Extract acceptance criteria (AC-1, AC-2, etc.)
|
|
262
|
+
- Create implementation plan (3-7 steps)
|
|
263
|
+
- Post plan comment to the issue
|
|
264
|
+
- Create feature worktree
|
|
191
265
|
|
|
192
|
-
|
|
193
|
-
- Identify complexity and risks
|
|
194
|
-
- Post plan comment to issue
|
|
266
|
+
### 1.2 Capture Spec Output
|
|
195
267
|
|
|
196
|
-
|
|
268
|
+
After `/spec` completes, extract and store:
|
|
269
|
+
- **AC Checklist:** List of acceptance criteria for tracking
|
|
270
|
+
- **Worktree Path:** Location for subsequent phases
|
|
271
|
+
- **Recommended Phases:** Whether `/test` is needed (UI features)
|
|
197
272
|
|
|
198
|
-
|
|
273
|
+
```markdown
|
|
274
|
+
## Spec Output Captured
|
|
199
275
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
thoughtNumber: 1,
|
|
205
|
-
totalThoughts: 4,
|
|
206
|
-
nextThoughtNeeded: true
|
|
207
|
-
})
|
|
276
|
+
**Issue:** #<N>
|
|
277
|
+
**Worktree:** ../worktrees/feature/<issue-number>-*/
|
|
278
|
+
**AC Count:** <N> items
|
|
279
|
+
**Needs Testing:** Yes/No (based on labels)
|
|
208
280
|
```
|
|
209
281
|
|
|
210
|
-
|
|
211
|
-
- Issue labeled `complex`, `refactor`, or `architecture`
|
|
212
|
-
- 3+ valid implementation approaches exist
|
|
213
|
-
- Unclear trade-offs between options
|
|
214
|
-
- Previous implementation attempt failed
|
|
282
|
+
### 1.3 Handle Spec Failures
|
|
215
283
|
|
|
216
|
-
|
|
284
|
+
If `/spec` fails:
|
|
285
|
+
- Check if issue exists and is readable
|
|
286
|
+
- Verify GitHub CLI authentication
|
|
287
|
+
- Report failure and exit workflow
|
|
217
288
|
|
|
218
|
-
|
|
289
|
+
```markdown
|
|
290
|
+
## Spec Failed
|
|
219
291
|
|
|
220
|
-
|
|
221
|
-
|
|
292
|
+
**Error:** [error message]
|
|
293
|
+
**Action Required:** [what the user needs to do]
|
|
294
|
+
|
|
295
|
+
Workflow halted. Fix the issue and re-run `/fullsolve <issue-number>`.
|
|
222
296
|
```
|
|
223
297
|
|
|
224
298
|
**State after Phase 1:**
|
|
225
299
|
- AC checklist defined
|
|
226
|
-
- Implementation plan created
|
|
300
|
+
- Implementation plan created (and posted to GitHub)
|
|
227
301
|
- Feature worktree ready
|
|
228
302
|
|
|
303
|
+
**→ IMMEDIATELY proceed to Phase 2 (do not wait for user input)**
|
|
304
|
+
|
|
229
305
|
## Phase 2: Implementation (EXEC)
|
|
230
306
|
|
|
231
|
-
|
|
307
|
+
**Invoke the `/exec` skill** to implement all acceptance criteria.
|
|
308
|
+
|
|
309
|
+
### 2.1 Invoke Exec Skill
|
|
310
|
+
|
|
311
|
+
Use the `Skill` tool to invoke `/exec`:
|
|
232
312
|
|
|
233
|
-
```
|
|
234
|
-
|
|
313
|
+
```
|
|
314
|
+
Skill(skill: "exec", args: "<issue-number>")
|
|
235
315
|
```
|
|
236
316
|
|
|
237
|
-
|
|
317
|
+
The `/exec` skill will:
|
|
318
|
+
- Navigate to the feature worktree
|
|
319
|
+
- Implement each AC item
|
|
320
|
+
- Run tests and build after changes
|
|
321
|
+
- Verify quality gates pass
|
|
238
322
|
|
|
239
|
-
|
|
323
|
+
### 2.2 Pass Orchestration Context
|
|
240
324
|
|
|
241
|
-
|
|
242
|
-
**Available MCPs:**
|
|
243
|
-
- [ ] Context7 (`mcp__context7__*`) - For external library documentation
|
|
244
|
-
- [ ] Sequential Thinking (`mcp__sequential-thinking__*`) - For complex decisions
|
|
245
|
-
- [ ] Chrome DevTools (`mcp__chrome-devtools__*`) - For browser testing in Phase 3
|
|
246
|
-
```
|
|
325
|
+
Set environment variables before invoking `/exec` so it can optimize its behavior:
|
|
247
326
|
|
|
248
|
-
|
|
327
|
+
```bash
|
|
328
|
+
export SEQUANT_ORCHESTRATOR=fullsolve
|
|
329
|
+
export SEQUANT_PHASE=exec
|
|
330
|
+
export SEQUANT_ISSUE=<issue-number>
|
|
331
|
+
export SEQUANT_WORKTREE=../worktrees/feature/<issue-number>-*/
|
|
332
|
+
```
|
|
249
333
|
|
|
250
|
-
|
|
334
|
+
When `/exec` detects `SEQUANT_ORCHESTRATOR`, it:
|
|
335
|
+
- Skips worktree creation (already done by `/spec`)
|
|
336
|
+
- Uses the provided worktree path
|
|
337
|
+
- Defers GitHub comment updates to orchestrator
|
|
251
338
|
|
|
252
|
-
|
|
253
|
-
1. Understand requirement
|
|
254
|
-
2. Find similar patterns in codebase (use Glob/Grep first)
|
|
255
|
-
3. **If using unfamiliar library:** Use Context7 for documentation lookup
|
|
256
|
-
4. **If facing complex decision:** Use Sequential Thinking to analyze approaches
|
|
257
|
-
5. Implement minimal solution
|
|
258
|
-
6. Run tests and build
|
|
259
|
-
7. Mark AC as complete
|
|
339
|
+
### 2.3 Handle Exec Failures
|
|
260
340
|
|
|
261
|
-
|
|
341
|
+
If `/exec` fails (tests or build):
|
|
262
342
|
|
|
343
|
+
**Attempt fix (max 3 iterations):**
|
|
263
344
|
```
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
│ └─ Fallback: WebSearch for documentation
|
|
268
|
-
│
|
|
269
|
-
├─ Multiple valid approaches? → Use Sequential Thinking (if available)
|
|
270
|
-
│ └─ Fallback: Explicit pros/cons analysis in response
|
|
271
|
-
│
|
|
272
|
-
└─ Standard implementation → Use Glob/Grep for patterns
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
### 2.4 Quality Gates
|
|
345
|
+
exec_iteration = 0
|
|
346
|
+
while exec_iteration < MAX_EXEC_ITERATIONS:
|
|
347
|
+
result = Skill(skill: "exec", args: "<issue-number>")
|
|
276
348
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
- `npm run build` - Build succeeds
|
|
280
|
-
- `git diff` - Changes are proportional
|
|
349
|
+
if result.success:
|
|
350
|
+
break
|
|
281
351
|
|
|
282
|
-
|
|
352
|
+
# Parse and log failure
|
|
353
|
+
log_failure(result.error)
|
|
354
|
+
exec_iteration += 1
|
|
355
|
+
```
|
|
283
356
|
|
|
284
|
-
**
|
|
357
|
+
**If all iterations exhausted:**
|
|
358
|
+
```markdown
|
|
359
|
+
## Exec Failed
|
|
285
360
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
npm test
|
|
361
|
+
**Iterations:** 3/3 exhausted
|
|
362
|
+
**Last Error:** [error message]
|
|
289
363
|
|
|
290
|
-
|
|
291
|
-
npm run build
|
|
364
|
+
Workflow halted. Manual intervention required.
|
|
292
365
|
```
|
|
293
366
|
|
|
294
|
-
|
|
367
|
+
### 2.4 Capture Exec Output
|
|
368
|
+
|
|
369
|
+
After successful `/exec`:
|
|
370
|
+
- Verify tests passed
|
|
371
|
+
- Verify build succeeded
|
|
372
|
+
- Record files changed
|
|
295
373
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
374
|
+
```markdown
|
|
375
|
+
## Exec Complete
|
|
376
|
+
|
|
377
|
+
**Tests:** ✅ All passing
|
|
378
|
+
**Build:** ✅ Succeeded
|
|
379
|
+
**Files Changed:** <N>
|
|
380
|
+
```
|
|
300
381
|
|
|
301
382
|
**State after Phase 2:**
|
|
302
383
|
- All AC items implemented
|
|
303
384
|
- Tests passing (verified AFTER final changes)
|
|
304
385
|
- Build succeeding
|
|
305
386
|
|
|
387
|
+
**→ IMMEDIATELY proceed to Phase 3 or 4 (do not wait for user input)**
|
|
388
|
+
- If UI labels (`ui`, `frontend`, `admin`) present AND no `no-browser-test` label → invoke `/test`
|
|
389
|
+
- If `no-browser-test` label present → skip to `/qa` (explicit opt-out)
|
|
390
|
+
- Otherwise → skip to `/qa`
|
|
391
|
+
|
|
306
392
|
## Phase 3: Testing (TEST)
|
|
307
393
|
|
|
308
394
|
**Skip if:**
|
|
309
|
-
- Issue doesn't have `admin`, `ui`, or `frontend` labels, OR
|
|
395
|
+
- Issue doesn't have `admin`, `ui`, or `frontend` labels (determined from `/spec` output), OR
|
|
310
396
|
- Issue has `no-browser-test` label (explicit opt-out, overrides UI labels)
|
|
311
397
|
|
|
312
398
|
### Browser Testing Label Reference
|
|
@@ -317,105 +403,164 @@ npm run build
|
|
|
317
403
|
| `no-browser-test` | Always skips `/test` phase (explicit opt-out) |
|
|
318
404
|
| Neither | Auto-detection in `/spec` may suggest adding `ui` label |
|
|
319
405
|
|
|
320
|
-
|
|
406
|
+
**Invoke the `/test` skill** for browser-based UI testing.
|
|
321
407
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
408
|
+
### 3.1 Invoke Test Skill
|
|
409
|
+
|
|
410
|
+
Use the `Skill` tool to invoke `/test`:
|
|
325
411
|
|
|
326
|
-
|
|
412
|
+
```
|
|
413
|
+
Skill(skill: "test", args: "<issue-number>")
|
|
414
|
+
```
|
|
327
415
|
|
|
328
|
-
|
|
329
|
-
-
|
|
416
|
+
The `/test` skill will:
|
|
417
|
+
- Start development server
|
|
418
|
+
- Navigate to feature in browser (Chrome DevTools MCP)
|
|
330
419
|
- Execute each test case
|
|
331
|
-
- Record PASS/FAIL/BLOCKED
|
|
420
|
+
- Record PASS/FAIL/BLOCKED results
|
|
421
|
+
|
|
422
|
+
### 3.2 Pass Orchestration Context
|
|
423
|
+
|
|
424
|
+
```bash
|
|
425
|
+
export SEQUANT_ORCHESTRATOR=fullsolve
|
|
426
|
+
export SEQUANT_PHASE=test
|
|
427
|
+
export SEQUANT_ISSUE=<issue-number>
|
|
428
|
+
export SEQUANT_WORKTREE=../worktrees/feature/<issue-number>-*/
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
When `/test` detects `SEQUANT_ORCHESTRATOR`, it:
|
|
432
|
+
- Skips issue fetch (trusts orchestrator context)
|
|
433
|
+
- Uses provided AC checklist
|
|
434
|
+
- Defers GitHub updates to orchestrator
|
|
332
435
|
|
|
333
436
|
### 3.3 Test Loop (Max 3 iterations)
|
|
334
437
|
|
|
438
|
+
If tests fail, invoke `/loop` to fix and re-test:
|
|
439
|
+
|
|
335
440
|
```
|
|
336
441
|
test_iteration = 0
|
|
337
|
-
while test_iteration <
|
|
338
|
-
|
|
442
|
+
while test_iteration < MAX_TEST_ITERATIONS:
|
|
443
|
+
result = Skill(skill: "test", args: "<issue-number>")
|
|
339
444
|
|
|
340
|
-
if all_tests_pass:
|
|
445
|
+
if result.all_tests_pass:
|
|
341
446
|
break
|
|
342
447
|
|
|
343
|
-
#
|
|
344
|
-
|
|
448
|
+
# Use /loop to fix failures
|
|
449
|
+
Skill(skill: "loop", args: "<issue-number> --phase test")
|
|
450
|
+
test_iteration += 1
|
|
451
|
+
```
|
|
345
452
|
|
|
346
|
-
|
|
347
|
-
for test in failed_tests:
|
|
348
|
-
understand_failure()
|
|
349
|
-
implement_fix()
|
|
350
|
-
verify_fix()
|
|
453
|
+
### 3.4 Handle Test Exhaustion
|
|
351
454
|
|
|
352
|
-
|
|
455
|
+
If max iterations reached:
|
|
456
|
+
|
|
457
|
+
```markdown
|
|
458
|
+
## Test Loop Exhausted
|
|
459
|
+
|
|
460
|
+
**Iterations:** 3/3
|
|
461
|
+
**Remaining Failures:** [list]
|
|
462
|
+
|
|
463
|
+
Proceeding to QA phase. Failures will be documented.
|
|
353
464
|
```
|
|
354
465
|
|
|
355
466
|
**State after Phase 3:**
|
|
356
467
|
- All tests passing (or max iterations reached)
|
|
357
468
|
- Bugs documented and fixed
|
|
358
469
|
|
|
359
|
-
|
|
470
|
+
**→ IMMEDIATELY proceed to Phase 4 (do not wait for user input)**
|
|
360
471
|
|
|
361
|
-
|
|
472
|
+
## Phase 4: Quality Assurance (QA)
|
|
362
473
|
|
|
363
|
-
|
|
364
|
-
# Type safety
|
|
365
|
-
git diff main...HEAD | grep -E ":\s*any[,)]|as any" || true
|
|
474
|
+
**Invoke the `/qa` skill** for code review and AC validation.
|
|
366
475
|
|
|
367
|
-
|
|
368
|
-
git diff main...HEAD --diff-filter=D --name-only | grep -E "\.test\." || true
|
|
476
|
+
### 4.1 Invoke QA Skill
|
|
369
477
|
|
|
370
|
-
|
|
371
|
-
git diff main...HEAD --name-only | wc -l
|
|
478
|
+
Use the `Skill` tool to invoke `/qa`:
|
|
372
479
|
|
|
373
|
-
# Size check
|
|
374
|
-
git diff main...HEAD --numstat
|
|
375
480
|
```
|
|
481
|
+
Skill(skill: "qa", args: "<issue-number>")
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
The `/qa` skill will:
|
|
485
|
+
- Run automated quality checks (type safety, deleted tests, scope)
|
|
486
|
+
- Review AC coverage (MET/PARTIALLY_MET/NOT_MET/PENDING)
|
|
487
|
+
- Generate review comment draft
|
|
488
|
+
- Return verdict: READY_FOR_MERGE, AC_MET_BUT_NOT_A_PLUS, NEEDS_VERIFICATION,
|
|
489
|
+
or AC_NOT_MET
|
|
376
490
|
|
|
377
|
-
### 4.2
|
|
491
|
+
### 4.2 Pass Orchestration Context
|
|
378
492
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
493
|
+
```bash
|
|
494
|
+
export SEQUANT_ORCHESTRATOR=fullsolve
|
|
495
|
+
export SEQUANT_PHASE=qa
|
|
496
|
+
export SEQUANT_ISSUE=<issue-number>
|
|
497
|
+
export SEQUANT_WORKTREE=../worktrees/feature/<issue-number>-*/
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
When `/qa` detects `SEQUANT_ORCHESTRATOR`, it:
|
|
501
|
+
- Skips pre-flight sync
|
|
502
|
+
- Defers GitHub comment posting to orchestrator
|
|
503
|
+
- Returns structured verdict for orchestrator to process
|
|
383
504
|
|
|
384
505
|
### 4.3 QA Loop (Max 2 iterations)
|
|
385
506
|
|
|
507
|
+
If verdict is not `READY_FOR_MERGE`, invoke `/loop` to fix and re-run QA:
|
|
508
|
+
|
|
386
509
|
```
|
|
387
510
|
qa_iteration = 0
|
|
388
|
-
while qa_iteration <
|
|
389
|
-
|
|
511
|
+
while qa_iteration < MAX_QA_ITERATIONS:
|
|
512
|
+
result = Skill(skill: "qa", args: "<issue-number>")
|
|
390
513
|
|
|
391
|
-
if verdict == "READY_FOR_MERGE":
|
|
514
|
+
if result.verdict == "READY_FOR_MERGE":
|
|
392
515
|
break
|
|
393
516
|
|
|
394
|
-
if verdict == "AC_MET_BUT_NOT_A_PLUS":
|
|
517
|
+
if result.verdict == "AC_MET_BUT_NOT_A_PLUS":
|
|
395
518
|
# Good enough, proceed with notes
|
|
396
519
|
break
|
|
397
520
|
|
|
398
|
-
if verdict == "NEEDS_VERIFICATION":
|
|
521
|
+
if result.verdict == "NEEDS_VERIFICATION":
|
|
399
522
|
# ACs are met but pending external verification
|
|
400
523
|
# Proceed to PR - verification can happen post-PR
|
|
401
524
|
break
|
|
402
525
|
|
|
403
|
-
#
|
|
404
|
-
|
|
526
|
+
# Use /loop to fix issues (AC_NOT_MET)
|
|
527
|
+
Skill(skill: "loop", args: "<issue-number> --phase qa")
|
|
528
|
+
qa_iteration += 1
|
|
529
|
+
```
|
|
405
530
|
|
|
406
|
-
|
|
407
|
-
for issue in issues:
|
|
408
|
-
understand_issue()
|
|
409
|
-
implement_fix()
|
|
410
|
-
verify_fix()
|
|
531
|
+
### 4.4 Handle QA Exhaustion
|
|
411
532
|
|
|
412
|
-
|
|
533
|
+
If max iterations reached with `AC_NOT_MET`:
|
|
534
|
+
|
|
535
|
+
```markdown
|
|
536
|
+
## QA Loop Exhausted
|
|
537
|
+
|
|
538
|
+
**Iterations:** 2/2
|
|
539
|
+
**Verdict:** AC_NOT_MET
|
|
540
|
+
**Remaining Issues:** [list]
|
|
541
|
+
|
|
542
|
+
Creating PR with notes for human review.
|
|
413
543
|
```
|
|
414
544
|
|
|
415
545
|
**State after Phase 4:**
|
|
416
|
-
- AC fully met
|
|
546
|
+
- AC fully met (or documented as partial)
|
|
417
547
|
- Code quality validated
|
|
418
|
-
- Ready for merge
|
|
548
|
+
- Ready for merge (or flagged for human review)
|
|
549
|
+
|
|
550
|
+
**→ IMMEDIATELY proceed to Phase 5 after self-evaluation (do not wait for user input)**
|
|
551
|
+
|
|
552
|
+
### 4.5 Risk Assessment
|
|
553
|
+
|
|
554
|
+
Risk assessment is performed during the QA phase — see QA output above. If QA was skipped or incomplete, state risks here using the same format:
|
|
555
|
+
|
|
556
|
+
```markdown
|
|
557
|
+
### Risk Assessment
|
|
558
|
+
|
|
559
|
+
- **Likely failure mode:** [How would this break in production?]
|
|
560
|
+
- **Not tested:** [What gaps exist in test coverage?]
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
---
|
|
419
564
|
|
|
420
565
|
## Phase 5: Pull Request (PR)
|
|
421
566
|
|
|
@@ -693,10 +838,57 @@ sequant merge --check # Verify no cross-issue conflicts
|
|
|
693
838
|
|
|
694
839
|
---
|
|
695
840
|
|
|
841
|
+
## State Tracking
|
|
842
|
+
|
|
843
|
+
**IMPORTANT:** `/fullsolve` is an orchestrator and manages state for child skills.
|
|
844
|
+
|
|
845
|
+
### Orchestrator Responsibilities
|
|
846
|
+
|
|
847
|
+
As an orchestrator, `/fullsolve` must:
|
|
848
|
+
|
|
849
|
+
1. **Set orchestration context** for child skills:
|
|
850
|
+
```bash
|
|
851
|
+
export SEQUANT_ORCHESTRATOR=fullsolve
|
|
852
|
+
export SEQUANT_PHASE=<current-phase>
|
|
853
|
+
export SEQUANT_ISSUE=<issue-number>
|
|
854
|
+
export SEQUANT_WORKTREE=<worktree-path>
|
|
855
|
+
```
|
|
856
|
+
|
|
857
|
+
2. **Initialize issue state at workflow start:**
|
|
858
|
+
```bash
|
|
859
|
+
npx tsx scripts/state/update.ts init <issue-number> "<issue-title>"
|
|
860
|
+
```
|
|
861
|
+
|
|
862
|
+
3. **Update phase status** at each transition:
|
|
863
|
+
```bash
|
|
864
|
+
# Before invoking child skill
|
|
865
|
+
npx tsx scripts/state/update.ts start <issue-number> <phase>
|
|
866
|
+
|
|
867
|
+
# After child skill completes
|
|
868
|
+
npx tsx scripts/state/update.ts complete <issue-number> <phase>
|
|
869
|
+
|
|
870
|
+
# If child skill fails
|
|
871
|
+
npx tsx scripts/state/update.ts fail <issue-number> <phase> "Error"
|
|
872
|
+
```
|
|
873
|
+
|
|
874
|
+
4. **Update final status** after workflow completes:
|
|
875
|
+
```bash
|
|
876
|
+
# On READY_FOR_MERGE
|
|
877
|
+
npx tsx scripts/state/update.ts status <issue-number> ready_for_merge
|
|
878
|
+
|
|
879
|
+
# On failure
|
|
880
|
+
npx tsx scripts/state/update.ts status <issue-number> blocked
|
|
881
|
+
```
|
|
882
|
+
|
|
883
|
+
**Why child skills skip state updates:** When `SEQUANT_ORCHESTRATOR` is set, child skills defer state management to the orchestrator to avoid duplicate updates.
|
|
884
|
+
|
|
885
|
+
---
|
|
886
|
+
|
|
696
887
|
## Output Verification
|
|
697
888
|
|
|
698
889
|
**Before responding, verify your output includes ALL of these:**
|
|
699
890
|
|
|
891
|
+
- [ ] **Risk Assessment (from QA)** - Likely failure mode and coverage gaps stated
|
|
700
892
|
- [ ] **Progress Table** - Phase, iterations, and status for each phase
|
|
701
893
|
- [ ] **AC Coverage** - Each AC marked MET/PARTIALLY_MET/NOT_MET
|
|
702
894
|
- [ ] **Quality Metrics** - Tests passed, build status, type issues
|