sequant 1.16.1 → 1.18.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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +14 -2
- package/README.md +2 -0
- package/dist/bin/cli.js +2 -1
- package/dist/marketplace/external_plugins/sequant/.claude-plugin/plugin.json +21 -0
- package/dist/marketplace/external_plugins/sequant/README.md +38 -0
- package/dist/marketplace/external_plugins/sequant/hooks/post-tool.sh +292 -0
- package/dist/marketplace/external_plugins/sequant/hooks/pre-tool.sh +463 -0
- package/dist/marketplace/external_plugins/sequant/skills/_shared/references/prompt-templates.md +350 -0
- package/dist/marketplace/external_plugins/sequant/skills/_shared/references/subagent-types.md +131 -0
- package/dist/marketplace/external_plugins/sequant/skills/assess/SKILL.md +474 -0
- package/dist/marketplace/external_plugins/sequant/skills/clean/SKILL.md +211 -0
- package/dist/marketplace/external_plugins/sequant/skills/docs/SKILL.md +337 -0
- package/dist/marketplace/external_plugins/sequant/skills/exec/SKILL.md +807 -0
- package/dist/marketplace/external_plugins/sequant/skills/fullsolve/SKILL.md +678 -0
- package/dist/marketplace/external_plugins/sequant/skills/improve/SKILL.md +668 -0
- package/dist/marketplace/external_plugins/sequant/skills/loop/SKILL.md +374 -0
- package/dist/marketplace/external_plugins/sequant/skills/qa/SKILL.md +570 -0
- package/dist/marketplace/external_plugins/sequant/skills/qa/references/code-quality-exemplars.md +107 -0
- package/dist/marketplace/external_plugins/sequant/skills/qa/references/code-review-checklist.md +65 -0
- package/dist/marketplace/external_plugins/sequant/skills/qa/references/quality-gates.md +179 -0
- package/dist/marketplace/external_plugins/sequant/skills/qa/references/semgrep-rules.md +207 -0
- package/dist/marketplace/external_plugins/sequant/skills/qa/references/testing-requirements.md +109 -0
- package/dist/marketplace/external_plugins/sequant/skills/qa/scripts/quality-checks.sh +622 -0
- package/dist/marketplace/external_plugins/sequant/skills/reflect/SKILL.md +175 -0
- package/dist/marketplace/external_plugins/sequant/skills/reflect/references/documentation-tiers.md +70 -0
- package/dist/marketplace/external_plugins/sequant/skills/reflect/references/phase-reflection.md +95 -0
- package/dist/marketplace/external_plugins/sequant/skills/security-review/SKILL.md +358 -0
- package/dist/marketplace/external_plugins/sequant/skills/security-review/references/security-checklists.md +432 -0
- package/dist/marketplace/external_plugins/sequant/skills/solve/SKILL.md +697 -0
- package/dist/marketplace/external_plugins/sequant/skills/spec/SKILL.md +754 -0
- package/dist/marketplace/external_plugins/sequant/skills/spec/references/parallel-groups.md +72 -0
- package/dist/marketplace/external_plugins/sequant/skills/spec/references/recommended-workflow.md +92 -0
- package/dist/marketplace/external_plugins/sequant/skills/spec/references/verification-criteria.md +104 -0
- package/dist/marketplace/external_plugins/sequant/skills/test/SKILL.md +600 -0
- package/dist/marketplace/external_plugins/sequant/skills/testgen/SKILL.md +576 -0
- package/dist/marketplace/external_plugins/sequant/skills/verify/SKILL.md +281 -0
- package/dist/src/commands/run.d.ts +13 -274
- package/dist/src/commands/run.js +43 -1958
- package/dist/src/commands/sync.js +3 -0
- package/dist/src/commands/update.js +3 -0
- package/dist/src/lib/plugin-version-sync.d.ts +2 -1
- package/dist/src/lib/plugin-version-sync.js +28 -7
- package/dist/src/lib/solve-comment-parser.d.ts +26 -0
- package/dist/src/lib/solve-comment-parser.js +63 -7
- package/dist/src/lib/upstream/assessment.js +6 -3
- package/dist/src/lib/upstream/relevance.d.ts +5 -0
- package/dist/src/lib/upstream/relevance.js +24 -0
- package/dist/src/lib/upstream/report.js +18 -46
- package/dist/src/lib/upstream/types.d.ts +2 -0
- package/dist/src/lib/workflow/batch-executor.d.ts +117 -0
- package/dist/src/lib/workflow/batch-executor.js +574 -0
- package/dist/src/lib/workflow/phase-executor.d.ts +40 -0
- package/dist/src/lib/workflow/phase-executor.js +381 -0
- package/dist/src/lib/workflow/phase-mapper.d.ts +65 -0
- package/dist/src/lib/workflow/phase-mapper.js +147 -0
- package/dist/src/lib/workflow/pr-operations.d.ts +86 -0
- package/dist/src/lib/workflow/pr-operations.js +326 -0
- package/dist/src/lib/workflow/pr-status.d.ts +49 -0
- package/dist/src/lib/workflow/pr-status.js +131 -0
- package/dist/src/lib/workflow/run-reflect.d.ts +32 -0
- package/dist/src/lib/workflow/run-reflect.js +191 -0
- package/dist/src/lib/workflow/run-summary.d.ts +36 -0
- package/dist/src/lib/workflow/run-summary.js +142 -0
- package/dist/src/lib/workflow/state-cleanup.d.ts +79 -0
- package/dist/src/lib/workflow/state-cleanup.js +250 -0
- package/dist/src/lib/workflow/state-rebuild.d.ts +38 -0
- package/dist/src/lib/workflow/state-rebuild.js +140 -0
- package/dist/src/lib/workflow/state-utils.d.ts +14 -162
- package/dist/src/lib/workflow/state-utils.js +10 -677
- package/dist/src/lib/workflow/worktree-discovery.d.ts +61 -0
- package/dist/src/lib/workflow/worktree-discovery.js +229 -0
- package/dist/src/lib/workflow/worktree-manager.d.ts +205 -0
- package/dist/src/lib/workflow/worktree-manager.js +918 -0
- package/package.json +4 -2
- package/templates/skills/exec/SKILL.md +2 -2
- package/templates/skills/fullsolve/SKILL.md +15 -5
- package/templates/skills/loop/SKILL.md +1 -1
- package/templates/skills/qa/SKILL.md +47 -7
- package/templates/skills/solve/SKILL.md +92 -6
- package/templates/skills/spec/SKILL.md +57 -4
- package/templates/skills/test/SKILL.md +10 -0
- package/templates/skills/testgen/SKILL.md +1 -1
|
@@ -0,0 +1,678 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fullsolve
|
|
3
|
+
description: "Complete issue resolution with integrated quality loops - spec → exec → test → qa with auto-fix iterations"
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
author: sequant
|
|
7
|
+
version: "1.0"
|
|
8
|
+
allowed-tools:
|
|
9
|
+
- Read
|
|
10
|
+
- Edit
|
|
11
|
+
- Write
|
|
12
|
+
- Glob
|
|
13
|
+
- Grep
|
|
14
|
+
- Bash
|
|
15
|
+
- TodoWrite
|
|
16
|
+
- Skill # For invoking child skills (/spec, /exec, /test, /qa)
|
|
17
|
+
# Optional MCP tools (enhanced functionality if available)
|
|
18
|
+
- mcp__chrome-devtools__* # Browser testing - falls back to manual checklist if unavailable
|
|
19
|
+
- mcp__sequential-thinking__* # Complex reasoning - falls back to standard analysis if unavailable
|
|
20
|
+
- mcp__context7__* # Library documentation - falls back to web search if unavailable
|
|
21
|
+
- Bash(gh issue view:*)
|
|
22
|
+
- Bash(gh issue comment:*)
|
|
23
|
+
- Bash(gh issue edit:*)
|
|
24
|
+
- Bash(gh pr create:*)
|
|
25
|
+
- Bash(npm test:*)
|
|
26
|
+
- Bash(npm run build:*)
|
|
27
|
+
- Bash(git diff:*)
|
|
28
|
+
- Bash(git status:*)
|
|
29
|
+
- Bash(git add:*)
|
|
30
|
+
- Bash(git commit:*)
|
|
31
|
+
- Bash(git push:*)
|
|
32
|
+
- Bash(git worktree:*)
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
# Full Solve Command
|
|
36
|
+
|
|
37
|
+
You are the "Full Solve Agent" for the current repository.
|
|
38
|
+
|
|
39
|
+
## Purpose
|
|
40
|
+
|
|
41
|
+
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
|
+
|
|
43
|
+
## Workflow Overview
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
/fullsolve <issue>
|
|
47
|
+
├─────────────────────────────────────────────────────────────┤
|
|
48
|
+
│ │
|
|
49
|
+
│ ┌─────────┐ │
|
|
50
|
+
│ │ SPEC │ Plan implementation, extract AC │
|
|
51
|
+
│ └────┬────┘ │
|
|
52
|
+
│ │ │
|
|
53
|
+
│ ▼ │
|
|
54
|
+
│ ┌─────────┐ │
|
|
55
|
+
│ │ EXEC │ Implement in feature worktree │
|
|
56
|
+
│ └────┬────┘ │
|
|
57
|
+
│ │ │
|
|
58
|
+
│ ▼ │
|
|
59
|
+
│ ┌─────────┐ │
|
|
60
|
+
│ │ TEST │ Browser-based testing (if UI feature) │
|
|
61
|
+
│ └────┬────┘ │
|
|
62
|
+
│ │ │
|
|
63
|
+
│ ▼ (failures?) │
|
|
64
|
+
│ ┌─────────┐ ┌─────────┐ │
|
|
65
|
+
│ │ FIX │────▶│ RE-TEST │──▶ (loop max 3x) │
|
|
66
|
+
│ └─────────┘ └─────────┘ │
|
|
67
|
+
│ │ │
|
|
68
|
+
│ ▼ (all pass) │
|
|
69
|
+
│ ┌─────────┐ │
|
|
70
|
+
│ │ QA │ Code review, AC validation │
|
|
71
|
+
│ └────┬────┘ │
|
|
72
|
+
│ │ │
|
|
73
|
+
│ ▼ (not ready?) │
|
|
74
|
+
│ ┌─────────┐ ┌─────────┐ │
|
|
75
|
+
│ │ FIX │────▶│ RE-QA │──▶ (loop max 2x) │
|
|
76
|
+
│ └─────────┘ └─────────┘ │
|
|
77
|
+
│ │ │
|
|
78
|
+
│ ▼ (READY_FOR_MERGE) │
|
|
79
|
+
│ ┌─────────┐ │
|
|
80
|
+
│ │ PR │ Create PR if not exists │
|
|
81
|
+
│ └─────────┘ │
|
|
82
|
+
└─────────────────────────────────────────────────────────────┘
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Invocation
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
/fullsolve 218 # Standard full solve
|
|
89
|
+
/fullsolve 218 --skip-test # Skip testing phase (backend issues)
|
|
90
|
+
/fullsolve 218 --max-iterations 5 # Override max fix iterations
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Phase Detection (Smart Resumption)
|
|
94
|
+
|
|
95
|
+
**Before starting any phase**, detect the current workflow state from GitHub issue comments to enable smart resumption:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Get all phase markers from issue comments
|
|
99
|
+
comments_json=$(gh issue view <issue-number> --json comments --jq '[.comments[].body]')
|
|
100
|
+
markers=$(echo "$comments_json" | grep -o '{[^}]*}' | grep '"phase"' || true)
|
|
101
|
+
|
|
102
|
+
if [[ -n "$markers" ]]; then
|
|
103
|
+
echo "Phase markers detected:"
|
|
104
|
+
echo "$markers" | jq -r '" \(.phase): \(.status)"'
|
|
105
|
+
|
|
106
|
+
# Determine resume point
|
|
107
|
+
latest_completed=$(echo "$markers" | jq -r 'select(.status == "completed") | .phase' | tail -1)
|
|
108
|
+
latest_failed=$(echo "$markers" | jq -r 'select(.status == "failed") | .phase' | tail -1)
|
|
109
|
+
|
|
110
|
+
echo "Latest completed: ${latest_completed:-none}"
|
|
111
|
+
echo "Latest failed: ${latest_failed:-none}"
|
|
112
|
+
fi
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Resume Logic:**
|
|
116
|
+
|
|
117
|
+
| Detected State | Action |
|
|
118
|
+
|---------------|--------|
|
|
119
|
+
| No markers | Start from Phase 1 (spec) — fresh start |
|
|
120
|
+
| `spec:completed` | Skip to Phase 2 (exec) |
|
|
121
|
+
| `exec:completed` | Skip to Phase 3 (test) or Phase 4 (qa) |
|
|
122
|
+
| `exec:failed` | Resume at Phase 2 (exec) — retry |
|
|
123
|
+
| `test:completed` | Skip to Phase 4 (qa) |
|
|
124
|
+
| `qa:completed` | Skip to Phase 5 (PR) |
|
|
125
|
+
| `qa:failed` | Resume at Phase 4 (qa) — retry with /loop |
|
|
126
|
+
| All completed | Skip to PR creation (if no PR exists) |
|
|
127
|
+
|
|
128
|
+
**Backward Compatibility:**
|
|
129
|
+
- Issues without markers → treat as fresh start (no phase detection)
|
|
130
|
+
- If detection fails (API error) → fall through to standard Phase 0 checks
|
|
131
|
+
|
|
132
|
+
**Phase Marker Emission:**
|
|
133
|
+
|
|
134
|
+
When posting progress comments after each phase, append the appropriate marker:
|
|
135
|
+
```markdown
|
|
136
|
+
<!-- SEQUANT_PHASE: {"phase":"<phase>","status":"<completed|failed>","timestamp":"<ISO-8601>"} -->
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Phase 0: Pre-flight Checks
|
|
140
|
+
|
|
141
|
+
**CRITICAL after context restoration:** Before starting any work, verify the current git state to avoid duplicate work.
|
|
142
|
+
|
|
143
|
+
### 0.1 Git State Verification
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# Check current branch and recent commits
|
|
147
|
+
git log --oneline -5 --stat
|
|
148
|
+
|
|
149
|
+
# Check for any existing work on this issue
|
|
150
|
+
git branch -a | grep -i "<issue-number>" || true
|
|
151
|
+
gh pr list --search "<issue-number>"
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**Why this matters:** After context restoration from a summarized conversation, the git state may have changed (PRs merged, rebases, etc.). Always verify what's already been done before creating files or making changes.
|
|
155
|
+
|
|
156
|
+
### 0.2 Existing Work Detection
|
|
157
|
+
|
|
158
|
+
Before creating any files, check if they already exist:
|
|
159
|
+
- Look for test files: `ls -la src/**/*.test.ts`
|
|
160
|
+
- Check recent commits for relevant changes
|
|
161
|
+
- Verify PR status if one was mentioned in context
|
|
162
|
+
|
|
163
|
+
**If work already exists:** Skip to the appropriate phase (e.g., if implementation is done, go to Phase 3 or 4).
|
|
164
|
+
|
|
165
|
+
## Phase 1: Planning (SPEC)
|
|
166
|
+
|
|
167
|
+
Execute the planning phase inline (not as separate command):
|
|
168
|
+
|
|
169
|
+
### 1.1 Fetch Issue Context
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
gh issue view <issue-number> --json title,body,labels
|
|
173
|
+
gh issue view <issue-number> --comments
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### 1.2 Extract Acceptance Criteria
|
|
177
|
+
|
|
178
|
+
Parse issue body and comments to build AC checklist:
|
|
179
|
+
- AC-1, AC-2, etc.
|
|
180
|
+
- Identify blockers, dependencies
|
|
181
|
+
- Note open questions
|
|
182
|
+
|
|
183
|
+
### 1.3 Create Implementation Plan
|
|
184
|
+
|
|
185
|
+
- Break down into 3-7 implementation steps
|
|
186
|
+
- Identify complexity and risks
|
|
187
|
+
- Post plan comment to issue
|
|
188
|
+
|
|
189
|
+
**Use Sequential Thinking for Complex Planning:**
|
|
190
|
+
|
|
191
|
+
If the issue involves architectural decisions or multiple valid approaches, use Sequential Thinking MCP:
|
|
192
|
+
|
|
193
|
+
```javascript
|
|
194
|
+
// For complex issues with multiple implementation paths
|
|
195
|
+
mcp__sequential-thinking__sequentialthinking({
|
|
196
|
+
thought: "Analyzing implementation approaches for [feature]. Options: 1) [Approach A] - pros/cons. 2) [Approach B] - pros/cons. 3) [Approach C] - pros/cons...",
|
|
197
|
+
thoughtNumber: 1,
|
|
198
|
+
totalThoughts: 4,
|
|
199
|
+
nextThoughtNeeded: true
|
|
200
|
+
})
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**When to use Sequential Thinking in planning:**
|
|
204
|
+
- Issue labeled `complex`, `refactor`, or `architecture`
|
|
205
|
+
- 3+ valid implementation approaches exist
|
|
206
|
+
- Unclear trade-offs between options
|
|
207
|
+
- Previous implementation attempt failed
|
|
208
|
+
|
|
209
|
+
**Fallback:** If Sequential Thinking unavailable, document pros/cons explicitly in the plan comment.
|
|
210
|
+
|
|
211
|
+
### 1.4 Create Feature Worktree
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
./scripts/dev/new-feature.sh <issue-number>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**State after Phase 1:**
|
|
218
|
+
- AC checklist defined
|
|
219
|
+
- Implementation plan created
|
|
220
|
+
- Feature worktree ready
|
|
221
|
+
|
|
222
|
+
## Phase 2: Implementation (EXEC)
|
|
223
|
+
|
|
224
|
+
### 2.1 Navigate to Worktree
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
cd ../worktrees/feature/<issue-number>-*/
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### 2.2 MCP Availability Check (Optional Enhancement)
|
|
231
|
+
|
|
232
|
+
Before implementation, check MCP tool availability for enhanced workflow:
|
|
233
|
+
|
|
234
|
+
```markdown
|
|
235
|
+
**Available MCPs:**
|
|
236
|
+
- [ ] Context7 (`mcp__context7__*`) - For external library documentation
|
|
237
|
+
- [ ] Sequential Thinking (`mcp__sequential-thinking__*`) - For complex decisions
|
|
238
|
+
- [ ] Chrome DevTools (`mcp__chrome-devtools__*`) - For browser testing in Phase 3
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**If MCPs unavailable:** Continue with standard implementation - fallback strategies documented in `/exec` skill.
|
|
242
|
+
|
|
243
|
+
### 2.3 Implement Each AC Item
|
|
244
|
+
|
|
245
|
+
For each AC item:
|
|
246
|
+
1. Understand requirement
|
|
247
|
+
2. Find similar patterns in codebase (use Glob/Grep first)
|
|
248
|
+
3. **If using unfamiliar library:** Use Context7 for documentation lookup
|
|
249
|
+
4. **If facing complex decision:** Use Sequential Thinking to analyze approaches
|
|
250
|
+
5. Implement minimal solution
|
|
251
|
+
6. Run tests and build
|
|
252
|
+
7. Mark AC as complete
|
|
253
|
+
|
|
254
|
+
**MCP Usage in Implementation Loop:**
|
|
255
|
+
|
|
256
|
+
```
|
|
257
|
+
For each AC item:
|
|
258
|
+
│
|
|
259
|
+
├─ Need external library API? → Use Context7 (if available)
|
|
260
|
+
│ └─ Fallback: WebSearch for documentation
|
|
261
|
+
│
|
|
262
|
+
├─ Multiple valid approaches? → Use Sequential Thinking (if available)
|
|
263
|
+
│ └─ Fallback: Explicit pros/cons analysis in response
|
|
264
|
+
│
|
|
265
|
+
└─ Standard implementation → Use Glob/Grep for patterns
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### 2.4 Quality Gates
|
|
269
|
+
|
|
270
|
+
After implementation:
|
|
271
|
+
- `npm test` - All tests pass
|
|
272
|
+
- `npm run build` - Build succeeds
|
|
273
|
+
- `git diff` - Changes are proportional
|
|
274
|
+
|
|
275
|
+
### 2.5 Final Verification (CRITICAL)
|
|
276
|
+
|
|
277
|
+
**After ALL implementation changes are complete**, run verification one more time:
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
# Run full test suite AFTER all changes
|
|
281
|
+
npm test
|
|
282
|
+
|
|
283
|
+
# Verify build still works
|
|
284
|
+
npm run build
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**Why this matters:** Tests run during implementation may pass before file conversions or final changes are made. Always verify after the LAST change, not just after each intermediate step.
|
|
288
|
+
|
|
289
|
+
**If tests fail at this stage:**
|
|
290
|
+
1. Fix the failing tests (update paths, content checks, etc.)
|
|
291
|
+
2. Re-run `npm test` until all pass
|
|
292
|
+
3. Do NOT proceed to Phase 3 until tests pass
|
|
293
|
+
|
|
294
|
+
**State after Phase 2:**
|
|
295
|
+
- All AC items implemented
|
|
296
|
+
- Tests passing (verified AFTER final changes)
|
|
297
|
+
- Build succeeding
|
|
298
|
+
|
|
299
|
+
## Phase 3: Testing (TEST)
|
|
300
|
+
|
|
301
|
+
**Skip if:**
|
|
302
|
+
- Issue doesn't have `admin`, `ui`, or `frontend` labels, OR
|
|
303
|
+
- Issue has `no-browser-test` label (explicit opt-out, overrides UI labels)
|
|
304
|
+
|
|
305
|
+
### Browser Testing Label Reference
|
|
306
|
+
|
|
307
|
+
| Label | Effect |
|
|
308
|
+
|-------|--------|
|
|
309
|
+
| `ui`, `frontend`, `admin` | Always includes `/test` phase |
|
|
310
|
+
| `no-browser-test` | Always skips `/test` phase (explicit opt-out) |
|
|
311
|
+
| Neither | Auto-detection in `/spec` may suggest adding `ui` label |
|
|
312
|
+
|
|
313
|
+
### 3.1 Start Dev Server
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
npm run dev &
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### 3.2 Execute Test Cases
|
|
320
|
+
|
|
321
|
+
Using Chrome DevTools MCP:
|
|
322
|
+
- Navigate to feature
|
|
323
|
+
- Execute each test case
|
|
324
|
+
- Record PASS/FAIL/BLOCKED
|
|
325
|
+
|
|
326
|
+
### 3.3 Test Loop (Max 3 iterations)
|
|
327
|
+
|
|
328
|
+
```
|
|
329
|
+
test_iteration = 0
|
|
330
|
+
while test_iteration < 3:
|
|
331
|
+
run_tests()
|
|
332
|
+
|
|
333
|
+
if all_tests_pass:
|
|
334
|
+
break
|
|
335
|
+
|
|
336
|
+
# Parse failures
|
|
337
|
+
failed_tests = parse_failed_tests()
|
|
338
|
+
|
|
339
|
+
# Fix each failure
|
|
340
|
+
for test in failed_tests:
|
|
341
|
+
understand_failure()
|
|
342
|
+
implement_fix()
|
|
343
|
+
verify_fix()
|
|
344
|
+
|
|
345
|
+
test_iteration += 1
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
**State after Phase 3:**
|
|
349
|
+
- All tests passing (or max iterations reached)
|
|
350
|
+
- Bugs documented and fixed
|
|
351
|
+
|
|
352
|
+
## Phase 4: Quality Assurance (QA)
|
|
353
|
+
|
|
354
|
+
### 4.1 Automated Quality Checks
|
|
355
|
+
|
|
356
|
+
```bash
|
|
357
|
+
# Type safety
|
|
358
|
+
git diff main...HEAD | grep -E ":\s*any[,)]|as any" || true
|
|
359
|
+
|
|
360
|
+
# Deleted tests
|
|
361
|
+
git diff main...HEAD --diff-filter=D --name-only | grep -E "\.test\." || true
|
|
362
|
+
|
|
363
|
+
# Scope check
|
|
364
|
+
git diff main...HEAD --name-only | wc -l
|
|
365
|
+
|
|
366
|
+
# Size check
|
|
367
|
+
git diff main...HEAD --numstat
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### 4.2 AC Coverage Review
|
|
371
|
+
|
|
372
|
+
For each AC item, mark:
|
|
373
|
+
- `MET` - Fully implemented
|
|
374
|
+
- `PARTIALLY_MET` - Needs more work
|
|
375
|
+
- `NOT_MET` - Not implemented
|
|
376
|
+
|
|
377
|
+
### 4.3 QA Loop (Max 2 iterations)
|
|
378
|
+
|
|
379
|
+
```
|
|
380
|
+
qa_iteration = 0
|
|
381
|
+
while qa_iteration < 2:
|
|
382
|
+
run_qa_checks()
|
|
383
|
+
|
|
384
|
+
if verdict == "READY_FOR_MERGE":
|
|
385
|
+
break
|
|
386
|
+
|
|
387
|
+
if verdict == "AC_MET_BUT_NOT_A_PLUS":
|
|
388
|
+
# Good enough, proceed with notes
|
|
389
|
+
break
|
|
390
|
+
|
|
391
|
+
if verdict == "NEEDS_VERIFICATION":
|
|
392
|
+
# ACs are met but pending external verification
|
|
393
|
+
# Proceed to PR - verification can happen post-PR
|
|
394
|
+
break
|
|
395
|
+
|
|
396
|
+
# Parse issues (AC_NOT_MET)
|
|
397
|
+
issues = parse_qa_issues()
|
|
398
|
+
|
|
399
|
+
# Fix each issue
|
|
400
|
+
for issue in issues:
|
|
401
|
+
understand_issue()
|
|
402
|
+
implement_fix()
|
|
403
|
+
verify_fix()
|
|
404
|
+
|
|
405
|
+
qa_iteration += 1
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
**State after Phase 4:**
|
|
409
|
+
- AC fully met
|
|
410
|
+
- Code quality validated
|
|
411
|
+
- Ready for merge
|
|
412
|
+
|
|
413
|
+
## Phase 5: Pull Request (PR)
|
|
414
|
+
|
|
415
|
+
### 5.1 Create PR (if not exists)
|
|
416
|
+
|
|
417
|
+
```bash
|
|
418
|
+
# Check for existing PR
|
|
419
|
+
gh pr list --head feature/<issue-number>-*
|
|
420
|
+
|
|
421
|
+
# Create if none exists
|
|
422
|
+
gh pr create --title "feat(#<N>): <title>" --body "..."
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
### 5.2 Final Summary
|
|
426
|
+
|
|
427
|
+
Post completion comment to issue with:
|
|
428
|
+
- AC coverage summary
|
|
429
|
+
- Key changes made
|
|
430
|
+
- PR link
|
|
431
|
+
- Quality metrics
|
|
432
|
+
|
|
433
|
+
### 5.3 Merge Workflow (Correct Order)
|
|
434
|
+
|
|
435
|
+
**IMPORTANT:** Merge the PR first, then clean up the worktree.
|
|
436
|
+
|
|
437
|
+
```bash
|
|
438
|
+
# 1. Merge PR (--delete-branch deletes remote; local deletion will fail but that's OK)
|
|
439
|
+
gh pr merge <N> --squash --delete-branch
|
|
440
|
+
|
|
441
|
+
# 2. Clean up worktree (removes local worktree + branch)
|
|
442
|
+
./scripts/dev/cleanup-worktree.sh feature/<issue-number>-*
|
|
443
|
+
|
|
444
|
+
# 3. Issue auto-closes if commit message contains "Fixes #N"
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
**Why this order matters:** The cleanup script checks if the PR is merged before proceeding. The `--delete-branch` flag will fail to delete the local branch (worktree conflict) but successfully deletes the remote branch. The cleanup script then handles the local branch removal.
|
|
448
|
+
|
|
449
|
+
### 5.4 Post-Merge Verification
|
|
450
|
+
|
|
451
|
+
**Recommended:** After merge, verify the build and CLI still work:
|
|
452
|
+
|
|
453
|
+
```bash
|
|
454
|
+
# Pull latest main
|
|
455
|
+
git pull origin main
|
|
456
|
+
|
|
457
|
+
# Rebuild and verify
|
|
458
|
+
npm run build
|
|
459
|
+
|
|
460
|
+
# Smoke test - verify CLI runs without errors
|
|
461
|
+
npx sequant doctor
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
If any command fails, fix immediately on main before continuing. This catches issues like ESM compatibility bugs that unit tests may miss.
|
|
465
|
+
|
|
466
|
+
## Iteration Tracking
|
|
467
|
+
|
|
468
|
+
Track iterations to prevent infinite loops:
|
|
469
|
+
|
|
470
|
+
```markdown
|
|
471
|
+
## Full Solve Progress
|
|
472
|
+
|
|
473
|
+
| Phase | Iterations | Status |
|
|
474
|
+
|-------|------------|--------|
|
|
475
|
+
| Spec | 1/1 | Complete |
|
|
476
|
+
| Exec | 1/1 | Complete |
|
|
477
|
+
| Test | 2/3 | Complete (fixed 2 bugs) |
|
|
478
|
+
| QA | 1/2 | Complete |
|
|
479
|
+
|
|
480
|
+
**Total Time:** [tracked]
|
|
481
|
+
**Final Verdict:** READY_FOR_MERGE
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
## Exit Conditions
|
|
485
|
+
|
|
486
|
+
**Success:**
|
|
487
|
+
- All AC met
|
|
488
|
+
- All tests passing
|
|
489
|
+
- QA verdict: `READY_FOR_MERGE`
|
|
490
|
+
- PR created
|
|
491
|
+
|
|
492
|
+
**Partial Success:**
|
|
493
|
+
- Most AC met
|
|
494
|
+
- Minor issues documented
|
|
495
|
+
- QA verdict: `AC_MET_BUT_NOT_A_PLUS`
|
|
496
|
+
- PR created with notes
|
|
497
|
+
|
|
498
|
+
**Pending Verification:**
|
|
499
|
+
|
|
500
|
+
- All AC met or pending
|
|
501
|
+
- External verification required (CI, manual test)
|
|
502
|
+
- QA verdict: `NEEDS_VERIFICATION`
|
|
503
|
+
- PR created, verification can happen post-PR
|
|
504
|
+
|
|
505
|
+
**Failure (manual intervention needed):**
|
|
506
|
+
- Max iterations reached on test or QA loop
|
|
507
|
+
- Blockers discovered
|
|
508
|
+
- QA verdict: `AC_NOT_MET` after all iterations
|
|
509
|
+
|
|
510
|
+
## GitHub Updates
|
|
511
|
+
|
|
512
|
+
Throughout the process, post progress comments:
|
|
513
|
+
|
|
514
|
+
**After Spec:**
|
|
515
|
+
```markdown
|
|
516
|
+
## Plan Complete
|
|
517
|
+
|
|
518
|
+
### AC Checklist
|
|
519
|
+
- [ ] AC-1: ...
|
|
520
|
+
- [ ] AC-2: ...
|
|
521
|
+
|
|
522
|
+
### Implementation Plan
|
|
523
|
+
1. Step 1
|
|
524
|
+
2. Step 2
|
|
525
|
+
|
|
526
|
+
Ready to implement.
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
**After Test Loop:**
|
|
530
|
+
```markdown
|
|
531
|
+
## Testing Complete
|
|
532
|
+
|
|
533
|
+
**Result:** 10/10 tests passed
|
|
534
|
+
**Iterations:** 2 (fixed 2 bugs)
|
|
535
|
+
|
|
536
|
+
### Bugs Fixed
|
|
537
|
+
1. [Bug] - Fixed in [file:line]
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
**Final Comment:**
|
|
541
|
+
```markdown
|
|
542
|
+
## /fullsolve Complete
|
|
543
|
+
|
|
544
|
+
**Issue:** #<N>
|
|
545
|
+
**Status:** READY_FOR_MERGE
|
|
546
|
+
|
|
547
|
+
### Summary
|
|
548
|
+
- AC: 5/5 met
|
|
549
|
+
- Tests: 10/10 passed
|
|
550
|
+
- QA: All checks passed
|
|
551
|
+
|
|
552
|
+
### Iterations
|
|
553
|
+
- Test loop: 2
|
|
554
|
+
- QA loop: 1
|
|
555
|
+
|
|
556
|
+
**PR:** #<PR_NUMBER>
|
|
557
|
+
|
|
558
|
+
---
|
|
559
|
+
Ready for human review and merge.
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
## Error Recovery
|
|
563
|
+
|
|
564
|
+
**If spec fails:**
|
|
565
|
+
- Check issue exists and is readable
|
|
566
|
+
- Verify GitHub CLI authentication
|
|
567
|
+
- Exit with clear error
|
|
568
|
+
|
|
569
|
+
**If exec fails (build/test):**
|
|
570
|
+
- Check error logs
|
|
571
|
+
- Attempt targeted fix
|
|
572
|
+
- If persistent, document and exit
|
|
573
|
+
|
|
574
|
+
**If test loop exhausted:**
|
|
575
|
+
- Document remaining failures
|
|
576
|
+
- Post status to issue
|
|
577
|
+
- Continue to QA (may catch issues there)
|
|
578
|
+
|
|
579
|
+
**If QA loop exhausted:**
|
|
580
|
+
- Document remaining issues
|
|
581
|
+
- Create PR anyway with notes
|
|
582
|
+
- Flag for human review
|
|
583
|
+
|
|
584
|
+
## Configuration
|
|
585
|
+
|
|
586
|
+
| Setting | Default | Description |
|
|
587
|
+
|---------|---------|-------------|
|
|
588
|
+
| MAX_TEST_ITERATIONS | 3 | Max fix loops for test phase |
|
|
589
|
+
| MAX_QA_ITERATIONS | 2 | Max fix loops for QA phase |
|
|
590
|
+
| SKIP_TEST | false | Skip testing phase |
|
|
591
|
+
| AUTO_PR | true | Create PR automatically |
|
|
592
|
+
|
|
593
|
+
## Smart Tests Integration
|
|
594
|
+
|
|
595
|
+
**Recommended:** Enable smart tests for automatic test running during implementation:
|
|
596
|
+
|
|
597
|
+
```bash
|
|
598
|
+
# Enable before running fullsolve
|
|
599
|
+
export CLAUDE_HOOKS_SMART_TESTS=true
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
When enabled, smart tests will:
|
|
603
|
+
- Auto-run related tests after each file edit during Phase 2 (EXEC)
|
|
604
|
+
- Catch regressions immediately instead of waiting for explicit `npm test`
|
|
605
|
+
- Log results to `/tmp/claude-tests.log` for debugging
|
|
606
|
+
|
|
607
|
+
**Benefits:**
|
|
608
|
+
- Faster feedback loop during implementation
|
|
609
|
+
- Catches test failures as they happen
|
|
610
|
+
- Reduces QA iteration count
|
|
611
|
+
|
|
612
|
+
**Trade-off:** Adds ~5-10s per file edit for test execution.
|
|
613
|
+
|
|
614
|
+
**View test results:**
|
|
615
|
+
```bash
|
|
616
|
+
npx tsx scripts/dev/analyze-hook-logs.ts --tests
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
## Usage Examples
|
|
620
|
+
|
|
621
|
+
**Standard full solve:**
|
|
622
|
+
```
|
|
623
|
+
/fullsolve 218
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
**Backend issue (no UI testing):**
|
|
627
|
+
```
|
|
628
|
+
/fullsolve 218 --skip-test
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
**With more iteration tolerance:**
|
|
632
|
+
```
|
|
633
|
+
/fullsolve 218 --max-iterations 5
|
|
634
|
+
```
|
|
635
|
+
|
|
636
|
+
## Batch Processing
|
|
637
|
+
|
|
638
|
+
For multiple issues, run `/fullsolve` on each sequentially:
|
|
639
|
+
|
|
640
|
+
```bash
|
|
641
|
+
# Process multiple issues one at a time
|
|
642
|
+
/fullsolve 218
|
|
643
|
+
/fullsolve 219
|
|
644
|
+
/fullsolve 220
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
Each issue gets its own worktree, PR, and quality validation.
|
|
648
|
+
|
|
649
|
+
### Post-Batch: Merge Verification
|
|
650
|
+
|
|
651
|
+
After processing a batch, run `sequant merge` to catch cross-issue integration gaps before merging:
|
|
652
|
+
|
|
653
|
+
```bash
|
|
654
|
+
/fullsolve 218
|
|
655
|
+
/fullsolve 219
|
|
656
|
+
/fullsolve 220
|
|
657
|
+
sequant merge --check # Verify no cross-issue conflicts
|
|
658
|
+
/merger 218 219 220 # Merge all issues
|
|
659
|
+
```
|
|
660
|
+
|
|
661
|
+
`sequant merge --check` detects merge conflicts, template mirroring gaps, and file overlaps at zero AI cost. See `docs/reference/merge-command.md`.
|
|
662
|
+
|
|
663
|
+
---
|
|
664
|
+
|
|
665
|
+
## Output Verification
|
|
666
|
+
|
|
667
|
+
**Before responding, verify your output includes ALL of these:**
|
|
668
|
+
|
|
669
|
+
- [ ] **Progress Table** - Phase, iterations, and status for each phase
|
|
670
|
+
- [ ] **AC Coverage** - Each AC marked MET/PARTIALLY_MET/NOT_MET
|
|
671
|
+
- [ ] **Quality Metrics** - Tests passed, build status, type issues
|
|
672
|
+
- [ ] **Iteration Summary** - Test loop and QA loop iteration counts
|
|
673
|
+
- [ ] **Final Verdict** - READY_FOR_MERGE, AC_MET_BUT_NOT_A_PLUS, NEEDS_VERIFICATION,
|
|
674
|
+
or AC_NOT_MET
|
|
675
|
+
- [ ] **PR Link** - Pull request URL (if created)
|
|
676
|
+
- [ ] **Final GitHub Comment** - Summary posted to issue
|
|
677
|
+
|
|
678
|
+
**DO NOT respond until all items are verified.**
|