repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

extensions/superpowers/docs-visual-brainstorming.md

Raw

Visual Brainstorming Research

Source inspected: upstream obra/superpowers brainstorming skill and visual companion docs.

How upstream works

Visual brainstorming is not a separate mode. It is an optional browser companion offered during brainstorming when upcoming questions are easier to answer visually.

Flow:

  1. Brainstorming starts with text/context exploration.
  2. If visual questions are likely, agent sends a standalone consent message.
  3. If user agrees, agent starts a local browser server.
  4. Agent writes HTML fragments into a watched content directory.
  5. Browser always shows newest HTML screen.
  6. User clicks options/cards/mockups in browser and also responds in terminal.
  7. Browser events are stored as JSONL in a state directory.
  8. Agent reads events next turn and merges them with terminal feedback.
  9. For non-visual questions, agent pushes a waiting screen and continues in terminal.

UX rules

Technical shape

Upstream server:

Important directories:

.superpowers/brainstorm/<session>/content/   # HTML screens
.superpowers/brainstorm/<session>/state/     # events + server-info

Design implications for Pi

For our Pi Superpowers:

Recommended Pi UX

/brainstorming improve dashboard UX

Agent:

Some choices are visual. I can open a local browser companion for mockups and layout comparisons. Use it? (local URL)

If yes:

/superpowers visual start

Then:

Showing 3 dashboard layout options at http://localhost:NNNN.
Click one if useful, then tell me what you think here.

Future command candidates:

/superpowers visual start
/superpowers visual show <html-fragment-file>
/superpowers visual stop

What not to copy blindly

Markdown source
File outline
# Visual Brainstorming Research

Source inspected: upstream `obra/superpowers` brainstorming skill and visual companion docs.

## How upstream works

Visual brainstorming is not a separate mode. It is an optional browser companion offered during brainstorming when upcoming questions are easier to answer visually.

Flow:

1. Brainstorming starts with text/context exploration.
2. If visual questions are likely, agent sends a standalone consent message.
3. If user agrees, agent starts a local browser server.
4. Agent writes HTML fragments into a watched content directory.
5. Browser always shows newest HTML screen.
6. User clicks options/cards/mockups in browser and also responds in terminal.
7. Browser events are stored as JSONL in a state directory.
8. Agent reads events next turn and merges them with terminal feedback.
9. For non-visual questions, agent pushes a waiting screen and continues in terminal.

## UX rules

- Offer visual companion once, in its own message.
- Decide per question whether visual helps.
- Use browser for mockups, wireframes, diagrams, layout/color/design comparisons.
- Use terminal for requirements, scope, text tradeoffs, technical decisions.
- User terminal response remains primary; click events are supporting evidence.
- Each screen uses a new semantic filename.
- Stale screens should be replaced with “Continuing in terminal…” when leaving visual mode.

## Technical shape

Upstream server:

- zero-dependency Node server using built-ins
- serves newest `.html` from screen dir
- wraps HTML fragments in a frame template
- injects helper JS
- records clicks/selections to JSONL events file
- uses WebSocket reload to update browser
- stores session under project `.superpowers/brainstorm/...`

Important directories:

```text
.superpowers/brainstorm/<session>/content/   # HTML screens
.superpowers/brainstorm/<session>/state/     # events + server-info
```

## Design implications for Pi

For our Pi Superpowers:

- Keep visual brainstorming explicitly activated by brainstorming workflow.
- Do not make it a hidden hook.
- It should be an explicit `/superpowers visual ...` tool, not automatic strict-mode behavior.
- Store ephemeral files under platform state, not the repo: `${XDG_STATE_HOME:-~/.local/state}/pi/superpowers/<project-hash>/visual/...` on Linux, native equivalents on macOS/Windows.
- Use Pi UI notification and a visible session message to show URL and paths.
- Use `read`/`write` tool workflow for screens/events.
- Keep zero dependency: Node built-ins or Bun server only.

## Recommended Pi UX

```text
/brainstorming improve dashboard UX
```

Agent:

```text
Some choices are visual. I can open a local browser companion for mockups and layout comparisons. Use it? (local URL)
```

If yes:

```text
/superpowers visual start
```

Then:

```text
Showing 3 dashboard layout options at http://localhost:NNNN.
Click one if useful, then tell me what you think here.
```

Future command candidates:

```text
/superpowers visual start
/superpowers visual show <html-fragment-file>
/superpowers visual stop
```

## What not to copy blindly

- Do not vendor dependencies.
- Do not force browser for conceptual questions.
- Do not let visual companion skip design approval/spec gates.
- Do not store under non-Pi `.superpowers` unless intentionally matching upstream.
- Do not make visual server start automatically on `/superpowers on`.