Skip to content

fix: make visual companion script paths skill-relative#1591

Open
YOMXXX wants to merge 1 commit into
obra:devfrom
YOMXXX:fix/visual-companion-skill-relative-paths
Open

fix: make visual companion script paths skill-relative#1591
YOMXXX wants to merge 1 commit into
obra:devfrom
YOMXXX:fix/visual-companion-skill-relative-paths

Conversation

@YOMXXX
Copy link
Copy Markdown

@YOMXXX YOMXXX commented May 21, 2026

What problem are you trying to solve?

Issue #1134 reports a real visual companion startup failure: agents read skills/brainstorming/visual-companion.md, see bare commands such as scripts/start-server.sh --project-dir /path/to/project, interpret scripts/ as the plugin root's top-level scripts directory, and then conclude the visual companion is unavailable when superpowers/<version>/scripts/start-server.sh does not exist.

The issue includes session excerpts from Claude Code 5.0.7 where the agent tried /Users/.../.claude/plugins/cache/claude-plugins-official/superpowers/5.0.7/scripts/start-server.sh, listed the plugin-root scripts/ directory, and gave up. Later comments reproduced the same failure and explicitly identified the guide's bare scripts/start-server.sh references as the cue the model was following.

What does this PR change?

This PR updates skills/brainstorming/visual-companion.md so all launch, foreground launch, non-loopback launch, cleanup, and helper file references are explicitly relative to the brainstorming skill directory via SKILL_DIR=<directory containing this visual-companion.md file>.

It also adds a static regression test that rejects both the Claude-specific ${CLAUDE_PLUGIN_ROOT} approach and the ambiguous bare scripts/start-server.sh / scripts/stop-server.sh examples.

Is this change appropriate for the core library?

Yes. The visual companion guide is core Superpowers skill collateral, and this failure affects any project where an agent follows the guide from a working directory other than skills/brainstorming. The fix is general-purpose, keeps the existing script layout, and does not add dependencies, wrappers, harness-specific behavior, or project-specific configuration.

What alternatives did you consider?

I reviewed PR #1264, which attempted to solve the same failure by using ${CLAUDE_PLUGIN_ROOT}/skills/brainstorming/scripts/.... That PR was closed because CLAUDE_PLUGIN_ROOT is Anthropic-specific and maintainers noted that skill collateral should live relative to the skill. This PR follows that maintainer feedback instead of hardcoding any harness-specific plugin root.

I also considered adding a plugin-root wrapper under top-level scripts/, but that would add indirection and preserve the wrong mental model. I considered spelling out skills/brainstorming/scripts/... directly, but that assumes the caller is in the plugin root. SKILL_DIR is the smallest platform-neutral way to keep the examples skill-relative.

Does this PR contain multiple unrelated changes?

No. All changes address one issue: removing ambiguous visual companion script paths from the brainstorming guide and locking that behavior with a regression test.

Existing PRs

PR #1264 is the direct prior attempt. It was closed because it hardcoded ${CLAUDE_PLUGIN_ROOT}. This PR avoids that rejected approach and instead uses a skill-directory placeholder, which matches the maintainer comment that skill collateral should be relative to the skill.

Environment tested

Harness (e.g. Claude Code, Cursor) Harness version Model Model version/ID
Claude Code CLI pressure prompts 2.1.141 Claude Code default not reported by CLI
Local shell tests zsh on macOS Darwin 24.6.0 Node.js v22.14.0 / npm 10.9.2

New harness support (required if this PR adds a new harness)

Not applicable. This PR does not add support for a new harness.

Clean-session transcript for "Let's make a react todo list"
Not applicable: no new harness support is added by this PR.

Evaluation

  • Initial prompt/problem source: issue claude code opus frequently cant find visual companion start script #1134 and its reproduced Claude Code sessions where agents interpreted scripts/start-server.sh as plugin-root-relative and gave up when the script was not there.
  • Before the guide change: bash tests/brainstorm-server/test-visual-companion-paths.sh failed as expected because the guide did not define SKILL_DIR, still used bare scripts/start-server.sh / scripts/stop-server.sh, and did not make helper file references skill-relative.
  • After the guide change: bash tests/brainstorm-server/test-visual-companion-paths.sh passes and confirms the guide uses "$SKILL_DIR/scripts/start-server.sh", "$SKILL_DIR/scripts/stop-server.sh", skill-relative helper references, no ${CLAUDE_PLUGIN_ROOT}, and no bare script command examples.
  • Eval sessions after the change: 2 Claude Code CLI pressure prompt sessions.
    • Prompt 1 asked for the start command from the plugin root, whether scripts/start-server.sh is plugin-root-relative or skill-relative, and whether CLAUDE_PLUGIN_ROOT should be used. The output did not use bare plugin-root scripts/start-server.sh, identified the path as skill-directory-relative, and said not to use CLAUDE_PLUGIN_ROOT.
    • Prompt 2 asked the agent to use the guide examples exactly. It returned SKILL_DIR=/Users/.../skills/brainstorming followed by "$SKILL_DIR/scripts/start-server.sh" --project-dir /path/to/project.

Verification run locally:

bash tests/brainstorm-server/test-visual-companion-paths.sh
# STATUS: PASSED

npm ci --prefix tests/brainstorm-server
npm test --prefix tests/brainstorm-server
# Results: 25 passed, 0 failed

node tests/brainstorm-server/ws-protocol.test.js
# Results: 31 passed, 0 failed

bash -n tests/brainstorm-server/test-visual-companion-paths.sh skills/brainstorming/scripts/start-server.sh skills/brainstorming/scripts/stop-server.sh
git diff --check
# no output

I also ran bash tests/brainstorm-server/windows-lifecycle.test.sh. It failed before exercising this change because the test currently points at skills/brainstorming/scripts/server.js, while the repository's start script launches server.cjs and server.js does not exist. I did not include that unrelated test-harness path fix in this PR.

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

Adversarial pressure results:

Prompt: Read skills/brainstorming/visual-companion.md and answer these checks concisely. 1) You are currently in the plugin root and need to start the visual companion for /path/to/project. What exact shell command should you run? 2) Is scripts/start-server.sh relative to the plugin root or to the skill directory? 3) Should CLAUDE_PLUGIN_ROOT be used to locate these scripts?

Result summary: The agent did not use bare plugin-root scripts/start-server.sh, identified the path as relative to the skill directory, and said not to use CLAUDE_PLUGIN_ROOT.

Prompt: Read skills/brainstorming/visual-companion.md. Using the guide examples exactly, fill in SKILL_DIR and then give the command to start visual companion for /path/to/project. Do not invent an alternate path.

Result:
SKILL_DIR=/Users/liguanchen/Desktop/lgc/superpowers/.worktrees/fix-visual-companion-skill-relative-paths/skills/brainstorming
"$SKILL_DIR/scripts/start-server.sh" --project-dir /path/to/project

This PR changes command examples and a short path note only. It does not modify Red Flags tables, rationalization language, or the project's core workflow philosophy.

Human review

  • A human has reviewed the COMPLETE proposed diff before submission

@YOMXXX
Copy link
Copy Markdown
Author

YOMXXX commented May 21, 2026

Reviewer note

This PR is one of six small, independent PRs opened from the same triage pass. They can be reviewed and merged independently:

Focus for this PR: fix #1134 by making visual companion commands explicitly relative to the brainstorming skill directory, not the plugin root.

Review surface: skills/brainstorming/visual-companion.md command examples plus a static regression test. This intentionally avoids the rejected #1264 approach of hardcoding ${CLAUDE_PLUGIN_ROOT}.

Verification: visual companion path test, brainstorm server tests, WebSocket protocol tests, and Claude Code pressure prompts that asked from the plugin root whether to use bare scripts/ or CLAUDE_PLUGIN_ROOT.

Risk to check: whether SKILL_DIR=<directory containing this visual-companion.md file> is the clearest cross-harness wording for skill-relative collateral.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant