Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 09:08:30 +08:00
commit 773b898589
19 changed files with 11663 additions and 0 deletions

15
hooks/hooks.json Normal file
View File

@@ -0,0 +1,15 @@
{
"hooks": {
"SessionStart": [
{
"matcher": "startup|resume|clear|compact",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh"
}
]
}
]
}
}

33
hooks/session-start.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/env bash
set -euo pipefail
PLUGIN_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
INTRO_FILE="$PLUGIN_ROOT/skills/using-rails-ai/SKILL.md"
if [ ! -f "$INTRO_FILE" ]; then
echo '{"error": "using-rails-ai/SKILL.md not found"}' >&2
exit 1
fi
CONTENT=$(cat "$INTRO_FILE")
# Escape for JSON
CONTENT=$(echo "$CONTENT" | sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | awk '{printf "%s\\n", $0}')
# Output JSON
cat << EOF
{
"event": "session-start",
"context": "🚀 Rails-AI SessionStart Hook Executed - using-rails-ai skill loaded with Superpowers dependency check and skill-loading protocol. Use /rails-ai:architect for Rails development.",
"content": "$CONTENT",
"debug": {
"hook_executed": true,
"timestamp": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
"skill_loaded": "rails-ai:using-rails-ai",
"skill_path": "$INTRO_FILE",
"content_length": $(echo "$CONTENT" | wc -c)
}
}
EOF
exit 0