summaryrefslogtreecommitdiff
path: root/hooks
diff options
context:
space:
mode:
authorJesse Vincent <jesse@fsck.com>2025-10-10 22:59:26 -0700
committerJesse Vincent <jesse@fsck.com>2025-10-10 22:59:26 -0700
commit015a07f7d76e62452e84afe7291d3d9381996f4f (patch)
tree50674a71f3c025ea466199279bc2fb6749c1f935 /hooks
parent33622d710e889093e85ea59a90aea5522b6aa196 (diff)
Show skills list and getting-started at session start
Session start hook now: - Inlines full getting-started/SKILL.md content (no @ links in hooks) - Runs find-skills and shows complete skills list - Shows tool paths after the guide Getting-started improvements: - Removed "Just Read This Guide?" section (redundant with hook) - Removed "Last thing" announcement requirement - Tightened intro from ~80 to ~35 words - Simplified "How to Load Skills" section - Updated Workflow 2 to reference skills list shown at session start - Removed redundant find-skills path examples This eliminates friction - agents see all available skills immediately without needing to search first. No excuse for "I didn't want to spend time searching."
Diffstat (limited to 'hooks')
-rwxr-xr-xhooks/session-start.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/hooks/session-start.sh b/hooks/session-start.sh
index 3f146a4..1fad497 100755
--- a/hooks/session-start.sh
+++ b/hooks/session-start.sh
@@ -26,12 +26,22 @@ elif echo "$setup_output" | grep -q "setup_failed=true"; then
github_recommendation="\n\n⚠️ Personal superpowers setup encountered an issue. Please file a bug at https://github.com/obra/superpowers/issues"
fi
+# Run find-skills to show all available skills
+find_skills_output=$("${CLAUDE_PLUGIN_ROOT}/scripts/find-skills" 2>&1 || echo "Error running find-skills")
+
+# Read getting-started content
+getting_started_content=$(cat "${CLAUDE_PLUGIN_ROOT}/skills/getting-started/SKILL.md" 2>&1 || echo "Error reading getting-started")
+
+# Escape both outputs for JSON
+find_skills_escaped=$(echo "$find_skills_output" | sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | awk '{printf "%s\\n", $0}')
+getting_started_escaped=$(echo "$getting_started_content" | sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | awk '{printf "%s\\n", $0}')
+
# Output context injection as JSON
cat <<EOF
{
"hookSpecificOutput": {
"hookEventName": "SessionStart",
- "additionalContext": "<EXTREMELY_IMPORTANT>\nYou have superpowers.\n\n**Skill tools are at:**\n- find-skills: ${CLAUDE_PLUGIN_ROOT}/scripts/find-skills\n- skill-run: ${CLAUDE_PLUGIN_ROOT}/scripts/skill-run\n\n**RIGHT NOW, go read**: @${CLAUDE_PLUGIN_ROOT}/skills/getting-started/SKILL.md${github_recommendation}\n</EXTREMELY_IMPORTANT>"
+ "additionalContext": "<EXTREMELY_IMPORTANT>\nYou have superpowers.\n\n**The content below is from skills/getting-started/SKILL.md - your introduction to using skills:**\n\n${getting_started_escaped}\n\n**Tool paths (use these when you need to search for or run skills):**\n- find-skills: ${CLAUDE_PLUGIN_ROOT}/scripts/find-skills\n- skill-run: ${CLAUDE_PLUGIN_ROOT}/scripts/skill-run\n\n**Available skills (output of find-skills):**\n\n${find_skills_escaped}${github_recommendation}\n</EXTREMELY_IMPORTANT>"
}
}
EOF