@open-agent-toolkit/cli 0.0.61 → 0.0.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/assets/docs/cli-utilities/tool-packs.md +74 -4
  2. package/assets/docs/reference/file-locations.md +1 -1
  3. package/assets/docs/reference/oat-directory-structure.md +2 -0
  4. package/assets/docs/workflows/ideas/index.md +6 -0
  5. package/assets/docs/workflows/ideas/lifecycle.md +12 -0
  6. package/assets/docs/workflows/projects/lifecycle.md +21 -0
  7. package/assets/docs/workflows/skills/index.md +8 -2
  8. package/assets/public-package-versions.json +4 -4
  9. package/assets/skills/oat-brainstorm/SKILL.md +600 -0
  10. package/assets/skills/oat-brainstorm/references/destinations.md +167 -0
  11. package/assets/skills/oat-brainstorm/references/dogfood-results.md +731 -0
  12. package/assets/skills/oat-brainstorm/references/visual-companion.md +316 -0
  13. package/assets/skills/oat-brainstorm/scripts/frame-template.html +214 -0
  14. package/assets/skills/oat-brainstorm/scripts/helper.js +88 -0
  15. package/assets/skills/oat-brainstorm/scripts/server.cjs +354 -0
  16. package/assets/skills/oat-brainstorm/scripts/start-server.sh +176 -0
  17. package/assets/skills/oat-brainstorm/scripts/stop-server.sh +56 -0
  18. package/assets/skills/oat-brainstorm/templates/brainstorm-doc.md +79 -0
  19. package/assets/skills/oat-idea-ideate/SKILL.md +8 -4
  20. package/assets/skills/oat-pjm-add-backlog-item/SKILL.md +2 -1
  21. package/assets/skills/oat-pjm-update-repo-reference/SKILL.md +2 -1
  22. package/assets/skills/oat-project-complete/SKILL.md +49 -2
  23. package/assets/skills/oat-project-document/SKILL.md +2 -1
  24. package/assets/skills/oat-project-pr-final/SKILL.md +2 -1
  25. package/assets/skills/oat-project-spec/SKILL.md +2 -2
  26. package/assets/skills/oat-project-summary/SKILL.md +2 -1
  27. package/dist/commands/config/index.d.ts.map +1 -1
  28. package/dist/commands/config/index.js +12 -0
  29. package/dist/commands/init/tools/brainstorm/index.d.ts +22 -0
  30. package/dist/commands/init/tools/brainstorm/index.d.ts.map +1 -0
  31. package/dist/commands/init/tools/brainstorm/index.js +145 -0
  32. package/dist/commands/init/tools/brainstorm/install-brainstorm.d.ts +19 -0
  33. package/dist/commands/init/tools/brainstorm/install-brainstorm.d.ts.map +1 -0
  34. package/dist/commands/init/tools/brainstorm/install-brainstorm.js +37 -0
  35. package/dist/commands/init/tools/index.d.ts +3 -1
  36. package/dist/commands/init/tools/index.d.ts.map +1 -1
  37. package/dist/commands/init/tools/index.js +76 -6
  38. package/dist/commands/init/tools/shared/skill-manifest.d.ts +7 -0
  39. package/dist/commands/init/tools/shared/skill-manifest.d.ts.map +1 -1
  40. package/dist/commands/init/tools/shared/skill-manifest.js +11 -0
  41. package/dist/commands/tools/remove/index.d.ts.map +1 -1
  42. package/dist/commands/tools/remove/index.js +2 -1
  43. package/dist/commands/tools/shared/install-sync-context.d.ts.map +1 -1
  44. package/dist/commands/tools/shared/install-sync-context.js +3 -1
  45. package/dist/commands/tools/shared/scan-tools.d.ts.map +1 -1
  46. package/dist/commands/tools/shared/scan-tools.js +3 -1
  47. package/dist/commands/tools/shared/types.d.ts +1 -1
  48. package/dist/commands/tools/shared/types.d.ts.map +1 -1
  49. package/dist/commands/tools/update/index.d.ts.map +1 -1
  50. package/dist/commands/tools/update/index.js +2 -1
  51. package/dist/commands/tools/update/update-tools.d.ts.map +1 -1
  52. package/dist/commands/tools/update/update-tools.js +6 -1
  53. package/dist/config/oat-config.d.ts +1 -1
  54. package/dist/config/oat-config.d.ts.map +1 -1
  55. package/dist/config/oat-config.js +1 -0
  56. package/dist/config/resolve.d.ts.map +1 -1
  57. package/dist/config/resolve.js +1 -0
  58. package/package.json +2 -2
@@ -0,0 +1,316 @@
1
+ # Visual Companion Guide
2
+
3
+ Browser-based visual brainstorming companion for showing mockups, diagrams, and options.
4
+
5
+ ## When to Use
6
+
7
+ Decide per-question, not per-session. The test: **would the user understand this better by seeing it than reading it?**
8
+
9
+ **Use the browser** when the content itself is visual:
10
+
11
+ - **UI mockups** — wireframes, layouts, navigation structures, component designs
12
+ - **Architecture diagrams** — system components, data flow, relationship maps
13
+ - **Side-by-side visual comparisons** — comparing two layouts, two color schemes, two design directions
14
+ - **Design polish** — when the question is about look and feel, spacing, visual hierarchy
15
+ - **Spatial relationships** — state machines, flowcharts, entity relationships rendered as diagrams
16
+
17
+ **Use the terminal** when the content is text or tabular:
18
+
19
+ - **Requirements and scope questions** — "what does X mean?", "which features are in scope?"
20
+ - **Conceptual A/B/C choices** — picking between approaches described in words
21
+ - **Tradeoff lists** — pros/cons, comparison tables
22
+ - **Technical decisions** — API design, data modeling, architectural approach selection
23
+ - **Clarifying questions** — anything where the answer is words, not a visual preference
24
+
25
+ A question _about_ a UI topic is not automatically a visual question. "What kind of wizard do you want?" is conceptual — use the terminal. "Which of these wizard layouts feels right?" is visual — use the browser.
26
+
27
+ ## How It Works
28
+
29
+ The server watches a directory for HTML files and serves the newest one to the browser. You write HTML content to `screen_dir`, the user sees it in their browser and can click to select options. Selections are recorded to `state_dir/events` that you read on your next turn.
30
+
31
+ **Content fragments vs full documents:** If your HTML file starts with `<!DOCTYPE` or `<html`, the server serves it as-is (just injects the helper script). Otherwise, the server automatically wraps your content in the frame template — adding the header, CSS theme, selection indicator, and all interactive infrastructure. **Write content fragments by default.** Only write full documents when you need complete control over the page.
32
+
33
+ ## Persistence Paths
34
+
35
+ The bundled `start-server.sh` resolves session paths through OAT-managed prefixes (no `/tmp` default — sessions persist in all cases):
36
+
37
+ 1. **`--project-dir <path>`** → `<path>/.oat/brainstorm/<session-id>/`
38
+ 2. **Inside an OAT-initialized repo** (auto-detected by walking up from `pwd` looking for a `.oat/` directory) → `<repo-root>/.oat/brainstorm/<session-id>/`
39
+ 3. **Fallback** (no project dir, not inside an OAT repo) → `~/.oat/brainstorm/<session-id>/`
40
+
41
+ OAT's repo-root `.gitignore` already covers `.oat/` so repo-scoped sessions are not tracked by default.
42
+
43
+ ## Starting a Session
44
+
45
+ The scripts ship inside the skill directory. Invoke them via paths relative to the installed skill location (`.agents/skills/oat-brainstorm/scripts/` or the user-scope equivalent `~/.agents/skills/oat-brainstorm/scripts/`).
46
+
47
+ ```bash
48
+ # Start server with project-dir override (paths land under that directory)
49
+ .agents/skills/oat-brainstorm/scripts/start-server.sh --project-dir /path/to/project
50
+
51
+ # Returns: {"type":"server-started","port":52341,"url":"http://localhost:52341",
52
+ # "screen_dir":"/path/to/project/.oat/brainstorm/12345-1706000000/content",
53
+ # "state_dir":"/path/to/project/.oat/brainstorm/12345-1706000000/state"}
54
+ ```
55
+
56
+ Save `screen_dir` and `state_dir` from the response. Tell user to open the URL.
57
+
58
+ **Finding connection info:** The server writes its startup JSON to `$STATE_DIR/server-info`. If you launched the server in the background and didn't capture stdout, read that file to get the URL and port. Inside an OAT repo (without `--project-dir`), the session lives under `<repo-root>/.oat/brainstorm/`. Outside an OAT repo, check `~/.oat/brainstorm/`.
59
+
60
+ **Note:** Repo-scoped sessions persist under `.oat/brainstorm/` (covered by OAT's default `.gitignore` for `.oat/`). User-scope fallback sessions persist under `~/.oat/brainstorm/`. There is no `/tmp` default — sessions are always recoverable.
61
+
62
+ **Launching the server by platform:**
63
+
64
+ **Claude Code (macOS / Linux):**
65
+
66
+ ```bash
67
+ # Default mode works — the script backgrounds the server itself
68
+ .agents/skills/oat-brainstorm/scripts/start-server.sh --project-dir /path/to/project
69
+ ```
70
+
71
+ **Claude Code (Windows):**
72
+
73
+ ```bash
74
+ # Windows auto-detects and uses foreground mode, which blocks the tool call.
75
+ # Use run_in_background: true on the Bash tool call so the server survives
76
+ # across conversation turns.
77
+ .agents/skills/oat-brainstorm/scripts/start-server.sh --project-dir /path/to/project
78
+ ```
79
+
80
+ When calling this via the Bash tool, set `run_in_background: true`. Then read `$STATE_DIR/server-info` on the next turn to get the URL and port.
81
+
82
+ **Codex:**
83
+
84
+ ```bash
85
+ # Codex reaps background processes. The script auto-detects CODEX_CI and
86
+ # switches to foreground mode. Run it normally — no extra flags needed.
87
+ .agents/skills/oat-brainstorm/scripts/start-server.sh --project-dir /path/to/project
88
+ ```
89
+
90
+ **Gemini CLI:**
91
+
92
+ ```bash
93
+ # Use --foreground and set is_background: true on your shell tool call
94
+ # so the process survives across turns
95
+ .agents/skills/oat-brainstorm/scripts/start-server.sh --project-dir /path/to/project --foreground
96
+ ```
97
+
98
+ **Other environments:** The server must keep running in the background across conversation turns. If your environment reaps detached processes, use `--foreground` and launch the command with your platform's background execution mechanism.
99
+
100
+ If the URL is unreachable from your browser (common in remote/containerized setups), bind a non-loopback host:
101
+
102
+ ```bash
103
+ .agents/skills/oat-brainstorm/scripts/start-server.sh \
104
+ --project-dir /path/to/project \
105
+ --host 0.0.0.0 \
106
+ --url-host localhost
107
+ ```
108
+
109
+ Use `--url-host` to control what hostname is printed in the returned URL JSON.
110
+
111
+ ## The Loop
112
+
113
+ 1. **Check server is alive**, then **write HTML** to a new file in `screen_dir`:
114
+ - Before each write, check that `$STATE_DIR/server-info` exists. If it doesn't (or `$STATE_DIR/server-stopped` exists), the server has shut down — restart it with `start-server.sh` before continuing. The server auto-exits after 30 minutes of inactivity.
115
+ - Use semantic filenames: `platform.html`, `visual-style.html`, `layout.html`
116
+ - **Never reuse filenames** — each screen gets a fresh file
117
+ - Use Write tool — **never use cat/heredoc** (dumps noise into terminal)
118
+ - Server automatically serves the newest file
119
+
120
+ 2. **Tell user what to expect and end your turn:**
121
+ - Remind them of the URL (every step, not just first)
122
+ - Give a brief text summary of what's on screen (e.g., "Showing 3 layout options for the homepage")
123
+ - Ask them to respond in the terminal: "Take a look and let me know what you think. Click to select an option if you'd like."
124
+
125
+ 3. **On your next turn** — after the user responds in the terminal:
126
+ - Read `$STATE_DIR/events` if it exists — this contains the user's browser interactions (clicks, selections) as JSON lines
127
+ - Merge with the user's terminal text to get the full picture
128
+ - The terminal message is the primary feedback; `state_dir/events` provides structured interaction data
129
+
130
+ 4. **Iterate or advance** — if feedback changes current screen, write a new file (e.g., `layout-v2.html`). Only move to the next question when the current step is validated.
131
+
132
+ 5. **Unload when returning to terminal** — when the next step doesn't need the browser (e.g., a clarifying question, a tradeoff discussion), push a waiting screen to clear the stale content:
133
+
134
+ ```html
135
+ <!-- filename: waiting.html (or waiting-2.html, etc.) -->
136
+ <div
137
+ style="display:flex;align-items:center;justify-content:center;min-height:60vh"
138
+ >
139
+ <p class="subtitle">Continuing in terminal...</p>
140
+ </div>
141
+ ```
142
+
143
+ This prevents the user from staring at a resolved choice while the conversation has moved on. When the next visual question comes up, push a new content file as usual.
144
+
145
+ 6. Repeat until done.
146
+
147
+ ## Writing Content Fragments
148
+
149
+ Write just the content that goes inside the page. The server wraps it in the frame template automatically (header, theme CSS, selection indicator, and all interactive infrastructure).
150
+
151
+ **Minimal example:**
152
+
153
+ ```html
154
+ <h2>Which layout works better?</h2>
155
+ <p class="subtitle">Consider readability and visual hierarchy</p>
156
+
157
+ <div class="options">
158
+ <div class="option" data-choice="a" onclick="toggleSelect(this)">
159
+ <div class="letter">A</div>
160
+ <div class="content">
161
+ <h3>Single Column</h3>
162
+ <p>Clean, focused reading experience</p>
163
+ </div>
164
+ </div>
165
+ <div class="option" data-choice="b" onclick="toggleSelect(this)">
166
+ <div class="letter">B</div>
167
+ <div class="content">
168
+ <h3>Two Column</h3>
169
+ <p>Sidebar navigation with main content</p>
170
+ </div>
171
+ </div>
172
+ </div>
173
+ ```
174
+
175
+ That's it. No `<html>`, no CSS, no `<script>` tags needed. The server provides all of that.
176
+
177
+ ## CSS Classes Available
178
+
179
+ The frame template provides these CSS classes for your content:
180
+
181
+ ### Options (A/B/C choices)
182
+
183
+ ```html
184
+ <div class="options">
185
+ <div class="option" data-choice="a" onclick="toggleSelect(this)">
186
+ <div class="letter">A</div>
187
+ <div class="content">
188
+ <h3>Title</h3>
189
+ <p>Description</p>
190
+ </div>
191
+ </div>
192
+ </div>
193
+ ```
194
+
195
+ **Multi-select:** Add `data-multiselect` to the container to let users select multiple options. Each click toggles the item. The indicator bar shows the count.
196
+
197
+ ```html
198
+ <div class="options" data-multiselect>
199
+ <!-- same option markup — users can select/deselect multiple -->
200
+ </div>
201
+ ```
202
+
203
+ ### Cards (visual designs)
204
+
205
+ ```html
206
+ <div class="cards">
207
+ <div class="card" data-choice="design1" onclick="toggleSelect(this)">
208
+ <div class="card-image"><!-- mockup content --></div>
209
+ <div class="card-body">
210
+ <h3>Name</h3>
211
+ <p>Description</p>
212
+ </div>
213
+ </div>
214
+ </div>
215
+ ```
216
+
217
+ ### Mockup container
218
+
219
+ ```html
220
+ <div class="mockup">
221
+ <div class="mockup-header">Preview: Dashboard Layout</div>
222
+ <div class="mockup-body"><!-- your mockup HTML --></div>
223
+ </div>
224
+ ```
225
+
226
+ ### Split view (side-by-side)
227
+
228
+ ```html
229
+ <div class="split">
230
+ <div class="mockup"><!-- left --></div>
231
+ <div class="mockup"><!-- right --></div>
232
+ </div>
233
+ ```
234
+
235
+ ### Pros/Cons
236
+
237
+ ```html
238
+ <div class="pros-cons">
239
+ <div class="pros">
240
+ <h4>Pros</h4>
241
+ <ul>
242
+ <li>Benefit</li>
243
+ </ul>
244
+ </div>
245
+ <div class="cons">
246
+ <h4>Cons</h4>
247
+ <ul>
248
+ <li>Drawback</li>
249
+ </ul>
250
+ </div>
251
+ </div>
252
+ ```
253
+
254
+ ### Mock elements (wireframe building blocks)
255
+
256
+ ```html
257
+ <div class="mock-nav">Logo | Home | About | Contact</div>
258
+ <div style="display: flex;">
259
+ <div class="mock-sidebar">Navigation</div>
260
+ <div class="mock-content">Main content area</div>
261
+ </div>
262
+ <button class="mock-button">Action Button</button>
263
+ <input class="mock-input" placeholder="Input field" />
264
+ <div class="placeholder">Placeholder area</div>
265
+ ```
266
+
267
+ ### Typography and sections
268
+
269
+ - `h2` — page title
270
+ - `h3` — section heading
271
+ - `.subtitle` — secondary text below title
272
+ - `.section` — content block with bottom margin
273
+ - `.label` — small uppercase label text
274
+
275
+ ## Browser Events Format
276
+
277
+ When the user clicks options in the browser, their interactions are recorded to `$STATE_DIR/events` (one JSON object per line). The file is cleared automatically when you push a new screen.
278
+
279
+ ```jsonl
280
+ {"type":"click","choice":"a","text":"Option A - Simple Layout","timestamp":1706000101}
281
+ {"type":"click","choice":"c","text":"Option C - Complex Grid","timestamp":1706000108}
282
+ {"type":"click","choice":"b","text":"Option B - Hybrid","timestamp":1706000115}
283
+ ```
284
+
285
+ The full event stream shows the user's exploration path — they may click multiple options before settling. The last `choice` event is typically the final selection, but the pattern of clicks can reveal hesitation or preferences worth asking about.
286
+
287
+ If `$STATE_DIR/events` doesn't exist, the user didn't interact with the browser — use only their terminal text.
288
+
289
+ ## Design Tips
290
+
291
+ - **Scale fidelity to the question** — wireframes for layout, polish for polish questions
292
+ - **Explain the question on each page** — "Which layout feels more professional?" not just "Pick one"
293
+ - **Iterate before advancing** — if feedback changes current screen, write a new version
294
+ - **2-4 options max** per screen
295
+ - **Use real content when it matters** — for a photography portfolio, use actual images (Unsplash). Placeholder content obscures design issues.
296
+ - **Keep mockups simple** — focus on layout and structure, not pixel-perfect design
297
+
298
+ ## File Naming
299
+
300
+ - Use semantic names: `platform.html`, `visual-style.html`, `layout.html`
301
+ - Never reuse filenames — each screen must be a new file
302
+ - For iterations: append version suffix like `layout-v2.html`, `layout-v3.html`
303
+ - Server serves newest file by modification time
304
+
305
+ ## Cleaning Up
306
+
307
+ ```bash
308
+ .agents/skills/oat-brainstorm/scripts/stop-server.sh $SESSION_DIR
309
+ ```
310
+
311
+ OAT-managed sessions persist under `.oat/brainstorm/` (repo-scope) or `~/.oat/brainstorm/` (user-scope) so mockup files remain available for later reference. The legacy `/tmp` cleanup branch in `stop-server.sh` is kept for safety but no longer fires under OAT's default path resolution.
312
+
313
+ ## Reference
314
+
315
+ - Frame template (CSS reference): `scripts/frame-template.html`
316
+ - Helper script (client-side): `scripts/helper.js`
@@ -0,0 +1,214 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Superpowers Brainstorming</title>
6
+ <style>
7
+ /*
8
+ * BRAINSTORM COMPANION FRAME TEMPLATE
9
+ *
10
+ * This template provides a consistent frame with:
11
+ * - OS-aware light/dark theming
12
+ * - Fixed header and selection indicator bar
13
+ * - Scrollable main content area
14
+ * - CSS helpers for common UI patterns
15
+ *
16
+ * Content is injected via placeholder comment in #claude-content.
17
+ */
18
+
19
+ * { box-sizing: border-box; margin: 0; padding: 0; }
20
+ html, body { height: 100%; overflow: hidden; }
21
+
22
+ /* ===== THEME VARIABLES ===== */
23
+ :root {
24
+ --bg-primary: #f5f5f7;
25
+ --bg-secondary: #ffffff;
26
+ --bg-tertiary: #e5e5e7;
27
+ --border: #d1d1d6;
28
+ --text-primary: #1d1d1f;
29
+ --text-secondary: #86868b;
30
+ --text-tertiary: #aeaeb2;
31
+ --accent: #0071e3;
32
+ --accent-hover: #0077ed;
33
+ --success: #34c759;
34
+ --warning: #ff9f0a;
35
+ --error: #ff3b30;
36
+ --selected-bg: #e8f4fd;
37
+ --selected-border: #0071e3;
38
+ }
39
+
40
+ @media (prefers-color-scheme: dark) {
41
+ :root {
42
+ --bg-primary: #1d1d1f;
43
+ --bg-secondary: #2d2d2f;
44
+ --bg-tertiary: #3d3d3f;
45
+ --border: #424245;
46
+ --text-primary: #f5f5f7;
47
+ --text-secondary: #86868b;
48
+ --text-tertiary: #636366;
49
+ --accent: #0a84ff;
50
+ --accent-hover: #409cff;
51
+ --selected-bg: rgba(10, 132, 255, 0.15);
52
+ --selected-border: #0a84ff;
53
+ }
54
+ }
55
+
56
+ body {
57
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
58
+ background: var(--bg-primary);
59
+ color: var(--text-primary);
60
+ display: flex;
61
+ flex-direction: column;
62
+ line-height: 1.5;
63
+ }
64
+
65
+ /* ===== FRAME STRUCTURE ===== */
66
+ .header {
67
+ background: var(--bg-secondary);
68
+ padding: 0.5rem 1.5rem;
69
+ display: flex;
70
+ justify-content: space-between;
71
+ align-items: center;
72
+ border-bottom: 1px solid var(--border);
73
+ flex-shrink: 0;
74
+ }
75
+ .header h1 { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }
76
+ .header .status { font-size: 0.7rem; color: var(--success); display: flex; align-items: center; gap: 0.4rem; }
77
+ .header .status::before { content: ''; width: 6px; height: 6px; background: var(--success); border-radius: 50%; }
78
+
79
+ .main { flex: 1; overflow-y: auto; }
80
+ #claude-content { padding: 2rem; min-height: 100%; }
81
+
82
+ .indicator-bar {
83
+ background: var(--bg-secondary);
84
+ border-top: 1px solid var(--border);
85
+ padding: 0.5rem 1.5rem;
86
+ flex-shrink: 0;
87
+ text-align: center;
88
+ }
89
+ .indicator-bar span {
90
+ font-size: 0.75rem;
91
+ color: var(--text-secondary);
92
+ }
93
+ .indicator-bar .selected-text {
94
+ color: var(--accent);
95
+ font-weight: 500;
96
+ }
97
+
98
+ /* ===== TYPOGRAPHY ===== */
99
+ h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; }
100
+ h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.25rem; }
101
+ .subtitle { color: var(--text-secondary); margin-bottom: 1.5rem; }
102
+ .section { margin-bottom: 2rem; }
103
+ .label { font-size: 0.7rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
104
+
105
+ /* ===== OPTIONS (for A/B/C choices) ===== */
106
+ .options { display: flex; flex-direction: column; gap: 0.75rem; }
107
+ .option {
108
+ background: var(--bg-secondary);
109
+ border: 2px solid var(--border);
110
+ border-radius: 12px;
111
+ padding: 1rem 1.25rem;
112
+ cursor: pointer;
113
+ transition: all 0.15s ease;
114
+ display: flex;
115
+ align-items: flex-start;
116
+ gap: 1rem;
117
+ }
118
+ .option:hover { border-color: var(--accent); }
119
+ .option.selected { background: var(--selected-bg); border-color: var(--selected-border); }
120
+ .option .letter {
121
+ background: var(--bg-tertiary);
122
+ color: var(--text-secondary);
123
+ width: 1.75rem; height: 1.75rem;
124
+ border-radius: 6px;
125
+ display: flex; align-items: center; justify-content: center;
126
+ font-weight: 600; font-size: 0.85rem; flex-shrink: 0;
127
+ }
128
+ .option.selected .letter { background: var(--accent); color: white; }
129
+ .option .content { flex: 1; }
130
+ .option .content h3 { font-size: 0.95rem; margin-bottom: 0.15rem; }
131
+ .option .content p { color: var(--text-secondary); font-size: 0.85rem; margin: 0; }
132
+
133
+ /* ===== CARDS (for showing designs/mockups) ===== */
134
+ .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
135
+ .card {
136
+ background: var(--bg-secondary);
137
+ border: 1px solid var(--border);
138
+ border-radius: 12px;
139
+ overflow: hidden;
140
+ cursor: pointer;
141
+ transition: all 0.15s ease;
142
+ }
143
+ .card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
144
+ .card.selected { border-color: var(--selected-border); border-width: 2px; }
145
+ .card-image { background: var(--bg-tertiary); aspect-ratio: 16/10; display: flex; align-items: center; justify-content: center; }
146
+ .card-body { padding: 1rem; }
147
+ .card-body h3 { margin-bottom: 0.25rem; }
148
+ .card-body p { color: var(--text-secondary); font-size: 0.85rem; }
149
+
150
+ /* ===== MOCKUP CONTAINER ===== */
151
+ .mockup {
152
+ background: var(--bg-secondary);
153
+ border: 1px solid var(--border);
154
+ border-radius: 12px;
155
+ overflow: hidden;
156
+ margin-bottom: 1.5rem;
157
+ }
158
+ .mockup-header {
159
+ background: var(--bg-tertiary);
160
+ padding: 0.5rem 1rem;
161
+ font-size: 0.75rem;
162
+ color: var(--text-secondary);
163
+ border-bottom: 1px solid var(--border);
164
+ }
165
+ .mockup-body { padding: 1.5rem; }
166
+
167
+ /* ===== SPLIT VIEW (side-by-side comparison) ===== */
168
+ .split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
169
+ @media (max-width: 700px) { .split { grid-template-columns: 1fr; } }
170
+
171
+ /* ===== PROS/CONS ===== */
172
+ .pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
173
+ .pros, .cons { background: var(--bg-secondary); border-radius: 8px; padding: 1rem; }
174
+ .pros h4 { color: var(--success); font-size: 0.85rem; margin-bottom: 0.5rem; }
175
+ .cons h4 { color: var(--error); font-size: 0.85rem; margin-bottom: 0.5rem; }
176
+ .pros ul, .cons ul { margin-left: 1.25rem; font-size: 0.85rem; color: var(--text-secondary); }
177
+ .pros li, .cons li { margin-bottom: 0.25rem; }
178
+
179
+ /* ===== PLACEHOLDER (for mockup areas) ===== */
180
+ .placeholder {
181
+ background: var(--bg-tertiary);
182
+ border: 2px dashed var(--border);
183
+ border-radius: 8px;
184
+ padding: 2rem;
185
+ text-align: center;
186
+ color: var(--text-tertiary);
187
+ }
188
+
189
+ /* ===== INLINE MOCKUP ELEMENTS ===== */
190
+ .mock-nav { background: var(--accent); color: white; padding: 0.75rem 1rem; display: flex; gap: 1.5rem; font-size: 0.9rem; }
191
+ .mock-sidebar { background: var(--bg-tertiary); padding: 1rem; min-width: 180px; }
192
+ .mock-content { padding: 1.5rem; flex: 1; }
193
+ .mock-button { background: var(--accent); color: white; border: none; padding: 0.5rem 1rem; border-radius: 6px; font-size: 0.85rem; }
194
+ .mock-input { background: var(--bg-primary); border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem; width: 100%; }
195
+ </style>
196
+ </head>
197
+ <body>
198
+ <div class="header">
199
+ <h1><a href="https://github.com/obra/superpowers" style="color: inherit; text-decoration: none;">Superpowers Brainstorming</a></h1>
200
+ <div class="status">Connected</div>
201
+ </div>
202
+
203
+ <div class="main">
204
+ <div id="claude-content">
205
+ <!-- CONTENT -->
206
+ </div>
207
+ </div>
208
+
209
+ <div class="indicator-bar">
210
+ <span id="indicator-text">Click an option above, then return to the terminal</span>
211
+ </div>
212
+
213
+ </body>
214
+ </html>
@@ -0,0 +1,88 @@
1
+ (function() {
2
+ const WS_URL = 'ws://' + window.location.host;
3
+ let ws = null;
4
+ let eventQueue = [];
5
+
6
+ function connect() {
7
+ ws = new WebSocket(WS_URL);
8
+
9
+ ws.onopen = () => {
10
+ eventQueue.forEach(e => ws.send(JSON.stringify(e)));
11
+ eventQueue = [];
12
+ };
13
+
14
+ ws.onmessage = (msg) => {
15
+ const data = JSON.parse(msg.data);
16
+ if (data.type === 'reload') {
17
+ window.location.reload();
18
+ }
19
+ };
20
+
21
+ ws.onclose = () => {
22
+ setTimeout(connect, 1000);
23
+ };
24
+ }
25
+
26
+ function sendEvent(event) {
27
+ event.timestamp = Date.now();
28
+ if (ws && ws.readyState === WebSocket.OPEN) {
29
+ ws.send(JSON.stringify(event));
30
+ } else {
31
+ eventQueue.push(event);
32
+ }
33
+ }
34
+
35
+ // Capture clicks on choice elements
36
+ document.addEventListener('click', (e) => {
37
+ const target = e.target.closest('[data-choice]');
38
+ if (!target) return;
39
+
40
+ sendEvent({
41
+ type: 'click',
42
+ text: target.textContent.trim(),
43
+ choice: target.dataset.choice,
44
+ id: target.id || null
45
+ });
46
+
47
+ // Update indicator bar (defer so toggleSelect runs first)
48
+ setTimeout(() => {
49
+ const indicator = document.getElementById('indicator-text');
50
+ if (!indicator) return;
51
+ const container = target.closest('.options') || target.closest('.cards');
52
+ const selected = container ? container.querySelectorAll('.selected') : [];
53
+ if (selected.length === 0) {
54
+ indicator.textContent = 'Click an option above, then return to the terminal';
55
+ } else if (selected.length === 1) {
56
+ const label = selected[0].querySelector('h3, .content h3, .card-body h3')?.textContent?.trim() || selected[0].dataset.choice;
57
+ indicator.innerHTML = '<span class="selected-text">' + label + ' selected</span> — return to terminal to continue';
58
+ } else {
59
+ indicator.innerHTML = '<span class="selected-text">' + selected.length + ' selected</span> — return to terminal to continue';
60
+ }
61
+ }, 0);
62
+ });
63
+
64
+ // Frame UI: selection tracking
65
+ window.selectedChoice = null;
66
+
67
+ window.toggleSelect = function(el) {
68
+ const container = el.closest('.options') || el.closest('.cards');
69
+ const multi = container && container.dataset.multiselect !== undefined;
70
+ if (container && !multi) {
71
+ container.querySelectorAll('.option, .card').forEach(o => o.classList.remove('selected'));
72
+ }
73
+ if (multi) {
74
+ el.classList.toggle('selected');
75
+ } else {
76
+ el.classList.add('selected');
77
+ }
78
+ window.selectedChoice = el.dataset.choice;
79
+ };
80
+
81
+ // Expose API for explicit use
82
+ window.brainstorm = {
83
+ send: sendEvent,
84
+ choice: (value, metadata = {}) => sendEvent({ type: 'choice', value, ...metadata })
85
+ };
86
+
87
+ connect();
88
+ })();