compound-workflow 0.1.1
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 +11 -0
- package/.claude-plugin/plugin.json +12 -0
- package/.cursor-plugin/plugin.json +12 -0
- package/README.md +155 -0
- package/package.json +22 -0
- package/scripts/install-cli.mjs +313 -0
- package/scripts/sync-into-repo.sh +103 -0
- package/src/.agents/agents/research/best-practices-researcher.md +132 -0
- package/src/.agents/agents/research/framework-docs-researcher.md +134 -0
- package/src/.agents/agents/research/git-history-analyzer.md +62 -0
- package/src/.agents/agents/research/learnings-researcher.md +288 -0
- package/src/.agents/agents/research/repo-research-analyst.md +146 -0
- package/src/.agents/agents/review/agent-native-reviewer.md +299 -0
- package/src/.agents/agents/workflow/bug-reproduction-validator.md +87 -0
- package/src/.agents/agents/workflow/lint.md +20 -0
- package/src/.agents/agents/workflow/spec-flow-analyzer.md +149 -0
- package/src/.agents/commands/assess.md +60 -0
- package/src/.agents/commands/install.md +53 -0
- package/src/.agents/commands/metrics.md +59 -0
- package/src/.agents/commands/setup.md +9 -0
- package/src/.agents/commands/sync.md +9 -0
- package/src/.agents/commands/test-browser.md +393 -0
- package/src/.agents/commands/workflow/brainstorm.md +252 -0
- package/src/.agents/commands/workflow/compound.md +142 -0
- package/src/.agents/commands/workflow/plan.md +737 -0
- package/src/.agents/commands/workflow/review-v2.md +148 -0
- package/src/.agents/commands/workflow/review.md +110 -0
- package/src/.agents/commands/workflow/triage.md +54 -0
- package/src/.agents/commands/workflow/work.md +439 -0
- package/src/.agents/references/README.md +12 -0
- package/src/.agents/references/standards/README.md +9 -0
- package/src/.agents/scripts/self-check.mjs +227 -0
- package/src/.agents/scripts/sync-opencode.mjs +355 -0
- package/src/.agents/skills/agent-browser/SKILL.md +223 -0
- package/src/.agents/skills/audit-traceability/SKILL.md +260 -0
- package/src/.agents/skills/brainstorming/SKILL.md +250 -0
- package/src/.agents/skills/compound-docs/SKILL.md +533 -0
- package/src/.agents/skills/compound-docs/assets/critical-pattern-template.md +34 -0
- package/src/.agents/skills/compound-docs/assets/resolution-template.md +97 -0
- package/src/.agents/skills/compound-docs/references/yaml-schema.md +87 -0
- package/src/.agents/skills/compound-docs/schema.project.yaml +18 -0
- package/src/.agents/skills/compound-docs/schema.yaml +119 -0
- package/src/.agents/skills/data-foundations/SKILL.md +185 -0
- package/src/.agents/skills/document-review/SKILL.md +108 -0
- package/src/.agents/skills/file-todos/SKILL.md +177 -0
- package/src/.agents/skills/file-todos/assets/todo-template.md +106 -0
- package/src/.agents/skills/financial-workflow-integrity/SKILL.md +423 -0
- package/src/.agents/skills/git-worktree/SKILL.md +268 -0
- package/src/.agents/skills/pii-protection-prisma/SKILL.md +629 -0
- package/src/.agents/skills/process-metrics/SKILL.md +46 -0
- package/src/.agents/skills/process-metrics/assets/daily-template.md +37 -0
- package/src/.agents/skills/process-metrics/assets/monthly-template.md +21 -0
- package/src/.agents/skills/process-metrics/assets/weekly-template.md +25 -0
- package/src/.agents/skills/technical-review/SKILL.md +83 -0
- package/src/AGENTS.md +213 -0
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-browser
|
|
3
|
+
description: Run browser tests on pages affected by current PR or branch
|
|
4
|
+
argument-hint: "[PR number, branch name, or 'current' for current branch]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Browser Test Command
|
|
8
|
+
|
|
9
|
+
<command_purpose>Run end-to-end browser tests on pages affected by a PR or branch changes using agent-browser CLI.</command_purpose>
|
|
10
|
+
|
|
11
|
+
## CRITICAL: Use agent-browser CLI Only
|
|
12
|
+
|
|
13
|
+
Do not use browser MCP automation tools.
|
|
14
|
+
|
|
15
|
+
This command uses the `agent-browser` CLI exclusively. The agent-browser CLI is a Bash-based tool from Vercel that runs headless Chromium. It is NOT the same as Chrome browser automation via MCP.
|
|
16
|
+
|
|
17
|
+
If you find yourself reaching for browser automation tools outside of `agent-browser`, STOP. Use `agent-browser` Bash commands instead.
|
|
18
|
+
|
|
19
|
+
## Guardrails
|
|
20
|
+
|
|
21
|
+
- Use the agent-browser CLI only; do not use other browser automation (e.g. MCP).
|
|
22
|
+
- Do not modify application code; validate only (run tests, capture snapshots, report).
|
|
23
|
+
|
|
24
|
+
## Introduction
|
|
25
|
+
|
|
26
|
+
<role>QA Engineer specializing in browser-based end-to-end testing</role>
|
|
27
|
+
|
|
28
|
+
This command tests affected pages in a real browser, catching issues that unit tests miss:
|
|
29
|
+
- JavaScript integration bugs
|
|
30
|
+
- CSS/layout regressions
|
|
31
|
+
- User workflow breakages
|
|
32
|
+
- Console errors
|
|
33
|
+
|
|
34
|
+
## Prerequisites
|
|
35
|
+
|
|
36
|
+
<requirements>
|
|
37
|
+
- Local development server running (use your repo's dev command)
|
|
38
|
+
- agent-browser CLI installed (see Setup below)
|
|
39
|
+
- Git repository with changes to test
|
|
40
|
+
</requirements>
|
|
41
|
+
|
|
42
|
+
Portability notes:
|
|
43
|
+
|
|
44
|
+
- If `gh` is unavailable, use `current` mode and derive changed files from `git diff`.
|
|
45
|
+
- If the default branch is not `main`, use `default_branch` from the Repo Config Block in `AGENTS.md` or fall back to `master`.
|
|
46
|
+
- If the dev server URL is not `http://localhost:3000`, use `dev_server_url` from the Repo Config Block in `AGENTS.md`.
|
|
47
|
+
|
|
48
|
+
Branching note:
|
|
49
|
+
|
|
50
|
+
- Prefer testing the branch you are currently on.
|
|
51
|
+
- Only switch branches (or create a worktree) when the user explicitly asks to test a different branch/PR.
|
|
52
|
+
|
|
53
|
+
## Setup
|
|
54
|
+
|
|
55
|
+
**Check installation:**
|
|
56
|
+
```bash
|
|
57
|
+
command -v agent-browser >/dev/null 2>&1 && echo "Installed" || echo "NOT INSTALLED"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Install if needed:**
|
|
61
|
+
```bash
|
|
62
|
+
npm install -g agent-browser
|
|
63
|
+
agent-browser install # Downloads Chromium (~160MB)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
See the `agent-browser` skill for detailed usage.
|
|
67
|
+
|
|
68
|
+
## Main Tasks
|
|
69
|
+
|
|
70
|
+
### 0. Resolve Defaults (ALWAYS FIRST)
|
|
71
|
+
|
|
72
|
+
Determine:
|
|
73
|
+
|
|
74
|
+
- Read `AGENTS.md` and look for the "Repo Config Block" YAML.
|
|
75
|
+
- `server_url`: from `dev_server_url`, else default `http://localhost:3000`
|
|
76
|
+
- `default_branch`: from `default_branch`, else try `main`, else `master`
|
|
77
|
+
|
|
78
|
+
Announce:
|
|
79
|
+
|
|
80
|
+
- Server URL you will test against
|
|
81
|
+
- Branch you are currently on
|
|
82
|
+
- How you will determine changed files
|
|
83
|
+
|
|
84
|
+
### 1. Verify agent-browser Installation
|
|
85
|
+
|
|
86
|
+
Before starting ANY browser testing, verify agent-browser is installed:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
command -v agent-browser >/dev/null 2>&1 && echo "Ready" || (echo "Installing..." && npm install -g agent-browser && agent-browser install)
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
If installation fails, inform the user and stop.
|
|
93
|
+
|
|
94
|
+
### 2. Ask Browser Mode
|
|
95
|
+
|
|
96
|
+
<ask_browser_mode>
|
|
97
|
+
|
|
98
|
+
Before starting tests, ask user if they want to watch the browser:
|
|
99
|
+
|
|
100
|
+
Use AskQuestion with:
|
|
101
|
+
- Question: "Do you want to watch the browser tests run?"
|
|
102
|
+
- Options:
|
|
103
|
+
1. **Headed (watch)** - Opens visible browser window so you can see tests run
|
|
104
|
+
2. **Headless (faster)** - Runs in background, faster but invisible
|
|
105
|
+
|
|
106
|
+
Store the choice and use `--headed` flag when user selects "Headed".
|
|
107
|
+
|
|
108
|
+
</ask_browser_mode>
|
|
109
|
+
|
|
110
|
+
### 3. Determine Test Scope
|
|
111
|
+
|
|
112
|
+
<test_target> $ARGUMENTS </test_target>
|
|
113
|
+
|
|
114
|
+
<determine_scope>
|
|
115
|
+
|
|
116
|
+
**If PR number provided:**
|
|
117
|
+
```bash
|
|
118
|
+
gh pr view [number] --json files -q '.files[].path'
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
If `gh` is not available, ask the user for a branch name or use `current`.
|
|
122
|
+
|
|
123
|
+
**If 'current' or empty:**
|
|
124
|
+
|
|
125
|
+
Prefer the upstream tracking branch if available:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
git diff --name-only @{upstream}...HEAD
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
If upstream is not configured, fall back to the configured default branch:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
git diff --name-only "origin/${default_branch}"...HEAD
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
If neither is available, fall back to the last commit:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
git diff --name-only HEAD~1..HEAD
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**If branch name provided:**
|
|
144
|
+
|
|
145
|
+
If you are already on that branch, treat it like `current`.
|
|
146
|
+
|
|
147
|
+
If you are not on that branch, ask whether to switch branches or use a worktree via `git-worktree`.
|
|
148
|
+
|
|
149
|
+
To compute changed files for that branch (once checked out):
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
git diff --name-only "origin/${default_branch}"...HEAD
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
</determine_scope>
|
|
156
|
+
|
|
157
|
+
### 3. Map Files to Routes
|
|
158
|
+
|
|
159
|
+
<file_to_route_mapping>
|
|
160
|
+
|
|
161
|
+
Map changed files to testable routes.
|
|
162
|
+
|
|
163
|
+
This mapping is repo-specific. Prefer project conventions first.
|
|
164
|
+
|
|
165
|
+
If the repo does not have an obvious file->route mapping, ask the user for 3-10 URLs to validate.
|
|
166
|
+
|
|
167
|
+
Examples of starting heuristics:
|
|
168
|
+
|
|
169
|
+
- Backend API changes: validate at least one happy-path request and one error path (if a browser route exists, validate it too).
|
|
170
|
+
- UI component changes: validate at least one page that renders the component.
|
|
171
|
+
- Router changes: validate affected routes directly.
|
|
172
|
+
- Shared layout/styling changes: validate at least the homepage + 1-3 key flows.
|
|
173
|
+
|
|
174
|
+
Build a list of URLs to test based on the mapping.
|
|
175
|
+
|
|
176
|
+
</file_to_route_mapping>
|
|
177
|
+
|
|
178
|
+
### 4. Verify Server is Running
|
|
179
|
+
|
|
180
|
+
<check_server>
|
|
181
|
+
|
|
182
|
+
Before testing, verify the local server is accessible:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
agent-browser open http://localhost:3000
|
|
186
|
+
agent-browser snapshot -i
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
If `dev_server_url` is configured in `AGENTS.md`, use that instead of `http://localhost:3000`.
|
|
190
|
+
|
|
191
|
+
If server is not running, inform user:
|
|
192
|
+
```markdown
|
|
193
|
+
**Server not running**
|
|
194
|
+
|
|
195
|
+
Please start your development server:
|
|
196
|
+
- Use the repo's dev command (see `AGENTS.md` if configured)
|
|
197
|
+
|
|
198
|
+
Then run `/test-browser` again.
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
</check_server>
|
|
202
|
+
|
|
203
|
+
### 5. Test Each Affected Page
|
|
204
|
+
|
|
205
|
+
<test_pages>
|
|
206
|
+
|
|
207
|
+
For each affected route, use agent-browser CLI commands (NOT Chrome MCP):
|
|
208
|
+
|
|
209
|
+
**Step 1: Navigate and capture snapshot**
|
|
210
|
+
```bash
|
|
211
|
+
agent-browser open "http://localhost:3000/[route]"
|
|
212
|
+
agent-browser snapshot -i
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**Step 2: For headed mode (visual debugging)**
|
|
216
|
+
```bash
|
|
217
|
+
agent-browser --headed open "http://localhost:3000/[route]"
|
|
218
|
+
agent-browser --headed snapshot -i
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**Step 3: Verify key elements**
|
|
222
|
+
- Use `agent-browser snapshot -i` to get interactive elements with refs
|
|
223
|
+
- Page title/heading present
|
|
224
|
+
- Primary content rendered
|
|
225
|
+
- No error messages visible
|
|
226
|
+
- Forms have expected fields
|
|
227
|
+
|
|
228
|
+
**Step 4: Test critical interactions**
|
|
229
|
+
```bash
|
|
230
|
+
agent-browser click @e1 # Use ref from snapshot
|
|
231
|
+
agent-browser snapshot -i
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
**Step 5: Take screenshots**
|
|
235
|
+
```bash
|
|
236
|
+
agent-browser screenshot page-name.png
|
|
237
|
+
agent-browser screenshot --full page-name-full.png # Full page
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
</test_pages>
|
|
241
|
+
|
|
242
|
+
### 6. Human Verification (When Required)
|
|
243
|
+
|
|
244
|
+
<human_verification>
|
|
245
|
+
|
|
246
|
+
Pause for human input when testing touches:
|
|
247
|
+
|
|
248
|
+
| Flow Type | What to Ask |
|
|
249
|
+
|-----------|-------------|
|
|
250
|
+
| OAuth | "Please sign in with [provider] and confirm it works" |
|
|
251
|
+
| Email | "Check your inbox for the test email and confirm receipt" |
|
|
252
|
+
| Payments | "Complete a test purchase in sandbox mode" |
|
|
253
|
+
| SMS | "Verify you received the SMS code" |
|
|
254
|
+
| External APIs | "Confirm the [service] integration is working" |
|
|
255
|
+
|
|
256
|
+
Use AskQuestion:
|
|
257
|
+
```markdown
|
|
258
|
+
**Human Verification Needed**
|
|
259
|
+
|
|
260
|
+
This test touches the [flow type]. Please:
|
|
261
|
+
1. [Action to take]
|
|
262
|
+
2. [What to verify]
|
|
263
|
+
|
|
264
|
+
Did it work correctly?
|
|
265
|
+
1. Yes - continue testing
|
|
266
|
+
2. No - describe the issue
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
</human_verification>
|
|
270
|
+
|
|
271
|
+
### 7. Handle Failures
|
|
272
|
+
|
|
273
|
+
<failure_handling>
|
|
274
|
+
|
|
275
|
+
When a test fails:
|
|
276
|
+
|
|
277
|
+
1. **Document the failure:**
|
|
278
|
+
- Screenshot the error state: `agent-browser screenshot error.png`
|
|
279
|
+
- Note the exact reproduction steps
|
|
280
|
+
|
|
281
|
+
2. **Ask user how to proceed:**
|
|
282
|
+
```markdown
|
|
283
|
+
**Test Failed: [route]**
|
|
284
|
+
|
|
285
|
+
Issue: [description]
|
|
286
|
+
Console errors: [if any]
|
|
287
|
+
|
|
288
|
+
How to proceed?
|
|
289
|
+
1. Fix now - I'll help debug and fix
|
|
290
|
+
2. Create todo - Add to todos/ for later
|
|
291
|
+
3. Skip - Continue testing other pages
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
3. **If "Fix now":**
|
|
295
|
+
- Investigate the issue
|
|
296
|
+
- Propose a fix
|
|
297
|
+
- Apply fix
|
|
298
|
+
- Re-run the failing test
|
|
299
|
+
|
|
300
|
+
4. **If "Create todo":**
|
|
301
|
+
- Create `{id}-pending-p1-browser-test-{description}.md`
|
|
302
|
+
- Continue testing
|
|
303
|
+
|
|
304
|
+
5. **If "Skip":**
|
|
305
|
+
- Log as skipped
|
|
306
|
+
- Continue testing
|
|
307
|
+
|
|
308
|
+
</failure_handling>
|
|
309
|
+
|
|
310
|
+
### 8. Test Summary
|
|
311
|
+
|
|
312
|
+
<test_summary>
|
|
313
|
+
|
|
314
|
+
After all tests complete, present summary:
|
|
315
|
+
|
|
316
|
+
```markdown
|
|
317
|
+
## Browser Test Results
|
|
318
|
+
|
|
319
|
+
**Test Scope:** PR #[number] / [branch name]
|
|
320
|
+
**Server:** http://localhost:3000
|
|
321
|
+
|
|
322
|
+
### Pages Tested: [count]
|
|
323
|
+
|
|
324
|
+
| Route | Status | Notes |
|
|
325
|
+
|-------|--------|-------|
|
|
326
|
+
| `/users` | Pass | |
|
|
327
|
+
| `/settings` | Pass | |
|
|
328
|
+
| `/dashboard` | Fail | Console error: [msg] |
|
|
329
|
+
| `/checkout` | Skip | Requires payment credentials |
|
|
330
|
+
|
|
331
|
+
### Console Errors: [count]
|
|
332
|
+
- [List any errors found]
|
|
333
|
+
|
|
334
|
+
### Human Verifications: [count]
|
|
335
|
+
- OAuth flow: Confirmed
|
|
336
|
+
- Email delivery: Confirmed
|
|
337
|
+
|
|
338
|
+
### Failures: [count]
|
|
339
|
+
- `/dashboard` - [issue description]
|
|
340
|
+
|
|
341
|
+
### Created Todos: [count]
|
|
342
|
+
- `005-pending-p1-browser-test-dashboard-error.md`
|
|
343
|
+
|
|
344
|
+
### Result: [PASS / FAIL / PARTIAL]
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
</test_summary>
|
|
348
|
+
|
|
349
|
+
## Quick Usage Examples
|
|
350
|
+
|
|
351
|
+
```bash
|
|
352
|
+
# Test current branch changes
|
|
353
|
+
/test-browser
|
|
354
|
+
|
|
355
|
+
# Test specific PR
|
|
356
|
+
/test-browser 847
|
|
357
|
+
|
|
358
|
+
# Test specific branch
|
|
359
|
+
/test-browser feature/new-dashboard
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
## agent-browser CLI Reference
|
|
363
|
+
|
|
364
|
+
Always use these Bash commands.
|
|
365
|
+
|
|
366
|
+
```bash
|
|
367
|
+
# Navigation
|
|
368
|
+
agent-browser open <url> # Navigate to URL
|
|
369
|
+
agent-browser back # Go back
|
|
370
|
+
agent-browser close # Close browser
|
|
371
|
+
|
|
372
|
+
# Snapshots (get element refs)
|
|
373
|
+
agent-browser snapshot -i # Interactive elements with refs (@e1, @e2, etc.)
|
|
374
|
+
agent-browser snapshot -i --json # JSON output
|
|
375
|
+
|
|
376
|
+
# Interactions (use refs from snapshot)
|
|
377
|
+
agent-browser click @e1 # Click element
|
|
378
|
+
agent-browser fill @e1 "text" # Fill input
|
|
379
|
+
agent-browser type @e1 "text" # Type without clearing
|
|
380
|
+
agent-browser press Enter # Press key
|
|
381
|
+
|
|
382
|
+
# Screenshots
|
|
383
|
+
agent-browser screenshot out.png # Viewport screenshot
|
|
384
|
+
agent-browser screenshot --full out.png # Full page screenshot
|
|
385
|
+
|
|
386
|
+
# Headed mode (visible browser)
|
|
387
|
+
agent-browser --headed open <url> # Open with visible browser
|
|
388
|
+
agent-browser --headed click @e1 # Click in visible browser
|
|
389
|
+
|
|
390
|
+
# Wait
|
|
391
|
+
agent-browser wait @e1 # Wait for element
|
|
392
|
+
agent-browser wait 2000 # Wait milliseconds
|
|
393
|
+
```
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brainstorm
|
|
3
|
+
invocation: workflow:brainstorm
|
|
4
|
+
description: Explore requirements and approaches through collaborative dialogue before planning implementation
|
|
5
|
+
argument-hint: "[feature idea or problem to explore]"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Brainstorm a Feature or Improvement
|
|
9
|
+
|
|
10
|
+
**Note: The current year is 2026.** Use this when dating brainstorm
|
|
11
|
+
documents.
|
|
12
|
+
|
|
13
|
+
Brainstorming helps answer **WHAT** to build through collaborative
|
|
14
|
+
dialogue. It precedes `/workflow:plan`, which answers **HOW** to build
|
|
15
|
+
it.
|
|
16
|
+
|
|
17
|
+
**Process knowledge:** Load the `brainstorming` skill for detailed
|
|
18
|
+
discussion-first facilitation (one-question-then-prompts), approach
|
|
19
|
+
exploration patterns, and YAGNI principles.
|
|
20
|
+
|
|
21
|
+
## Guardrails
|
|
22
|
+
|
|
23
|
+
- Do not write or modify application code.
|
|
24
|
+
- Do not create commits or PRs.
|
|
25
|
+
- Output is the brainstorm document only.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Feature Description
|
|
30
|
+
|
|
31
|
+
<feature_description>#$ARGUMENTS</feature_description>
|
|
32
|
+
|
|
33
|
+
**If the feature description above is empty, ask the user:**\
|
|
34
|
+
"What would you like to explore? Please describe the feature, problem,
|
|
35
|
+
or improvement you're thinking about."
|
|
36
|
+
|
|
37
|
+
Do not proceed until you have a feature description from the user.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Execution Flow
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
### Phase 0: Assess Requirements Clarity
|
|
46
|
+
|
|
47
|
+
Evaluate whether brainstorming is needed based on the feature
|
|
48
|
+
description.
|
|
49
|
+
|
|
50
|
+
**Clear requirements indicators:**
|
|
51
|
+
|
|
52
|
+
- Specific acceptance criteria provided
|
|
53
|
+
- Referenced existing patterns to follow
|
|
54
|
+
- Described exact expected behavior
|
|
55
|
+
- Constrained, well-defined scope
|
|
56
|
+
|
|
57
|
+
**If requirements are already clear:**\
|
|
58
|
+
Use **AskQuestion** to suggest:
|
|
59
|
+
|
|
60
|
+
> "Your requirements seem detailed enough to proceed directly to
|
|
61
|
+
> planning. Should I run `/workflow:plan` instead, or would you like to
|
|
62
|
+
> explore the idea further?"
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
### Phase 1: Understand the Idea
|
|
67
|
+
|
|
68
|
+
#### 1.1 Repository Research (Lightweight)
|
|
69
|
+
|
|
70
|
+
Run a quick repo scan to understand existing patterns:
|
|
71
|
+
|
|
72
|
+
- Task repo-research-analyst("Understand existing patterns related to:
|
|
73
|
+
<feature_description>")
|
|
74
|
+
|
|
75
|
+
Focus on: - Similar features - Established patterns - AGENTS.md guidance
|
|
76
|
+
|
|
77
|
+
Also consider any repo-level guidance files such as `AGENTS.md`.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
#### 1.2 Structured Dialogue Exploration (Default)
|
|
82
|
+
|
|
83
|
+
Engage in collaborative dialogue rather than a rapid question loop.
|
|
84
|
+
|
|
85
|
+
**Critical (non-negotiable):** Default response shape is **synthesize + discussion prompts + assumptions**. Multiple-choice / AskQuestion only for handoffs (Phase 0, Phase 4) or a single blocking question when the user is stuck.
|
|
86
|
+
|
|
87
|
+
**Enforcement rule:** Do **not** use AskQuestion during exploration until **after** at least one full dialogue iteration (Synthesize + discussion prompts + Capture). AskQuestion is only for handoffs or when one focused multiple-choice truly unblocks.
|
|
88
|
+
|
|
89
|
+
**Default cadence (per iteration):**
|
|
90
|
+
|
|
91
|
+
1. **Synthesize Current Understanding** (2--4 bullets)
|
|
92
|
+
2. **Ask at most ONE high-leverage question** (only if needed)
|
|
93
|
+
3. **Surface Tensions & Unknowns** using 3--5 **discussion prompts** (not interrogation)
|
|
94
|
+
4. **Capture Emerging Assumptions** (bullets)
|
|
95
|
+
|
|
96
|
+
**Hard rules:**
|
|
97
|
+
|
|
98
|
+
- Do not ask follow-up questions in the same turn.
|
|
99
|
+
- Ask **no more than one** clarifying question per iteration.
|
|
100
|
+
- If blocked, ask **one** additional clarifying question max, then return to prompts.
|
|
101
|
+
|
|
102
|
+
**First assistant message template (copy/paste shape):**
|
|
103
|
+
|
|
104
|
+
```markdown
|
|
105
|
+
**What I think you're aiming for (so far):**
|
|
106
|
+
- ...
|
|
107
|
+
- ...
|
|
108
|
+
|
|
109
|
+
**One question to anchor us:**
|
|
110
|
+
<single sentence>
|
|
111
|
+
|
|
112
|
+
**Prompts to react to (pick any):**
|
|
113
|
+
- Tradeoff: ...
|
|
114
|
+
- Edge area: ...
|
|
115
|
+
- UX vs architecture: ...
|
|
116
|
+
- Scale implication: ...
|
|
117
|
+
- Short-term vs long-term: ...
|
|
118
|
+
|
|
119
|
+
**Working assumptions (tell me what’s wrong):**
|
|
120
|
+
- ...
|
|
121
|
+
- ...
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
For each iteration:
|
|
125
|
+
|
|
126
|
+
1. **Synthesize Current Understanding**
|
|
127
|
+
|
|
128
|
+
- What the feature appears to be
|
|
129
|
+
- Who it impacts
|
|
130
|
+
- What class of change this is (incremental, foundational, risky, trivial)
|
|
131
|
+
- Implied constraints
|
|
132
|
+
|
|
133
|
+
2. **Ask at most ONE high-leverage question** (only if needed to unblock discussion)
|
|
134
|
+
|
|
135
|
+
3. **Surface Tensions & Unknowns** via 3--5 prompts to react to (not interrogation), such as:
|
|
136
|
+
|
|
137
|
+
- Tradeoff
|
|
138
|
+
- Edge area
|
|
139
|
+
- Scale implication
|
|
140
|
+
- UX vs architecture tension
|
|
141
|
+
- Short-term vs long-term implication
|
|
142
|
+
|
|
143
|
+
4. **Capture Emerging Assumptions** Explicitly note:
|
|
144
|
+
|
|
145
|
+
- Working assumptions
|
|
146
|
+
- Tentative decisions
|
|
147
|
+
- Areas still unresolved
|
|
148
|
+
|
|
149
|
+
5. Continue iteratively until:
|
|
150
|
+
|
|
151
|
+
- Direction is clear
|
|
152
|
+
- Or user says "proceed"
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
#### Targeted Clarification Fallback
|
|
157
|
+
|
|
158
|
+
If ambiguity blocks meaningful progress:
|
|
159
|
+
|
|
160
|
+
- Ask **one** focused, high-leverage clarification question.
|
|
161
|
+
- Only use direct questioning when it is truly blocking meaningful discussion.
|
|
162
|
+
- Avoid serial low-value questioning.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
### Phase 2: Explore Approaches
|
|
167
|
+
|
|
168
|
+
Propose **2--3 concrete approaches** based on research and dialogue.
|
|
169
|
+
|
|
170
|
+
For each approach, provide:
|
|
171
|
+
|
|
172
|
+
- Brief description (2--3 sentences)
|
|
173
|
+
- Pros and cons
|
|
174
|
+
- When it is best suited
|
|
175
|
+
|
|
176
|
+
Lead with your recommendation and explain why. Apply YAGNI --- prefer
|
|
177
|
+
simpler solutions.
|
|
178
|
+
|
|
179
|
+
Use **AskQuestion** to confirm preferred direction if needed.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
### Phase 3: Capture the Design
|
|
184
|
+
|
|
185
|
+
Write a brainstorm document to:
|
|
186
|
+
|
|
187
|
+
docs/brainstorms/YYYY-MM-DD-`<topic>`-brainstorm.md
|
|
188
|
+
|
|
189
|
+
**Document structure must include:**
|
|
190
|
+
|
|
191
|
+
- What We're Building
|
|
192
|
+
- Why This Approach
|
|
193
|
+
- Key Decisions
|
|
194
|
+
- Open Questions
|
|
195
|
+
|
|
196
|
+
Ensure `docs/brainstorms/` exists before writing.
|
|
197
|
+
|
|
198
|
+
**Critical Rule:**\
|
|
199
|
+
Before proceeding to Phase 4, check if Open Questions remain.
|
|
200
|
+
|
|
201
|
+
If Open Questions exist:
|
|
202
|
+
|
|
203
|
+
- Classify each as **blocking** vs **non-blocking**.
|
|
204
|
+
- You MUST ask the user about each **blocking** question.
|
|
205
|
+
- Move resolved questions into a "Resolved Questions" section.
|
|
206
|
+
- Non-blocking questions may remain for planning, but must be clearly stated.
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
### Phase 4: Handoff
|
|
211
|
+
|
|
212
|
+
Use **AskQuestion** to present next steps:
|
|
213
|
+
|
|
214
|
+
**Question:**
|
|
215
|
+
"Brainstorm captured. What would you like to do next?"
|
|
216
|
+
|
|
217
|
+
**Options:**
|
|
218
|
+
|
|
219
|
+
1. Review and refine
|
|
220
|
+
2. Proceed to planning
|
|
221
|
+
3. Ask more questions
|
|
222
|
+
4. Done for now
|
|
223
|
+
|
|
224
|
+
If "Ask more questions" is selected: Return to Phase 1.2 and continue
|
|
225
|
+
structured dialogue.
|
|
226
|
+
|
|
227
|
+
If "Review and refine" is selected: Load the `document-review` skill and
|
|
228
|
+
apply it.
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## Output Summary
|
|
233
|
+
|
|
234
|
+
When complete, display:
|
|
235
|
+
|
|
236
|
+
Brainstorm complete!
|
|
237
|
+
|
|
238
|
+
Document: docs/brainstorms/YYYY-MM-DD-`<topic>`-brainstorm.md
|
|
239
|
+
|
|
240
|
+
Key decisions: - \[Decision 1\] - \[Decision 2\]
|
|
241
|
+
|
|
242
|
+
Next: Run `/workflow:plan` when ready to implement.
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Important Guidelines
|
|
247
|
+
|
|
248
|
+
- Stay focused on WHAT, not HOW
|
|
249
|
+
- Dialogue first; interrogation only when necessary
|
|
250
|
+
- Apply YAGNI
|
|
251
|
+
- Keep outputs concise (200--300 words per section max)
|
|
252
|
+
- NEVER CODE during brainstorming
|