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,508 @@
1
+ ---
2
+ name: test
3
+ description: "Execute structured browser-based testing for admin features"
4
+ license: MIT
5
+ metadata:
6
+ author: sequant
7
+ version: "1.0"
8
+ allowed-tools:
9
+ - Read
10
+ - Bash
11
+ - mcp__chrome-devtools__*
12
+ - Glob
13
+ - Grep
14
+ - TodoWrite
15
+ - Bash(gh issue view:*)
16
+ - Bash(gh issue comment:*)
17
+ - Bash(npm run dev:*)
18
+ - Bash(lsof:*)
19
+ - Bash(npx tsx:*)
20
+ ---
21
+
22
+ # Browser Testing Command
23
+
24
+ You are the "Testing Agent" for the current repository.
25
+
26
+ ## Purpose
27
+
28
+ When invoked as `/test <issue-number>`, execute structured browser-based testing for admin features that require manual QA validation.
29
+
30
+ **Workflow:**
31
+ 1. **Setup Phase:** Fetch Issue, prepare test data, start dev server
32
+ 2. **Execution Phase:** Run tests systematically with browser automation
33
+ 3. **Reporting Phase:** Generate test results and GitHub comment
34
+
35
+ ## Phase 1: Setup
36
+
37
+ ### 1.1 Fetch Issue Context
38
+
39
+ ```bash
40
+ gh issue view <issue-number> --json title,body,labels
41
+ gh issue view <issue-number> --comments
42
+ ```
43
+
44
+ **Read all GitHub issue comments** to gather complete context:
45
+ - Comments often contain clarifications, updates, or additional test cases added after the initial issue description
46
+ - Look for discussion about test requirements, edge cases, or expected behaviors mentioned in comments
47
+ - Review feedback from previous testing cycles or review comments
48
+
49
+ Parse the Issue body and all comments to extract:
50
+ - Feature description
51
+ - Test cases (look for "Test 1:", "**Test N:**", "### Test N", numbered lists)
52
+ - Test data requirements (if specified)
53
+ - Expected outcomes
54
+ - Any clarifications or additional test requirements from comments
55
+
56
+ ### 1.2 Implementation Status Check
57
+
58
+ Before proceeding with full test setup, verify the feature exists:
59
+
60
+ **For admin features (`/admin/*`):**
61
+ ```bash
62
+ # Check if main page exists
63
+ ls app/admin/<feature>/page.tsx 2>/dev/null && echo "Exists" || echo "Not implemented"
64
+ ```
65
+
66
+ **For component features:**
67
+ ```bash
68
+ # Check if main component exists
69
+ find components -name "*<FeatureName>*" -type f
70
+ ```
71
+
72
+ **Decision based on result:**
73
+
74
+ **Feature Implemented → Continue to 1.3**
75
+ - Proceed with test data preparation and full test execution
76
+
77
+ **Feature Not Implemented → Two options:**
78
+
79
+ 1. **Quick Status Report (for P2/deferred features):**
80
+ - Verify infrastructure readiness (backend queries, DB schema, dependencies)
81
+ - Document what exists vs. what's missing
82
+ - Post brief status comment to issue
83
+ - Exit testing workflow - let user decide: implement now or defer
84
+
85
+ 2. **Implement First (for P0/P1 features):**
86
+ - Exit `/test` workflow
87
+ - Recommend: Run `/spec <issue>` to plan, then `/exec <issue>` to implement
88
+ - Run `/test <issue>` again after implementation complete
89
+
90
+ ### 1.3 Test Data Preparation
91
+
92
+ Check for test data requirements:
93
+
94
+ 1. Look for seed script: `scripts/seed-test-*.ts`
95
+ 2. If seed script exists, offer to run it:
96
+ ```bash
97
+ npx tsx --env-file=.env.local scripts/seed-test-<feature>.ts
98
+ ```
99
+ 3. If no seed script exists, check Issue for SQL statements or manual setup steps
100
+ 4. Execute setup or provide clear instructions to user
101
+
102
+ ### 1.4 Dev Server Check
103
+
104
+ Check if dev server is running:
105
+ ```bash
106
+ lsof -ti:3000
107
+ ```
108
+
109
+ If not running, start it:
110
+ ```bash
111
+ npm run dev
112
+ ```
113
+
114
+ Wait for server ready before proceeding.
115
+
116
+ ## Decision Point: Feature Implemented or Not?
117
+
118
+ At this point, you've checked if the feature exists (section 1.2). Based on that result:
119
+
120
+ ### Path A: Feature Implemented
121
+
122
+ **Continue to Phase 2** - Execute full test suite with browser automation.
123
+
124
+ **Workflow:**
125
+ 1. Create test plan with TodoWrite (all test cases)
126
+ 2. Execute tests systematically using Chrome DevTools MCP
127
+ 3. Generate test results report
128
+ 4. Post results to GitHub issue
129
+
130
+ ### Path B: Feature Not Implemented
131
+
132
+ **Skip to Infrastructure Assessment** - Don't run browser tests, verify readiness instead.
133
+
134
+ **For P2/Deferred Features:**
135
+ 1. Check backend infrastructure:
136
+ - Database queries exist? (`lib/queries/`)
137
+ - Database schema ready? (check migrations)
138
+ - Utility functions available? (`lib/utils/`)
139
+ - Dependencies installed? (`package.json`)
140
+ 2. Create status report:
141
+ - What infrastructure exists
142
+ - What UI/frontend is missing
143
+ - Current workaround (e.g., CLI tool)
144
+ 3. Post "Feature Not Implemented" comment to GitHub issue
145
+ 4. Document deferral decision (e.g., add note to `CLAUDE.md`)
146
+ 5. Exit testing workflow
147
+
148
+ **For P0/P1 Features:**
149
+ 1. Note that feature needs implementation
150
+ 2. Recommend workflow:
151
+ - `/spec <issue>` - Plan implementation
152
+ - `/exec <issue>` - Implement feature
153
+ - `/test <issue>` - Run tests after implementation
154
+ 3. Exit testing workflow
155
+ 4. Ask user: "Should I proceed with `/spec` and `/exec` now?"
156
+
157
+ ## Phase 2: Test Execution
158
+
159
+ **Note:** Only proceed to Phase 2 if feature is implemented (Path A above).
160
+
161
+ ### 2.1 Create Test Plan
162
+
163
+ Use TodoWrite to create a todo list with all test cases found:
164
+
165
+ ```javascript
166
+ [
167
+ { content: "Test 1: Basic functionality", status: "pending", activeForm: "Testing basic functionality" },
168
+ { content: "Test 2: Edge cases", status: "pending", activeForm: "Testing edge cases" },
169
+ // ... etc
170
+ ]
171
+ ```
172
+
173
+ ### 2.2 Execute Tests Systematically
174
+
175
+ For each test case:
176
+
177
+ **Step 1: Display Test**
178
+ - Show test number, description, and steps
179
+ - Mark test as "in_progress" in todo list
180
+
181
+ **Step 2: Browser Automation**
182
+
183
+ Use Chrome DevTools MCP for browser-based tests:
184
+
185
+ ```javascript
186
+ // Navigate to feature
187
+ mcp__chrome-devtools__navigate_page({url: "http://localhost:3000/..."})
188
+
189
+ // Get page structure
190
+ mcp__chrome-devtools__take_snapshot()
191
+
192
+ // Interact with elements (use UIDs from snapshot)
193
+ mcp__chrome-devtools__click({uid: "..."})
194
+ mcp__chrome-devtools__fill({uid: "...", value: "..."})
195
+ mcp__chrome-devtools__press_key({key: "Enter"})
196
+
197
+ // Verify state changes
198
+ mcp__chrome-devtools__take_snapshot()
199
+
200
+ // Document visual state
201
+ mcp__chrome-devtools__take_screenshot()
202
+
203
+ // Handle dialogs if needed
204
+ mcp__chrome-devtools__handle_dialog({action: "accept"})
205
+ ```
206
+
207
+ **Step 3: Verify Results**
208
+
209
+ Compare actual vs. expected outcomes:
210
+ - Check snapshot for expected elements/state
211
+ - Verify visual appearance in screenshot
212
+ - Confirm behavior matches test requirements
213
+
214
+ **Step 4: Record Result**
215
+
216
+ Mark test status:
217
+ - **PASS**: All expectations met
218
+ - **FAIL**: Expected behavior not working
219
+ - **BLOCKED**: Cannot complete test (prerequisite failed, bug blocking)
220
+
221
+ Update todo list:
222
+ - PASS → status: "completed"
223
+ - FAIL/BLOCKED → keep status: "in_progress", document issue
224
+
225
+ ### 2.3 Bug-Fix-Resume Pattern
226
+
227
+ When a bug is discovered during testing:
228
+
229
+ 1. **Pause Testing**
230
+ - Mark current test as BLOCKED
231
+ - Document the bug clearly (expected vs. actual)
232
+
233
+ 2. **Bug Fix Decision**
234
+ - If bug is critical and fixable now → pause tests, fix bug, resume
235
+ - If bug is non-critical → document, continue other tests
236
+ - If bug blocks multiple tests → fix before continuing
237
+
238
+ 3. **Resume Testing**
239
+ - After fix, restart blocked test
240
+ - Mark as PASS/FAIL based on fix
241
+ - Continue with remaining tests
242
+
243
+ ## Phase 3: Reporting
244
+
245
+ ### 3.1 Generate Test Summary
246
+
247
+ Create structured test results:
248
+
249
+ ```markdown
250
+ ## Testing Results for Issue #<N>
251
+
252
+ **Summary:** X/Y tests passed
253
+
254
+ ### Test Results
255
+
256
+ **Test 1: [Description]** - PASS
257
+ - Steps executed successfully
258
+ - Expected behavior confirmed
259
+ - Screenshots: [if applicable]
260
+
261
+ **Test 2: [Description]** - FAIL
262
+ - Steps executed: [list]
263
+ - Expected: [what should happen]
264
+ - Actual: [what happened]
265
+ - Issue: [describe the problem]
266
+
267
+ **Test 3: [Description]** - BLOCKED
268
+ - Blocker: [describe blocking issue]
269
+ - Dependency: [what needs to be fixed first]
270
+
271
+ ### Bugs Found
272
+
273
+ 1. **[Bug Title]**
274
+ - Location: [file:line]
275
+ - Issue: [description]
276
+ - Fix: [applied/pending]
277
+ - Status: [fixed/documented for follow-up]
278
+
279
+ ### Coverage
280
+
281
+ - Completed: X tests
282
+ - Failed: Y tests
283
+ - Blocked: Z tests
284
+ - Remaining: W tests
285
+
286
+ ### Recommendations
287
+
288
+ - [Next steps]
289
+ - [Follow-up issues needed]
290
+ - [Areas needing additional testing]
291
+ ```
292
+
293
+ ### 3.2 GitHub Comment
294
+
295
+ Draft comment for Issue #<N>:
296
+
297
+ ```markdown
298
+ ## Testing Progress Update
299
+
300
+ [Test summary from above]
301
+
302
+ ### Next Steps
303
+
304
+ - [ ] [Action item 1]
305
+ - [ ] [Action item 2]
306
+
307
+ **Testing tools used:** Chrome DevTools MCP, manual verification
308
+ ```
309
+
310
+ Offer to post comment:
311
+ ```bash
312
+ gh issue comment <issue-number> --body "$(cat <<'EOF'
313
+ [comment content]
314
+ EOF
315
+ )"
316
+ ```
317
+
318
+ ## Test Case Detection Patterns
319
+
320
+ Parse Issue body for these test formats:
321
+
322
+ **Format 1: Numbered headers**
323
+ ```
324
+ ### Test 1: Description
325
+ Steps...
326
+
327
+ ### Test 2: Description
328
+ Steps...
329
+ ```
330
+
331
+ **Format 2: Bold labels**
332
+ ```
333
+ **Test 1:** Description
334
+ - Step 1
335
+ - Step 2
336
+
337
+ **Test 2:** Description
338
+ - Step 1
339
+ ```
340
+
341
+ **Format 3: Numbered lists**
342
+ ```
343
+ 1. Test basic functionality:
344
+ - Step a
345
+ - Step b
346
+ 2. Test edge cases:
347
+ - Step a
348
+ ```
349
+
350
+ **Format 4: Acceptance Criteria as Tests**
351
+ If no explicit tests, use AC as test cases:
352
+ ```
353
+ **AC-1:** User can do X
354
+ → Test 1: Verify user can do X
355
+
356
+ **AC-2:** System shows Y
357
+ → Test 2: Verify system shows Y
358
+ ```
359
+
360
+ ## Browser Testing Best Practices
361
+
362
+ ### Snapshots vs. Screenshots
363
+
364
+ **Use `take_snapshot()` when:**
365
+ - You need to interact with elements (get UIDs)
366
+ - Verifying text content or element presence
367
+ - Checking accessibility tree structure
368
+ - Automating clicks/fills/navigation
369
+
370
+ **Use `take_screenshot()` when:**
371
+ - Documenting visual appearance
372
+ - Capturing hover states, colors, layouts
373
+ - Creating test evidence for reports
374
+ - Comparing before/after states visually
375
+
376
+ ### Common Testing Patterns
377
+
378
+ **Pattern 1: Form Submission**
379
+ ```javascript
380
+ // 1. Navigate to form
381
+ navigate_page({url: "..."})
382
+
383
+ // 2. Get form structure
384
+ take_snapshot()
385
+
386
+ // 3. Fill form fields
387
+ fill({uid: "name_field", value: "Test Name"})
388
+ fill({uid: "email_field", value: "test@example.com"})
389
+
390
+ // 4. Submit
391
+ click({uid: "submit_button"})
392
+
393
+ // 5. Verify result
394
+ wait_for({text: "Success"})
395
+ take_snapshot()
396
+ ```
397
+
398
+ **Pattern 2: Modal Interactions**
399
+ ```javascript
400
+ // 1. Open modal
401
+ click({uid: "open_modal_button"})
402
+
403
+ // 2. Verify modal content
404
+ take_snapshot() // Should show modal in tree
405
+
406
+ // 3. Interact with modal
407
+ fill({uid: "modal_input", value: "test"})
408
+ click({uid: "modal_confirm"})
409
+
410
+ // 4. Verify modal closed
411
+ take_snapshot() // Modal should be gone
412
+ ```
413
+
414
+ **Pattern 3: Multi-Selection Testing**
415
+ ```javascript
416
+ // 1. Get initial state
417
+ take_snapshot() // Note initial selection count
418
+
419
+ // 2. Select items
420
+ click({uid: "checkbox_1"})
421
+ take_snapshot() // Verify count updated
422
+
423
+ click({uid: "checkbox_2"})
424
+ take_snapshot() // Verify count updated
425
+
426
+ // 3. Perform bulk action
427
+ click({uid: "bulk_action_button"})
428
+ take_snapshot() // Verify action UI
429
+ ```
430
+
431
+ **Pattern 4: Escape/Cancel Testing**
432
+ ```javascript
433
+ // 1. Open UI element (modal, dropdown, etc.)
434
+ click({uid: "trigger"})
435
+
436
+ // 2. Press Escape
437
+ press_key({key: "Escape"})
438
+
439
+ // 3. Verify closed
440
+ take_snapshot() // Element should not be present
441
+ ```
442
+
443
+ ## Test Data Cleanup
444
+
445
+ After testing completes, ask user if test data should be cleaned up:
446
+
447
+ **Option 1: Delete test data**
448
+ ```sql
449
+ DELETE FROM pending_shops WHERE name LIKE 'Test Cafe%';
450
+ ```
451
+
452
+ **Option 2: Keep for future testing**
453
+ - Document that test data exists
454
+ - Note: May need to update or regenerate for next test session
455
+
456
+ ## Exit Conditions
457
+
458
+ Testing session is complete when:
459
+
460
+ 1. All test cases executed (or explicitly skipped)
461
+ 2. Test results documented with PASS/FAIL/BLOCKED status
462
+ 3. Bugs found have been fixed or documented
463
+ 4. Test summary generated
464
+ 5. GitHub comment drafted (and optionally posted)
465
+ 6. Recommendations for next steps provided
466
+
467
+ ## Example Invocation
468
+
469
+ ```bash
470
+ /test 151
471
+ ```
472
+
473
+ **Expected workflow:**
474
+ 1. Fetch Issue #151
475
+ 2. Detect 10 test cases in Issue body
476
+ 3. Check for seed script: `scripts/seed-test-bulk-edit.ts`
477
+ 4. Start dev server if needed
478
+ 5. Execute tests 1-10 using Chrome DevTools MCP
479
+ 6. Generate test summary with PASS/FAIL/BLOCKED status
480
+ 7. Draft GitHub comment with results
481
+ 8. Offer to post comment and identify next steps
482
+
483
+ ## Integration with Development Workflow
484
+
485
+ **Typical usage pattern:**
486
+
487
+ ```
488
+ /spec <issue> → Plan the feature
489
+ /exec <issue> → Implement the feature
490
+ /test <issue> → Test the feature (browser-based)
491
+ /qa <issue> → Code review and quality assessment
492
+ ```
493
+
494
+ **Alternative: Test-Driven Development**
495
+ ```
496
+ /spec <issue> → Plan the feature
497
+ /test <issue> → Run tests (expect failures)
498
+ /exec <issue> → Implement until tests pass
499
+ /qa <issue> → Final code review
500
+ ```
501
+
502
+ **When to use `/test` vs `/qa`:**
503
+ - **`/test`**: Browser-based functional testing, user workflows, UI interactions
504
+ - **`/qa`**: Code review, AC validation, architecture assessment, merge readiness
505
+
506
+ Both can be used together:
507
+ 1. `/test` → Verify feature works for users
508
+ 2. `/qa` → Verify code quality and completeness