Skip to content

fix(brainstorming): use CLAUDE_PLUGIN_ROOT in visual companion script paths - #1264

Closed
jdavidrparra wants to merge 1 commit into
obra:mainfrom
jdavidrparra:fix/visual-companion-script-path
Closed

jdavidrparra wants to merge 1 commit into
obra:mainfrom
jdavidrparra:fix/visual-companion-script-path

Conversation

@jdavidrparra

Copy link
Copy Markdown

What problem are you trying to solve?

When an agent tries to start the visual companion server, it looks for scripts/start-server.sh relative to an unspecified working directory. Since the scripts were moved from lib/brainstorm-server/ to skills/brainstorming/scripts/ (per the agentskills.io spec), the bare scripts/ prefix no longer resolves correctly. Agents consistently try the top-level scripts/ directory (which only contains bump-version.sh and sync-to-codex-plugin.sh), fail to find start-server.sh, and give up — telling the user the visual companion is unavailable.

This was reproduced on Claude Code (Windows + Git Bash) today and is tracked in issue #1134, which was filed the same day by another user experiencing the identical failure mode on macOS.

Exact failure sequence from both reports:

  1. Agent runs scripts/start-server.sh → not found
  2. Agent runs ls .../superpowers/5.0.7/scripts/ → sees only maintenance scripts
  3. Agent concludes "visual companion server scripts aren't available in this version" and falls back to terminal-only brainstorming

What does this PR change?

Replaces all bare scripts/ references in visual-companion.md with the full ${CLAUDE_PLUGIN_ROOT}/skills/brainstorming/scripts/ path. Affects start-server.sh, stop-server.sh, frame-template.html, and helper.js references (9 lines total, 1 file).

Is this change appropriate for the core library?

Yes. This is a documentation fix for a core skill that affects all users on all platforms. The bug causes a reliable failure for any agent following the visual companion guide as written.

What alternatives did you consider?

  • Add a wrapper in top-level scripts/ that delegates to the correct path — rejected, adds unnecessary indirection and a file to maintain.
  • Move scripts back to top-level scripts/ — rejected, the current location follows the agentskills.io spec and was an intentional architectural decision.
  • Add a note at the top of visual-companion.md warning about the path — rejected, agents would still copy the wrong path from the code blocks below the note.

Does this PR contain multiple unrelated changes?

No. Single file, single issue.

Existing PRs

Environment tested

Harness Harness version Model Model version/ID
Claude Code (Windows / Git Bash) 2.1.101 Claude Sonnet us.anthropic.claude-sonnet-4-6

Evaluation

  • Initial prompt: user asked to use visual brainstorming companion, accepted the offer, agent failed to find start-server.sh
  • After fix: agent used ${CLAUDE_PLUGIN_ROOT}/skills/brainstorming/scripts/start-server.sh, server started correctly, session proceeded
  • The fix was verified in the same session that reproduced the bug — server launched successfully on the first attempt with the corrected path

Rigor

  • If this is a skills change: I used superpowers:writing-skills and completed adversarial pressure testing (paste results below)
  • This change was tested adversarially, not just on the happy path
  • I did not modify carefully-tuned content (Red Flags table, rationalizations, "human partner" language) without extensive evals showing the change is an improvement

This is a path fix in code blocks, not behavior-shaping prose. No skill wording was changed.

Human review

  • A human has reviewed the COMPLETE proposed diff before submission

… paths

Scripts were referenced as bare relative paths (scripts/start-server.sh)
which caused agents to look in the wrong directory. The server scripts
live in skills/brainstorming/scripts/ since the brainstorm-server was
moved there, so all references now use the full
${CLAUDE_PLUGIN_ROOT}/skills/brainstorming/scripts/ prefix.

Fixes obra#1134

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Copilot AI review requested due to automatic review settings April 24, 2026 14:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the brainstorming visual companion guide to reference the correct on-disk locations for the companion server scripts after they moved under skills/brainstorming/scripts/, preventing agents from attempting to run non-existent top-level scripts/*.sh.

Changes:

  • Replace scripts/start-server.sh invocations with ${CLAUDE_PLUGIN_ROOT}/skills/brainstorming/scripts/start-server.sh across platform-specific launch examples.
  • Update cleanup instructions to call the corresponding stop-server.sh via the same root.
  • Update reference links for frame-template.html and helper.js to the new location.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

```bash
# Start server with persistence (mockups saved to project)
scripts/start-server.sh --project-dir /path/to/project
${CLAUDE_PLUGIN_ROOT}/skills/brainstorming/scripts/start-server.sh --project-dir /path/to/project

Copilot AI Apr 24, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command paths use ${CLAUDE_PLUGIN_ROOT} unquoted. In bash, this will break if the plugin path contains spaces (a case already called out elsewhere in the repo). Wrap ${CLAUDE_PLUGIN_ROOT}/... in double quotes (and consider quoting --project-dir too if it may contain spaces).

Suggested change
${CLAUDE_PLUGIN_ROOT}/skills/brainstorming/scripts/start-server.sh --project-dir /path/to/project
"${CLAUDE_PLUGIN_ROOT}/skills/brainstorming/scripts/start-server.sh" --project-dir "/path/to/project"

Copilot uses AI. Check for mistakes.
Comment on lines 67 to 79
**Codex:**
```bash
# Codex reaps background processes. The script auto-detects CODEX_CI and
# switches to foreground mode. Run it normally — no extra flags needed.
scripts/start-server.sh --project-dir /path/to/project
${CLAUDE_PLUGIN_ROOT}/skills/brainstorming/scripts/start-server.sh --project-dir /path/to/project
```

**Gemini CLI:**
```bash
# Use --foreground and set is_background: true on your shell tool call
# so the process survives across turns
scripts/start-server.sh --project-dir /path/to/project --foreground
${CLAUDE_PLUGIN_ROOT}/skills/brainstorming/scripts/start-server.sh --project-dir /path/to/project --foreground
```

Copilot AI Apr 24, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These Codex/Gemini examples now rely on ${CLAUDE_PLUGIN_ROOT}, but Codex install docs symlink skills into ~/.agents/skills/superpowers and don’t mention CLAUDE_PLUGIN_ROOT being set. If that env var isn’t present in those environments, the launch instructions will fail. Consider keeping ${CLAUDE_PLUGIN_ROOT} only for Claude Code, and using a Codex-safe path (e.g., ~/.agents/skills/superpowers/brainstorming/scripts/start-server.sh) and a Gemini-safe mechanism (documented extension root/env var) in their respective sections.

Copilot uses AI. Check for mistakes.

```bash
scripts/stop-server.sh $SESSION_DIR
${CLAUDE_PLUGIN_ROOT}/skills/brainstorming/scripts/stop-server.sh $SESSION_DIR

Copilot AI Apr 24, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleanup command also hard-codes ${CLAUDE_PLUGIN_ROOT}. If you adjust start-server paths per platform (e.g., Codex/Gemini), this should be updated in parallel so stop-server is invokable in the same environments. Also quote the script path and $SESSION_DIR to avoid failures when paths contain spaces.

Suggested change
${CLAUDE_PLUGIN_ROOT}/skills/brainstorming/scripts/stop-server.sh $SESSION_DIR
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${GEMINI_PLUGIN_ROOT}}}"
"$PLUGIN_ROOT/skills/brainstorming/scripts/stop-server.sh" "$SESSION_DIR"

Copilot uses AI. Check for mistakes.
Comment on lines +286 to +287
- Frame template (CSS reference): `${CLAUDE_PLUGIN_ROOT}/skills/brainstorming/scripts/frame-template.html`
- Helper script (client-side): `${CLAUDE_PLUGIN_ROOT}/skills/brainstorming/scripts/helper.js`

Copilot AI Apr 24, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reference paths now use ${CLAUDE_PLUGIN_ROOT}, which may not exist in non-Claude environments (Codex/Gemini). Since these are meant as file locations (not necessarily executable commands), consider using a platform-neutral relative path like skills/brainstorming/scripts/frame-template.html / .../helper.js, or documenting the equivalent root variable/path for each platform.

Suggested change
- Frame template (CSS reference): `${CLAUDE_PLUGIN_ROOT}/skills/brainstorming/scripts/frame-template.html`
- Helper script (client-side): `${CLAUDE_PLUGIN_ROOT}/skills/brainstorming/scripts/helper.js`
- Frame template (CSS reference): `skills/brainstorming/scripts/frame-template.html`
- Helper script (client-side): `skills/brainstorming/scripts/helper.js`

Copilot uses AI. Check for mistakes.
@obra obra added the brainstorming Retired: use skill:brainstorming label Apr 27, 2026
@obra

obra commented Apr 28, 2026

Copy link
Copy Markdown
Owner

We can't hardcode CLAUDE_PLUGIN_ROOT - that's Anthropic-only. Skill collateral is explicitly supposed to live relative to the skill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

brainstorming Retired: use skill:brainstorming

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants