@spardutti/claude-skills 2.41.2 → 2.41.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -62,8 +62,10 @@ if [ "$TOOL" = "Bash" ]; then
|
|
|
62
62
|
STRIPPED=$(printf '%s' "$CMD" | sed 's![12]*>>*[[:space:]]*/dev/null!!g')
|
|
63
63
|
WRITES=""
|
|
64
64
|
case "$STRIPPED" in
|
|
65
|
-
*">"*|*"
|
|
65
|
+
*">"*|*"sed -i"*) WRITES=1 ;;
|
|
66
66
|
esac
|
|
67
|
+
# Whole words only: "git add api/x.py" contains "dd ".
|
|
68
|
+
printf '%s' "$STRIPPED" | grep -qE '(^|[[:space:];|&(])(tee|cp|mv|truncate|dd)[[:space:]]' && WRITES=1
|
|
67
69
|
case "$CMD" in
|
|
68
70
|
*"<<"*|*python*" -c"*|*node*" -e"*|*perl*" -e"*|*ruby*" -e"*) WRITES=1 ;;
|
|
69
71
|
esac
|
|
@@ -24,7 +24,9 @@ SKILL_NAME=$(printf '%s' "$INPUT" | grep -o '"skill":"[^"]*"' | head -1 | sed 's
|
|
|
24
24
|
if [ -n "$SKILL_NAME" ]; then
|
|
25
25
|
# Sanitize: only allow [A-Za-z0-9_-] in the marker filename.
|
|
26
26
|
SAFE_NAME=$(printf '%s' "$SKILL_NAME" | tr -cd 'A-Za-z0-9_-')
|
|
27
|
-
|
|
27
|
+
# Only skills the CLI installed get acked; built-ins and hand-made skills have no rules for us.
|
|
28
|
+
MANIFEST="$(dirname "$(cd "$(dirname "$0")" && pwd)")/.claude-skills.json"
|
|
29
|
+
if [ -n "$SAFE_NAME" ] && tr -d ' \n' 2>/dev/null < "$MANIFEST" | grep -o '"skills":\[[^]]*\]' | grep -q "\"$SAFE_NAME\""; then
|
|
28
30
|
touch "/tmp/claude-skill-loaded-$KEY-$SAFE_NAME"
|
|
29
31
|
# The ack path holds a key the model cannot know, so without this line its
|
|
30
32
|
# first write is always denied just to learn it.
|
package/hooks/skill-gate.sh
CHANGED
|
@@ -85,8 +85,10 @@ if [ "$TOOL" = "Bash" ]; then
|
|
|
85
85
|
STRIPPED=$(printf '%s' "$CMD" | sed 's![12]*>>*[[:space:]]*/dev/null!!g')
|
|
86
86
|
WRITES=""
|
|
87
87
|
case "$STRIPPED" in
|
|
88
|
-
*">"*|*"
|
|
88
|
+
*">"*|*"sed -i"*) WRITES=1 ;;
|
|
89
89
|
esac
|
|
90
|
+
# Whole words only: "git add api/x.py" contains "dd ".
|
|
91
|
+
printf '%s' "$STRIPPED" | grep -qE '(^|[[:space:];|&(])(tee|cp|mv|truncate|dd)[[:space:]]' && WRITES=1
|
|
90
92
|
# An interpreter given inline code or a heredoc can write anything, and the
|
|
91
93
|
# shell shows no redirect at all — this is the shape that got past the gate.
|
|
92
94
|
case "$CMD" in
|