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.
Question: which layout would you actually want to use all day?
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.
- Visual companion is an active decision aid, not a reporting dashboard.
- Every visual screen must ask a question, present selectable options, or show a
  mockup/diagram the user is meant to judge.
- Do not use visual screens for progress updates, implementation summaries,
  final reports, or proof-of-work slides.
- Use `data-choice` for clickable options; browser JS auto-records clicks.
- After writing a decision screen, wait for terminal response or browser event
  before implementing.
- 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.
- End of visual phase:
  ask whether to leave browser open for inspection or stop it with `/superpowers
  visual stop`.

## 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
- auto-records clicks on `[data-choice]` elements so agents do not need inline
  JS
- uses polling 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.
- Create the events JSONL file at start so agent reads never fail before the
  first browser click.
- Close server on `/superpowers visual stop` and session shutdown.
- 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.
Question: which layout would you actually want to use all day?
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 use visual companion as a status board or final report.
- 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`.