refactor: restructure repo layout

This commit is contained in:
2026-03-27 10:24:55 +01:00
parent 1a6d5a7dda
commit 648fef9929
95 changed files with 33 additions and 44 deletions

9
hooks/post-write-lint.sh Executable file
View 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
View 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
View 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