Skip to content

An agentic skills framework & software development methodology that works.

feat: add Cursor-compatible hooks and fix platform detection

jesse4e7c0842f899
diff --git a/.cursor-plugin/plugin.json b/.cursor-plugin/plugin.json
index 6a27decb5..18e42958a 100644
--- a/.cursor-plugin/plugin.json
+++ b/.cursor-plugin/plugin.json
@@ -14,5 +14,5 @@
"skills": "./skills/",
"agents": "./agents/",
"commands": "./commands/",
- "hooks": "./hooks/hooks.json"
+ "hooks": "./hooks/hooks-cursor.json"
}
diff --git a/hooks/hooks-cursor.json b/hooks/hooks-cursor.json
new file mode 100644
index 000000000..70f22add5
--- /dev/null
+++ b/hooks/hooks-cursor.json
@@ -0,0 +1,10 @@
+{
+ "version": 1,
+ "hooks": {
+ "sessionStart": [
+ {
+ "command": "\"${CURSOR_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start"
+ }
+ ]
+ }
+}
diff --git a/hooks/session-start b/hooks/session-start
index dca538975..237193581 100755
--- a/hooks/session-start
+++ b/hooks/session-start
@@ -43,11 +43,14 @@ session_context="<EXTREMELY_IMPORTANT>\nYou have superpowers.\n\n**Below is the
# Uses printf instead of heredoc (cat <<EOF) to work around a bash 5.3+
# bug where heredoc variable expansion hangs when content exceeds ~512 bytes.
# See: https://github.com/obra/superpowers/issues/571
-if [ -n "${CLAUDE_PLUGIN_ROOT:-}" ]; then
+if [ -n "${CURSOR_PLUGIN_ROOT:-}" ]; then
+ # Cursor sets CURSOR_PLUGIN_ROOT (may also set CLAUDE_PLUGIN_ROOT) — emit additional_context
+ printf '{\n "additional_context": "%s"\n}\n' "$session_context"
+elif [ -n "${CLAUDE_PLUGIN_ROOT:-}" ]; then
# Claude Code sets CLAUDE_PLUGIN_ROOT — emit only hookSpecificOutput
printf '{\n "hookSpecificOutput": {\n "hookEventName": "SessionStart",\n "additionalContext": "%s"\n }\n}\n' "$session_context"
else
- # Other platforms (Cursor, etc.) — emit only additional_context
+ # Other platforms — emit additional_context as fallback
printf '{\n "additional_context": "%s"\n}\n' "$session_context"
fi