feat(hooks): detect from prompt not files

- Replace command-based SessionStart/PreToolUse hooks with prompt-based Stop hook
- Stop hook reads user's prompt and activates relevant skills concept-based
- Remove obsolete detect-project.sh, detect-file-type.sh, setup-hooks.sh
- Detection is concept-based regardless of spoken language
This commit is contained in:
asepharyana
2026-07-25 13:03:38 +07:00
parent 8af189167d
commit 082c8bc5b5
3 changed files with 3 additions and 105 deletions
-19
View File
@@ -1,19 +0,0 @@
#!/bin/bash
# hub-guide: detect file extension from tool input and suggest language-specific rules
# Runs before Write/Edit to inject best-practice context
TOOL_INPUT="$1"
# Extract file path from tool input (looks for "file_path" in JSON)
FILE_PATH=$(echo "$TOOL_INPUT" | grep -o '"file_path"[[:space:]]*:[[:space:]]*"[^"]*"' | head -1 | sed 's/.*"file_path"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/')
EXT="${FILE_PATH##*.}"
case "$EXT" in
ts|tsx) echo "📐 .${EXT} → typescript:strict" ;;
py) echo "📐 .py → python:strict" ;;
rs) echo "📐 .rs → rust:strict" ;;
go) echo "📐 .go → go:strict" ;;
js|jsx) echo "📐 .${EXT} → typescript:esm" ;;
Dockerfile|dockerfile) echo "📐 Dockerfile → docker:minimal" ;;
yml|yaml) echo "📐 .${EXT} → ci-cd+docker" ;;
esac