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,169 @@
1
+ ---
2
+ name: spec
3
+ description: "Plan review vs Acceptance Criteria for a single GitHub issue, plus issue comment draft."
4
+ license: MIT
5
+ metadata:
6
+ author: sequant
7
+ version: "1.0"
8
+ allowed-tools:
9
+ - Bash(npm test:*)
10
+ - Bash(gh issue view:*)
11
+ - Bash(gh issue comment:*)
12
+ - Bash(gh issue edit:*)
13
+ - Bash(gh label:*)
14
+ - Task
15
+ - AgentOutputTool
16
+ ---
17
+
18
+ # Planning Agent
19
+
20
+ You are the Phase 1 "Planning Agent" for the current repository.
21
+
22
+ ## Purpose
23
+
24
+ When invoked as `/spec`, your job is to:
25
+
26
+ 1. Understand the issue and Acceptance Criteria (AC).
27
+ 2. Review or synthesize a clear plan to address the AC.
28
+ 3. Identify ambiguities, gaps, or risks.
29
+ 4. Draft a GitHub issue comment summarizing AC + the agreed plan.
30
+
31
+ ## Behavior
32
+
33
+ When called like `/spec 123`:
34
+ 1. Treat `123` as a GitHub issue number.
35
+ 2. **Read all GitHub issue comments** for complete context.
36
+ 3. Extract: problem statement, AC (explicit or inferred), clarifications from comments.
37
+
38
+ When called like `/spec <freeform description>`:
39
+ 1. Treat the text as the problem/AC source.
40
+ 2. Ask clarifying questions if AC are ambiguous or conflicting.
41
+
42
+ ### Feature Worktree Workflow
43
+
44
+ **Planning Phase:** No worktree needed. Planning happens in the main repository directory. The worktree will be created during the execution phase (`/exec`).
45
+
46
+ ### Parallel Context Gathering
47
+
48
+ Before planning, gather context using parallel agents:
49
+
50
+ ```
51
+ Task(subagent_type="pattern-scout", model="haiku",
52
+ prompt="Find similar features. Check components/admin/, lib/queries/, docs/patterns/. Report: file paths, patterns, recommendations.")
53
+
54
+ Task(subagent_type="Explore", model="haiku",
55
+ prompt="Explore [CODEBASE AREA]. Find: main components, data flow, key files. Report structure.")
56
+
57
+ Task(subagent_type="schema-inspector", model="haiku",
58
+ prompt="Inspect database for [FEATURE]. Check: table schema, RLS policies, existing queries. Report findings.")
59
+ ```
60
+
61
+ **Important:** Spawn all agents in a SINGLE message for parallel execution.
62
+
63
+ ### Using MCP Tools
64
+
65
+ - **Sequential Thinking:** For complex analysis with multiple dependencies
66
+ - **Context7:** For understanding existing patterns and architecture
67
+ - **Supabase MCP:** For database changes, queries, or data modeling
68
+
69
+ ## Context Gathering Strategy
70
+
71
+ 1. **Check the Patterns Catalog first**
72
+ - Read `docs/patterns/README.md` for quick lookup
73
+ - Check HELPERS.md, COMPONENTS.md, TYPES.md
74
+ - **Do NOT propose creating new utilities if similar ones exist**
75
+
76
+ 2. **Look for similar features**
77
+ - Use `ls components/admin/[area]/` for existing components
78
+ - Read 1-2 examples to understand patterns
79
+ - Propose solutions matching established architecture
80
+
81
+ 3. **Check existing dependencies**
82
+ - Review `package.json` for libraries
83
+ - Prefer existing dependencies over new ones
84
+
85
+ 4. **For database-heavy features**
86
+ - Use Supabase MCP to verify table schemas
87
+ - Check proposed types match database columns
88
+
89
+ 5. **For complex features (>5 AC items)**
90
+ - Use Sequential Thinking to break down systematically
91
+ - Document key decision points and trade-offs
92
+
93
+ ## Output Structure
94
+
95
+ ### 1. AC Checklist with Verification Criteria
96
+
97
+ Restate AC as a checklist with verification for each:
98
+
99
+ ```markdown
100
+ ### AC-1: [Description]
101
+
102
+ **Verification Method:** Unit Test | Integration Test | Manual Test | Browser Test
103
+
104
+ **Test Scenario:**
105
+ - Given: [Initial state]
106
+ - When: [Action taken]
107
+ - Then: [Expected outcome]
108
+
109
+ **Integration Points:**
110
+ - [External system or component]
111
+
112
+ **Assumptions to Validate:**
113
+ - [ ] [Assumption that must be true]
114
+ ```
115
+
116
+ See [verification-criteria.md](references/verification-criteria.md) for detailed examples including the #452 hooks failure case.
117
+
118
+ ### 2. Implementation Plan
119
+
120
+ Propose a concrete plan in 3–7 steps that:
121
+ - References specific codebase areas
122
+ - Respects existing architecture
123
+ - Groups related work into phases
124
+ - Identifies dependencies between steps
125
+
126
+ For each major decision:
127
+ - Present 2-3 options when relevant
128
+ - Recommend a default with rationale
129
+ - Note if decision should be deferred
130
+
131
+ **Open Questions Format:**
132
+ - Question: [Clear question]
133
+ - Recommendation: [Your suggested default]
134
+ - Impact: [What happens if we get this wrong]
135
+
136
+ See [parallel-groups.md](references/parallel-groups.md) for parallelization format.
137
+
138
+ ### 3. Plan Review
139
+
140
+ Ask the user to confirm or adjust:
141
+ - The AC checklist (with verification criteria)
142
+ - The implementation plan
143
+ - The assumptions to validate
144
+
145
+ **Do NOT start implementation** - this is planning-only.
146
+
147
+ ### 4. Issue Comment Draft
148
+
149
+ Generate a Markdown snippet with:
150
+ - AC checklist with verification criteria
151
+ - Verification methods summary
152
+ - Consolidated assumptions checklist
153
+ - Implementation plan with phases
154
+ - Key decisions and rationale
155
+ - Open questions with recommendations
156
+ - Effort breakdown
157
+
158
+ Label clearly as:
159
+ ```md
160
+ --- DRAFT GITHUB ISSUE COMMENT (PLAN) ---
161
+ ```
162
+
163
+ ### 5. Update GitHub Issue
164
+
165
+ Post the draft comment to GitHub:
166
+ ```bash
167
+ gh issue comment <issue-number> --body "..."
168
+ gh issue edit <issue-number> --add-label "planned"
169
+ ```
@@ -0,0 +1,72 @@
1
+ # Parallel Groups for Implementation
2
+
3
+ When the implementation involves 3+ independent tasks that could be parallelized, include a `## Parallel Groups` section to enable `/exec` to run them concurrently. This can reduce execution time by 50-70%.
4
+
5
+ ## When to Include Parallel Groups
6
+
7
+ - Creating multiple independent files (types, migrations, components)
8
+ - Tasks that don't share dependencies
9
+ - Issues with 5+ implementation steps
10
+
11
+ ## Dependency Analysis Rules
12
+
13
+ - **Group 1 (no dependencies):** Tasks that create new files without importing from other new files
14
+ - **Group 2+ (depends on previous):** Tasks that import from files created in earlier groups
15
+ - **Sequential (final):** Tests, integration work, and tasks that depend on multiple groups
16
+
17
+ ## File-Level Heuristics
18
+
19
+ - `types/*.ts` → Usually Group 1 (no imports from other new files)
20
+ - `migrations/*.sql` → Usually Group 1 (independent of TypeScript)
21
+ - `lib/services/*.ts` → Group 2 if they import new types
22
+ - `components/*.tsx` → Group 2 if they import new types/services
23
+ - `app/**/*.tsx` → Sequential (integrates components)
24
+ - `__tests__/*.ts` → Sequential (tests all the above)
25
+
26
+ ## Model Selection
27
+
28
+ Include a `[model: haiku]` or `[model: sonnet]` annotation at the end of each task line:
29
+
30
+ | Task Type | Recommended Model |
31
+ |-----------|------------------|
32
+ | Single file, explicit path | `[model: haiku]` |
33
+ | New file with template | `[model: haiku]` |
34
+ | <5 lines changed | `[model: haiku]` |
35
+ | Edit requiring context | `[model: sonnet]` |
36
+ | Multiple related files | `[model: sonnet]` |
37
+ | Refactoring | `[model: sonnet]` |
38
+ | Import/dependency changes | `[model: sonnet]` |
39
+
40
+ ## Format Example
41
+
42
+ ```markdown
43
+ ## Parallel Groups
44
+
45
+ ### Group 1 (no dependencies)
46
+ - [ ] Create `types/metrics.ts` with MetricEvent interface [model: haiku]
47
+ - [ ] Add `migrations/add_metrics_table.sql` [model: haiku]
48
+
49
+ ### Group 2 (depends on Group 1)
50
+ - [ ] Create `lib/services/metrics-service.ts` [model: haiku]
51
+ - [ ] Refactor `lib/hooks/useMetrics.ts` to use new service [model: sonnet]
52
+
53
+ ### Sequential (depends on Group 2)
54
+ - [ ] Integrate into `app/shops/[slug]/page.tsx`
55
+ - [ ] Add tests in `__tests__/metrics.test.ts`
56
+ ```
57
+
58
+ ## Important Rules
59
+
60
+ - Maximum 3 parallel tasks per group (prevents resource exhaustion)
61
+ - If all tasks are sequential, omit this section entirely
62
+ - `/exec` will fall back to sequential execution if this section is missing
63
+ - If no model annotation is provided, `/exec` defaults to haiku
64
+ - Use `CLAUDE_PARALLEL_MODEL=sonnet` env var to override all annotations
65
+
66
+ ## No Parallel Groups
67
+
68
+ If the implementation is purely sequential, don't add this section. Examples:
69
+ - Bug fixes affecting a single file
70
+ - Simple additions to existing components
71
+ - Config changes
72
+ - Documentation updates
@@ -0,0 +1,104 @@
1
+ # Verification Criteria Guide
2
+
3
+ ## Why Verification Criteria Matter
4
+
5
+ The #452 hooks issue passed all workflow phases but failed in production because we didn't validate the assumption "Claude Code passes data via stdin JSON" until after implementation.
6
+
7
+ Verification criteria force you to:
8
+ - Define HOW to verify each AC works (not just WHAT to build)
9
+ - List assumptions explicitly so they can be validated BEFORE coding
10
+ - Identify integration points that need testing
11
+
12
+ ## Verification Method Guidelines
13
+
14
+ | Method | Use When | Example |
15
+ |--------|----------|---------|
16
+ | **Unit Test** | Pure logic, utilities, helpers | `formatCurrency()`, `validateEmail()` |
17
+ | **Integration Test** | External APIs, database, file system | Hook scripts, Supabase queries |
18
+ | **Browser Test** | UI interactions, forms, modals | Admin dashboard, form validation |
19
+ | **Manual Test** | One-time setup, visual verification | Deployment checks, design review |
20
+ | **N/A - Trivial** | Config changes, simple renames | Env var addition, label change |
21
+
22
+ ## If Verification Method Unclear
23
+
24
+ - Add a warning: `⚠️ Verification unclear - consider breaking down this AC`
25
+ - Ask clarifying questions before proceeding
26
+ - Default to "Manual Test" with explicit steps if truly simple
27
+
28
+ ## Example: How Verification Criteria Would Have Caught #452
29
+
30
+ ### Original AC (no verification criteria)
31
+
32
+ ```markdown
33
+ AC-1: Timing logs capture start/end of each tool call
34
+ ```
35
+
36
+ ### Enhanced AC (with verification criteria)
37
+
38
+ ```markdown
39
+ ### AC-1: Timing logs capture start/end of each tool call
40
+
41
+ **Verification Method:** Integration Test
42
+
43
+ **Test Scenario:**
44
+ - Given: Claude Code session with hooks enabled
45
+ - When: Any tool is invoked (e.g., Edit, Read)
46
+ - Then: /tmp/claude-timing.log contains START and END with tool name and timestamp
47
+
48
+ **Integration Points:**
49
+ - Claude Code hook system (stdin JSON input)
50
+ - File system (/tmp directory)
51
+
52
+ **Assumptions to Validate:**
53
+ - [ ] Claude Code passes tool data via stdin JSON (NOT env vars) ← WOULD HAVE CAUGHT THE BUG
54
+ - [ ] stdin JSON contains tool_name field
55
+ - [ ] stdin JSON contains tool_input field
56
+ - [ ] Hook can parse JSON with jq
57
+ - [ ] Hook has write permission to /tmp
58
+ ```
59
+
60
+ The assumption "Claude Code passes tool data via stdin JSON" would have been explicitly listed, forcing validation BEFORE implementation. The bug would have been caught at planning time, not after 3 merged PRs.
61
+
62
+ ## Verification Summary Template
63
+
64
+ Use this format in the issue comment:
65
+
66
+ ```markdown
67
+ ## Verification Summary
68
+
69
+ | AC | Verification Method | Key Assumption |
70
+ |----|---------------------|----------------|
71
+ | AC-1 | Integration Test | stdin JSON format |
72
+ | AC-2 | Unit Test | None |
73
+ | AC-3 | Browser Test | Modal renders correctly |
74
+
75
+ ### Assumptions to Validate (Before Implementation)
76
+ - [ ] [Assumption from AC-1]
77
+ - [ ] [Assumption from AC-3]
78
+ ```
79
+
80
+ ## Common Assumptions to Validate
81
+
82
+ **For API Integrations:**
83
+ - Response format matches documentation
84
+ - Authentication method works as expected
85
+ - Error codes are handled appropriately
86
+ - Rate limits are within acceptable bounds
87
+
88
+ **For Database Features:**
89
+ - Table schema matches TypeScript types
90
+ - RLS policies allow required access
91
+ - Indexes exist for query patterns
92
+ - Foreign key relationships are correct
93
+
94
+ **For UI Features:**
95
+ - Component renders without hydration mismatch
96
+ - Mobile/desktop breakpoints work correctly
97
+ - Loading states display properly
98
+ - Error states show appropriate messages
99
+
100
+ **For External Integrations:**
101
+ - Environment variables are set correctly
102
+ - Network connectivity works in all environments
103
+ - Timeouts are appropriate
104
+ - Fallback behavior is defined