agy-superpowers 5.1.6 → 5.1.8

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agy-superpowers",
3
- "version": "5.1.6",
3
+ "version": "5.1.8",
4
4
  "description": "Superpowers skills library for Google Antigravity agent — scaffold .agent/ with one command",
5
5
  "type": "module",
6
6
  "bin": {
@@ -25,10 +25,9 @@ You MUST create a task for each of these items and complete them in order:
25
25
  2. **Offer visual companion** (if topic will involve visual questions) — this is its own message, not combined with a clarifying question. See the Visual Companion section below.
26
26
  3. **Ask clarifying questions** — one at a time, understand purpose/constraints/success criteria
27
27
  4. **Propose 2-3 approaches** — with trade-offs and your recommendation
28
- - *UI/visual tasks only:* Before proposing, run `search.py` to gather style, typography, color, and UX data so proposals are grounded in real design patterns. See the [UI/UX Intelligence](#uiux-intelligence) section below.
29
28
  5. **Present design** — in sections scaled to their complexity, get user approval after each section
30
29
  6. **Write design doc** — save to `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md` and commit
31
- 7. **Spec review loop** — dispatch spec-document-reviewer subagent with precisely crafted review context (never your session history); fix issues and re-dispatch until approved (max 3 iterations, then surface to human)
30
+ 7. **Spec self-review** — quick inline check for placeholders, contradictions, ambiguity, scope (see below)
32
31
  8. **User reviews written spec** — ask user to review the spec file before proceeding
33
32
  9. **Transition to implementation** — invoke writing-plans skill to create implementation plan
34
33
 
@@ -44,8 +43,7 @@ digraph brainstorming {
44
43
  "Present design sections" [shape=box];
45
44
  "User approves design?" [shape=diamond];
46
45
  "Write design doc" [shape=box];
47
- "Spec review loop" [shape=box];
48
- "Spec review passed?" [shape=diamond];
46
+ "Spec self-review\n(fix inline)" [shape=box];
49
47
  "User reviews spec?" [shape=diamond];
50
48
  "Invoke writing-plans skill" [shape=doublecircle];
51
49
 
@@ -58,10 +56,8 @@ digraph brainstorming {
58
56
  "Present design sections" -> "User approves design?";
59
57
  "User approves design?" -> "Present design sections" [label="no, revise"];
60
58
  "User approves design?" -> "Write design doc" [label="yes"];
61
- "Write design doc" -> "Spec review loop";
62
- "Spec review loop" -> "Spec review passed?";
63
- "Spec review passed?" -> "Spec review loop" [label="issues found,\nfix and re-dispatch"];
64
- "Spec review passed?" -> "User reviews spec?" [label="approved"];
59
+ "Write design doc" -> "Spec self-review\n(fix inline)";
60
+ "Spec self-review\n(fix inline)" -> "User reviews spec?";
65
61
  "User reviews spec?" -> "Write design doc" [label="changes requested"];
66
62
  "User reviews spec?" -> "Invoke writing-plans skill" [label="approved"];
67
63
  }
@@ -87,62 +83,6 @@ digraph brainstorming {
87
83
  - Present options conversationally with your recommendation and reasoning
88
84
  - Lead with your recommended option and explain why
89
85
 
90
- ## UI/UX Intelligence
91
-
92
- **When the task involves any visual/UI work** (landing pages, dashboards, components, screens, design systems), run the UI/UX Pro Max search tool **before** presenting the design. This grounds your proposals in a curated knowledge base rather than generic defaults.
93
-
94
- **How to trigger:**
95
-
96
- ```bash
97
- python3 .agent/.shared/ui-ux-pro-max/scripts/search.py "<keyword>" --domain <domain>
98
- ```
99
-
100
- **Recommended search sequence** (run in parallel where possible):
101
-
102
- | # | Domain | What to search | Example |
103
- |---|--------|----------------|---------|
104
- | 1 | `product` | Product type + industry | `"SaaS dashboard"`, `"beauty landing page"` |
105
- | 2 | `style` | Desired visual style | `"glassmorphism dark"`, `"minimal clean"` |
106
- | 3 | `typography` | Mood/personality | `"elegant modern"`, `"playful friendly"` |
107
- | 4 | `color` | Industry or product type | `"fintech"`, `"healthcare"`, `"beauty spa"` |
108
- | 5 | `landing` | Page structure type | `"hero-centric social-proof"` |
109
- | 6 | `ux` | `"animation"`, `"accessibility"`, `"z-index"` | Always check these three |
110
- | 7 | `stack` | Target framework | `--stack react-native`, `--stack flutter` |
111
-
112
- **When to use each domain:**
113
- - Always run `product` + `style` + `ux` as a baseline for any UI task
114
- - Add `typography` + `color` when presenting a full design system
115
- - Add `landing` only for marketing/landing pages
116
- - Add `chart` only for analytics dashboards
117
- - Use `--stack` flag to get implementation-specific patterns (e.g., `--stack react-native` for mobile)
118
-
119
- **Synthesize results before presenting design:** Do not dump raw search output to the user. Summarize what you found and explain how it informs your design choices.
120
-
121
- > **Skip this step** for purely backend, data-model, or logic-only tasks where no UI is involved.
122
-
123
- ### Mobile UI/UX Intelligence (Extended Layer)
124
-
125
- **When the request is for a mobile app** — detect keywords like: `iOS`, `Android`, `React Native`, `Flutter`, `SwiftUI`, `Jetpack Compose`, `mobile`, `app screen`, `native app` — run the **mobile-uiux-promax workflow** IN ADDITION to the web tool above.
126
-
127
- Read the workflow file first: `.agent/workflows/mobile-uiux-promax.md`
128
-
129
- The mobile workflow adds 3 more steps after the web style layer:
130
-
131
- ```bash
132
- # Step 2: Mobile behavior
133
- python3 .agent/.shared/mobile-uiux-promax/scripts/mobile-search.py "<nav pattern>" --domain navigation
134
- python3 .agent/.shared/mobile-uiux-promax/scripts/mobile-search.py "<component>" --domain components
135
- python3 .agent/.shared/mobile-uiux-promax/scripts/mobile-search.py "<platform topic>" --domain platform
136
- python3 .agent/.shared/mobile-uiux-promax/scripts/mobile-search.py "<animation>" --domain animation
137
-
138
- # Step 3: Stack guidelines (react-native / flutter / swiftui / jetpack-compose)
139
- python3 .agent/.shared/mobile-uiux-promax/scripts/mobile-search.py "<topic>" --stack react-native
140
-
141
- # Step 4: Synthesize style + mobile behavior + stack patterns → present design
142
- ```
143
-
144
- Read and apply the mobile-uiux-promax skill: `.agent/skills/mobile-uiux-promax/SKILL.md`
145
-
146
86
  **Presenting the design:**
147
87
 
148
88
  - Once you believe you understand what you're building, present the design
@@ -175,12 +115,15 @@ Read and apply the mobile-uiux-promax skill: `.agent/skills/mobile-uiux-promax/S
175
115
  - If `auto_commit: true` (default): run `git add <path> && git commit -m "docs: add <topic> design spec"`
176
116
  - If `auto_commit: false`: skip commit and staging entirely. Print: "Skipping commit (auto_commit: false in .agent/config.yml). File is ready for manual commit."
177
117
 
178
- **Spec Review Loop:**
179
- After writing the spec document:
118
+ **Spec Self-Review:**
119
+ After writing the spec document, look at it with fresh eyes:
120
+
121
+ 1. **Placeholder scan:** Any "TBD", "TODO", incomplete sections, or vague requirements? Fix them.
122
+ 2. **Internal consistency:** Do any sections contradict each other? Does the architecture match the feature descriptions?
123
+ 3. **Scope check:** Is this focused enough for a single implementation plan, or does it need decomposition?
124
+ 4. **Ambiguity check:** Could any requirement be interpreted two different ways? If so, pick one and make it explicit.
180
125
 
181
- 1. Dispatch spec-document-reviewer subagent (see spec-document-reviewer-prompt.md)
182
- 2. If Issues Found: fix, re-dispatch, repeat until Approved
183
- 3. If loop exceeds 3 iterations, surface to human for guidance
126
+ Fix any issues inline. No need to re-review just fix and move on.
184
127
 
185
128
  **User Review Gate:**
186
129
  After the spec review loop passes, ask the user to review the written spec before proceeding:
@@ -76,8 +76,10 @@ function decodeFrame(buffer) {
76
76
  const PORT = process.env.BRAINSTORM_PORT || (49152 + Math.floor(Math.random() * 16383));
77
77
  const HOST = process.env.BRAINSTORM_HOST || '127.0.0.1';
78
78
  const URL_HOST = process.env.BRAINSTORM_URL_HOST || (HOST === '127.0.0.1' ? 'localhost' : HOST);
79
- const SCREEN_DIR = process.env.BRAINSTORM_DIR || '/tmp/brainstorm';
80
- const OWNER_PID = process.env.BRAINSTORM_OWNER_PID ? Number(process.env.BRAINSTORM_OWNER_PID) : null;
79
+ const SESSION_DIR = process.env.BRAINSTORM_DIR || '/tmp/brainstorm';
80
+ const CONTENT_DIR = path.join(SESSION_DIR, 'content');
81
+ const STATE_DIR = path.join(SESSION_DIR, 'state');
82
+ let ownerPid = process.env.BRAINSTORM_OWNER_PID ? Number(process.env.BRAINSTORM_OWNER_PID) : null;
81
83
 
82
84
  const MIME_TYPES = {
83
85
  '.html': 'text/html', '.css': 'text/css', '.js': 'application/javascript',
@@ -112,10 +114,10 @@ function wrapInFrame(content) {
112
114
  }
113
115
 
114
116
  function getNewestScreen() {
115
- const files = fs.readdirSync(SCREEN_DIR)
117
+ const files = fs.readdirSync(CONTENT_DIR)
116
118
  .filter(f => f.endsWith('.html'))
117
119
  .map(f => {
118
- const fp = path.join(SCREEN_DIR, f);
120
+ const fp = path.join(CONTENT_DIR, f);
119
121
  return { path: fp, mtime: fs.statSync(fp).mtime.getTime() };
120
122
  })
121
123
  .sort((a, b) => b.mtime - a.mtime);
@@ -142,7 +144,7 @@ function handleRequest(req, res) {
142
144
  res.end(html);
143
145
  } else if (req.method === 'GET' && req.url.startsWith('/files/')) {
144
146
  const fileName = req.url.slice(7);
145
- const filePath = path.join(SCREEN_DIR, path.basename(fileName));
147
+ const filePath = path.join(CONTENT_DIR, path.basename(fileName));
146
148
  if (!fs.existsSync(filePath)) {
147
149
  res.writeHead(404);
148
150
  res.end('Not found');
@@ -230,7 +232,7 @@ function handleMessage(text) {
230
232
  touchActivity();
231
233
  console.log(JSON.stringify({ source: 'user-event', ...event }));
232
234
  if (event.choice) {
233
- const eventsFile = path.join(SCREEN_DIR, '.events');
235
+ const eventsFile = path.join(STATE_DIR, 'events');
234
236
  fs.appendFileSync(eventsFile, JSON.stringify(event) + '\n');
235
237
  }
236
238
  }
@@ -258,32 +260,33 @@ const debounceTimers = new Map();
258
260
  // ========== Server Startup ==========
259
261
 
260
262
  function startServer() {
261
- if (!fs.existsSync(SCREEN_DIR)) fs.mkdirSync(SCREEN_DIR, { recursive: true });
263
+ if (!fs.existsSync(CONTENT_DIR)) fs.mkdirSync(CONTENT_DIR, { recursive: true });
264
+ if (!fs.existsSync(STATE_DIR)) fs.mkdirSync(STATE_DIR, { recursive: true });
262
265
 
263
266
  // Track known files to distinguish new screens from updates.
264
267
  // macOS fs.watch reports 'rename' for both new files and overwrites,
265
268
  // so we can't rely on eventType alone.
266
269
  const knownFiles = new Set(
267
- fs.readdirSync(SCREEN_DIR).filter(f => f.endsWith('.html'))
270
+ fs.readdirSync(CONTENT_DIR).filter(f => f.endsWith('.html'))
268
271
  );
269
272
 
270
273
  const server = http.createServer(handleRequest);
271
274
  server.on('upgrade', handleUpgrade);
272
275
 
273
- const watcher = fs.watch(SCREEN_DIR, (eventType, filename) => {
276
+ const watcher = fs.watch(CONTENT_DIR, (eventType, filename) => {
274
277
  if (!filename || !filename.endsWith('.html')) return;
275
278
 
276
279
  if (debounceTimers.has(filename)) clearTimeout(debounceTimers.get(filename));
277
280
  debounceTimers.set(filename, setTimeout(() => {
278
281
  debounceTimers.delete(filename);
279
- const filePath = path.join(SCREEN_DIR, filename);
282
+ const filePath = path.join(CONTENT_DIR, filename);
280
283
 
281
284
  if (!fs.existsSync(filePath)) return; // file was deleted
282
285
  touchActivity();
283
286
 
284
287
  if (!knownFiles.has(filename)) {
285
288
  knownFiles.add(filename);
286
- const eventsFile = path.join(SCREEN_DIR, '.events');
289
+ const eventsFile = path.join(STATE_DIR, 'events');
287
290
  if (fs.existsSync(eventsFile)) fs.unlinkSync(eventsFile);
288
291
  console.log(JSON.stringify({ type: 'screen-added', file: filePath }));
289
292
  } else {
@@ -297,10 +300,10 @@ function startServer() {
297
300
 
298
301
  function shutdown(reason) {
299
302
  console.log(JSON.stringify({ type: 'server-stopped', reason }));
300
- const infoFile = path.join(SCREEN_DIR, '.server-info');
303
+ const infoFile = path.join(STATE_DIR, 'server-info');
301
304
  if (fs.existsSync(infoFile)) fs.unlinkSync(infoFile);
302
305
  fs.writeFileSync(
303
- path.join(SCREEN_DIR, '.server-stopped'),
306
+ path.join(STATE_DIR, 'server-stopped'),
304
307
  JSON.stringify({ reason, timestamp: Date.now() }) + '\n'
305
308
  );
306
309
  watcher.close();
@@ -309,8 +312,8 @@ function startServer() {
309
312
  }
310
313
 
311
314
  function ownerAlive() {
312
- if (!OWNER_PID) return true;
313
- try { process.kill(OWNER_PID, 0); return true; } catch (e) { return false; }
315
+ if (!ownerPid) return true;
316
+ try { process.kill(ownerPid, 0); return true; } catch (e) { return e.code === 'EPERM'; }
314
317
  }
315
318
 
316
319
  // Check every 60s: exit if owner process died or idle for 30 minutes
@@ -320,14 +323,27 @@ function startServer() {
320
323
  }, 60 * 1000);
321
324
  lifecycleCheck.unref();
322
325
 
326
+ // Validate owner PID at startup. If it's already dead, the PID resolution
327
+ // was wrong (common on WSL, Tailscale SSH, and cross-user scenarios).
328
+ // Disable monitoring and rely on the idle timeout instead.
329
+ if (ownerPid) {
330
+ try { process.kill(ownerPid, 0); }
331
+ catch (e) {
332
+ if (e.code !== 'EPERM') {
333
+ console.log(JSON.stringify({ type: 'owner-pid-invalid', pid: ownerPid, reason: 'dead at startup' }));
334
+ ownerPid = null;
335
+ }
336
+ }
337
+ }
338
+
323
339
  server.listen(PORT, HOST, () => {
324
340
  const info = JSON.stringify({
325
341
  type: 'server-started', port: Number(PORT), host: HOST,
326
342
  url_host: URL_HOST, url: 'http://' + URL_HOST + ':' + PORT,
327
- screen_dir: SCREEN_DIR
343
+ screen_dir: CONTENT_DIR, state_dir: STATE_DIR
328
344
  });
329
345
  console.log(info);
330
- fs.writeFileSync(path.join(SCREEN_DIR, '.server-info'), info + '\n');
346
+ fs.writeFileSync(path.join(STATE_DIR, 'server-info'), info + '\n');
331
347
  });
332
348
  }
333
349
 
@@ -78,16 +78,17 @@ fi
78
78
  SESSION_ID="$$-$(date +%s)"
79
79
 
80
80
  if [[ -n "$PROJECT_DIR" ]]; then
81
- SCREEN_DIR="${PROJECT_DIR}/.superpowers/brainstorm/${SESSION_ID}"
81
+ SESSION_DIR="${PROJECT_DIR}/.superpowers/brainstorm/${SESSION_ID}"
82
82
  else
83
- SCREEN_DIR="/tmp/brainstorm-${SESSION_ID}"
83
+ SESSION_DIR="/tmp/brainstorm-${SESSION_ID}"
84
84
  fi
85
85
 
86
- PID_FILE="${SCREEN_DIR}/.server.pid"
87
- LOG_FILE="${SCREEN_DIR}/.server.log"
86
+ STATE_DIR="${SESSION_DIR}/state"
87
+ PID_FILE="${STATE_DIR}/server.pid"
88
+ LOG_FILE="${STATE_DIR}/server.log"
88
89
 
89
- # Create fresh session directory
90
- mkdir -p "$SCREEN_DIR"
90
+ # Create fresh session directory with content and state peers
91
+ mkdir -p "${SESSION_DIR}/content" "$STATE_DIR"
91
92
 
92
93
  # Kill any existing server
93
94
  if [[ -f "$PID_FILE" ]]; then
@@ -106,22 +107,16 @@ if [[ -z "$OWNER_PID" || "$OWNER_PID" == "1" ]]; then
106
107
  OWNER_PID="$PPID"
107
108
  fi
108
109
 
109
- # On Windows/MSYS2, the MSYS2 PID namespace is invisible to Node.js.
110
- # Skip owner-PID monitoring — the 30-minute idle timeout prevents orphans.
111
- case "${OSTYPE:-}" in
112
- msys*|cygwin*|mingw*) OWNER_PID="" ;;
113
- esac
114
-
115
110
  # Foreground mode for environments that reap detached/background processes.
116
111
  if [[ "$FOREGROUND" == "true" ]]; then
117
112
  echo "$$" > "$PID_FILE"
118
- env BRAINSTORM_DIR="$SCREEN_DIR" BRAINSTORM_HOST="$BIND_HOST" BRAINSTORM_URL_HOST="$URL_HOST" BRAINSTORM_OWNER_PID="$OWNER_PID" node server.cjs
113
+ env BRAINSTORM_DIR="$SESSION_DIR" BRAINSTORM_HOST="$BIND_HOST" BRAINSTORM_URL_HOST="$URL_HOST" BRAINSTORM_OWNER_PID="$OWNER_PID" node server.cjs
119
114
  exit $?
120
115
  fi
121
116
 
122
117
  # Start server, capturing output to log file
123
118
  # Use nohup to survive shell exit; disown to remove from job table
124
- nohup env BRAINSTORM_DIR="$SCREEN_DIR" BRAINSTORM_HOST="$BIND_HOST" BRAINSTORM_URL_HOST="$URL_HOST" BRAINSTORM_OWNER_PID="$OWNER_PID" node server.cjs > "$LOG_FILE" 2>&1 &
119
+ nohup env BRAINSTORM_DIR="$SESSION_DIR" BRAINSTORM_HOST="$BIND_HOST" BRAINSTORM_URL_HOST="$URL_HOST" BRAINSTORM_OWNER_PID="$OWNER_PID" node server.cjs > "$LOG_FILE" 2>&1 &
125
120
  SERVER_PID=$!
126
121
  disown "$SERVER_PID" 2>/dev/null
127
122
  echo "$SERVER_PID" > "$PID_FILE"
@@ -1,19 +1,20 @@
1
1
  #!/usr/bin/env bash
2
2
  # Stop the brainstorm server and clean up
3
- # Usage: stop-server.sh <screen_dir>
3
+ # Usage: stop-server.sh <session_dir>
4
4
  #
5
5
  # Kills the server process. Only deletes session directory if it's
6
6
  # under /tmp (ephemeral). Persistent directories (.superpowers/) are
7
7
  # kept so mockups can be reviewed later.
8
8
 
9
- SCREEN_DIR="$1"
9
+ SESSION_DIR="$1"
10
10
 
11
- if [[ -z "$SCREEN_DIR" ]]; then
12
- echo '{"error": "Usage: stop-server.sh <screen_dir>"}'
11
+ if [[ -z "$SESSION_DIR" ]]; then
12
+ echo '{"error": "Usage: stop-server.sh <session_dir>"}'
13
13
  exit 1
14
14
  fi
15
15
 
16
- PID_FILE="${SCREEN_DIR}/.server.pid"
16
+ STATE_DIR="${SESSION_DIR}/state"
17
+ PID_FILE="${STATE_DIR}/server.pid"
17
18
 
18
19
  if [[ -f "$PID_FILE" ]]; then
19
20
  pid=$(cat "$PID_FILE")
@@ -42,11 +43,11 @@ if [[ -f "$PID_FILE" ]]; then
42
43
  exit 1
43
44
  fi
44
45
 
45
- rm -f "$PID_FILE" "${SCREEN_DIR}/.server.log"
46
+ rm -f "$PID_FILE" "${STATE_DIR}/server.log"
46
47
 
47
48
  # Only delete ephemeral /tmp directories
48
- if [[ "$SCREEN_DIR" == /tmp/* ]]; then
49
- rm -rf "$SCREEN_DIR"
49
+ if [[ "$SESSION_DIR" == /tmp/* ]]; then
50
+ rm -rf "$SESSION_DIR"
50
51
  fi
51
52
 
52
53
  echo '{"status": "stopped"}'
@@ -26,7 +26,7 @@ A question *about* a UI topic is not automatically a visual question. "What kind
26
26
 
27
27
  ## How It Works
28
28
 
29
- The server watches a directory for HTML files and serves the newest one to the browser. You write HTML content, the user sees it in their browser and can click to select options. Selections are recorded to a `.events` file that you read on your next turn.
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
30
 
31
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
32
 
@@ -37,12 +37,13 @@ The server watches a directory for HTML files and serves the newest one to the b
37
37
  scripts/start-server.sh --project-dir /path/to/project
38
38
 
39
39
  # Returns: {"type":"server-started","port":52341,"url":"http://localhost:52341",
40
- # "screen_dir":"/path/to/project/.superpowers/brainstorm/12345-1706000000"}
40
+ # "screen_dir":"/path/to/project/.superpowers/brainstorm/12345-1706000000/content",
41
+ # "state_dir":"/path/to/project/.superpowers/brainstorm/12345-1706000000/state"}
41
42
  ```
42
43
 
43
- Save `screen_dir` from the response. Tell user to open the URL.
44
+ Save `screen_dir` and `state_dir` from the response. Tell user to open the URL.
44
45
 
45
- **Finding connection info:** The server writes its startup JSON to `$SCREEN_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. When using `--project-dir`, check `<project>/.superpowers/brainstorm/` for the session directory.
46
+ **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. When using `--project-dir`, check `<project>/.superpowers/brainstorm/` for the session directory.
46
47
 
47
48
  **Note:** Pass the project root as `--project-dir` so mockups persist in `.superpowers/brainstorm/` and survive server restarts. Without it, files go to `/tmp` and get cleaned up. Remind the user to add `.superpowers/` to `.gitignore` if it's not already there.
48
49
 
@@ -70,7 +71,7 @@ Use `--url-host` to control what hostname is printed in the returned URL JSON.
70
71
  ## The Loop
71
72
 
72
73
  1. **Check server is alive**, then **write HTML** to a new file in `screen_dir`:
73
- - Before each write, check that `$SCREEN_DIR/.server-info` exists. If it doesn't (or `.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.
74
+ - 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.
74
75
  - Use semantic filenames: `platform.html`, `visual-style.html`, `layout.html`
75
76
  - **Never reuse filenames** — each screen gets a fresh file
76
77
  - Use Write tool — **never use cat/heredoc** (dumps noise into terminal)
@@ -82,9 +83,9 @@ Use `--url-host` to control what hostname is printed in the returned URL JSON.
82
83
  - 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."
83
84
 
84
85
  3. **On your next turn** — after the user responds in the terminal:
85
- - Read `$SCREEN_DIR/.events` if it exists — this contains the user's browser interactions (clicks, selections) as JSON lines
86
+ - Read `$STATE_DIR/events` if it exists — this contains the user's browser interactions (clicks, selections) as JSON lines
86
87
  - Merge with the user's terminal text to get the full picture
87
- - The terminal message is the primary feedback; `.events` provides structured interaction data
88
+ - The terminal message is the primary feedback; `state_dir/events` provides structured interaction data
88
89
 
89
90
  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.
90
91
 
@@ -221,7 +222,7 @@ The frame template provides these CSS classes for your content:
221
222
 
222
223
  ## Browser Events Format
223
224
 
224
- When the user clicks options in the browser, their interactions are recorded to `$SCREEN_DIR/.events` (one JSON object per line). The file is cleared automatically when you push a new screen.
225
+ 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.
225
226
 
226
227
  ```jsonl
227
228
  {"type":"click","choice":"a","text":"Option A - Simple Layout","timestamp":1706000101}
@@ -231,7 +232,7 @@ When the user clicks options in the browser, their interactions are recorded to
231
232
 
232
233
  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.
233
234
 
234
- If `.events` doesn't exist, the user didn't interact with the browser — use only their terminal text.
235
+ If `$STATE_DIR/events` doesn't exist, the user didn't interact with the browser — use only their terminal text.
235
236
 
236
237
  ## Design Tips
237
238
 
@@ -252,7 +253,7 @@ If `.events` doesn't exist, the user didn't interact with the browser — use on
252
253
  ## Cleaning Up
253
254
 
254
255
  ```bash
255
- scripts/stop-server.sh $SCREEN_DIR
256
+ scripts/stop-server.sh $SESSION_DIR
256
257
  ```
257
258
 
258
259
  If the session used `--project-dir`, mockup files persist in `.superpowers/brainstorm/` for later reference. Only `/tmp` sessions get deleted on stop.
@@ -16,6 +16,7 @@ Load plan, review critically, execute all tasks, report when complete.
16
16
  ## The Process
17
17
 
18
18
  ### Step 1: Load and Review Plan
19
+
19
20
  1. Read plan file
20
21
  2. Review critically - identify any questions or concerns about the plan
21
22
  3. If concerns: Raise them with your human partner before starting
@@ -24,6 +25,7 @@ Load plan, review critically, execute all tasks, report when complete.
24
25
  ### Step 2: Execute Tasks
25
26
 
26
27
  For each task:
28
+
27
29
  1. Mark as in_progress
28
30
  2. **Check for domain skills** — before writing any code, identify which domain skill applies to this task's context (e.g. `mobile-developer` for React Native work, `backend-developer` for API work, `frontend-developer` for web UI). Read only the relevant SKILL.md (not all references); load specific references on demand as the task requires them.
29
31
  3. Follow each step exactly (plan has bite-sized steps)
@@ -33,6 +35,7 @@ For each task:
33
35
  ### Step 3: Complete Development
34
36
 
35
37
  After all tasks complete and verified:
38
+
36
39
  - Announce: "I'm using the finishing-a-development-branch skill to complete this work."
37
40
  - **REQUIRED SUB-SKILL:** Use superpowers:finishing-a-development-branch
38
41
  - Follow that skill to verify tests, present options, execute choice
@@ -40,6 +43,7 @@ After all tasks complete and verified:
40
43
  ## When to Stop and Ask for Help
41
44
 
42
45
  **STOP executing immediately when:**
46
+
43
47
  - Hit a blocker (missing dependency, test fails, instruction unclear)
44
48
  - Plan has critical gaps preventing starting
45
49
  - You don't understand an instruction
@@ -50,12 +54,14 @@ After all tasks complete and verified:
50
54
  ## When to Revisit Earlier Steps
51
55
 
52
56
  **Return to Review (Step 1) when:**
57
+
53
58
  - Partner updates the plan based on your feedback
54
59
  - Fundamental approach needs rethinking
55
60
 
56
61
  **Don't force through blockers** - stop and ask.
57
62
 
58
63
  ## Remember
64
+
59
65
  - Review plan critically first
60
66
  - Follow plan steps exactly
61
67
  - Don't skip verifications
@@ -66,6 +72,7 @@ After all tasks complete and verified:
66
72
  ## Integration
67
73
 
68
74
  **Required workflow skills:**
75
+
69
76
  - **superpowers:using-git-worktrees** - REQUIRED: Set up isolated workspace before starting
70
77
  - **superpowers:writing-plans** - Creates the plan this skill executes
71
78
  - **superpowers:finishing-a-development-branch** - Complete development after all tasks
@@ -28,7 +28,6 @@ Task tool (general-purpose):
28
28
 
29
29
  ## Your Job
30
30
 
31
- Once you're clear on requirements:
32
31
  1. Implement exactly what the task specifies
33
32
  2. Write tests (following TDD if task says to)
34
33
  3. Verify implementation works
@@ -24,6 +24,7 @@ If you haven't completed Phase 1, you cannot propose fixes.
24
24
  ## When to Use
25
25
 
26
26
  Use for ANY technical issue:
27
+
27
28
  - Test failures
28
29
  - Bugs in production
29
30
  - Unexpected behavior
@@ -32,6 +33,7 @@ Use for ANY technical issue:
32
33
  - Integration issues
33
34
 
34
35
  **Use this ESPECIALLY when:**
36
+
35
37
  - Under time pressure (emergencies make guessing tempting)
36
38
  - "Just one quick fix" seems obvious
37
39
  - You've already tried multiple fixes
@@ -39,6 +41,7 @@ Use for ANY technical issue:
39
41
  - You don't fully understand the issue
40
42
 
41
43
  **Don't skip when:**
44
+
42
45
  - Issue seems simple (simple bugs have root causes too)
43
46
  - You're in a hurry (rushing guarantees rework)
44
47
  - Manager wants it fixed NOW (systematic is faster than thrashing)
@@ -74,6 +77,7 @@ You MUST complete each phase before proceeding to the next.
74
77
  **WHEN system has multiple components (CI → build → signing, API → service → database):**
75
78
 
76
79
  **BEFORE proposing fixes, add diagnostic instrumentation:**
80
+
77
81
  ```
78
82
  For EACH component boundary:
79
83
  - Log what data enters component
@@ -87,6 +91,7 @@ You MUST complete each phase before proceeding to the next.
87
91
  ```
88
92
 
89
93
  **Example (multi-layer system):**
94
+
90
95
  ```bash
91
96
  # Layer 1: Workflow
92
97
  echo "=== Secrets available in workflow: ==="
@@ -174,6 +179,7 @@ You MUST present your complete analysis to the user and get explicit confirmatio
174
179
  BEFORE proceeding to Phase 4 (Implementation).
175
180
 
176
181
  **Present a summary containing:**
182
+
177
183
  1. **Root Cause** — from Phase 1
178
184
  2. **Pattern Analysis** — key differences found in Phase 2
179
185
  3. **Hypothesis** — your confirmed theory from Phase 3
@@ -232,6 +238,7 @@ Wait for user confirmation. Do NOT proceed to Phase 4 until confirmed.
232
238
  ## Red Flags - STOP and Follow Process
233
239
 
234
240
  If you catch yourself thinking:
241
+
235
242
  - "Quick fix for now, investigate later"
236
243
  - "Just try changing X and see if it works"
237
244
  - "Add multiple changes, run tests"
@@ -251,6 +258,7 @@ If you catch yourself thinking:
251
258
  ## your human partner's Signals You're Doing It Wrong
252
259
 
253
260
  **Watch for these redirections:**
261
+
254
262
  - "Is that not happening?" - You assumed without verifying
255
263
  - "Will it show us...?" - You should have added evidence gathering
256
264
  - "Stop guessing" - You're proposing fixes without understanding
@@ -261,25 +269,25 @@ If you catch yourself thinking:
261
269
 
262
270
  ## Common Rationalizations
263
271
 
264
- | Excuse | Reality |
265
- |--------|---------|
266
- | "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs. |
267
- | "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing. |
268
- | "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
269
- | "I'll write test after confirming fix works" | Untested fixes don't stick. Test first proves it. |
270
- | "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. |
271
- | "Reference too long, I'll adapt the pattern" | Partial understanding guarantees bugs. Read it completely. |
272
- | "I see the problem, let me fix it" | Seeing symptoms ≠ understanding root cause. |
273
- | "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. Question pattern, don't fix again. |
272
+ | Excuse | Reality |
273
+ | -------------------------------------------- | ----------------------------------------------------------------------- |
274
+ | "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs. |
275
+ | "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing. |
276
+ | "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
277
+ | "I'll write test after confirming fix works" | Untested fixes don't stick. Test first proves it. |
278
+ | "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. |
279
+ | "Reference too long, I'll adapt the pattern" | Partial understanding guarantees bugs. Read it completely. |
280
+ | "I see the problem, let me fix it" | Seeing symptoms ≠ understanding root cause. |
281
+ | "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. Question pattern, don't fix again. |
274
282
 
275
283
  ## Quick Reference
276
284
 
277
- | Phase | Key Activities | Success Criteria |
278
- |-------|---------------|------------------|
279
- | **1. Root Cause** | Read errors, reproduce, check changes, gather evidence | Understand WHAT and WHY |
280
- | **2. Pattern** | Find working examples, compare | Identify differences |
281
- | **3. Hypothesis** | Form theory, test minimally | Confirmed or new hypothesis |
282
- | **4. Implementation** | Create test, fix, verify | Bug resolved, tests pass |
285
+ | Phase | Key Activities | Success Criteria |
286
+ | --------------------- | ------------------------------------------------------ | --------------------------- |
287
+ | **1. Root Cause** | Read errors, reproduce, check changes, gather evidence | Understand WHAT and WHY |
288
+ | **2. Pattern** | Find working examples, compare | Identify differences |
289
+ | **3. Hypothesis** | Form theory, test minimally | Confirmed or new hypothesis |
290
+ | **4. Implementation** | Create test, fix, verify | Bug resolved, tests pass |
283
291
 
284
292
  ## When Process Reveals "No Root Cause"
285
293
 
@@ -301,12 +309,14 @@ These techniques are part of systematic debugging and available in this director
301
309
  - **`condition-based-waiting.md`** - Replace arbitrary timeouts with condition polling
302
310
 
303
311
  **Related skills:**
312
+
304
313
  - **superpowers:test-driven-development** - For creating failing test case (Phase 4, Step 1)
305
314
  - **superpowers:verification-before-completion** - Verify fix worked before claiming success
306
315
 
307
316
  ## Real-World Impact
308
317
 
309
318
  From debugging sessions:
319
+
310
320
  - Systematic approach: 15-30 minutes to fix
311
321
  - Random fixes approach: 2-3 hours of thrashing
312
322
  - First-time fix rate: 95% vs 40%
@@ -99,17 +99,6 @@ Skip any step = lying, not verifying
99
99
  ❌ "Tests pass, phase complete"
100
100
  ```
101
101
 
102
- **`.agent/.tests/` check (if applicable):**
103
-
104
- If work involved modifying any `.agent/skills/<skill>/` or `.agent/.shared/<tool>/`, run tests before claiming done:
105
- ```bash
106
- python3 .agent/.tests/run_tests.py <skill-name>
107
- ```
108
- ```
109
- ✅ Run command → Paste full verbose output → All pass → Claim done
110
- ❌ "Should still pass" / Skip running because "I didn't change the data"
111
- ```
112
-
113
102
  **Agent delegation:**
114
103
  ```
115
104
  ✅ Agent reports success → Check VCS diff → Verify changes → Report actual state
@@ -106,26 +106,33 @@ git commit -m "feat: add specific feature"
106
106
  - If `auto_commit: false`: skip commit and staging. Print: "Skipping commit (auto_commit: false)."
107
107
  ````
108
108
 
109
+ ## No Placeholders
110
+
111
+ Every step must contain the actual content an engineer needs. These are **plan failures** — never write them:
112
+ - "TBD", "TODO", "implement later", "fill in details"
113
+ - "Add appropriate error handling" / "add validation" / "handle edge cases"
114
+ - "Write tests for the above" (without actual test code)
115
+ - "Similar to Task N" (repeat the code — the engineer may be reading tasks out of order)
116
+ - Steps that describe what to do without showing how (code blocks required for code steps)
117
+ - References to types, functions, or methods not defined in any task
118
+
109
119
  ## Remember
110
120
  - Exact file paths always
111
- - Complete code in plan (not "add validation")
121
+ - Complete code in every step if a step changes code, show the code
112
122
  - Exact commands with expected output
113
- - Reference relevant skills with @ syntax
114
123
  - DRY, YAGNI, TDD, frequent commits
115
124
 
116
- ## Plan Review Loop
125
+ ## Self-Review
126
+
127
+ After writing the complete plan, look at the spec with fresh eyes and check the plan against it. This is a checklist you run yourself — not a subagent dispatch.
128
+
129
+ **1. Spec coverage:** Skim each section/requirement in the spec. Can you point to a task that implements it? List any gaps.
117
130
 
118
- After writing the complete plan:
131
+ **2. Placeholder scan:** Search your plan for red flags — any of the patterns from the "No Placeholders" section above. Fix them.
119
132
 
120
- 1. Dispatch a single plan-document-reviewer subagent (see plan-document-reviewer-prompt.md) with precisely crafted review context never your session history. This keeps the reviewer focused on the plan, not your thought process.
121
- - Provide: path to the plan document, path to spec document
122
- 2. If ❌ Issues Found: fix the issues, re-dispatch reviewer for the whole plan
123
- 3. If ✅ Approved: proceed to execution handoff
133
+ **3. Type consistency:** Do the types, method signatures, and property names you used in later tasks match what you defined in earlier tasks? A function called `clearLayers()` in Task 3 but `clearFullLayers()` in Task 7 is a bug.
124
134
 
125
- **Review loop guidance:**
126
- - Same agent that wrote the plan fixes it (preserves context)
127
- - If loop exceeds 3 iterations, surface to human for guidance
128
- - Reviewers are advisory — explain disagreements if you believe feedback is incorrect
135
+ If you find issues, fix them inline. No need to re-review — just fix and move on. If you find a spec requirement with no task, add the task.
129
136
 
130
137
  ## Execution Handoff
131
138
 
@@ -93,7 +93,7 @@ skills/
93
93
  ## SKILL.md Structure
94
94
 
95
95
  **Frontmatter (YAML):**
96
- - Only two fields supported: `name` and `description`
96
+ - Two required fields: `name` and `description` (see [agentskills.io/specification](https://agentskills.io/specification) for all supported fields)
97
97
  - Max 1024 characters total
98
98
  - `name`: Use letters, numbers, and hyphens only (no parentheses, special chars)
99
99
  - `description`: Third-person, describes ONLY when to use (NOT what it does)
@@ -604,7 +604,7 @@ Deploying untested skills = deploying untested code. It's a violation of quality
604
604
 
605
605
  **GREEN Phase - Write Minimal Skill:**
606
606
  - [ ] Name uses only letters, numbers, hyphens (no parentheses/special chars)
607
- - [ ] YAML frontmatter with only name and description (max 1024 chars)
607
+ - [ ] YAML frontmatter with required `name` and `description` fields (max 1024 chars; see [spec](https://agentskills.io/specification))
608
608
  - [ ] Description starts with "Use when..." and includes specific triggers/symptoms
609
609
  - [ ] Description written in third person
610
610
  - [ ] Keywords throughout for search (errors, symptoms, tools)
@@ -1,5 +1,5 @@
1
1
  {
2
- "tag": "v5.0.5",
3
- "updated_at": "2026-03-21T03:01:32Z",
2
+ "tag": "v5.0.6",
3
+ "updated_at": "2026-03-28T11:32:19Z",
4
4
  "source": "https://github.com/obra/superpowers"
5
5
  }
@@ -1,20 +1,5 @@
1
1
  ---
2
- description: Start the brainstorming process before writing any code - uses superpowers brainstorming skill
2
+ description: "Deprecated - use the superpowers:brainstorming skill instead"
3
3
  ---
4
4
 
5
- Read and follow the `brainstorming` skill completely:
6
-
7
- // turbo
8
- 1. Read the skill: `view_file` `.agent/skills/brainstorming/SKILL.md`
9
-
10
- 2. Explore current project context (files, docs, recent git log)
11
-
12
- 3. Execute the full skill checklist in order:
13
- - Offer visual companion if upcoming questions involve visuals
14
- - Ask clarifying questions one at a time
15
- - Propose 2-3 approaches with trade-offs and a recommendation
16
- - Present design section by section, wait for approval after each
17
- - Write design doc to `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md`
18
- - Run spec review loop (dispatch spec-document-reviewer, fix issues, repeat max 3x)
19
- - Ask user to review the written spec
20
- - Transition to `writing-plans` skill
5
+ Tell your human partner that this command is deprecated and will be removed in the next major release. They should ask you to use the "superpowers brainstorming" skill instead.
@@ -1,25 +1,5 @@
1
1
  ---
2
- description: Execute an implementation plan task by task with TDD and code review - uses superpowers executing-plans skill
2
+ description: "Deprecated - use the superpowers:executing-plans skill instead"
3
3
  ---
4
4
 
5
- Read and follow the `executing-plans` skill completely:
6
-
7
- // turbo
8
- 1. Read the skill: `view_file` `.agent/skills/executing-plans/SKILL.md`
9
-
10
- // turbo
11
- 2. Read the TDD skill: `view_file` `.agent/skills/test-driven-development/SKILL.md`
12
-
13
- 3. Locate the plan in `docs/superpowers/plans/` or as specified by the user
14
-
15
- 4. For each task in the plan:
16
- a. Read the task spec carefully
17
- b. Write a failing test first (RED) — run it, confirm it fails
18
- c. Write the minimal code to make the test pass (GREEN) — run it, confirm it passes
19
- d. Refactor if needed, keeping tests green (REFACTOR)
20
- e. Commit with a clear, descriptive message
21
-
22
- 5. After each batch of tasks, pause for a human checkpoint
23
-
24
- 6. When all tasks are complete, read and follow the `verification-before-completion` skill:
25
- `view_file` `.agent/skills/verification-before-completion/SKILL.md`
5
+ Tell your human partner that this command is deprecated and will be removed in the next major release. They should ask you to use the "superpowers executing-plans" skill instead.
@@ -1,17 +1,5 @@
1
1
  ---
2
- description: Write a detailed implementation plan from an approved design - uses superpowers writing-plans skill
2
+ description: "Deprecated - use the superpowers:writing-plans skill instead"
3
3
  ---
4
4
 
5
- Read and follow the `writing-plans` skill completely:
6
-
7
- // turbo
8
- 1. Read the skill: `view_file` `.agent/skills/writing-plans/SKILL.md`
9
-
10
- 2. Locate the most recent design doc in `docs/superpowers/specs/` as the foundation
11
-
12
- 3. Execute the full skill process:
13
- - Break the design into tasks of 2-5 minutes each
14
- - Each task must include: exact file paths, complete code, and verification steps
15
- - Save the plan to `docs/superpowers/plans/YYYY-MM-DD-<topic>-plan.md`
16
- - Commit the plan to git
17
- - Wait for user approval before execution begins
5
+ Tell your human partner that this command is deprecated and will be removed in the next major release. They should ask you to use the "superpowers writing-plans" skill instead.