fix(cursor): resolve session hook from plugin root - #2053
Open
ShiroKSH wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Who is submitting this PR? (required)
What problem are you trying to solve?
Cursor marketplace plugin hooks run with the opened workspace as their working directory. The relative command in
hooks/hooks-cursor.jsontherefore looks for./hooks/run-hook.cmdin the workspace instead of the installed plugin, so SessionStart cannot inject the Superpowers bootstrap. Cursor support confirms that${CURSOR_PLUGIN_ROOT}is the supported way to address the plugin directory from a hook command. This regressed after2b25774, which replaced the root-qualified command introduced for the Cursor hook integration.What does this PR change?
Restore the root-qualified Cursor dispatcher command, update the porting guide to describe the same contract, and add a regression test that rejects a relative Cursor hook command.
Is this change appropriate for the core library?
Yes. This is the shipped Cursor plugin bootstrap path and affects every Superpowers user running Cursor marketplace hooks.
What alternatives did you consider?
session-startdirectly: that reintroduces the Windows extensionless-script failure addressed by the existingrun-hook.cmdwrapper.Does this PR contain multiple unrelated changes?
No. The config, documentation, and regression test all enforce the same Cursor hook-path contract.
Existing PRs
Environment tested
New harness support (required if this PR adds a new harness)
N/A — this does not add a harness.
Evaluation
obra/superpowersfor a proven bug, preserve business logic, and choose a real contribution rather than cosmetic refactoring.SKILL.mdcontent.tests/hooks/test-session-start.shnow asserts the exact command and verifies the wrapper's Cursor JSON output.Rigor
Human review