refactor: restructure repo layout
This commit is contained in:
9
hooks/post-write-lint.sh
Executable file
9
hooks/post-write-lint.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
# Lint automatique après écriture de fichier
|
||||
FILE=$(echo "$CLAUDE_TOOL_INPUT" | python3 -c "import json,sys; print(json.load(sys.stdin).get('file_path',''))")
|
||||
|
||||
if [[ "$FILE" == *.rs ]]; then
|
||||
cargo clippy --quiet 2>&1 | tail -20
|
||||
elif [[ "$FILE" == *.go ]]; then
|
||||
golangci-lint run "$FILE" 2>&1 | tail -20
|
||||
fi
|
||||
8
hooks/pre-bash-guard.sh
Executable file
8
hooks/pre-bash-guard.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# Bloque les commandes destructives sans confirmation
|
||||
CMD=$(echo "$CLAUDE_TOOL_INPUT" | python3 -c "import json,sys; print(json.load(sys.stdin).get('command',''))")
|
||||
|
||||
if echo "$CMD" | grep -qE 'rm -rf|DROP TABLE|git push --force'; then
|
||||
echo "BLOQUÉ : commande dangereuse détectée. Confirmez explicitement."
|
||||
exit 2 # exit 2 = deny dans Claude Code
|
||||
fi
|
||||
6
hooks/subagent-stop-log.sh
Executable file
6
hooks/subagent-stop-log.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# Observabilité : log chaque fin de subagent
|
||||
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
||||
PAYLOAD=$(cat)
|
||||
AGENT=$(echo "$PAYLOAD" | python3 -c "import json,sys; d=json.load(sys.stdin); print(d.get('agent_name','unknown'))" 2>/dev/null)
|
||||
echo "$TIMESTAMP agent=$AGENT" >> .claude/logs/subagent-decisions.log
|
||||
Reference in New Issue
Block a user