specweave 1.0.356 → 1.0.357
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/bin/specweave.js +21 -1
- package/dist/plugins/specweave-github/lib/duplicate-detector.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/duplicate-detector.js +18 -2
- package/dist/plugins/specweave-github/lib/duplicate-detector.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-feature-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/github-feature-sync.js +10 -0
- package/dist/plugins/specweave-github/lib/github-feature-sync.js.map +1 -1
- package/dist/plugins/specweave-jira/lib/jira-status-sync.d.ts +17 -0
- package/dist/plugins/specweave-jira/lib/jira-status-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-jira/lib/jira-status-sync.js +85 -0
- package/dist/plugins/specweave-jira/lib/jira-status-sync.js.map +1 -1
- package/dist/src/adapters/agents-md-generator.js +1 -1
- package/dist/src/adapters/agents-md-generator.js.map +1 -1
- package/dist/src/adapters/claude-md-generator.js +2 -2
- package/dist/src/adapters/claude-md-generator.js.map +1 -1
- package/dist/src/cli/commands/check-discipline.d.ts.map +1 -1
- package/dist/src/cli/commands/check-discipline.js +2 -1
- package/dist/src/cli/commands/check-discipline.js.map +1 -1
- package/dist/src/cli/commands/create-increment.d.ts.map +1 -1
- package/dist/src/cli/commands/create-increment.js +4 -1
- package/dist/src/cli/commands/create-increment.js.map +1 -1
- package/dist/src/cli/commands/health.d.ts +34 -0
- package/dist/src/cli/commands/health.d.ts.map +1 -0
- package/dist/src/cli/commands/health.js +349 -0
- package/dist/src/cli/commands/health.js.map +1 -0
- package/dist/src/cli/commands/migrate-to-umbrella.d.ts.map +1 -1
- package/dist/src/cli/commands/migrate-to-umbrella.js +38 -0
- package/dist/src/cli/commands/migrate-to-umbrella.js.map +1 -1
- package/dist/src/cli/commands/save.js +1 -1
- package/dist/src/cli/commands/save.js.map +1 -1
- package/dist/src/cli/commands/sync-living-docs.d.ts.map +1 -1
- package/dist/src/cli/commands/sync-living-docs.js +2 -1
- package/dist/src/cli/commands/sync-living-docs.js.map +1 -1
- package/dist/src/cli/commands/sync-progress.d.ts.map +1 -1
- package/dist/src/cli/commands/sync-progress.js +208 -8
- package/dist/src/cli/commands/sync-progress.js.map +1 -1
- package/dist/src/core/ac-progress-sync.d.ts.map +1 -1
- package/dist/src/core/ac-progress-sync.js +13 -4
- package/dist/src/core/ac-progress-sync.js.map +1 -1
- package/dist/src/core/config/types.d.ts +33 -0
- package/dist/src/core/config/types.d.ts.map +1 -1
- package/dist/src/core/config/types.js.map +1 -1
- package/dist/src/core/doctor/checkers/increments-checker.js +2 -2
- package/dist/src/core/doctor/checkers/increments-checker.js.map +1 -1
- package/dist/src/core/hooks/LifecycleHookDispatcher.d.ts.map +1 -1
- package/dist/src/core/hooks/LifecycleHookDispatcher.js +6 -1
- package/dist/src/core/hooks/LifecycleHookDispatcher.js.map +1 -1
- package/dist/src/core/increment/completion-validator.d.ts.map +1 -1
- package/dist/src/core/increment/completion-validator.js +8 -7
- package/dist/src/core/increment/completion-validator.js.map +1 -1
- package/dist/src/core/increment/increment-reopener.d.ts.map +1 -1
- package/dist/src/core/increment/increment-reopener.js +5 -4
- package/dist/src/core/increment/increment-reopener.js.map +1 -1
- package/dist/src/core/increment/metadata-manager.d.ts +5 -6
- package/dist/src/core/increment/metadata-manager.d.ts.map +1 -1
- package/dist/src/core/increment/metadata-manager.js +12 -13
- package/dist/src/core/increment/metadata-manager.js.map +1 -1
- package/dist/src/core/increment/spec-frontmatter-updater.d.ts.map +1 -1
- package/dist/src/core/increment/spec-frontmatter-updater.js +3 -2
- package/dist/src/core/increment/spec-frontmatter-updater.js.map +1 -1
- package/dist/src/core/increment/status-auto-transition.d.ts.map +1 -1
- package/dist/src/core/increment/status-auto-transition.js +5 -4
- package/dist/src/core/increment/status-auto-transition.js.map +1 -1
- package/dist/src/core/increment/status-change-sync-trigger.d.ts.map +1 -1
- package/dist/src/core/increment/status-change-sync-trigger.js +3 -2
- package/dist/src/core/increment/status-change-sync-trigger.js.map +1 -1
- package/dist/src/core/increment/status-commands.d.ts.map +1 -1
- package/dist/src/core/increment/status-commands.js +4 -3
- package/dist/src/core/increment/status-commands.js.map +1 -1
- package/dist/src/core/increment/template-creator.d.ts.map +1 -1
- package/dist/src/core/increment/template-creator.js +49 -5
- package/dist/src/core/increment/template-creator.js.map +1 -1
- package/dist/src/core/lazy-loading/llm-plugin-detector.js +1 -1
- package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.js +16 -6
- package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
- package/dist/src/core/migration/consolidation-engine.d.ts +59 -0
- package/dist/src/core/migration/consolidation-engine.d.ts.map +1 -0
- package/dist/src/core/migration/consolidation-engine.js +177 -0
- package/dist/src/core/migration/consolidation-engine.js.map +1 -0
- package/dist/src/core/migration/types.d.ts +2 -0
- package/dist/src/core/migration/types.d.ts.map +1 -1
- package/dist/src/core/project/project-resolution.d.ts.map +1 -1
- package/dist/src/core/project/project-resolution.js +20 -2
- package/dist/src/core/project/project-resolution.js.map +1 -1
- package/dist/src/generators/spec/spec-parser.js +2 -2
- package/dist/src/generators/spec/spec-parser.js.map +1 -1
- package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
- package/dist/src/integrations/jira/jira-client.js +83 -30
- package/dist/src/integrations/jira/jira-client.js.map +1 -1
- package/dist/src/sync/external-issue-auto-creator.d.ts +6 -2
- package/dist/src/sync/external-issue-auto-creator.d.ts.map +1 -1
- package/dist/src/sync/external-issue-auto-creator.js +75 -19
- package/dist/src/sync/external-issue-auto-creator.js.map +1 -1
- package/dist/src/sync/sync-coordinator.d.ts.map +1 -1
- package/dist/src/sync/sync-coordinator.js +20 -4
- package/dist/src/sync/sync-coordinator.js.map +1 -1
- package/dist/src/sync/sync-target-resolver.d.ts +36 -0
- package/dist/src/sync/sync-target-resolver.d.ts.map +1 -0
- package/dist/src/sync/sync-target-resolver.js +72 -0
- package/dist/src/sync/sync-target-resolver.js.map +1 -0
- package/dist/src/utils/external-tool-drift-detector.js +4 -4
- package/dist/src/utils/external-tool-drift-detector.js.map +1 -1
- package/dist/src/utils/find-project-root.d.ts +26 -0
- package/dist/src/utils/find-project-root.d.ts.map +1 -1
- package/dist/src/utils/find-project-root.js +78 -0
- package/dist/src/utils/find-project-root.js.map +1 -1
- package/dist/src/utils/multi-project-detector.js +1 -1
- package/dist/src/utils/multi-project-detector.js.map +1 -1
- package/package.json +1 -1
- package/plugins/specweave/PLUGIN.md +1 -0
- package/plugins/specweave/lib/vendor/core/increment/metadata-manager.d.ts +5 -6
- package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js +12 -13
- package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js.map +1 -1
- package/plugins/specweave/lib/vendor/core/increment/status-auto-transition.js +5 -4
- package/plugins/specweave/lib/vendor/core/increment/status-auto-transition.js.map +1 -1
- package/plugins/specweave/skills/brainstorm/SKILL.md +619 -0
- package/plugins/specweave-ado/lib/ado-multi-project-sync.js +1 -0
- package/plugins/specweave-docs/PLUGIN.md +1 -1
- package/plugins/specweave-github/lib/duplicate-detector.js +21 -1
- package/plugins/specweave-github/lib/duplicate-detector.ts +18 -2
- package/plugins/specweave-github/lib/github-feature-sync.js +17 -0
- package/plugins/specweave-github/lib/github-feature-sync.ts +11 -0
- package/plugins/specweave-jira/lib/jira-status-sync.js +75 -0
- package/plugins/specweave-jira/lib/jira-status-sync.ts +91 -1
- package/src/templates/CLAUDE.md.template +3 -1
- package/plugins/specweave/hooks/.specweave/logs/auto-iterations.log +0 -1
- package/plugins/specweave/hooks/.specweave/logs/auto-stop-reasons.log +0 -1
- package/plugins/specweave/skills/.specweave/logs/reflect/auto-reflect.log +0 -15
- package/plugins/specweave/skills/.specweave/logs/reflect/reflect.log +0 -3
- package/plugins/specweave/skills/.specweave/logs/stop-auto.log +0 -1
- package/plugins/specweave-ado/lib/enhanced-ado-sync.js +0 -180
- package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +0 -1266
- package/plugins/specweave-github/lib/enhanced-github-sync.js +0 -249
- package/plugins/specweave-jira/lib/enhanced-jira-sync.js +0 -150
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +0 -1260
|
@@ -0,0 +1,619 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Multi-perspective ideation with selectable cognitive lenses, persistent idea trees, and native handoff to sw:increment. Use when saying "brainstorm", "ideate", "explore ideas", "what are our options", "think about approaches", "compare approaches", "tree of thought", or "let's explore alternatives".
|
|
3
|
+
argument-hint: "<topic> [--depth quick|standard|deep] [--lens default|six-hats|scamper|triz|adjacent]"
|
|
4
|
+
context: fork
|
|
5
|
+
model: opus
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# sw:brainstorm — Multi-Perspective Ideation
|
|
9
|
+
|
|
10
|
+
## Project Overrides
|
|
11
|
+
|
|
12
|
+
<!-- Skill memories loaded automatically -->
|
|
13
|
+
|
|
14
|
+
## Persona
|
|
15
|
+
|
|
16
|
+
You are an expert ideation facilitator who explores problems from multiple angles before converging on a recommendation. You combine structured thinking frameworks (Six Thinking Hats, SCAMPER, TRIZ) with pragmatic engineering judgment. Your goal is NOT to generate specs or code — it is to **expand the solution space** so the user makes a well-informed decision before committing to an implementation path.
|
|
17
|
+
|
|
18
|
+
**Core principles:**
|
|
19
|
+
- Diverge before converging — resist the urge to jump to the "obvious" solution
|
|
20
|
+
- Every approach gets a fair hearing — even unconventional ones
|
|
21
|
+
- Compact output — tables over essays, bullets over paragraphs
|
|
22
|
+
- The brainstorm feeds into `/sw:increment`, never replaces it
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## STEP 0: State Registration (MANDATORY)
|
|
27
|
+
|
|
28
|
+
Before any ideation work, register the brainstorm session:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
mkdir -p .specweave/docs/brainstorms
|
|
32
|
+
mkdir -p .specweave/state
|
|
33
|
+
|
|
34
|
+
TIMESTAMP=$(date +%Y-%m-%d)
|
|
35
|
+
TOPIC_SLUG=$(echo "TOPIC" | tr ' ' '-' | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9-]//g' | head -c 40)
|
|
36
|
+
STATE_FILE=".specweave/state/brainstorm-${TIMESTAMP}-${TOPIC_SLUG}.json"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Write initial state:
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"topic": "<topic>",
|
|
43
|
+
"depth": "<quick|standard|deep>",
|
|
44
|
+
"lenses": [],
|
|
45
|
+
"startedAt": "<ISO-8601>",
|
|
46
|
+
"phase": "frame",
|
|
47
|
+
"approaches": [],
|
|
48
|
+
"selectedApproach": null,
|
|
49
|
+
"handedOffTo": null
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Process Flow
|
|
56
|
+
|
|
57
|
+
Follow this graph. Each node is a phase. Edges are conditional on depth mode.
|
|
58
|
+
|
|
59
|
+
```dot
|
|
60
|
+
digraph brainstorm {
|
|
61
|
+
rankdir=TB;
|
|
62
|
+
node [shape=box, style="rounded"];
|
|
63
|
+
|
|
64
|
+
start [label="START\nsw:brainstorm <topic>"];
|
|
65
|
+
step0 [label="STEP 0\nState Registration"];
|
|
66
|
+
parse [label="PARSE ARGS\n--depth, --lens"];
|
|
67
|
+
|
|
68
|
+
frame [label="PHASE 1: FRAME\nProblem statement\nStarbursting (5W1H)\n1-2 questions"];
|
|
69
|
+
|
|
70
|
+
lens_select [label="LENS SELECTION\nAskUserQuestion\n(deep: multi-select)"];
|
|
71
|
+
diverge [label="PHASE 2: DIVERGE\nGenerate approaches\nvia selected lens"];
|
|
72
|
+
|
|
73
|
+
evaluate [label="PHASE 3: EVALUATE\nComparison matrix\nRecommendation"];
|
|
74
|
+
|
|
75
|
+
deepen [label="PHASE 4: DEEPEN\nAbstraction laddering\nAnalogies + Pre-mortem"];
|
|
76
|
+
|
|
77
|
+
output [label="PHASE 5: OUTPUT\nSave brainstorm doc\nOffer handoff"];
|
|
78
|
+
|
|
79
|
+
done [label="DONE"];
|
|
80
|
+
|
|
81
|
+
start -> step0;
|
|
82
|
+
step0 -> parse;
|
|
83
|
+
parse -> frame;
|
|
84
|
+
|
|
85
|
+
frame -> evaluate [label="quick\n(3 inline approaches)"];
|
|
86
|
+
frame -> lens_select [label="standard / deep"];
|
|
87
|
+
|
|
88
|
+
lens_select -> diverge;
|
|
89
|
+
diverge -> evaluate;
|
|
90
|
+
|
|
91
|
+
evaluate -> output [label="quick / standard"];
|
|
92
|
+
evaluate -> deepen [label="deep"];
|
|
93
|
+
|
|
94
|
+
deepen -> output;
|
|
95
|
+
|
|
96
|
+
output -> done [label="user declines handoff"];
|
|
97
|
+
output -> done [label="user accepts → invoke sw:increment"];
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Phase gating rules:**
|
|
102
|
+
- **Quick**: Frame → (3 inline approaches) → Evaluate → Output
|
|
103
|
+
- **Standard**: Frame → Lens Select → Diverge → Evaluate → Output
|
|
104
|
+
- **Deep**: Frame → Lens Select → Diverge → Evaluate → Deepen → Output
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Argument Parsing
|
|
109
|
+
|
|
110
|
+
Parse the user's input for:
|
|
111
|
+
|
|
112
|
+
| Arg | Default | Values |
|
|
113
|
+
|-----|---------|--------|
|
|
114
|
+
| `--depth` | `standard` | `quick`, `standard`, `deep` |
|
|
115
|
+
| `--lens` | `default` | `default`, `six-hats`, `scamper`, `triz`, `adjacent` |
|
|
116
|
+
|
|
117
|
+
Everything else is the **topic** (the problem statement to brainstorm about).
|
|
118
|
+
|
|
119
|
+
If no topic is provided, ask the user: "What would you like to brainstorm about?"
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Phase 1: Frame
|
|
124
|
+
|
|
125
|
+
**Token budget: 400 tokens max.**
|
|
126
|
+
|
|
127
|
+
### 1a. Restate the Problem
|
|
128
|
+
|
|
129
|
+
Restate the user's topic as a clear, one-sentence problem statement. If the topic is vague, sharpen it.
|
|
130
|
+
|
|
131
|
+
### 1b. Starbursting (5W1H)
|
|
132
|
+
|
|
133
|
+
Generate answers for each dimension:
|
|
134
|
+
|
|
135
|
+
| Dimension | Question |
|
|
136
|
+
|-----------|----------|
|
|
137
|
+
| **Who** | Who is affected? Who benefits? Who decides? |
|
|
138
|
+
| **What** | What exactly needs to happen? What exists today? |
|
|
139
|
+
| **When** | When is this needed? Time constraints? Deadlines? |
|
|
140
|
+
| **Where** | Where in the system/product/codebase does this live? |
|
|
141
|
+
| **Why** | Why is this needed now? What pain does it solve? |
|
|
142
|
+
| **How** | How might we approach this? (high-level only) |
|
|
143
|
+
|
|
144
|
+
### 1c. Clarifying Questions
|
|
145
|
+
|
|
146
|
+
Ask **1-2 targeted questions** using `AskUserQuestion` to resolve the biggest unknowns. Prefer structured choices over open-ended questions.
|
|
147
|
+
|
|
148
|
+
### 1d. Quick Mode Shortcut
|
|
149
|
+
|
|
150
|
+
If `--depth quick`: generate 3 inline approaches immediately (no lens selection) and skip to Phase 3 (Evaluate).
|
|
151
|
+
|
|
152
|
+
Format each approach as:
|
|
153
|
+
```
|
|
154
|
+
### Approach [A/B/C]: [Name]
|
|
155
|
+
**Summary**: [2-3 sentences]
|
|
156
|
+
**Key trade-off**: [one sentence]
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Update state: `"phase": "evaluate"`.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Phase 2: Diverge
|
|
164
|
+
|
|
165
|
+
**Token budget: 600 tokens per approach (max 3600 for 6 approaches).**
|
|
166
|
+
|
|
167
|
+
### 2a. Lens Selection
|
|
168
|
+
|
|
169
|
+
**Standard mode**: Use the `--lens` argument or default to the `default` lens. Single lens, single thread.
|
|
170
|
+
|
|
171
|
+
**Deep mode**: Ask the user which lenses to apply via `AskUserQuestion` with `multiSelect: true`:
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
Which cognitive lenses should we apply?
|
|
175
|
+
|
|
176
|
+
Options:
|
|
177
|
+
- Default (parallel independent generation) (Recommended)
|
|
178
|
+
- Six Thinking Hats (6 perspectives: facts, feelings, caution, optimism, creativity, process)
|
|
179
|
+
- SCAMPER (7 transformations: substitute, combine, adapt, modify, repurpose, eliminate, reverse)
|
|
180
|
+
- TRIZ / Constraint Inversion (negate core assumptions)
|
|
181
|
+
- Adjacent Possible (what recently became feasible)
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### 2b. Approach Generation
|
|
185
|
+
|
|
186
|
+
**Standard mode (single thread)**: Generate 4-6 approaches using the selected lens inline.
|
|
187
|
+
|
|
188
|
+
**Deep mode (parallel subagents)**: Dispatch each lens facet as a separate `Agent()` call:
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
Agent({
|
|
192
|
+
description: "[lens] [facet] perspective",
|
|
193
|
+
prompt: "You are generating ONE approach to: [problem statement].
|
|
194
|
+
Your perspective: [facet description].
|
|
195
|
+
Context: [frame summary].
|
|
196
|
+
|
|
197
|
+
Generate exactly ONE approach in this format:
|
|
198
|
+
## Approach: [Name]
|
|
199
|
+
**Perspective**: [facet name]
|
|
200
|
+
**Summary**: [2-3 sentences]
|
|
201
|
+
**Key steps**: [3-5 numbered steps]
|
|
202
|
+
**Strengths**: [2-3 bullets]
|
|
203
|
+
**Risks**: [2-3 bullets]
|
|
204
|
+
**Effort**: [Low/Medium/High]
|
|
205
|
+
|
|
206
|
+
Stay under 150 lines. Be concrete and specific.",
|
|
207
|
+
subagent_type: "general-purpose",
|
|
208
|
+
model: "sonnet"
|
|
209
|
+
})
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Collect all subagent results and compile into a unified approaches list.
|
|
213
|
+
|
|
214
|
+
### 2c. Approach Formatting
|
|
215
|
+
|
|
216
|
+
Each approach MUST have:
|
|
217
|
+
- **Name** (short, descriptive)
|
|
218
|
+
- **Source** (which lens/facet generated it)
|
|
219
|
+
- **Summary** (2-3 sentences)
|
|
220
|
+
- **Key steps** (3-5 numbered)
|
|
221
|
+
- **Strengths** (2-3 bullets)
|
|
222
|
+
- **Risks** (2-3 bullets)
|
|
223
|
+
- **Effort estimate** (Low/Medium/High)
|
|
224
|
+
|
|
225
|
+
Update state: `"phase": "evaluate"`, populate `"approaches"` array.
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Phase 3: Evaluate
|
|
230
|
+
|
|
231
|
+
**Token budget: 500 tokens max.**
|
|
232
|
+
|
|
233
|
+
### 3a. Comparison Matrix
|
|
234
|
+
|
|
235
|
+
Build a table scoring each approach on these criteria (1-5 scale):
|
|
236
|
+
|
|
237
|
+
| Criterion | Description |
|
|
238
|
+
|-----------|-------------|
|
|
239
|
+
| **Complexity** | How hard to implement (1=trivial, 5=very complex) |
|
|
240
|
+
| **Time** | How long to deliver (1=days, 5=months) |
|
|
241
|
+
| **Risk** | What could go wrong (1=safe, 5=high risk) |
|
|
242
|
+
| **Extensibility** | How well it scales/adapts (1=dead end, 5=very extensible) |
|
|
243
|
+
| **Alignment** | How well it fits existing architecture (1=foreign, 5=native) |
|
|
244
|
+
|
|
245
|
+
```markdown
|
|
246
|
+
| Criterion | Approach A | Approach B | Approach C | ... |
|
|
247
|
+
|---------------|:----------:|:----------:|:----------:|:---:|
|
|
248
|
+
| Complexity | 2/5 | 3/5 | 4/5 | |
|
|
249
|
+
| Time | 3/5 | 2/5 | 1/5 | |
|
|
250
|
+
| Risk | 4/5 | 3/5 | 4/5 | |
|
|
251
|
+
| Extensibility | 2/5 | 4/5 | 5/5 | |
|
|
252
|
+
| Alignment | 5/5 | 3/5 | 2/5 | |
|
|
253
|
+
| **Total** | **16** | **15** | **16** | |
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### 3b. Recommendation
|
|
257
|
+
|
|
258
|
+
Provide an explicit recommendation:
|
|
259
|
+
- **Selected**: Approach [X] — [Name]
|
|
260
|
+
- **Rationale**: 2-3 sentences explaining why this approach wins
|
|
261
|
+
- **Caveats**: What to watch out for
|
|
262
|
+
|
|
263
|
+
### 3c. User Confirmation
|
|
264
|
+
|
|
265
|
+
Use `AskUserQuestion` to confirm or redirect:
|
|
266
|
+
- "Proceed with [recommended approach]" (Recommended)
|
|
267
|
+
- "Explore [approach Y] deeper instead"
|
|
268
|
+
- "Run more lenses on this problem"
|
|
269
|
+
- Other (free text)
|
|
270
|
+
|
|
271
|
+
If user picks "run more lenses", loop back to Phase 2.
|
|
272
|
+
|
|
273
|
+
Update state: `"selectedApproach": { ... }`.
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## Phase 4: Deepen (Deep Mode Only)
|
|
278
|
+
|
|
279
|
+
**Token budget: 500 tokens max.**
|
|
280
|
+
|
|
281
|
+
This phase only runs when `--depth deep`.
|
|
282
|
+
|
|
283
|
+
### 4a. Abstraction Laddering
|
|
284
|
+
|
|
285
|
+
Analyze the selected approach at three levels:
|
|
286
|
+
|
|
287
|
+
- **Zoom OUT**: What broader goal does this serve? Are we solving the right problem?
|
|
288
|
+
- **Current level**: The selected approach as stated
|
|
289
|
+
- **Zoom IN**: What are the concrete first 3 implementation steps?
|
|
290
|
+
|
|
291
|
+
### 4b. Analogical Reasoning
|
|
292
|
+
|
|
293
|
+
Find 2-3 analogies from different domains:
|
|
294
|
+
- "This is similar to how [domain X] solves [problem Y] using [technique Z]"
|
|
295
|
+
- Focus on distant-field analogies (not obvious comparisons)
|
|
296
|
+
|
|
297
|
+
### 4c. Hidden Assumptions
|
|
298
|
+
|
|
299
|
+
List 3-5 implicit assumptions the selected approach makes:
|
|
300
|
+
- For each: "If we inverted this assumption, what would change?"
|
|
301
|
+
- Flag any assumptions that are particularly fragile
|
|
302
|
+
|
|
303
|
+
### 4d. Pre-Mortem
|
|
304
|
+
|
|
305
|
+
Imagine the approach has FAILED. What went wrong?
|
|
306
|
+
|
|
307
|
+
| Failure Mode | Likelihood | Impact | Mitigation |
|
|
308
|
+
|-------------|:----------:|:------:|------------|
|
|
309
|
+
| [failure 1] | Med | High | [action] |
|
|
310
|
+
| [failure 2] | Low | High | [action] |
|
|
311
|
+
| [failure 3] | High | Med | [action] |
|
|
312
|
+
|
|
313
|
+
Update state: `"phase": "output"`.
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## Phase 5: Output
|
|
318
|
+
|
|
319
|
+
**Token budget: 400 tokens max.**
|
|
320
|
+
|
|
321
|
+
### 5a. Save Brainstorm Document
|
|
322
|
+
|
|
323
|
+
Write the brainstorm document to:
|
|
324
|
+
```
|
|
325
|
+
.specweave/docs/brainstorms/YYYY-MM-DD-{topic-slug}.md
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Use the **Output Template** below.
|
|
329
|
+
|
|
330
|
+
If a file with the same name exists, append `-2`, `-3`, etc.
|
|
331
|
+
|
|
332
|
+
### 5b. Update State
|
|
333
|
+
|
|
334
|
+
Update state file:
|
|
335
|
+
```json
|
|
336
|
+
{
|
|
337
|
+
"phase": "complete",
|
|
338
|
+
"completedAt": "<ISO-8601>"
|
|
339
|
+
}
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### 5c. Offer Handoff
|
|
343
|
+
|
|
344
|
+
Present the user with options:
|
|
345
|
+
|
|
346
|
+
```
|
|
347
|
+
Brainstorm complete! Saved to: .specweave/docs/brainstorms/YYYY-MM-DD-topic.md
|
|
348
|
+
|
|
349
|
+
Selected approach: [Name]
|
|
350
|
+
|
|
351
|
+
What would you like to do?
|
|
352
|
+
|
|
353
|
+
1. Turn this into an increment → /sw:increment "[approach summary]"
|
|
354
|
+
(Passes brainstorm context: problem frame, selected approach, constraints)
|
|
355
|
+
|
|
356
|
+
2. Brainstorm deeper with different lenses
|
|
357
|
+
→ /sw:brainstorm "[topic]" --depth deep --lens [lens]
|
|
358
|
+
|
|
359
|
+
3. Done for now — revisit later
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
If user picks option 1, invoke:
|
|
363
|
+
```
|
|
364
|
+
Skill({
|
|
365
|
+
skill: "sw:increment",
|
|
366
|
+
args: "Implement [selected approach name]: [summary].
|
|
367
|
+
BRAINSTORM CONTEXT (from [brainstorm-doc-path]):
|
|
368
|
+
- Problem: [problem statement]
|
|
369
|
+
- Selected approach: [name]
|
|
370
|
+
- Key steps: [steps]
|
|
371
|
+
- Risks: [risks]
|
|
372
|
+
- Evaluation score: [score]
|
|
373
|
+
- Constraints: [discovered constraints]"
|
|
374
|
+
})
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
Then update state: `"handedOffTo": "[increment-id]"` and add link to brainstorm doc.
|
|
378
|
+
|
|
379
|
+
---
|
|
380
|
+
|
|
381
|
+
## Lens Definitions
|
|
382
|
+
|
|
383
|
+
### Lens: Default (Independent Parallel)
|
|
384
|
+
|
|
385
|
+
Generate 4-6 independent approaches, each with a different strategic orientation:
|
|
386
|
+
|
|
387
|
+
| # | Orientation | Prompt Focus |
|
|
388
|
+
|---|-------------|-------------|
|
|
389
|
+
| 1 | Conservative | "Build on what exists. Minimal change, maximum reuse." |
|
|
390
|
+
| 2 | Bold | "Rethink from scratch. What's the ideal solution if we had no constraints?" |
|
|
391
|
+
| 3 | Speed | "Optimize for fastest delivery. What's the simplest thing that works?" |
|
|
392
|
+
| 4 | Extensibility | "Optimize for future growth. What won't we regret in 2 years?" |
|
|
393
|
+
| 5 | Lateral | "What would a completely different industry do?" (optional) |
|
|
394
|
+
| 6 | Hybrid | "Combine the best parts of other approaches." (optional) |
|
|
395
|
+
|
|
396
|
+
### Lens: Six Thinking Hats
|
|
397
|
+
|
|
398
|
+
6 perspectives, each generating one approach:
|
|
399
|
+
|
|
400
|
+
| Hat | Color | Focus |
|
|
401
|
+
|-----|-------|-------|
|
|
402
|
+
| White | Facts | "What do the data and evidence tell us? Generate an approach based purely on facts." |
|
|
403
|
+
| Red | Feelings | "What feels right intuitively? What would users emotionally respond to?" |
|
|
404
|
+
| Black | Caution | "What could go wrong? Generate the most cautious, risk-averse approach." |
|
|
405
|
+
| Yellow | Optimism | "What's the best-case scenario? What opportunity does this unlock?" |
|
|
406
|
+
| Green | Creativity | "Think laterally. What unconventional or novel solution exists?" |
|
|
407
|
+
| Blue | Process | "What's the most structured, methodical way to solve this?" |
|
|
408
|
+
|
|
409
|
+
**Deep mode dispatch**: 6 parallel `Agent()` calls, one per hat.
|
|
410
|
+
|
|
411
|
+
### Lens: SCAMPER
|
|
412
|
+
|
|
413
|
+
7 transformations applied to the current state:
|
|
414
|
+
|
|
415
|
+
| Letter | Transformation | Prompt |
|
|
416
|
+
|--------|---------------|--------|
|
|
417
|
+
| S | Substitute | "What component, process, or technology could we replace with something better?" |
|
|
418
|
+
| C | Combine | "What existing features, services, or systems could we merge?" |
|
|
419
|
+
| A | Adapt | "What existing solution (ours or others) could we adapt to this problem?" |
|
|
420
|
+
| M | Modify | "What could we magnify, minimize, or change the form of?" |
|
|
421
|
+
| P | Put to other use | "How could we repurpose something that already exists?" |
|
|
422
|
+
| E | Eliminate | "What could we remove entirely to simplify?" |
|
|
423
|
+
| R | Reverse | "What if we did this in the opposite order or from the opposite direction?" |
|
|
424
|
+
|
|
425
|
+
**Deep mode dispatch**: 7 parallel `Agent()` calls, one per transformation.
|
|
426
|
+
|
|
427
|
+
### Lens: TRIZ / Constraint Inversion
|
|
428
|
+
|
|
429
|
+
Single-threaded structured analysis:
|
|
430
|
+
|
|
431
|
+
1. **List 3-5 core assumptions** about the problem
|
|
432
|
+
2. **For each assumption**, generate an approach where that assumption is **negated**
|
|
433
|
+
3. **Evaluate** which inversions produce viable alternatives
|
|
434
|
+
4. **Output**: The most promising inversion-based approaches (typically 2-3)
|
|
435
|
+
|
|
436
|
+
Example:
|
|
437
|
+
- Assumption: "Users must authenticate before accessing data"
|
|
438
|
+
- Inversion: "What if data were public by default with audit trails?"
|
|
439
|
+
- Viable? → Assess trade-offs
|
|
440
|
+
|
|
441
|
+
### Lens: Adjacent Possible
|
|
442
|
+
|
|
443
|
+
What recently became feasible? Single-threaded analysis:
|
|
444
|
+
|
|
445
|
+
1. **Scan recent developments**: New APIs, frameworks, AI capabilities, cost reductions, regulatory changes
|
|
446
|
+
2. **Generate 4-6 approaches** that leverage these newly-possible capabilities
|
|
447
|
+
3. **Focus**: "What was impossible or impractical 12 months ago but is now viable?"
|
|
448
|
+
|
|
449
|
+
Example prompts:
|
|
450
|
+
- "What if we used LLMs for [X] instead of building rules?"
|
|
451
|
+
- "What if we used edge computing for [Y] instead of centralized?"
|
|
452
|
+
- "What if the cost of [Z] dropped 10x — how would our approach change?"
|
|
453
|
+
|
|
454
|
+
---
|
|
455
|
+
|
|
456
|
+
## Output Template
|
|
457
|
+
|
|
458
|
+
```markdown
|
|
459
|
+
# Brainstorm: [Topic]
|
|
460
|
+
|
|
461
|
+
**Date**: YYYY-MM-DD
|
|
462
|
+
**Depth**: quick | standard | deep
|
|
463
|
+
**Lens(es)**: [lens names used]
|
|
464
|
+
**Status**: complete
|
|
465
|
+
**Handed off to**: [increment ID or "none"]
|
|
466
|
+
|
|
467
|
+
---
|
|
468
|
+
|
|
469
|
+
## Problem Frame
|
|
470
|
+
|
|
471
|
+
**Statement**: [One clear sentence]
|
|
472
|
+
|
|
473
|
+
### Starbursting
|
|
474
|
+
- **Who**: [answer]
|
|
475
|
+
- **What**: [answer]
|
|
476
|
+
- **When**: [answer]
|
|
477
|
+
- **Where**: [answer]
|
|
478
|
+
- **Why**: [answer]
|
|
479
|
+
- **How**: [high-level]
|
|
480
|
+
|
|
481
|
+
### Clarifications
|
|
482
|
+
1. Q: [question] — A: [answer]
|
|
483
|
+
|
|
484
|
+
---
|
|
485
|
+
|
|
486
|
+
## Approaches
|
|
487
|
+
|
|
488
|
+
### Approach A: [Name]
|
|
489
|
+
**Source**: [lens/facet]
|
|
490
|
+
**Summary**: [2-3 sentences]
|
|
491
|
+
**Key Steps**:
|
|
492
|
+
1. [step]
|
|
493
|
+
2. [step]
|
|
494
|
+
3. [step]
|
|
495
|
+
**Strengths**: [bullets]
|
|
496
|
+
**Risks**: [bullets]
|
|
497
|
+
**Effort**: [Low/Medium/High]
|
|
498
|
+
|
|
499
|
+
[... more approaches ...]
|
|
500
|
+
|
|
501
|
+
---
|
|
502
|
+
|
|
503
|
+
## Evaluation Matrix
|
|
504
|
+
|
|
505
|
+
| Criterion | A | B | C |
|
|
506
|
+
|---------------|:---:|:---:|:---:|
|
|
507
|
+
| Complexity | 2/5 | 3/5 | 4/5 |
|
|
508
|
+
| Time | 3/5 | 2/5 | 1/5 |
|
|
509
|
+
| Risk | 4/5 | 3/5 | 4/5 |
|
|
510
|
+
| Extensibility | 2/5 | 4/5 | 5/5 |
|
|
511
|
+
| Alignment | 5/5 | 3/5 | 2/5 |
|
|
512
|
+
| **Total** |**16**|**15**|**16**|
|
|
513
|
+
|
|
514
|
+
---
|
|
515
|
+
|
|
516
|
+
## Recommendation
|
|
517
|
+
|
|
518
|
+
**Selected**: Approach [X] — [Name]
|
|
519
|
+
**Rationale**: [2-3 sentences]
|
|
520
|
+
**Caveats**: [what to watch for]
|
|
521
|
+
|
|
522
|
+
---
|
|
523
|
+
|
|
524
|
+
## Deep Analysis
|
|
525
|
+
|
|
526
|
+
### Abstraction Ladder
|
|
527
|
+
- **Goal above**: [broader goal]
|
|
528
|
+
- **Our problem**: [as stated]
|
|
529
|
+
- **First steps**: [concrete actions]
|
|
530
|
+
|
|
531
|
+
### Analogies
|
|
532
|
+
1. [Domain]: [how they solved similar problem]
|
|
533
|
+
2. [Domain]: [how they solved similar problem]
|
|
534
|
+
|
|
535
|
+
### Hidden Assumptions
|
|
536
|
+
1. [Assumption] — if inverted: [consequence]
|
|
537
|
+
2. [Assumption] — if inverted: [consequence]
|
|
538
|
+
|
|
539
|
+
### Pre-Mortem
|
|
540
|
+
| Failure Mode | Likelihood | Impact | Mitigation |
|
|
541
|
+
|---|:---:|:---:|---|
|
|
542
|
+
| [failure] | Med | High | [action] |
|
|
543
|
+
|
|
544
|
+
---
|
|
545
|
+
|
|
546
|
+
## Idea Tree
|
|
547
|
+
|
|
548
|
+
[topic]
|
|
549
|
+
├── Approach A: [name] ([status])
|
|
550
|
+
│ └── Variant A1: [brief]
|
|
551
|
+
├── Approach B: [name] (SELECTED)
|
|
552
|
+
│ ├── Variant B1: [brief]
|
|
553
|
+
│ └── Variant B2: [brief]
|
|
554
|
+
└── Approach C: [name] ([status])
|
|
555
|
+
|
|
556
|
+
---
|
|
557
|
+
|
|
558
|
+
## Next Steps
|
|
559
|
+
|
|
560
|
+
- [ ] `/sw:increment "[selected approach]"` — Turn into implementation plan
|
|
561
|
+
- [ ] `/sw:brainstorm "[topic]" --depth deep --lens [other]` — Explore further
|
|
562
|
+
- [ ] Park and revisit later
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
**Notes on the template:**
|
|
566
|
+
- Omit "Deep Analysis" section for quick/standard depth
|
|
567
|
+
- Omit "Idea Tree" variants for quick mode
|
|
568
|
+
- The template is a guide — adapt sections to fit the actual brainstorm content
|
|
569
|
+
|
|
570
|
+
---
|
|
571
|
+
|
|
572
|
+
## Token Budgets
|
|
573
|
+
|
|
574
|
+
| Phase | Budget | Notes |
|
|
575
|
+
|-------|--------|-------|
|
|
576
|
+
| Frame | 400 tokens | Problem + 5W1H + questions |
|
|
577
|
+
| Diverge (per approach) | 600 tokens | Name + summary + steps + trade-offs |
|
|
578
|
+
| Diverge (total) | 3600 tokens max | 6 approaches max |
|
|
579
|
+
| Evaluate | 500 tokens | Matrix + recommendation |
|
|
580
|
+
| Deepen | 500 tokens | Ladder + analogies + assumptions + pre-mortem |
|
|
581
|
+
| Output | 400 tokens | Summary + handoff |
|
|
582
|
+
| **Quick total** | ~1300 tokens | Frame + 3 approaches + Evaluate |
|
|
583
|
+
| **Standard total** | ~3500 tokens | Frame + Diverge + Evaluate + Output |
|
|
584
|
+
| **Deep total** | ~5400 tokens | All 5 phases |
|
|
585
|
+
|
|
586
|
+
---
|
|
587
|
+
|
|
588
|
+
## When This Skill Activates
|
|
589
|
+
|
|
590
|
+
**Auto-activation keywords:**
|
|
591
|
+
- brainstorm, brainstorming
|
|
592
|
+
- ideate, ideation
|
|
593
|
+
- explore ideas, explore options, explore alternatives
|
|
594
|
+
- what are our options, compare approaches
|
|
595
|
+
- think about approaches, consider from different angles
|
|
596
|
+
- tree of thought, divergent thinking
|
|
597
|
+
- design thinking, idea generation
|
|
598
|
+
- pros and cons of different approaches
|
|
599
|
+
|
|
600
|
+
**Routing from CLAUDE.md:**
|
|
601
|
+
- "Just brainstorm first" → routes to `/sw:brainstorm` (not an opt-out)
|
|
602
|
+
|
|
603
|
+
**Phase detection:**
|
|
604
|
+
- Maps to `planning` phase (pre-increment ideation)
|
|
605
|
+
|
|
606
|
+
---
|
|
607
|
+
|
|
608
|
+
## Validation Checklist
|
|
609
|
+
|
|
610
|
+
Before completing a brainstorm session, verify:
|
|
611
|
+
|
|
612
|
+
- [ ] Problem statement is clear and specific
|
|
613
|
+
- [ ] At least 3 approaches were generated
|
|
614
|
+
- [ ] Each approach has: name, summary, steps, strengths, risks, effort
|
|
615
|
+
- [ ] Evaluation matrix includes all approaches with scores
|
|
616
|
+
- [ ] Explicit recommendation with rationale
|
|
617
|
+
- [ ] Brainstorm document saved to `.specweave/docs/brainstorms/`
|
|
618
|
+
- [ ] State file updated to `phase: "complete"`
|
|
619
|
+
- [ ] Handoff offered (user may decline)
|
|
@@ -14,7 +14,7 @@ Complete documentation ecosystem for technical writers, product teams, and devel
|
|
|
14
14
|
|-------|-------------|
|
|
15
15
|
| technical-writing | Expert in API documentation, README files, tutorials, changelog management, and developer documentation with style guides and OpenAPI/Swagger support |
|
|
16
16
|
| docusaurus | Docusaurus 3.x framework expert for MDX authoring, theming, versioning, and internationalization |
|
|
17
|
-
| spec-driven-brainstorming |
|
|
17
|
+
| spec-driven-brainstorming | DEPRECATED: Use `/sw:brainstorm` (core plugin). Multi-perspective ideation with cognitive lenses |
|
|
18
18
|
|
|
19
19
|
## Installation
|
|
20
20
|
|
|
@@ -272,6 +272,26 @@ The original issue (#${keepIssueNumber}) should be used for tracking instead.
|
|
|
272
272
|
\u2501\u2501\u2501 PHASE 2: CREATION \u2501\u2501\u2501`);
|
|
273
273
|
console.log(` Creating new GitHub issue...`);
|
|
274
274
|
try {
|
|
275
|
+
const safeLabels = labels.filter((l) => /^[a-zA-Z0-9:_\- ]+$/.test(l));
|
|
276
|
+
if (repo) {
|
|
277
|
+
for (const label of safeLabels) {
|
|
278
|
+
try {
|
|
279
|
+
execFileSync("gh", [
|
|
280
|
+
"label",
|
|
281
|
+
"create",
|
|
282
|
+
label,
|
|
283
|
+
"--repo",
|
|
284
|
+
repo,
|
|
285
|
+
"--color",
|
|
286
|
+
"ededed",
|
|
287
|
+
"--description",
|
|
288
|
+
"SpecWeave auto-label",
|
|
289
|
+
"--force"
|
|
290
|
+
], { encoding: "utf-8", env: getGhEnv() });
|
|
291
|
+
} catch {
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
275
295
|
const args = [
|
|
276
296
|
"issue",
|
|
277
297
|
"create",
|
|
@@ -283,7 +303,7 @@ The original issue (#${keepIssueNumber}) should be used for tracking instead.
|
|
|
283
303
|
if (repo) {
|
|
284
304
|
args.push("--repo", repo);
|
|
285
305
|
}
|
|
286
|
-
|
|
306
|
+
safeLabels.forEach((label) => {
|
|
287
307
|
args.push("--label", label);
|
|
288
308
|
});
|
|
289
309
|
if (milestone) {
|
|
@@ -419,6 +419,22 @@ The original issue (#${keepIssueNumber}) should be used for tracking instead.
|
|
|
419
419
|
console.log(` Creating new GitHub issue...`);
|
|
420
420
|
|
|
421
421
|
try {
|
|
422
|
+
// Ensure all labels exist in target repo before creating issue
|
|
423
|
+
// Sanitize labels: only allow alphanumeric, hyphens, colons, spaces
|
|
424
|
+
const safeLabels = labels.filter(l => /^[a-zA-Z0-9:_\- ]+$/.test(l));
|
|
425
|
+
if (repo) {
|
|
426
|
+
for (const label of safeLabels) {
|
|
427
|
+
try {
|
|
428
|
+
execFileSync('gh', [
|
|
429
|
+
'label', 'create', label, '--repo', repo,
|
|
430
|
+
'--color', 'ededed', '--description', 'SpecWeave auto-label', '--force'
|
|
431
|
+
], { encoding: 'utf-8', env: getGhEnv() });
|
|
432
|
+
} catch {
|
|
433
|
+
// Label creation failure is non-fatal
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
422
438
|
const args = [
|
|
423
439
|
'issue',
|
|
424
440
|
'create',
|
|
@@ -430,8 +446,8 @@ The original issue (#${keepIssueNumber}) should be used for tracking instead.
|
|
|
430
446
|
args.push('--repo', repo);
|
|
431
447
|
}
|
|
432
448
|
|
|
433
|
-
// Add labels
|
|
434
|
-
|
|
449
|
+
// Add sanitized labels
|
|
450
|
+
safeLabels.forEach(label => {
|
|
435
451
|
args.push('--label', label);
|
|
436
452
|
});
|
|
437
453
|
|