sequant 2.0.1 → 2.1.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 (58) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/dist/bin/cli.js +2 -1
  4. package/dist/marketplace/external_plugins/sequant/.claude-plugin/plugin.json +1 -1
  5. package/dist/marketplace/external_plugins/sequant/.mcp.json +6 -0
  6. package/dist/marketplace/external_plugins/sequant/README.md +58 -8
  7. package/dist/marketplace/external_plugins/sequant/hooks/post-tool.sh +19 -8
  8. package/dist/marketplace/external_plugins/sequant/hooks/pre-tool.sh +36 -49
  9. package/dist/marketplace/external_plugins/sequant/skills/_shared/references/subagent-types.md +158 -48
  10. package/dist/marketplace/external_plugins/sequant/skills/assess/SKILL.md +354 -352
  11. package/dist/marketplace/external_plugins/sequant/skills/exec/SKILL.md +1155 -33
  12. package/dist/marketplace/external_plugins/sequant/skills/fullsolve/SKILL.md +35 -4
  13. package/dist/marketplace/external_plugins/sequant/skills/qa/SKILL.md +2157 -104
  14. package/dist/marketplace/external_plugins/sequant/skills/qa/scripts/quality-checks.sh +1 -1
  15. package/dist/marketplace/external_plugins/sequant/skills/setup/SKILL.md +386 -0
  16. package/dist/marketplace/external_plugins/sequant/skills/solve/SKILL.md +38 -664
  17. package/dist/marketplace/external_plugins/sequant/skills/spec/SKILL.md +505 -120
  18. package/dist/marketplace/external_plugins/sequant/skills/test/SKILL.md +246 -1
  19. package/dist/marketplace/external_plugins/sequant/skills/testgen/SKILL.md +138 -1
  20. package/dist/src/commands/dashboard.js +1 -1
  21. package/dist/src/commands/doctor.js +1 -1
  22. package/dist/src/commands/init.js +10 -10
  23. package/dist/src/commands/logs.js +1 -1
  24. package/dist/src/commands/run.js +49 -39
  25. package/dist/src/commands/state.js +3 -3
  26. package/dist/src/commands/status.js +5 -5
  27. package/dist/src/commands/sync.js +8 -8
  28. package/dist/src/commands/update.js +16 -16
  29. package/dist/src/lib/cli-ui.js +20 -19
  30. package/dist/src/lib/merge-check/index.js +2 -2
  31. package/dist/src/lib/settings.d.ts +8 -0
  32. package/dist/src/lib/settings.js +1 -0
  33. package/dist/src/lib/shutdown.js +1 -1
  34. package/dist/src/lib/templates.js +2 -0
  35. package/dist/src/lib/wizard.js +6 -4
  36. package/dist/src/lib/workflow/batch-executor.js +1 -1
  37. package/dist/src/lib/workflow/log-writer.js +6 -6
  38. package/dist/src/lib/workflow/metrics-writer.js +5 -3
  39. package/dist/src/lib/workflow/phase-executor.js +5 -1
  40. package/dist/src/lib/workflow/platforms/github.js +5 -1
  41. package/dist/src/lib/workflow/state-cleanup.js +1 -1
  42. package/dist/src/lib/workflow/state-manager.js +15 -13
  43. package/dist/src/lib/workflow/state-rebuild.js +2 -2
  44. package/dist/src/lib/workflow/types.d.ts +11 -0
  45. package/dist/src/lib/workflow/worktree-manager.js +40 -41
  46. package/dist/src/lib/worktree-isolation.d.ts +130 -0
  47. package/dist/src/lib/worktree-isolation.js +310 -0
  48. package/package.json +8 -8
  49. package/templates/agents/sequant-explorer.md +23 -0
  50. package/templates/agents/sequant-implementer.md +18 -0
  51. package/templates/agents/sequant-qa-checker.md +24 -0
  52. package/templates/agents/sequant-testgen.md +25 -0
  53. package/templates/scripts/cleanup-worktree.sh +18 -0
  54. package/templates/skills/_shared/references/subagent-types.md +158 -48
  55. package/templates/skills/exec/SKILL.md +72 -6
  56. package/templates/skills/qa/SKILL.md +8 -217
  57. package/templates/skills/spec/SKILL.md +446 -120
  58. package/templates/skills/testgen/SKILL.md +138 -1
@@ -1,10 +1,10 @@
1
1
  # Claude Code Subagent Types
2
2
 
3
- Reference for valid subagent types when spawning agents via the `Task` tool.
3
+ Reference for valid subagent types when spawning agents via the `Agent` tool.
4
4
 
5
- ## Valid Types
5
+ ## Built-in Types
6
6
 
7
- Claude Code supports exactly **4 subagent types**:
7
+ Claude Code supports exactly **4 built-in subagent types**:
8
8
 
9
9
  | Type | Purpose | Tools Available |
10
10
  |------|---------|-----------------|
@@ -13,55 +13,122 @@ Claude Code supports exactly **4 subagent types**:
13
13
  | `Explore` | Codebase exploration, file search, pattern finding | Read-only tools |
14
14
  | `Plan` | Architecture planning, implementation design | Read-only tools |
15
15
 
16
- ## When to Use Each
16
+ ## Custom Agents (Sequant)
17
17
 
18
- ### `Bash`
19
- Best for: Single command execution, git operations, build commands
18
+ Sequant defines **4 custom agents** in `.claude/agents/`. These centralize model, permissions, effort, and tool restrictions that were previously duplicated inline.
19
+
20
+ | Agent Name | Based On | Model | Permission Mode | Used By |
21
+ |------------|----------|-------|-----------------|---------|
22
+ | `sequant-explorer` | Explore | haiku | (default) | `/spec` |
23
+ | `sequant-qa-checker` | general-purpose | haiku | bypassPermissions | `/qa` |
24
+ | `sequant-implementer` | general-purpose | (inherits) | bypassPermissions | `/exec` |
25
+ | `sequant-testgen` | general-purpose | haiku | (default) | `/testgen` |
26
+
27
+ ### sequant-explorer
28
+
29
+ Read-only codebase exploration for the `/spec` phase. No Bash, Edit, or Write access.
20
30
 
21
31
  ```
22
- Task(subagent_type="Bash", prompt="Run npm test and report results")
32
+ Agent(subagent_type="sequant-explorer",
33
+ prompt="Find similar features in components/. Report patterns.")
23
34
  ```
24
35
 
25
- ### `general-purpose`
26
- Best for: Implementation tasks, quality checks, multi-file operations
36
+ ### sequant-qa-checker
37
+
38
+ Quality check agent for the `/qa` phase. Has `bypassPermissions` for Bash access (git diff, npm test). Effort: low.
27
39
 
28
40
  ```
29
- Task(subagent_type="general-purpose",
41
+ Agent(subagent_type="sequant-qa-checker",
30
42
  prompt="Run type safety checks on the diff. Report: type issues, verdict.")
31
43
  ```
32
44
 
33
- **Use cases:**
34
- - Quality checks (type safety, security scan, scope analysis)
35
- - Implementation tasks requiring edits
36
- - Tasks needing both file reading and command execution
45
+ ### sequant-implementer
46
+
47
+ Implementation agent for `/exec` parallel groups. Inherits model from parent (user-configurable). Has `bypassPermissions` for full tool access.
48
+
49
+ ```
50
+ Agent(subagent_type="sequant-implementer",
51
+ prompt="Implement the UserCard component in components/admin/...")
52
+ ```
53
+
54
+ ### sequant-testgen
37
55
 
38
- ### `Explore`
39
- Best for: Codebase search, pattern discovery, schema inspection
56
+ Test stub generator for the `/testgen` phase. Has Write access but no Bash access.
40
57
 
41
58
  ```
42
- Task(subagent_type="Explore",
43
- prompt="Find similar components in components/admin/. Report patterns.")
59
+ Agent(subagent_type="sequant-testgen",
60
+ prompt="Generate test stubs for AC-1: User authentication...")
61
+ ```
62
+
63
+ ### Agent Definition Location
64
+
65
+ Custom agents are defined in `.claude/agents/*.md` with YAML frontmatter:
66
+
67
+ ```markdown
68
+ ---
69
+ name: sequant-qa-checker
70
+ description: Quality check agent for sequant QA phase.
71
+ model: haiku
72
+ permissionMode: bypassPermissions
73
+ effort: low
74
+ maxTurns: 15
75
+ tools:
76
+ - Read
77
+ - Grep
78
+ - Glob
79
+ - Bash
80
+ - Edit
81
+ ---
82
+
83
+ [Agent behavioral instructions here]
84
+ ```
85
+
86
+ ### Agent Resolution Priority
87
+
88
+ Claude Code resolves agent names in this order:
89
+ 1. Managed settings
90
+ 2. `--agents` CLI flag
91
+ 3. `.claude/agents/` (project-level) — sequant's agents live here
92
+ 4. `~/.claude/agents/` (user-level) — users can override here
93
+ 5. Plugin agents
94
+
95
+ ## When to Use Each
96
+
97
+ ### Built-in `Bash`
98
+ Best for: Single command execution, git operations, build commands
99
+
100
+ ```
101
+ Agent(subagent_type="Bash", prompt="Run npm test and report results")
102
+ ```
103
+
104
+ ### Built-in `general-purpose`
105
+ Best for: Custom tasks that don't fit a sequant agent profile
106
+
107
+ ```
108
+ Agent(subagent_type="general-purpose",
109
+ prompt="Analyze the error logs and suggest fixes.")
44
110
  ```
45
111
 
46
112
  **Use cases:**
47
- - Finding existing patterns before implementing new features
48
- - Searching for file locations
49
- - Understanding codebase structure
50
- - Schema and database inspection
113
+ - One-off tasks outside the sequant workflow
114
+ - Tasks needing a specific model/permission combination
51
115
 
52
- ### `Plan`
116
+ ### Built-in `Explore`
117
+ Best for: Ad-hoc codebase search outside the `/spec` workflow
118
+
119
+ ```
120
+ Agent(subagent_type="Explore",
121
+ prompt="Find all API routes in the project.")
122
+ ```
123
+
124
+ ### Built-in `Plan`
53
125
  Best for: Designing implementation approaches, architectural decisions
54
126
 
55
127
  ```
56
- Task(subagent_type="Plan",
128
+ Agent(subagent_type="Plan",
57
129
  prompt="Design the implementation approach for adding user auth.")
58
130
  ```
59
131
 
60
- **Use cases:**
61
- - Creating implementation plans
62
- - Evaluating architectural trade-offs
63
- - Breaking down complex features
64
-
65
132
  ## Model Selection
66
133
 
67
134
  | Model | When to Use | Cost |
@@ -72,60 +139,103 @@ Task(subagent_type="Plan",
72
139
 
73
140
  **Default:** Use `haiku` unless the task requires deep reasoning.
74
141
 
142
+ Custom agents set their model in the agent definition, so you don't need to specify it inline:
143
+
75
144
  ```
76
- Task(subagent_type="general-purpose",
77
- model="haiku",
145
+ # Model comes from .claude/agents/sequant-qa-checker.md (haiku)
146
+ Agent(subagent_type="sequant-qa-checker",
78
147
  prompt="...")
79
148
  ```
80
149
 
81
150
  ## Common Patterns
82
151
 
83
- ### Parallel Quality Checks
152
+ ### Parallel Quality Checks (via /qa)
84
153
  ```
85
- Task(subagent_type="general-purpose", model="haiku",
154
+ Agent(subagent_type="sequant-qa-checker",
86
155
  prompt="Check type safety on diff vs main. Report issues count.")
87
156
 
88
- Task(subagent_type="general-purpose", model="haiku",
157
+ Agent(subagent_type="sequant-qa-checker",
89
158
  prompt="Check for deleted tests in diff. Report count.")
90
159
 
91
- Task(subagent_type="general-purpose", model="haiku",
160
+ Agent(subagent_type="sequant-qa-checker",
92
161
  prompt="Run security scan on changed files. Report findings.")
93
162
  ```
94
163
 
95
- ### Context Gathering (Spec Phase)
164
+ ### Context Gathering (via /spec)
96
165
  ```
97
- Task(subagent_type="Explore", model="haiku",
166
+ Agent(subagent_type="sequant-explorer",
98
167
  prompt="Find similar features in components/. Report patterns.")
99
168
 
100
- Task(subagent_type="Explore", model="haiku",
169
+ Agent(subagent_type="sequant-explorer",
101
170
  prompt="Explore database schema for user tables. Report structure.")
102
171
  ```
103
172
 
104
- ### Background Execution
173
+ ### Background Execution (via /exec)
105
174
  ```
106
- Task(subagent_type="general-purpose",
107
- model="haiku",
175
+ Agent(subagent_type="sequant-implementer",
108
176
  run_in_background=true,
109
177
  prompt="Implement the UserCard component...")
110
178
  ```
111
179
 
112
180
  Use `TaskOutput(task_id="...", block=true)` to wait for completion.
113
181
 
182
+ **IMPORTANT: Background agents and permissions**
183
+
184
+ Background agents cannot prompt for permission interactively. Custom agents with
185
+ `permissionMode: bypassPermissions` in their definition handle this automatically.
186
+ For built-in types, set `mode` explicitly when spawning background agents.
187
+
188
+ ### Permission Mode Reference
189
+
190
+ | Mode | Edit/Write | Bash | When to Use |
191
+ |------|------------|------|-------------|
192
+ | `"acceptEdits"` | ✅ Auto-approved | ❌ **Denied** (prompts) | File-editing agents that don't need Bash |
193
+ | `"bypassPermissions"` | ✅ Auto-approved | ✅ Auto-approved | **Agents that need Bash** (quality checks, git commands) |
194
+ | (omitted) | ❌ Prompts | ❌ Prompts | Only if parent already auto-approves |
195
+
196
+ **Note:** Sequant's custom agents (`sequant-qa-checker`, `sequant-implementer`) have
197
+ `permissionMode` set in their agent definitions, so you don't need to specify `mode`
198
+ inline when spawning them.
199
+
200
+ ### Choosing the Right Agent
201
+
202
+ | Task | Recommended Agent | Why |
203
+ |------|-------------------|-----|
204
+ | Quality checks (git diff, npm test) | `sequant-qa-checker` | bypassPermissions + haiku + effort:low |
205
+ | Codebase exploration | `sequant-explorer` | Read-only, haiku, focused tools |
206
+ | Implementation subtask | `sequant-implementer` | Full access, inherits model |
207
+ | Test stub generation | `sequant-testgen` | Write access, no Bash, haiku |
208
+ | One-off custom task | `general-purpose` | Flexible, specify model/mode inline |
209
+
210
+ **CRITICAL:** If your background agent runs `git diff`, `npm test`, `git status`, or any shell command, use `sequant-qa-checker` or `sequant-implementer` (both have bypassPermissions). Do NOT use `general-purpose` without `mode="bypassPermissions"` — Bash calls will silently fail.
211
+
212
+ ### Security Considerations
213
+
214
+ `bypassPermissions` is safe when:
215
+ - Agent only reads/analyzes (quality checks, security scans)
216
+ - Agent runs in an isolated worktree
217
+ - Agent output is reviewed before any further action
218
+
219
+ `bypassPermissions` requires caution when:
220
+ - Agent could write to production files
221
+ - Agent could push to remote repositories
222
+ - Agent has access to secrets or credentials
223
+
114
224
  ## Invalid Types (Do Not Use)
115
225
 
116
226
  These types do **not exist** and will cause silent failures:
117
227
 
118
- - ~~`quality-checker`~~ → Use `general-purpose`
119
- - ~~`pattern-scout`~~ → Use `Explore`
120
- - ~~`schema-inspector`~~ → Use `Explore`
121
- - ~~`code-reviewer`~~ → Use `general-purpose`
122
- - ~~`implementation`~~ → Use `general-purpose`
228
+ - ~~`quality-checker`~~ → Use `sequant-qa-checker` or `general-purpose`
229
+ - ~~`pattern-scout`~~ → Use `sequant-explorer` or `Explore`
230
+ - ~~`schema-inspector`~~ → Use `sequant-explorer` or `Explore`
231
+ - ~~`code-reviewer`~~ → Use `sequant-qa-checker` or `general-purpose`
232
+ - ~~`implementation`~~ → Use `sequant-implementer` or `general-purpose`
123
233
 
124
234
  See issue #170 for context on this fix.
125
235
 
126
236
  ## References
127
237
 
128
- - [Claude Code Task Tool Documentation](https://docs.anthropic.com/claude-code)
129
- - [Prompt Templates](./prompt-templates.md) - Task-specific prompt templates for sub-agents
238
+ - [Claude Code Custom Subagents](https://code.claude.com/docs/en/sub-agents)
239
+ - Agent definitions: `.claude/agents/*.md`
130
240
  - `/exec` skill parallel execution: `templates/skills/exec/SKILL.md`
131
241
  - `/qa` skill quality checks: `templates/skills/qa/SKILL.md`