sequant 1.0.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.
Files changed (99) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +237 -0
  3. package/dist/bin/cli.d.ts +8 -0
  4. package/dist/bin/cli.d.ts.map +1 -0
  5. package/dist/bin/cli.js +70 -0
  6. package/dist/bin/cli.js.map +1 -0
  7. package/dist/src/commands/doctor.d.ts +8 -0
  8. package/dist/src/commands/doctor.d.ts.map +1 -0
  9. package/dist/src/commands/doctor.js +171 -0
  10. package/dist/src/commands/doctor.js.map +1 -0
  11. package/dist/src/commands/init.d.ts +11 -0
  12. package/dist/src/commands/init.d.ts.map +1 -0
  13. package/dist/src/commands/init.js +124 -0
  14. package/dist/src/commands/init.js.map +1 -0
  15. package/dist/src/commands/run.d.ts +18 -0
  16. package/dist/src/commands/run.d.ts.map +1 -0
  17. package/dist/src/commands/run.js +229 -0
  18. package/dist/src/commands/run.js.map +1 -0
  19. package/dist/src/commands/status.d.ts +5 -0
  20. package/dist/src/commands/status.d.ts.map +1 -0
  21. package/dist/src/commands/status.js +45 -0
  22. package/dist/src/commands/status.js.map +1 -0
  23. package/dist/src/commands/update.d.ts +10 -0
  24. package/dist/src/commands/update.d.ts.map +1 -0
  25. package/dist/src/commands/update.js +124 -0
  26. package/dist/src/commands/update.js.map +1 -0
  27. package/dist/src/index.d.ts +15 -0
  28. package/dist/src/index.d.ts.map +1 -0
  29. package/dist/src/index.js +13 -0
  30. package/dist/src/index.js.map +1 -0
  31. package/dist/src/lib/fs.d.ts +10 -0
  32. package/dist/src/lib/fs.d.ts.map +1 -0
  33. package/dist/src/lib/fs.js +44 -0
  34. package/dist/src/lib/fs.js.map +1 -0
  35. package/dist/src/lib/manifest.d.ts +14 -0
  36. package/dist/src/lib/manifest.d.ts.map +1 -0
  37. package/dist/src/lib/manifest.js +37 -0
  38. package/dist/src/lib/manifest.js.map +1 -0
  39. package/dist/src/lib/stacks.d.ts +22 -0
  40. package/dist/src/lib/stacks.d.ts.map +1 -0
  41. package/dist/src/lib/stacks.js +131 -0
  42. package/dist/src/lib/stacks.js.map +1 -0
  43. package/dist/src/lib/templates.d.ts +16 -0
  44. package/dist/src/lib/templates.d.ts.map +1 -0
  45. package/dist/src/lib/templates.js +118 -0
  46. package/dist/src/lib/templates.js.map +1 -0
  47. package/dist/src/lib/workflow/cli-args.d.ts +138 -0
  48. package/dist/src/lib/workflow/cli-args.d.ts.map +1 -0
  49. package/dist/src/lib/workflow/cli-args.js +210 -0
  50. package/dist/src/lib/workflow/cli-args.js.map +1 -0
  51. package/dist/src/lib/workflow/execute-issues.d.ts +42 -0
  52. package/dist/src/lib/workflow/execute-issues.d.ts.map +1 -0
  53. package/dist/src/lib/workflow/execute-issues.js +463 -0
  54. package/dist/src/lib/workflow/execute-issues.js.map +1 -0
  55. package/dist/src/lib/workflow/logger.d.ts +168 -0
  56. package/dist/src/lib/workflow/logger.d.ts.map +1 -0
  57. package/dist/src/lib/workflow/logger.js +249 -0
  58. package/dist/src/lib/workflow/logger.js.map +1 -0
  59. package/dist/src/lib/workflow/types.d.ts +89 -0
  60. package/dist/src/lib/workflow/types.d.ts.map +1 -0
  61. package/dist/src/lib/workflow/types.js +23 -0
  62. package/dist/src/lib/workflow/types.js.map +1 -0
  63. package/package.json +69 -0
  64. package/stacks/go.yaml +22 -0
  65. package/stacks/nextjs.yaml +28 -0
  66. package/stacks/python.yaml +24 -0
  67. package/stacks/rust.yaml +23 -0
  68. package/templates/hooks/post-tool.sh +301 -0
  69. package/templates/hooks/pre-tool.sh +350 -0
  70. package/templates/memory/constitution.md +60 -0
  71. package/templates/scripts/cleanup-worktree.sh +78 -0
  72. package/templates/scripts/list-worktrees.sh +50 -0
  73. package/templates/scripts/new-feature.sh +156 -0
  74. package/templates/settings.json +26 -0
  75. package/templates/skills/assess/SKILL.md +428 -0
  76. package/templates/skills/clean/SKILL.md +196 -0
  77. package/templates/skills/docs/SKILL.md +323 -0
  78. package/templates/skills/exec/SKILL.md +426 -0
  79. package/templates/skills/fullsolve/SKILL.md +479 -0
  80. package/templates/skills/loop/SKILL.md +310 -0
  81. package/templates/skills/qa/SKILL.md +261 -0
  82. package/templates/skills/qa/references/code-quality-exemplars.md +112 -0
  83. package/templates/skills/qa/references/code-review-checklist.md +77 -0
  84. package/templates/skills/qa/references/quality-gates.md +95 -0
  85. package/templates/skills/qa/references/testing-requirements.md +109 -0
  86. package/templates/skills/qa/scripts/quality-checks.sh +109 -0
  87. package/templates/skills/reflect/SKILL.md +159 -0
  88. package/templates/skills/reflect/references/documentation-tiers.md +70 -0
  89. package/templates/skills/reflect/references/phase-reflection.md +95 -0
  90. package/templates/skills/reflect/scripts/workflow-queries.ts +165 -0
  91. package/templates/skills/security-review/SKILL.md +344 -0
  92. package/templates/skills/security-review/references/security-checklists.md +377 -0
  93. package/templates/skills/solve/SKILL.md +242 -0
  94. package/templates/skills/spec/SKILL.md +169 -0
  95. package/templates/skills/spec/references/parallel-groups.md +72 -0
  96. package/templates/skills/spec/references/verification-criteria.md +104 -0
  97. package/templates/skills/test/SKILL.md +508 -0
  98. package/templates/skills/testgen/SKILL.md +561 -0
  99. package/templates/skills/verify/SKILL.md +266 -0
@@ -0,0 +1,479 @@
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
+ - Task
17
+ - mcp__chrome-devtools__*
18
+ - mcp__supabase__*
19
+ - mcp__sequential-thinking__sequentialthinking
20
+ - mcp__context7__*
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 1: Planning (SPEC)
94
+
95
+ Execute the planning phase inline (not as separate command):
96
+
97
+ ### 1.1 Fetch Issue Context
98
+
99
+ ```bash
100
+ gh issue view <issue-number> --json title,body,labels
101
+ gh issue view <issue-number> --comments
102
+ ```
103
+
104
+ ### 1.2 Extract Acceptance Criteria
105
+
106
+ Parse issue body and comments to build AC checklist:
107
+ - AC-1, AC-2, etc.
108
+ - Identify blockers, dependencies
109
+ - Note open questions
110
+
111
+ ### 1.3 Create Implementation Plan
112
+
113
+ - Break down into 3-7 implementation steps
114
+ - Identify complexity and risks
115
+ - Post plan comment to issue
116
+
117
+ ### 1.4 Create Feature Worktree
118
+
119
+ ```bash
120
+ ./scripts/dev/new-feature.sh <issue-number>
121
+ ```
122
+
123
+ **State after Phase 1:**
124
+ - AC checklist defined
125
+ - Implementation plan created
126
+ - Feature worktree ready
127
+
128
+ ## Phase 2: Implementation (EXEC)
129
+
130
+ ### 2.1 Navigate to Worktree
131
+
132
+ ```bash
133
+ cd ../worktrees/feature/<issue-number>-*/
134
+ ```
135
+
136
+ ### 2.2 Implement Each AC Item
137
+
138
+ For each AC item:
139
+ 1. Understand requirement
140
+ 2. Find similar patterns in codebase
141
+ 3. Implement minimal solution
142
+ 4. Run tests and build
143
+ 5. Mark AC as complete
144
+
145
+ ### 2.3 Quality Gates
146
+
147
+ After implementation:
148
+ - `npm test` - All tests pass
149
+ - `npm run build` - Build succeeds
150
+ - `git diff` - Changes are proportional
151
+
152
+ ### 2.4 Final Verification (CRITICAL)
153
+
154
+ **After ALL implementation changes are complete**, run verification one more time:
155
+
156
+ ```bash
157
+ # Run full test suite AFTER all changes
158
+ npm test
159
+
160
+ # Verify build still works
161
+ npm run build
162
+ ```
163
+
164
+ **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.
165
+
166
+ **If tests fail at this stage:**
167
+ 1. Fix the failing tests (update paths, content checks, etc.)
168
+ 2. Re-run `npm test` until all pass
169
+ 3. Do NOT proceed to Phase 3 until tests pass
170
+
171
+ **State after Phase 2:**
172
+ - All AC items implemented
173
+ - Tests passing (verified AFTER final changes)
174
+ - Build succeeding
175
+
176
+ ## Phase 3: Testing (TEST)
177
+
178
+ **Skip if:** Issue doesn't have `admin`, `ui`, or `frontend` labels
179
+
180
+ ### 3.1 Start Dev Server
181
+
182
+ ```bash
183
+ npm run dev &
184
+ ```
185
+
186
+ ### 3.2 Execute Test Cases
187
+
188
+ Using Chrome DevTools MCP:
189
+ - Navigate to feature
190
+ - Execute each test case
191
+ - Record PASS/FAIL/BLOCKED
192
+
193
+ ### 3.3 Test Loop (Max 3 iterations)
194
+
195
+ ```
196
+ test_iteration = 0
197
+ while test_iteration < 3:
198
+ run_tests()
199
+
200
+ if all_tests_pass:
201
+ break
202
+
203
+ # Parse failures
204
+ failed_tests = parse_failed_tests()
205
+
206
+ # Fix each failure
207
+ for test in failed_tests:
208
+ understand_failure()
209
+ implement_fix()
210
+ verify_fix()
211
+
212
+ test_iteration += 1
213
+ ```
214
+
215
+ **State after Phase 3:**
216
+ - All tests passing (or max iterations reached)
217
+ - Bugs documented and fixed
218
+
219
+ ## Phase 4: Quality Assurance (QA)
220
+
221
+ ### 4.1 Automated Quality Checks
222
+
223
+ ```bash
224
+ # Type safety
225
+ git diff main...HEAD | grep -E ":\s*any[,)]|as any"
226
+
227
+ # Deleted tests
228
+ git diff main...HEAD --diff-filter=D --name-only | grep -E "\.test\."
229
+
230
+ # Scope check
231
+ git diff main...HEAD --name-only | wc -l
232
+
233
+ # Size check
234
+ git diff main...HEAD --numstat
235
+ ```
236
+
237
+ ### 4.2 AC Coverage Review
238
+
239
+ For each AC item, mark:
240
+ - `MET` - Fully implemented
241
+ - `PARTIALLY_MET` - Needs more work
242
+ - `NOT_MET` - Not implemented
243
+
244
+ ### 4.3 QA Loop (Max 2 iterations)
245
+
246
+ ```
247
+ qa_iteration = 0
248
+ while qa_iteration < 2:
249
+ run_qa_checks()
250
+
251
+ if verdict == "READY_FOR_MERGE":
252
+ break
253
+
254
+ # Parse issues
255
+ issues = parse_qa_issues()
256
+
257
+ # Fix each issue
258
+ for issue in issues:
259
+ understand_issue()
260
+ implement_fix()
261
+ verify_fix()
262
+
263
+ qa_iteration += 1
264
+ ```
265
+
266
+ **State after Phase 4:**
267
+ - AC fully met
268
+ - Code quality validated
269
+ - Ready for merge
270
+
271
+ ## Phase 5: Pull Request (PR)
272
+
273
+ ### 5.1 Create PR (if not exists)
274
+
275
+ ```bash
276
+ # Check for existing PR
277
+ gh pr list --head feature/<issue-number>-*
278
+
279
+ # Create if none exists
280
+ gh pr create --title "feat(#<N>): <title>" --body "..."
281
+ ```
282
+
283
+ ### 5.2 Final Summary
284
+
285
+ Post completion comment to issue with:
286
+ - AC coverage summary
287
+ - Key changes made
288
+ - PR link
289
+ - Quality metrics
290
+
291
+ ### 5.3 Merge Workflow (Correct Order)
292
+
293
+ **IMPORTANT:** Clean up worktree BEFORE merging to avoid "branch used by worktree" error.
294
+
295
+ ```bash
296
+ # 1. Clean up worktree FIRST (removes worktree + local branch)
297
+ ./scripts/dev/cleanup-worktree.sh feature/<issue-number>-*
298
+
299
+ # 2. THEN merge (--delete-branch now works since local branch is gone)
300
+ gh pr merge <N> --squash --delete-branch
301
+
302
+ # 3. Close issue (if not auto-closed by "Fixes #N" in commit)
303
+ gh issue close <issue-number>
304
+ ```
305
+
306
+ **Why this order matters:** `gh pr merge --delete-branch` tries to delete the local branch, which fails if a worktree is still using it. Always clean up the worktree first.
307
+
308
+ ## Iteration Tracking
309
+
310
+ Track iterations to prevent infinite loops:
311
+
312
+ ```markdown
313
+ ## Full Solve Progress
314
+
315
+ | Phase | Iterations | Status |
316
+ |-------|------------|--------|
317
+ | Spec | 1/1 | Complete |
318
+ | Exec | 1/1 | Complete |
319
+ | Test | 2/3 | Complete (fixed 2 bugs) |
320
+ | QA | 1/2 | Complete |
321
+
322
+ **Total Time:** [tracked]
323
+ **Final Verdict:** READY_FOR_MERGE
324
+ ```
325
+
326
+ ## Exit Conditions
327
+
328
+ **Success:**
329
+ - All AC met
330
+ - All tests passing
331
+ - QA verdict: `READY_FOR_MERGE`
332
+ - PR created
333
+
334
+ **Partial Success:**
335
+ - Most AC met
336
+ - Minor issues documented
337
+ - QA verdict: `AC_MET_BUT_NOT_A_PLUS`
338
+ - PR created with notes
339
+
340
+ **Failure (manual intervention needed):**
341
+ - Max iterations reached on test or QA loop
342
+ - Blockers discovered
343
+ - QA verdict: `AC_NOT_MET` after all iterations
344
+
345
+ ## GitHub Updates
346
+
347
+ Throughout the process, post progress comments:
348
+
349
+ **After Spec:**
350
+ ```markdown
351
+ ## Plan Complete
352
+
353
+ ### AC Checklist
354
+ - [ ] AC-1: ...
355
+ - [ ] AC-2: ...
356
+
357
+ ### Implementation Plan
358
+ 1. Step 1
359
+ 2. Step 2
360
+
361
+ Ready to implement.
362
+ ```
363
+
364
+ **After Test Loop:**
365
+ ```markdown
366
+ ## Testing Complete
367
+
368
+ **Result:** 10/10 tests passed
369
+ **Iterations:** 2 (fixed 2 bugs)
370
+
371
+ ### Bugs Fixed
372
+ 1. [Bug] - Fixed in [file:line]
373
+ ```
374
+
375
+ **Final Comment:**
376
+ ```markdown
377
+ ## /fullsolve Complete
378
+
379
+ **Issue:** #<N>
380
+ **Status:** READY_FOR_MERGE
381
+
382
+ ### Summary
383
+ - AC: 5/5 met
384
+ - Tests: 10/10 passed
385
+ - QA: All checks passed
386
+
387
+ ### Iterations
388
+ - Test loop: 2
389
+ - QA loop: 1
390
+
391
+ **PR:** #<PR_NUMBER>
392
+
393
+ ---
394
+ Ready for human review and merge.
395
+ ```
396
+
397
+ ## Error Recovery
398
+
399
+ **If spec fails:**
400
+ - Check issue exists and is readable
401
+ - Verify GitHub CLI authentication
402
+ - Exit with clear error
403
+
404
+ **If exec fails (build/test):**
405
+ - Check error logs
406
+ - Attempt targeted fix
407
+ - If persistent, document and exit
408
+
409
+ **If test loop exhausted:**
410
+ - Document remaining failures
411
+ - Post status to issue
412
+ - Continue to QA (may catch issues there)
413
+
414
+ **If QA loop exhausted:**
415
+ - Document remaining issues
416
+ - Create PR anyway with notes
417
+ - Flag for human review
418
+
419
+ ## Configuration
420
+
421
+ | Setting | Default | Description |
422
+ |---------|---------|-------------|
423
+ | MAX_TEST_ITERATIONS | 3 | Max fix loops for test phase |
424
+ | MAX_QA_ITERATIONS | 2 | Max fix loops for QA phase |
425
+ | SKIP_TEST | false | Skip testing phase |
426
+ | AUTO_PR | true | Create PR automatically |
427
+
428
+ ## Smart Tests Integration
429
+
430
+ **Recommended:** Enable smart tests for automatic test running during implementation:
431
+
432
+ ```bash
433
+ # Enable before running fullsolve
434
+ export CLAUDE_HOOKS_SMART_TESTS=true
435
+ ```
436
+
437
+ When enabled, smart tests will:
438
+ - Auto-run related tests after each file edit during Phase 2 (EXEC)
439
+ - Catch regressions immediately instead of waiting for explicit `npm test`
440
+ - Log results to `/tmp/claude-tests.log` for debugging
441
+
442
+ **Benefits:**
443
+ - Faster feedback loop during implementation
444
+ - Catches test failures as they happen
445
+ - Reduces QA iteration count
446
+
447
+ **Trade-off:** Adds ~5-10s per file edit for test execution.
448
+
449
+ **View test results:**
450
+ ```bash
451
+ npx tsx scripts/dev/analyze-hook-logs.ts --tests
452
+ ```
453
+
454
+ ## Usage Examples
455
+
456
+ **Standard full solve:**
457
+ ```
458
+ /fullsolve 218
459
+ ```
460
+
461
+ **Backend issue (no UI testing):**
462
+ ```
463
+ /fullsolve 218 --skip-test
464
+ ```
465
+
466
+ **With more iteration tolerance:**
467
+ ```
468
+ /fullsolve 218 --max-iterations 5
469
+ ```
470
+
471
+ ## Integration with Batch Automation
472
+
473
+ For batch automation, `execute-issues.ts` can use fullsolve mode:
474
+
475
+ ```bash
476
+ FULLSOLVE=true npx tsx --env-file=.env.local scripts/dev/execute-issues.ts 218 219 220
477
+ ```
478
+
479
+ This runs `/fullsolve` for each issue with integrated quality loops.