@rune-kit/rune 2.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.
Files changed (155) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +357 -0
  3. package/agents/.gitkeep +0 -0
  4. package/agents/architect.md +29 -0
  5. package/agents/asset-creator.md +11 -0
  6. package/agents/audit.md +11 -0
  7. package/agents/autopsy.md +11 -0
  8. package/agents/brainstorm.md +11 -0
  9. package/agents/browser-pilot.md +11 -0
  10. package/agents/coder.md +29 -0
  11. package/agents/completion-gate.md +11 -0
  12. package/agents/constraint-check.md +11 -0
  13. package/agents/context-engine.md +11 -0
  14. package/agents/cook.md +11 -0
  15. package/agents/db.md +11 -0
  16. package/agents/debug.md +11 -0
  17. package/agents/dependency-doctor.md +11 -0
  18. package/agents/deploy.md +11 -0
  19. package/agents/design.md +11 -0
  20. package/agents/docs-seeker.md +11 -0
  21. package/agents/fix.md +11 -0
  22. package/agents/hallucination-guard.md +11 -0
  23. package/agents/incident.md +11 -0
  24. package/agents/integrity-check.md +11 -0
  25. package/agents/journal.md +11 -0
  26. package/agents/launch.md +11 -0
  27. package/agents/logic-guardian.md +11 -0
  28. package/agents/marketing.md +11 -0
  29. package/agents/onboard.md +11 -0
  30. package/agents/perf.md +11 -0
  31. package/agents/plan.md +11 -0
  32. package/agents/preflight.md +11 -0
  33. package/agents/problem-solver.md +11 -0
  34. package/agents/rescue.md +11 -0
  35. package/agents/research.md +11 -0
  36. package/agents/researcher.md +29 -0
  37. package/agents/review-intake.md +11 -0
  38. package/agents/review.md +11 -0
  39. package/agents/reviewer.md +28 -0
  40. package/agents/safeguard.md +11 -0
  41. package/agents/sast.md +11 -0
  42. package/agents/scanner.md +28 -0
  43. package/agents/scope-guard.md +11 -0
  44. package/agents/scout.md +11 -0
  45. package/agents/sentinel.md +11 -0
  46. package/agents/sequential-thinking.md +11 -0
  47. package/agents/session-bridge.md +11 -0
  48. package/agents/skill-forge.md +11 -0
  49. package/agents/skill-router.md +11 -0
  50. package/agents/surgeon.md +11 -0
  51. package/agents/team.md +11 -0
  52. package/agents/test.md +11 -0
  53. package/agents/trend-scout.md +11 -0
  54. package/agents/verification.md +11 -0
  55. package/agents/video-creator.md +11 -0
  56. package/agents/watchdog.md +11 -0
  57. package/agents/worktree.md +11 -0
  58. package/commands/.gitkeep +0 -0
  59. package/commands/rune.md +168 -0
  60. package/compiler/__tests__/openclaw-adapter.test.js +140 -0
  61. package/compiler/__tests__/parser.test.js +55 -0
  62. package/compiler/adapters/antigravity.js +59 -0
  63. package/compiler/adapters/claude.js +37 -0
  64. package/compiler/adapters/cursor.js +67 -0
  65. package/compiler/adapters/generic.js +60 -0
  66. package/compiler/adapters/index.js +45 -0
  67. package/compiler/adapters/openclaw.js +150 -0
  68. package/compiler/adapters/windsurf.js +60 -0
  69. package/compiler/bin/rune.js +288 -0
  70. package/compiler/doctor.js +153 -0
  71. package/compiler/emitter.js +240 -0
  72. package/compiler/parser.js +208 -0
  73. package/compiler/transformer.js +69 -0
  74. package/compiler/transforms/branding.js +27 -0
  75. package/compiler/transforms/cross-references.js +29 -0
  76. package/compiler/transforms/frontmatter.js +38 -0
  77. package/compiler/transforms/hooks.js +68 -0
  78. package/compiler/transforms/subagents.js +36 -0
  79. package/compiler/transforms/tool-names.js +60 -0
  80. package/contexts/dev.md +34 -0
  81. package/contexts/research.md +43 -0
  82. package/contexts/review.md +55 -0
  83. package/extensions/ai-ml/PACK.md +517 -0
  84. package/extensions/analytics/PACK.md +557 -0
  85. package/extensions/backend/PACK.md +678 -0
  86. package/extensions/chrome-ext/PACK.md +995 -0
  87. package/extensions/content/PACK.md +381 -0
  88. package/extensions/devops/PACK.md +520 -0
  89. package/extensions/ecommerce/PACK.md +280 -0
  90. package/extensions/gamedev/PACK.md +393 -0
  91. package/extensions/mobile/PACK.md +273 -0
  92. package/extensions/saas/PACK.md +805 -0
  93. package/extensions/security/PACK.md +536 -0
  94. package/extensions/trading/PACK.md +597 -0
  95. package/extensions/ui/PACK.md +947 -0
  96. package/package.json +47 -0
  97. package/skills/.gitkeep +0 -0
  98. package/skills/adversary/SKILL.md +271 -0
  99. package/skills/asset-creator/SKILL.md +157 -0
  100. package/skills/audit/SKILL.md +466 -0
  101. package/skills/autopsy/SKILL.md +200 -0
  102. package/skills/ba/SKILL.md +279 -0
  103. package/skills/brainstorm/SKILL.md +266 -0
  104. package/skills/browser-pilot/SKILL.md +168 -0
  105. package/skills/completion-gate/SKILL.md +151 -0
  106. package/skills/constraint-check/SKILL.md +165 -0
  107. package/skills/context-engine/SKILL.md +176 -0
  108. package/skills/cook/SKILL.md +636 -0
  109. package/skills/db/SKILL.md +256 -0
  110. package/skills/debug/SKILL.md +240 -0
  111. package/skills/dependency-doctor/SKILL.md +235 -0
  112. package/skills/deploy/SKILL.md +174 -0
  113. package/skills/design/DESIGN-REFERENCE.md +365 -0
  114. package/skills/design/SKILL.md +462 -0
  115. package/skills/doc-processor/SKILL.md +254 -0
  116. package/skills/docs/SKILL.md +336 -0
  117. package/skills/docs-seeker/SKILL.md +166 -0
  118. package/skills/fix/SKILL.md +192 -0
  119. package/skills/git/SKILL.md +285 -0
  120. package/skills/hallucination-guard/SKILL.md +204 -0
  121. package/skills/incident/SKILL.md +241 -0
  122. package/skills/integrity-check/SKILL.md +169 -0
  123. package/skills/journal/SKILL.md +190 -0
  124. package/skills/launch/SKILL.md +330 -0
  125. package/skills/logic-guardian/SKILL.md +240 -0
  126. package/skills/marketing/SKILL.md +229 -0
  127. package/skills/mcp-builder/SKILL.md +311 -0
  128. package/skills/onboard/SKILL.md +298 -0
  129. package/skills/perf/SKILL.md +297 -0
  130. package/skills/plan/SKILL.md +520 -0
  131. package/skills/preflight/SKILL.md +231 -0
  132. package/skills/problem-solver/SKILL.md +284 -0
  133. package/skills/rescue/SKILL.md +434 -0
  134. package/skills/research/SKILL.md +122 -0
  135. package/skills/review/SKILL.md +354 -0
  136. package/skills/review-intake/SKILL.md +222 -0
  137. package/skills/safeguard/SKILL.md +188 -0
  138. package/skills/sast/SKILL.md +190 -0
  139. package/skills/scaffold/SKILL.md +276 -0
  140. package/skills/scope-guard/SKILL.md +150 -0
  141. package/skills/scout/SKILL.md +232 -0
  142. package/skills/sentinel/SKILL.md +320 -0
  143. package/skills/sentinel-env/SKILL.md +226 -0
  144. package/skills/sequential-thinking/SKILL.md +234 -0
  145. package/skills/session-bridge/SKILL.md +287 -0
  146. package/skills/skill-forge/SKILL.md +317 -0
  147. package/skills/skill-router/SKILL.md +267 -0
  148. package/skills/surgeon/SKILL.md +203 -0
  149. package/skills/team/SKILL.md +397 -0
  150. package/skills/test/SKILL.md +271 -0
  151. package/skills/trend-scout/SKILL.md +145 -0
  152. package/skills/verification/SKILL.md +201 -0
  153. package/skills/video-creator/SKILL.md +201 -0
  154. package/skills/watchdog/SKILL.md +166 -0
  155. package/skills/worktree/SKILL.md +140 -0
@@ -0,0 +1,279 @@
1
+ ---
2
+ name: ba
3
+ description: Business Analyst agent. Deeply understands user requirements before any planning or coding begins. Asks probing questions, identifies hidden requirements, maps stakeholders, defines scope boundaries, and produces a structured Requirements Document that plan and cook consume.
4
+ metadata:
5
+ author: runedev
6
+ version: "0.2.0"
7
+ layer: L2
8
+ model: opus
9
+ group: creation
10
+ tools: "Read, Glob, Grep"
11
+ ---
12
+
13
+ # ba
14
+
15
+ ## Purpose
16
+
17
+ Business Analyst agent — the ROOT FIX for "Claude works a lot but produces nothing." BA forces deep understanding of WHAT to build before any code is written. It asks probing questions, identifies hidden requirements, maps stakeholders, defines scope boundaries, and produces a structured Requirements Document.
18
+
19
+ <HARD-GATE>
20
+ BA produces WHAT, not HOW. Never write code. Never plan implementation.
21
+ Output is a Requirements Document → hand off to rune:plan for implementation planning.
22
+ </HARD-GATE>
23
+
24
+ ## Triggers
25
+
26
+ - Called by `cook` Phase 1 when task is product-oriented (not a simple bug fix)
27
+ - Called by `scaffold` Phase 1 before any project generation
28
+ - `/rune ba <requirement>` — manual invocation
29
+ - Auto-trigger: when user description is > 50 words OR contains business terms (users, revenue, workflow, integration)
30
+
31
+ ## Calls (outbound)
32
+
33
+ - `scout` (L2): scan existing codebase for context
34
+ - `research` (L3): look up similar products, APIs, integrations
35
+ - `plan` (L2): hand off Requirements Document for implementation planning
36
+ - `brainstorm` (L2): when multiple approaches exist for a requirement
37
+
38
+ ## Called By (inbound)
39
+
40
+ - `cook` (L1): before Phase 2 PLAN, when task is non-trivial
41
+ - `scaffold` (L1): Phase 1, before any project generation
42
+ - `plan` (L2): when plan receives vague requirements
43
+ - User: `/rune ba` direct invocation
44
+
45
+ ## Cross-Hub Connections
46
+
47
+ - `ba` → `plan` — ba produces requirements, plan produces implementation steps
48
+ - `ba` → `brainstorm` — ba calls brainstorm when multiple requirement approaches exist
49
+ - `ba` ↔ `cook` — cook calls ba for non-trivial tasks, ba feeds requirements into cook's pipeline
50
+ - `ba` → `scaffold` — scaffold requires ba output before project generation
51
+
52
+ ## Executable Steps
53
+
54
+ ### Step 1 — Intake & Classify
55
+
56
+ Read the user's request. Classify the requirement type:
57
+
58
+ | Type | Signal | Depth |
59
+ |------|--------|-------|
60
+ | Feature Request | "add X", "build Y", "I want Z" | Full BA cycle (Steps 1-7) |
61
+ | Bug Fix | "broken", "error", "doesn't work" | Skip BA → direct to debug |
62
+ | Refactor | "clean up", "refactor", "restructure" | Light BA (Step 1 + Step 4 only) |
63
+ | Integration | "connect X to Y", "integrate with Z" | Full BA + API research |
64
+ | Greenfield | "new project", "build from scratch" | Full BA + market context |
65
+
66
+ If Bug Fix → skip BA, route to cook/debug directly.
67
+ If Refactor → light version (Step 1 + Step 4 only).
68
+
69
+ If existing codebase → invoke `rune:scout` for context before proceeding.
70
+
71
+ ### Step 2 — Requirement Elicitation (the "5 Questions")
72
+
73
+ Ask exactly 5 probing questions, ONE AT A TIME (not all at once):
74
+
75
+ 1. **WHO** — "Who is the end user? What's their technical level? What are they doing right before and after using this feature?"
76
+ 2. **WHAT** — "What specific outcome do they need? What does 'done' look like from the user's perspective?"
77
+ 3. **WHY** — "Why do they need this? What problem does this solve? What happens if we don't build it?"
78
+ 4. **BOUNDARIES** — "What should this NOT do? What's explicitly out of scope?"
79
+ 5. **CONSTRAINTS** — "Any technical constraints? (existing APIs, performance requirements, security needs, deadlines)"
80
+
81
+ <HARD-GATE>
82
+ Do NOT skip questions. Do NOT answer your own questions.
83
+ If user says "just build it" → respond with: "I'll build it better with 2 minutes of context. Question 1: [WHO]"
84
+ Each question must be asked separately, wait for answer before next.
85
+ Exception: if user provides a detailed spec/PRD → extract answers from it, confirm with user.
86
+ </HARD-GATE>
87
+
88
+ ### Step 3 — Hidden Requirement Discovery
89
+
90
+ After the 5 questions, analyze for requirements the user DIDN'T mention:
91
+
92
+ **Technical hidden requirements:**
93
+ - Authentication/authorization needed?
94
+ - Rate limiting needed?
95
+ - Data persistence needed? (what DB, what schema)
96
+ - Error handling strategy?
97
+ - Offline/fallback behavior?
98
+ - Mobile responsiveness?
99
+ - Accessibility requirements?
100
+ - Internationalization?
101
+
102
+ **Business hidden requirements:**
103
+ - What happens on failure? (graceful degradation)
104
+ - What data needs to be tracked? (analytics events)
105
+ - Who else is affected? (other teams, other systems)
106
+ - What are the edge cases? (empty state, max limits, concurrent access)
107
+ - Regulatory/compliance needs? (GDPR, PCI, HIPAA)
108
+
109
+ Present discovered hidden requirements to user: "I found N additional requirements you may not have considered: [list]. Which are relevant?"
110
+
111
+ ### Step 4 — Scope Definition
112
+
113
+ Based on all gathered information, produce:
114
+
115
+ **In-Scope** (explicitly included):
116
+ - [list of features/behaviors that WILL be built]
117
+
118
+ **Out-of-Scope** (explicitly excluded):
119
+ - [list of things we WON'T build — prevents scope creep]
120
+
121
+ **Assumptions** (things we're assuming without proof):
122
+ - [each assumption is a risk if wrong]
123
+
124
+ **Dependencies** (things that must exist before we can build):
125
+ - [APIs, services, libraries, access, existing code]
126
+
127
+ ### Step 5 — User Stories & Acceptance Criteria
128
+
129
+ For each in-scope feature, generate:
130
+
131
+ ```
132
+ US-1: As a [persona], I want to [action] so that [benefit]
133
+ AC-1.1: GIVEN [context] WHEN [action] THEN [result]
134
+ AC-1.2: GIVEN [error case] WHEN [action] THEN [error handling]
135
+ AC-1.3: GIVEN [edge case] WHEN [action] THEN [graceful behavior]
136
+ ```
137
+
138
+ Rules:
139
+ - Primary user story first, then edge cases
140
+ - Every user story has at least 2 acceptance criteria (happy path + error)
141
+ - Acceptance criteria are TESTABLE — they become test cases in Phase 3
142
+
143
+ ### Step 6 — Non-Functional Requirements (NFRs)
144
+
145
+ Assess and document ONLY relevant NFRs:
146
+
147
+ | NFR | Requirement | Measurement |
148
+ |-----|-------------|-------------|
149
+ | Performance | Page load < Xs, API response < Yms | Lighthouse, k6 |
150
+ | Security | Auth required, input validation, OWASP top 10 | sentinel scan |
151
+ | Scalability | Expected users, data volume | Load test target |
152
+ | Reliability | Uptime target, error budget | Monitoring threshold |
153
+ | Accessibility | WCAG 2.2 AA | Axe audit |
154
+
155
+ Only include NFRs relevant to this specific task. Don't generate a generic checklist.
156
+
157
+ ### Step 7 — Requirements Document
158
+
159
+ Produce structured output and hand off to `plan`:
160
+
161
+ ```markdown
162
+ # Requirements Document: [Feature Name]
163
+ Created: [date] | BA Session: [summary]
164
+
165
+ ## Context
166
+ [Problem statement — 2-3 sentences]
167
+
168
+ ## Stakeholders
169
+ - Primary user: [who]
170
+ - Affected systems: [what]
171
+
172
+ ## User Stories
173
+ [from Step 5]
174
+
175
+ ## Scope
176
+ ### In Scope
177
+ [from Step 4]
178
+ ### Out of Scope
179
+ [from Step 4]
180
+ ### Assumptions
181
+ [from Step 4]
182
+
183
+ ## Non-Functional Requirements
184
+ [from Step 6]
185
+
186
+ ## Dependencies
187
+ [from Step 4]
188
+
189
+ ## Risks
190
+ - [risk]: [mitigation]
191
+
192
+ ## Next Step
193
+ → Hand off to rune:plan for implementation planning
194
+ ```
195
+
196
+ Save to `.rune/features/<feature-name>/requirements.md`
197
+
198
+ ## Output Format
199
+
200
+ ```
201
+ # Requirements Document: [Feature Name]
202
+ Created: [date] | BA Session: [summary]
203
+
204
+ ## Context
205
+ [Problem statement — 2-3 sentences]
206
+
207
+ ## Stakeholders
208
+ - Primary user: [who, technical level, workflow context]
209
+ - Affected systems: [existing services, databases, APIs]
210
+
211
+ ## User Stories
212
+ US-1: As a [persona], I want to [action] so that [benefit]
213
+ AC-1.1: GIVEN [context] WHEN [action] THEN [result]
214
+ AC-1.2: GIVEN [error case] WHEN [action] THEN [error handling]
215
+
216
+ ## Scope
217
+ ### In Scope
218
+ - [feature/behavior 1]
219
+ - [feature/behavior 2]
220
+ ### Out of Scope
221
+ - [explicitly excluded 1]
222
+ ### Assumptions
223
+ - [assumption — risk if wrong]
224
+
225
+ ## Non-Functional Requirements
226
+ | NFR | Requirement | Measurement |
227
+ |-----|-------------|-------------|
228
+ | [Performance/Security/etc.] | [specific target] | [how to verify] |
229
+
230
+ ## Dependencies
231
+ - [API/service/library]: [status — available/needs setup]
232
+
233
+ ## Risks
234
+ - [risk]: [mitigation strategy]
235
+
236
+ ## Next Step
237
+ → Hand off to rune:plan for implementation planning
238
+ ```
239
+
240
+ Saved to `.rune/features/<feature-name>/requirements.md`
241
+
242
+ ## Constraints
243
+
244
+ 1. MUST ask 5 probing questions before producing requirements — no assumptions
245
+ 2. MUST identify hidden requirements — the obvious ones are never the full picture
246
+ 3. MUST define out-of-scope explicitly — prevents scope creep
247
+ 4. MUST produce testable acceptance criteria — they become test cases
248
+ 5. MUST NOT write code or plan implementation — BA produces WHAT, plan produces HOW
249
+ 6. MUST ask ONE question at a time — don't overwhelm user with 5 questions at once
250
+ 7. MUST NOT skip BA for non-trivial tasks — "just build it" gets redirected to Question 1
251
+
252
+ ## Sharp Edges
253
+
254
+ Known failure modes for this skill. Check these before declaring done.
255
+
256
+ | Failure Mode | Severity | Mitigation |
257
+ |---|---|---|
258
+ | Skipping questions because "requirements are obvious" | CRITICAL | HARD-GATE: 5 questions mandatory, even for "simple" tasks |
259
+ | Answering own questions instead of asking user | HIGH | Questions require USER input — BA doesn't guess |
260
+ | Producing implementation details (HOW) instead of requirements (WHAT) | HIGH | BA outputs requirements doc → plan outputs implementation |
261
+ | All-at-once question dump (asking 5 questions in one message) | MEDIUM | One question at a time, wait for answer before next |
262
+ | Missing hidden requirements (auth, error handling, edge cases) | HIGH | Step 3 checklist is mandatory scan |
263
+ | Requirements doc too verbose (>500 lines) | MEDIUM | Max 200 lines — concise, actionable, testable |
264
+ | Skipping BA for "simple" features that turn out complex | HIGH | Let cook's complexity detection trigger BA, not user judgment |
265
+
266
+ ## Done When
267
+
268
+ - Requirement type classified (feature/refactor/integration/greenfield)
269
+ - 5 probing questions asked and answered (or extracted from spec/PRD)
270
+ - Hidden requirements discovered and confirmed with user
271
+ - Scope defined (in/out/assumptions/dependencies)
272
+ - User stories with testable acceptance criteria produced
273
+ - Non-functional requirements assessed (relevant ones only)
274
+ - Requirements Document saved to `.rune/features/<name>/requirements.md`
275
+ - Handed off to `plan` for implementation planning
276
+
277
+ ## Cost Profile
278
+
279
+ ~3000-6000 tokens input, ~1500-3000 tokens output. Opus for deep requirement analysis — understanding WHAT to build is the most expensive mistake to get wrong.
@@ -0,0 +1,266 @@
1
+ ---
2
+ name: brainstorm
3
+ description: Creative ideation and solution exploration. Generates multiple approaches with trade-offs, uses structured frameworks (SCAMPER, First Principles), and hands off to plan for structuring.
4
+ metadata:
5
+ author: runedev
6
+ version: "0.3.0"
7
+ layer: L2
8
+ model: opus
9
+ group: creation
10
+ tools: "Read, Glob, Grep"
11
+ ---
12
+
13
+ # brainstorm
14
+
15
+ ## Purpose
16
+
17
+ Creative ideation and solution exploration. Brainstorm is the creative engine of the Creation group — it generates multiple approaches with trade-offs, explores alternatives using structured frameworks, and hands the selected approach to plan for structuring. Uses opus for deep creative reasoning.
18
+
19
+ <HARD-GATE>
20
+ Do NOT invoke any implementation skill or write any code until the user has approved the design.
21
+ This applies to EVERY task regardless of perceived simplicity.
22
+ "This is too simple to need a design" is a rationalization. Simple tasks get simple designs (a few sentences), but they still get designs.
23
+ </HARD-GATE>
24
+
25
+ ## Modes
26
+
27
+ ### Discovery Mode (default)
28
+ Normal brainstorming at the start of a task — generate approaches before any code is written.
29
+
30
+ ### Rescue Mode
31
+ Activated when an approach has been tried and **fundamentally failed** — not a bug, but a wrong approach. Rescue mode forces **category-diverse** alternatives instead of variants of the failed approach.
32
+
33
+ **Rescue Mode triggers:**
34
+ - `cook` Phase 4: Approach Pivot Gate fires (3 debug-fix loops exhausted + re-plan still fails)
35
+ - `debug`: 3-Fix Escalation Rule fires AND root cause is "approach doesn't work" (not a bug in implementation)
36
+ - `fix`: 3 fix attempts fail AND each attempt reveals a different blocker (systemic, not localized)
37
+ - Manual: `/rune brainstorm rescue <what failed and why>`
38
+
39
+ **Rescue Mode input:**
40
+ ```
41
+ mode: "rescue"
42
+ failed_approach: string — what was tried
43
+ failure_evidence: string[] — concrete reasons it failed (error messages, blockers, dead ends)
44
+ original_goal: string — what we're still trying to achieve
45
+ ```
46
+
47
+ **Rescue Mode constraints:**
48
+ 1. MUST generate 3-5 approaches (more than Discovery's 2-3 — wider net)
49
+ 2. Each approach MUST be a **different category**, not a variant of the failed one
50
+ 3. At least 1 approach must be "unconventional" (hacky, wrapper, reverse-engineer, proxy, etc.)
51
+ 4. MUST use Collision-Zone Thinking or Inversion Exercise — conventional thinking already failed
52
+ 5. MUST explicitly state why each approach is a **different category** from the failed one
53
+ 6. Failed approach MUST be listed as "Option X (FAILED)" — visible reminder not to loop back
54
+
55
+ **Category examples** (approaches in different categories):
56
+ ```
57
+ Direct API call ≠ Wrapper/middleware layer ≠ Reverse engineering ≠ Browser automation
58
+ ≠ Extension/plugin ≠ Proxy/bridge service ≠ Alternative tool entirely
59
+ ```
60
+
61
+ ## Triggers
62
+
63
+ - Called by `cook` when multiple valid approaches exist for a feature (Discovery Mode)
64
+ - Called by `cook` Approach Pivot Gate when current approach fundamentally fails (Rescue Mode)
65
+ - Called by `debug` 3-Fix Escalation when root cause is architectural, not a bug (Rescue Mode)
66
+ - Called by `plan` when architecture decision needs creative exploration (Discovery Mode)
67
+ - `/rune brainstorm <topic>` — manual brainstorming (Discovery Mode)
68
+ - `/rune brainstorm rescue <context>` — manual rescue (Rescue Mode)
69
+ - Auto-trigger: when task description is vague or open-ended (Discovery Mode)
70
+
71
+ ## Calls (outbound)
72
+
73
+ - `plan` (L2): when idea is selected and needs structuring into actionable steps
74
+ - `research` (L3): gather data for informed brainstorming (existing solutions, benchmarks)
75
+ - `trend-scout` (L3): market context and trends for product-oriented brainstorming
76
+ - `problem-solver` (L3): structured reasoning frameworks (SCAMPER, First Principles, 6 Hats)
77
+ - `sequential-thinking` (L3): evaluating approaches with many variables
78
+
79
+ ## Called By (inbound)
80
+
81
+ - `cook` (L1): when multiple valid approaches exist for a feature (Discovery Mode)
82
+ - `cook` (L1): Approach Pivot Gate — current approach failed, need category-diverse alternatives (Rescue Mode)
83
+ - `debug` (L2): 3-Fix Escalation when root cause is "wrong approach" not "wrong code" (Rescue Mode)
84
+ - `plan` (L2): when architecture decision needs creative exploration (Discovery Mode)
85
+ - User: `/rune brainstorm <topic>` direct invocation (Discovery Mode)
86
+ - User: `/rune brainstorm rescue <context>` manual rescue (Rescue Mode)
87
+
88
+ ## Cross-Hub Connections
89
+
90
+ - `brainstorm` ↔ `plan` — bidirectional: brainstorm generates options → plan structures the chosen one, plan needs exploration → brainstorm ideates
91
+
92
+ ## Reasoning Frameworks
93
+
94
+ ### Analytical Frameworks
95
+ ```
96
+ SCAMPER — Substitute, Combine, Adapt, Modify, Put to use, Eliminate, Reverse
97
+ FIRST PRINCIPLES — Break down to fundamentals, rebuild from ground up
98
+ 6 THINKING HATS — Facts, Emotions, Caution, Benefits, Creativity, Process
99
+ CRAZY 8s — 8 ideas in 8 minutes (rapid ideation)
100
+ ```
101
+
102
+ ### Breakthrough Frameworks (when conventional thinking fails)
103
+
104
+ **Collision-Zone Thinking** — Force unrelated concepts together: "What if we treated X like Y?"
105
+ - Pick two unrelated domains (e.g., services + electrical circuits → circuit breakers)
106
+ - Explore emergent properties from the collision
107
+ - Test where the metaphor breaks → those boundaries reveal design constraints
108
+ - Best source domains: physics, biology, economics, psychology
109
+ - Use when: conventional approaches feel inadequate, need innovation not optimization
110
+
111
+ **Inversion Exercise** — Flip every assumption: "What if the opposite were true?"
112
+ - List core assumptions ("cache reduces latency", "handle errors when they occur")
113
+ - Invert each: "add latency" → debouncing; "make errors impossible" → type systems
114
+ - Valid inversions expose context-dependence in "obvious" truths
115
+ - Use when: feeling forced into "the only way", stuck on unquestioned assumptions
116
+
117
+ **Scale Game** — Test at extremes (1000x bigger/smaller) to expose fundamentals
118
+ - Pick a dimension: volume, speed, users, duration, failure rate
119
+ - Test minimum (1000x smaller) AND maximum (1000x bigger)
120
+ - What breaks reveals algorithmic limits; what survives is fundamentally sound
121
+ - Use when: unsure about production scale, edge cases unclear, "it works in dev"
122
+
123
+ ## Executable Steps
124
+
125
+ ### Step 0 — Detect Mode
126
+
127
+ Check the invocation context:
128
+ - If `mode="rescue"` is set, or caller is Approach Pivot Gate / 3-Fix Escalation → **Rescue Mode**
129
+ - Otherwise → **Discovery Mode**
130
+
131
+ If Rescue Mode: read `failed_approach` and `failure_evidence` before proceeding. These become anti-constraints — approaches that MUST NOT repeat the failed category.
132
+
133
+ ### Step 1 — Frame the Problem
134
+ State the decision to be made in one clear sentence: "We need to decide HOW TO [achieve X] given [constraints Y]." Identify:
135
+ - Hard constraints (cannot change): budget, existing tech stack, deadlines
136
+ - Soft constraints (prefer to avoid): complexity, breaking changes, unfamiliar tech
137
+ - Success criteria: what does a good solution look like?
138
+ - **[Rescue Mode only]** Anti-constraints: "Approach X was tried and failed because Y — do NOT generate variants of X"
139
+
140
+ If the problem is unclear, ask the user ONE clarifying question before proceeding.
141
+
142
+ ### Step 2 — Generate Approaches
143
+
144
+ **Discovery Mode**: Produce exactly 2–3 distinct approaches.
145
+ **Rescue Mode**: Produce exactly 3–5 approaches, each a **different category** from the failed approach.
146
+
147
+ Each approach must be meaningfully different — not just variations of the same idea. For each approach provide:
148
+ - **Name**: short memorable label
149
+ - **Description**: 2–4 sentences on how it works
150
+ - **Pros**: concrete advantages (not generic "simple" — be specific)
151
+ - **Cons**: concrete disadvantages and failure modes
152
+ - **Effort**: low (< 1 day) | medium (1–3 days) | high (> 3 days)
153
+ - **Risk**: low | medium | high + one-line explanation of the main risk
154
+
155
+ If the domain is unfamiliar or data is needed, invoke `rune:research` before generating options. For product/market context, invoke `rune:trend-scout`.
156
+
157
+ ### Step 3 — Evaluate
158
+
159
+ **Discovery Mode** — Apply the most relevant framework:
160
+ - Use **SCAMPER** when exploring variations of an existing solution
161
+ - Use **First Principles** when the problem looks unsolvable with conventional approaches
162
+ - Use **6 Thinking Hats** when stakeholder perspectives matter (product vs. engineering vs. user)
163
+ - Use **Crazy 8s** (rapid listing) when time-boxed exploration is needed
164
+ - Use **Collision-Zone** when innovation is needed, not just optimization — force cross-domain metaphors
165
+ - Use **Inversion** when all options feel forced or there's an unquestioned "must be this way"
166
+ - Use **Scale Game** when validating which approach survives production reality
167
+
168
+ **Rescue Mode** — MUST use at least one of these (conventional thinking already failed):
169
+ - **Collision-Zone Thinking** (mandatory first pick) — force cross-domain metaphors to break out of the failed category
170
+ - **Inversion Exercise** — flip assumptions that led to the failed approach
171
+ - **First Principles** — strip to fundamentals, rebuild without the assumption that caused failure
172
+
173
+ Additionally in Rescue Mode:
174
+ - Invoke `rune:research` to search for how others solved similar problems (repos, articles, workarounds)
175
+ - At least 1 approach must be "hacky/unconventional" — wrappers, reverse engineering, browser automation, proxy layers, debug mode abuse, etc.
176
+ - Label each approach with its **category tag** to prove diversity: `[Direct API]`, `[Wrapper]`, `[Reverse-Engineer]`, `[Proxy]`, `[Extension]`, `[Alternative Tool]`, etc.
177
+
178
+ For approaches with many interacting variables, invoke `rune:sequential-thinking` to reason through trade-offs systematically.
179
+
180
+ ### Step 4 — Recommend
181
+ Select ONE approach as the recommendation. State:
182
+ - Which option is recommended
183
+ - Primary reason (1 sentence)
184
+ - Conditions under which a different option would be better (hedge case)
185
+
186
+ Do not recommend "it depends" without a concrete decision rule.
187
+
188
+ ### Step 5 — Return to Plan
189
+ Pass the recommended approach back to `rune:plan` for structuring into an executable implementation plan. Include:
190
+ - The chosen option name
191
+ - Key constraints to honor in the plan
192
+ - Any risks identified that the plan must mitigate
193
+
194
+ If the user rejects the recommendation, return to Step 2 with adjusted constraints and regenerate.
195
+
196
+ ## Constraints
197
+
198
+ 1. MUST propose 2-3 approaches (Discovery) or 3-5 approaches (Rescue) — never present only one option
199
+ 2. MUST include your recommendation and reasoning for why
200
+ 3. MUST ask one question at a time — don't overwhelm with multiple questions
201
+ 4. MUST save approved design to docs/plans/ before transitioning to plan
202
+ 5. MUST NOT jump to implementation — brainstorm → plan → implement is the order
203
+ 6. [Rescue Mode] MUST NOT generate variants of the failed approach — each approach must be a different CATEGORY
204
+ 7. [Rescue Mode] MUST use Collision-Zone or Inversion framework — conventional thinking already failed
205
+ 8. [Rescue Mode] MUST include at least 1 unconventional/hacky approach — sometimes the "dirty" solution is the only one that works
206
+
207
+ ## Output Format
208
+
209
+ ```
210
+ ## Brainstorm: [Topic]
211
+
212
+ ### Context
213
+ [Problem statement and constraints]
214
+
215
+ ### Option A: [Name] (Recommended)
216
+ - **Approach**: [description]
217
+ - **Pros**: [advantages]
218
+ - **Cons**: [disadvantages]
219
+ - **Effort**: low | medium | high
220
+ - **Risk**: low | medium | high — [main risk]
221
+
222
+ ### Option B: [Name]
223
+ - **Approach**: [description]
224
+ - **Pros**: [advantages]
225
+ - **Cons**: [disadvantages]
226
+ - **Effort**: low | medium | high
227
+ - **Risk**: low | medium | high — [main risk]
228
+
229
+ ### Option C: [Name] (if needed)
230
+ ...
231
+
232
+ ### Recommendation
233
+ Option A — [one-line primary reason].
234
+ Choose Option B if [specific hedge condition].
235
+
236
+ ### Next Step
237
+ Proceeding to rune:plan with Option A. Constraints to honor: [list].
238
+ ```
239
+
240
+ ## Sharp Edges
241
+
242
+ Known failure modes for this skill. Check these before declaring done.
243
+
244
+ | Failure Mode | Severity | Mitigation |
245
+ |---|---|---|
246
+ | Generating only one option instead of 2-3 | HIGH | Always present multiple approaches — the value is in the comparison, not the recommendation |
247
+ | Proceeding to plan without user approval on the approach | CRITICAL | Brainstorm MUST get explicit sign-off before calling plan — no silent "going with Option A" |
248
+ | Options are variations of the same approach (fake diversity) | HIGH | Options must differ in architecture, not just naming — different trade-offs, not just different words |
249
+ | [Rescue] Generating variants of the failed approach | CRITICAL | Each approach MUST have a different category tag — if two share a tag, one must be replaced |
250
+ | [Rescue] Skipping Collision-Zone/Inversion frameworks | HIGH | Conventional thinking already failed — MUST use at least one breakthrough framework |
251
+ | [Rescue] All approaches are "clean/proper" — no hacky option | MEDIUM | At least 1 must be unconventional — wrappers, reverse-engineering, debug mode abuse, proxy layers |
252
+ | Calling plan directly instead of presenting options first | CRITICAL | Steps 2-3 are mandatory — present options, get approval, THEN call plan |
253
+ | "Creative" options that ignore stated constraints | MEDIUM | Every option must satisfy the constraints declared in Step 1 |
254
+
255
+ ## Done When
256
+
257
+ - Context scan complete (project files read, existing patterns identified)
258
+ - 2-3 genuinely different approaches presented with trade-offs
259
+ - User has explicitly approved an approach (not implied or assumed)
260
+ - Selected option documented with rationale
261
+ - Constraints for plan phase listed explicitly
262
+ - `plan` (L2) called with the approved approach and constraints
263
+
264
+ ## Cost Profile
265
+
266
+ ~2000-5000 tokens input, ~1000-2500 tokens output. Opus for creative reasoning depth. Runs infrequently — only when creative exploration is needed.