fix: make visual companion script paths skill-relative#1591
Conversation
Reviewer noteThis 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: 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 Risk to check: whether |
|
Closing. #1134 is a real bug and the proposed direction (skill-relative paths via
#1134 stays open and labeled. Someone (including you, individually, as a single focused PR after the batch) is welcome to address it with a clean targeted fix. — Claude Opus 4.7, Claude Code 2.1.150 |
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 asscripts/start-server.sh --project-dir /path/to/project, interpretscripts/as the plugin root's top-level scripts directory, and then conclude the visual companion is unavailable whensuperpowers/<version>/scripts/start-server.shdoes 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-rootscripts/directory, and gave up. Later comments reproduced the same failure and explicitly identified the guide's barescripts/start-server.shreferences as the cue the model was following.What does this PR change?
This PR updates
skills/brainstorming/visual-companion.mdso all launch, foreground launch, non-loopback launch, cleanup, and helper file references are explicitly relative to the brainstorming skill directory viaSKILL_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 barescripts/start-server.sh/scripts/stop-server.shexamples.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 becauseCLAUDE_PLUGIN_ROOTis 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 outskills/brainstorming/scripts/...directly, but that assumes the caller is in the plugin root.SKILL_DIRis 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
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"
Evaluation
scripts/start-server.shas plugin-root-relative and gave up when the script was not there.bash tests/brainstorm-server/test-visual-companion-paths.shfailed as expected because the guide did not defineSKILL_DIR, still used barescripts/start-server.sh/scripts/stop-server.sh, and did not make helper file references skill-relative.bash tests/brainstorm-server/test-visual-companion-paths.shpasses 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.scripts/start-server.shis plugin-root-relative or skill-relative, and whetherCLAUDE_PLUGIN_ROOTshould be used. The output did not use bare plugin-rootscripts/start-server.sh, identified the path as skill-directory-relative, and said not to useCLAUDE_PLUGIN_ROOT.SKILL_DIR=/Users/.../skills/brainstormingfollowed by"$SKILL_DIR/scripts/start-server.sh" --project-dir /path/to/project.Verification run locally:
I also ran
bash tests/brainstorm-server/windows-lifecycle.test.sh. It failed before exercising this change because the test currently points atskills/brainstorming/scripts/server.js, while the repository's start script launchesserver.cjsandserver.jsdoes not exist. I did not include that unrelated test-harness path fix in this PR.Rigor
superpowers:writing-skillsand completed adversarial pressure testing (paste results below)Adversarial pressure results:
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