brainstorm-companion 2.1.4 → 2.1.5

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 (3) hide show
  1. package/package.json +1 -1
  2. package/skill/SKILL.md +50 -13
  3. package/src/mcp.js +21 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brainstorm-companion",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
4
4
  "description": "AI-assisted visual brainstorming companion",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
package/skill/SKILL.md CHANGED
@@ -5,16 +5,33 @@ description: Visual brainstorming companion — opens a browser window for compa
5
5
 
6
6
  # Brainstorm Companion — Complete Agent Reference
7
7
 
8
- ## Quickstart (4 calls, no setup, user's choice comes back automatically)
8
+ ## Quickstart CLI (preferred, works everywhere including VMs)
9
+
10
+ The server runs in foreground — run `start` in background so you can push content from other commands.
11
+
12
+ ```bash
13
+ brainstorm-companion start --no-open & # start in background
14
+ # → Tell user: "Open http://127.0.0.1:XXXXX in your browser"
15
+ brainstorm-companion push --html '<h2>Option A</h2>' --slot a --label "Design A"
16
+ brainstorm-companion push --html '<h2>Option B</h2>' --slot b --label "Design B"
17
+ brainstorm-companion events --wait 120 # waits for user click
18
+ brainstorm-companion stop
19
+ ```
20
+
21
+ In Claude Code, use `run_in_background: true` for the start command.
22
+
23
+ ## Quickstart — MCP Tools (alternative)
9
24
 
10
25
  ```
11
26
  brainstorm_start_session()
12
- brainstorm_push_screen({ html: "<h2>Pick a layout</h2><div class='options'><div class='option' data-choice='grid' onclick='toggleSelect(this)'><div class='letter'>A</div><div class='content'><h3>Grid</h3></div></div><div class='option' data-choice='list' onclick='toggleSelect(this)'><div class='letter'>B</div><div class='content'><h3>List</h3></div></div></div>" })
13
- brainstorm_read_events({ wait_seconds: 120 }) // blocks until user clicks, returns their choice
27
+ brainstorm_push_screen({ html: "<h2>Option A</h2>...", slot: "a", label: "Design A" })
28
+ brainstorm_push_screen({ html: "<h2>Option B</h2>...", slot: "b", label: "Design B" })
29
+ brainstorm_read_events({ wait_seconds: 120 })
14
30
  brainstorm_stop_session()
15
31
  ```
16
32
 
17
- No arguments required. Browser opens, content appears, user clicks, event returns to you automatically.
33
+ **After starting, ALWAYS tell the user the URL** so they can open it in their browser.
34
+ The browser may not auto-open in VMs, containers, or remote environments.
18
35
 
19
36
  ## When to Use
20
37
 
@@ -414,18 +431,18 @@ All events include a `timestamp` field (Unix ms).
414
431
 
415
432
  ## Best Practices
416
433
 
417
- 1. **Zero config** — `brainstorm_start_session()` works with no arguments; isolation is automatic
418
- 3. **Never restart to update content** — just call `brainstorm_push_screen` again; the browser auto-reloads
419
- 4. **One `brainstorm_start_session` per workflow** — within MCP, subsequent calls reuse the session
420
- 5. **Push fragments, not full documents** — the frame template handles `<html>`, theming, and scroll
421
- 6. **Start with a heading** — `<h2>` describes what the user is looking at
422
- 7. **Add a `.subtitle`**describes the decision being made
434
+ 1. **Zero config** — works with no arguments; isolation is automatic
435
+ 2. **Always tell the user the URL** — the browser may not auto-open in VMs/containers
436
+ 3. **Never restart to update content** — just call `push_screen` / `push --html` again
437
+ 4. **One start per workflow** — within MCP, subsequent calls reuse the session
438
+ 5. **Push HTML inline, not files** — pass HTML directly, don't create temp files
439
+ 6. **Push fragments, not full documents** — the frame template handles theming and scroll
440
+ 7. **Start with `<h2>` heading + `.subtitle`** — describes what the user is looking at
423
441
  8. **One decision per screen** — don't combine unrelated choices
424
442
  9. **Use slot labels** — `label` makes comparison tabs readable
425
443
  10. **Use `data-choice` for interaction** — the built-in `toggleSelect` emits events automatically
426
- 11. **Tell the user to interact** — after pushing content, let them know the browser is ready
427
- 12. **Read events after user has time** don't immediately read; wait for user to respond
428
- 13. **Clean up with `brainstorm_stop_session`** — or use `idle_timeout_minutes` for auto-cleanup
444
+ 11. **Use `wait_seconds` in events** — the user's click returns automatically
445
+ 12. **Clean up with `stop`** or use `--timeout` / `idle_timeout_minutes` for auto-cleanup
429
446
 
430
447
  ## Common Mistakes
431
448
 
@@ -433,6 +450,26 @@ All events include a `timestamp` field (Unix ms).
433
450
  - **Pushing full HTML documents** — push fragments; the frame template adds theming and structure.
434
451
  - **Reading events immediately after push** — give the user time to interact first.
435
452
  - **Forgetting to stop** — always call `brainstorm_stop_session` when done, or use `idle_timeout_minutes`.
453
+ - **Trying to screenshot, scrape, or verify the browser content** — DON'T. The browser is for the USER to see. Just push content and tell the user it's ready. Never use browser automation, screenshots, curl, or other tools to check the brainstorm browser. The user sees it directly.
454
+ - **Creating HTML files on disk then trying to serve them** — DON'T. Pass HTML directly to `brainstorm_push_screen({ html: "..." })`. No temp files needed.
455
+ - **Trying to access localhost from a VM or container** — The server runs locally. The user's browser opens it automatically. Don't try to proxy, tunnel, or access it from other machines.
456
+
457
+ ## What NOT to Do
458
+
459
+ The brainstorm companion is a **push-and-forget visual tool**. Your job is:
460
+ 1. Start the server and tell the user the URL
461
+ 2. Push HTML content (inline, not files)
462
+ 3. Read events when the user interacts
463
+
464
+ You should NEVER:
465
+ - Take screenshots of the browser
466
+ - Use browser automation tools (Chrome DevTools, Puppeteer, etc.) to verify content
467
+ - Create HTML files on disk — pass HTML inline to `push --html` or `push_screen`
468
+ - Use curl/fetch/wget to check what's being served
469
+ - Try to access the URL yourself — it's for the user's browser only
470
+ - Try to proxy, tunnel, or forward the port to another machine
471
+ - Worry about whether the user can see it — just tell them the URL
472
+ - Go in circles if something doesn't work — just give the user the URL and instructions
436
473
 
437
474
  ---
438
475
 
package/src/mcp.js CHANGED
@@ -136,23 +136,29 @@ class McpServer {
136
136
  return [
137
137
  {
138
138
  name: 'brainstorm_start_session',
139
- description: `Start a visual brainstorming session. Opens a browser window where you push HTML and users interact visually.
139
+ description: `Start a visual brainstorming session. Returns a URL for the user to view content you push.
140
140
 
141
- QUICKSTART show content and get user's choice:
141
+ QUICKSTART (CLI is preferred use Bash tool):
142
+ brainstorm-companion start --no-open → starts server, prints URL
143
+ brainstorm-companion push --html "<h2>...</h2>" --slot a --label "Option A"
144
+ brainstorm-companion push --html "<h2>...</h2>" --slot b --label "Option B"
145
+ brainstorm-companion events --wait 120 → waits for user click, returns choice
146
+ brainstorm-companion stop
147
+
148
+ OR via MCP tools:
142
149
  brainstorm_start_session()
143
- brainstorm_push_screen({ html: "<h2>Pick one</h2>..." })
144
- brainstorm_read_events({ wait_seconds: 120 }) → blocks until user clicks, returns choice
150
+ brainstorm_push_screen({ html: "...", slot: "a", label: "Option A" })
151
+ brainstorm_read_events({ wait_seconds: 120 })
145
152
  brainstorm_stop_session()
146
153
 
147
- FULL WORKFLOW:
148
- 1. brainstorm_start_session() no args needed. Returns { url, session_dir }.
149
- 2. brainstorm_push_screen({ html }) — browser auto-reloads. Call as many times as needed.
150
- 3. brainstorm_read_events({ wait_seconds: 120 }) BLOCKS until user interacts, then returns events automatically. No polling needed.
151
- 4. brainstorm_stop_session()clean up.
152
-
153
- KEY: Use wait_seconds in read_events so the user's click comes back to you automatically. No need to ask the user "what did you pick?" — the event arrives on its own.
154
+ IMPORTANT — after starting:
155
+ 1. Tell the user to open the URL in their browser (it may not auto-open in VMs/containers)
156
+ 2. Push content — browser auto-reloads
157
+ 3. Use read_events with wait_seconds to get the user's click automatically
158
+ 4. NEVER screenshot, curl, or try to verify the browser the user sees it directly
159
+ 5. NEVER create HTML files on disk — pass HTML inline to push_screen or push --html
154
160
 
155
- Each start is a clean slate — no leftover content. Within one MCP connection, subsequent calls return the existing session. Sessions persist until stopped.
161
+ Each start is a clean slate. Within one MCP connection, subsequent calls reuse the session.
156
162
 
157
163
  COMPARISON MODE: Push to slots a/b/c with labels for side-by-side view:
158
164
  brainstorm_push_screen({ html: "...", slot: "a", label: "Option A" })
@@ -176,8 +182,10 @@ EVENTS: click (choice,text), preference (choice), tab-switch (slot), view-change
176
182
  RULES:
177
183
  - Use wait_seconds in read_events — the user's choice comes back automatically
178
184
  - NEVER restart to update — just push_screen again
179
- - Push HTML fragments, not full <html> documents
185
+ - Push HTML inline to push_screen do NOT create HTML files on disk
180
186
  - Tell user the browser is ready after pushing
187
+ - NEVER screenshot, curl, or verify the browser — the user sees it directly
188
+ - NEVER use browser automation tools on the brainstorm URL
181
189
  - Always stop_session when done`,
182
190
  inputSchema: {
183
191
  type: 'object',