diff options
| author | Jesse Vincent <jesse@fsck.com> | 2026-03-16 17:56:02 -0700 |
|---|---|---|
| committer | Jesse Vincent <jesse@fsck.com> | 2026-03-16 17:56:02 -0700 |
| commit | 1128a721ca3b7fd76bf12e8392cdeb89cfcfcf2a (patch) | |
| tree | ec548034f8d61a509450679eab9d757fbc3e489a /skills/brainstorming | |
| parent | 825a142aa32af84a8f276b7d7ee38c5bcaee64b1 (diff) | |
| parent | d1b5f578b00371fb5330810134562758c67f581a (diff) | |
Merge branch 'dev'v5.0.4
Diffstat (limited to 'skills/brainstorming')
| -rw-r--r-- | skills/brainstorming/SKILL.md | 4 | ||||
| -rw-r--r-- | skills/brainstorming/scripts/server.js | 2 | ||||
| -rwxr-xr-x | skills/brainstorming/scripts/start-server.sh | 12 | ||||
| -rwxr-xr-x | skills/brainstorming/scripts/stop-server.sh | 28 | ||||
| -rw-r--r-- | skills/brainstorming/spec-document-reviewer-prompt.md | 27 | ||||
| -rw-r--r-- | skills/brainstorming/visual-companion.md | 8 |
6 files changed, 61 insertions, 20 deletions
diff --git a/skills/brainstorming/SKILL.md b/skills/brainstorming/SKILL.md index 724dc79..edbc2b5 100644 --- a/skills/brainstorming/SKILL.md +++ b/skills/brainstorming/SKILL.md @@ -27,7 +27,7 @@ You MUST create a task for each of these items and complete them in order: 4. **Propose 2-3 approaches** — with trade-offs and your recommendation 5. **Present design** — in sections scaled to their complexity, get user approval after each section 6. **Write design doc** — save to `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md` and commit -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 5 iterations, then surface to human) +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) 8. **User reviews written spec** — ask user to review the spec file before proceeding 9. **Transition to implementation** — invoke writing-plans skill to create implementation plan @@ -121,7 +121,7 @@ After writing the spec document: 1. Dispatch spec-document-reviewer subagent (see spec-document-reviewer-prompt.md) 2. If Issues Found: fix, re-dispatch, repeat until Approved -3. If loop exceeds 5 iterations, surface to human for guidance +3. If loop exceeds 3 iterations, surface to human for guidance **User Review Gate:** After the spec review loop passes, ask the user to review the written spec before proceeding: diff --git a/skills/brainstorming/scripts/server.js b/skills/brainstorming/scripts/server.js index dec2f7a..86c3080 100644 --- a/skills/brainstorming/scripts/server.js +++ b/skills/brainstorming/scripts/server.js @@ -94,7 +94,7 @@ const WAITING_PAGE = `<!DOCTYPE html> h1 { color: #333; } p { color: #666; }</style> </head> <body><h1>Brainstorm Companion</h1> -<p>Waiting for Claude to push a screen...</p></body></html>`; +<p>Waiting for the agent to push a screen...</p></body></html>`; const frameTemplate = fs.readFileSync(path.join(__dirname, 'frame-template.html'), 'utf-8'); const helperScript = fs.readFileSync(path.join(__dirname, 'helper.js'), 'utf-8'); diff --git a/skills/brainstorming/scripts/start-server.sh b/skills/brainstorming/scripts/start-server.sh index b5f5a75..a60025c 100755 --- a/skills/brainstorming/scripts/start-server.sh +++ b/skills/brainstorming/scripts/start-server.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Start the brainstorm server and output connection info # Usage: start-server.sh [--project-dir <path>] [--host <bind-host>] [--url-host <display-host>] [--foreground] [--background] # @@ -64,6 +64,16 @@ if [[ -n "${CODEX_CI:-}" && "$FOREGROUND" != "true" && "$FORCE_BACKGROUND" != "t FOREGROUND="true" fi +# Windows/Git Bash reaps nohup background processes. Auto-foreground when detected. +if [[ "$FOREGROUND" != "true" && "$FORCE_BACKGROUND" != "true" ]]; then + case "${OSTYPE:-}" in + msys*|cygwin*|mingw*) FOREGROUND="true" ;; + esac + if [[ -n "${MSYSTEM:-}" ]]; then + FOREGROUND="true" + fi +fi + # Generate unique session directory SESSION_ID="$$-$(date +%s)" diff --git a/skills/brainstorming/scripts/stop-server.sh b/skills/brainstorming/scripts/stop-server.sh index c3724de..2e5973d 100755 --- a/skills/brainstorming/scripts/stop-server.sh +++ b/skills/brainstorming/scripts/stop-server.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Stop the brainstorm server and clean up # Usage: stop-server.sh <screen_dir> # @@ -17,7 +17,31 @@ PID_FILE="${SCREEN_DIR}/.server.pid" if [[ -f "$PID_FILE" ]]; then pid=$(cat "$PID_FILE") - kill "$pid" 2>/dev/null + + # Try to stop gracefully, fallback to force if still alive + kill "$pid" 2>/dev/null || true + + # Wait for graceful shutdown (up to ~2s) + for i in {1..20}; do + if ! kill -0 "$pid" 2>/dev/null; then + break + fi + sleep 0.1 + done + + # If still running, escalate to SIGKILL + if kill -0 "$pid" 2>/dev/null; then + kill -9 "$pid" 2>/dev/null || true + + # Give SIGKILL a moment to take effect + sleep 0.1 + fi + + if kill -0 "$pid" 2>/dev/null; then + echo '{"status": "failed", "error": "process still running"}' + exit 1 + fi + rm -f "$PID_FILE" "${SCREEN_DIR}/.server.log" # Only delete ephemeral /tmp directories diff --git a/skills/brainstorming/spec-document-reviewer-prompt.md b/skills/brainstorming/spec-document-reviewer-prompt.md index 212b36c..35acbb6 100644 --- a/skills/brainstorming/spec-document-reviewer-prompt.md +++ b/skills/brainstorming/spec-document-reviewer-prompt.md @@ -19,32 +19,31 @@ Task tool (general-purpose): | Category | What to Look For | |----------|------------------| | Completeness | TODOs, placeholders, "TBD", incomplete sections | - | Coverage | Missing error handling, edge cases, integration points | | Consistency | Internal contradictions, conflicting requirements | - | Clarity | Ambiguous requirements | - | YAGNI | Unrequested features, over-engineering | + | Clarity | Requirements ambiguous enough to cause someone to build the wrong thing | | Scope | Focused enough for a single plan — not covering multiple independent subsystems | - | Architecture | Units with clear boundaries, well-defined interfaces, independently understandable and testable | + | YAGNI | Unrequested features, over-engineering | + + ## Calibration - ## CRITICAL + **Only flag issues that would cause real problems during implementation planning.** + A missing section, a contradiction, or a requirement so ambiguous it could be + interpreted two different ways — those are issues. Minor wording improvements, + stylistic preferences, and "sections less detailed than others" are not. - Look especially hard for: - - Any TODO markers or placeholder text - - Sections saying "to be defined later" or "will spec when X is done" - - Sections noticeably less detailed than others - - Units that lack clear boundaries or interfaces — can you understand what each unit does without reading its internals? + Approve unless there are serious gaps that would lead to a flawed plan. ## Output Format ## Spec Review - **Status:** ✅ Approved | ❌ Issues Found + **Status:** Approved | Issues Found **Issues (if any):** - - [Section X]: [specific issue] - [why it matters] + - [Section X]: [specific issue] - [why it matters for planning] - **Recommendations (advisory):** - - [suggestions that don't block approval] + **Recommendations (advisory, do not block approval):** + - [suggestions for improvement] ``` **Reviewer returns:** Status, Issues (if any), Recommendations diff --git a/skills/brainstorming/visual-companion.md b/skills/brainstorming/visual-companion.md index a25e85a..2c35d5d 100644 --- a/skills/brainstorming/visual-companion.md +++ b/skills/brainstorming/visual-companion.md @@ -61,6 +61,14 @@ scripts/start-server.sh --project-dir /path/to/project scripts/start-server.sh --project-dir /path/to/project ``` +**Windows (Git Bash / CMD / PowerShell):** +```bash +# Windows/Git Bash reaps nohup background processes. The script auto-detects +# this via OSTYPE/MSYSTEM and switches to foreground mode automatically. +# No extra flags needed — all Windows shells route through Git Bash. +scripts/start-server.sh --project-dir /path/to/project +``` + **Gemini CLI:** ```bash # Use --foreground and set is_background: true on your shell tool call |
