فهرست منبع

Update hooks to use skills repository from ~/.config/superpowers/skills

Changes:
- Set SUPERPOWERS_SKILLS_ROOT environment variable
- Call lib/initialize-skills.sh to handle clone/fetch/notification
- Update find-skills path to ${SUPERPOWERS_SKILLS_ROOT}/skills/using-skills/find-skills
- Update using-skills path (renamed from getting-started)
- Include initialization output in session start message
- Update slash command paths to use SUPERPOWERS_SKILLS_ROOT

Implements Task 7 from skills-repo-separation plan.
Jesse Vincent 11 ماه پیش
والد
کامیت
5b0b086829
4فایلهای تغییر یافته به همراه24 افزوده شده و 10 حذف شده
  1. 1 1
      commands/brainstorm.md
  2. 1 1
      commands/execute-plan.md
  3. 1 1
      commands/write-plan.md
  4. 21 7
      hooks/session-start.sh

+ 1 - 1
commands/brainstorm.md

@@ -2,4 +2,4 @@
 description: Interactive design refinement using Socratic method
 ---
 
-Read and follow: ${CLAUDE_PLUGIN_ROOT}/skills/collaboration/brainstorming/SKILL.md
+Read and follow: ${SUPERPOWERS_SKILLS_ROOT}/skills/collaboration/brainstorming/SKILL.md

+ 1 - 1
commands/execute-plan.md

@@ -2,4 +2,4 @@
 description: Execute plan in batches with review checkpoints
 ---
 
-Read and follow: ${CLAUDE_PLUGIN_ROOT}/skills/collaboration/executing-plans/SKILL.md
+Read and follow: ${SUPERPOWERS_SKILLS_ROOT}/skills/collaboration/executing-plans/SKILL.md

+ 1 - 1
commands/write-plan.md

@@ -2,4 +2,4 @@
 description: Create detailed implementation plan with bite-sized tasks
 ---
 
-Read and follow: ${CLAUDE_PLUGIN_ROOT}/skills/collaboration/writing-plans/SKILL.md
+Read and follow: ${SUPERPOWERS_SKILLS_ROOT}/skills/collaboration/writing-plans/SKILL.md

+ 21 - 7
hooks/session-start.sh

@@ -3,8 +3,15 @@
 
 set -euo pipefail
 
-# Run personal superpowers setup
+# Set SUPERPOWERS_SKILLS_ROOT environment variable
+export SUPERPOWERS_SKILLS_ROOT="${HOME}/.config/superpowers/skills"
+
+# Run skills initialization script (handles clone/fetch/notification)
 SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+PLUGIN_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
+init_output=$("${PLUGIN_ROOT}/lib/initialize-skills.sh" 2>&1 || echo "")
+
+# Run personal superpowers setup
 setup_output=$("${SCRIPT_DIR}/setup-personal-superpowers.sh" 2>&1 || echo "setup_failed=true")
 
 # Use same directory resolution as setup script
@@ -27,21 +34,28 @@ elif echo "$setup_output" | grep -q "setup_failed=true"; then
 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")
+find_skills_output=$("${SUPERPOWERS_SKILLS_ROOT}/skills/using-skills/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")
+# Read using-skills content (renamed from getting-started)
+using_skills_content=$(cat "${SUPERPOWERS_SKILLS_ROOT}/skills/using-skills/SKILL.md" 2>&1 || echo "Error reading using-skills")
 
-# Escape both outputs for JSON
+# Escape outputs for JSON
+init_escaped=$(echo "$init_output" | sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | awk '{printf "%s\\n", $0}')
 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}')
+using_skills_escaped=$(echo "$using_skills_content" | sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | awk '{printf "%s\\n", $0}')
+
+# Build initialization output message if present
+init_message=""
+if [ -n "$init_escaped" ]; then
+    init_message="${init_escaped}\n\n"
+fi
 
 # Output context injection as JSON
 cat <<EOF
 {
   "hookSpecificOutput": {
     "hookEventName": "SessionStart",
-    "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>"
+    "additionalContext": "<EXTREMELY_IMPORTANT>\nYou have superpowers.\n\n${init_message}**The content below is from skills/using-skills/SKILL.md - your introduction to using skills:**\n\n${using_skills_escaped}\n\n**Tool paths (use these when you need to search for or run skills):**\n- find-skills: ${SUPERPOWERS_SKILLS_ROOT}/skills/using-skills/find-skills\n- skill-run: ${SUPERPOWERS_SKILLS_ROOT}/skills/using-skills/skill-run\n\n**Available skills (output of find-skills):**\n\n${find_skills_escaped}${github_recommendation}\n</EXTREMELY_IMPORTANT>"
   }
 }
 EOF