-
Notifications
You must be signed in to change notification settings - Fork 512
Expand file tree
/
Copy pathskill-eval.sh
More file actions
executable file
·31 lines (26 loc) · 902 Bytes
/
skill-eval.sh
File metadata and controls
executable file
·31 lines (26 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# Skill Evaluation Hook v2.0
# Wrapper script that delegates to the Node.js evaluation engine
#
# This hook runs on UserPromptSubmit and analyzes the prompt for:
# - Keywords and patterns indicating skill relevance
# - File paths mentioned in the prompt
# - Intent patterns (what the user wants to do)
# - Directory mappings (what directories map to which skills)
#
# Configuration is in skill-rules.json
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
NODE_SCRIPT="$SCRIPT_DIR/skill-eval.js"
# Check if Node.js is available
if ! command -v node &>/dev/null; then
# Fallback: exit silently if Node.js not found
exit 0
fi
# Check if the Node script exists
if [[ ! -f "$NODE_SCRIPT" ]]; then
exit 0
fi
# Pipe stdin to the Node.js script (suppress stderr noise from nvm/shell init)
cat | node "$NODE_SCRIPT" 2>/dev/null
# Always exit 0 to allow the prompt through
exit 0