skills/git-guardrails/SKILL.md
Configure des hooks Claude Code pour bloquer les commandes git dangereuses (push, force-push, reset --hard, clean, branch -D, checkout/restore) avant leur exécution. Empêche les opérations git destructrices au niveau de l'agent.
npx skillsauth add dedalus-erp-pas/foundation-skills git-guardrailsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Sets up a PreToolUse hook that intercepts and blocks dangerous git commands before Claude Code executes them.
brew install jq or apt-get install jq
jq is not installed, the hook will fail open (allow all commands). Always verify jq is available after setup.Activate when the user:
git push, git reset --hard, or other dangerous commandsThe following commands are intercepted and blocked before execution:
| Pattern | Description |
|---------|-------------|
| git push | All push variants (prevents unreviewed pushes) |
| git push --force | Force push (rewrites remote history) |
| git push --force-with-lease | Force push variant |
| git reset --hard | Discards all uncommitted changes |
| git clean -f / git clean -fd | Deletes untracked files permanently |
| git branch -D | Force-deletes a branch without merge check |
| git checkout . | Discards all working tree changes |
| git restore . | Discards all working tree changes |
| git rebase on main/master | Prevents rebase of protected branches |
When blocked, Claude sees a message telling it that it does not have authority to run these commands. The user must run them manually if needed.
Ask the user: install for this project only (.claude/settings.json) or all projects (~/.claude/settings.json)?
The bundled script is at: reference/block-dangerous-git.sh
Copy it to the target location based on scope:
.claude/hooks/block-dangerous-git.sh~/.claude/hooks/block-dangerous-git.shMake it executable:
chmod +x <path-to-script>
Add to the appropriate settings file.
Project scope (.claude/settings.json):
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/block-dangerous-git.sh"
}
]
}
]
}
}
Global scope (~/.claude/settings.json):
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/block-dangerous-git.sh"
}
]
}
]
}
}
If the settings file already exists, merge the hook into the existing hooks.PreToolUse array. Do not overwrite other settings.
Ask if the user wants to add or remove any patterns from the blocked list. Edit the copied script accordingly.
Common additions users may want:
git stash drop (prevents accidental stash loss)git tag -d (prevents tag deletion)git push but only block --force variantsRun a quick test to confirm the hook works:
echo '{"tool_input":{"command":"git push origin main"}}' | <path-to-script>
Expected result: exits with code 2 and prints a BLOCKED message to stderr.
Run a second test with a safe command:
echo '{"tool_input":{"command":"git status"}}' | <path-to-script>
Expected result: exits with code 0 (allowed).
Claude Code supports PreToolUse hooks that run before any tool invocation. The hook:
command field using jqgit push also catches git push origin main --force.jq is not installed, the script will fail open (allow all commands). Ensure jq is available.databases
Exécute des requêtes SQL en lecture seule sur plusieurs bases de données PostgreSQL. À utiliser pour : (1) interroger des bases PostgreSQL, (2) explorer les schémas/tables, (3) exécuter des requêtes SELECT pour l'analyse de données, (4) vérifier le contenu des bases. Supporte plusieurs connexions avec descriptions pour une sélection automatique intelligente. Bloque toutes les opérations d'écriture (INSERT, UPDATE, DELETE, DROP, etc.) par sécurité.
development
Automatisation complète du navigateur et tests web avec Playwright. Détecte automatiquement les serveurs de développement, gère le cycle de vie des serveurs, écrit des scripts de test propres dans /tmp. Tester des pages, remplir des formulaires, capturer des screenshots, vérifier le responsive design, valider l'UX, tester les flux de connexion, vérifier les liens, déboguer des webapps dynamiques, automatiser toute tâche navigateur. À utiliser quand l'utilisateur veut tester des sites web, automatiser des interactions navigateur, valider des fonctionnalités web ou effectuer tout test basé sur le navigateur.
documentation
Boîte à outils complète pour la manipulation de PDF : extraction de texte et tableaux, création de nouveaux PDF, fusion/découpage de documents et gestion de formulaires. Quand Claude doit remplir un formulaire PDF ou traiter, générer ou analyser des documents PDF de manière programmatique et à grande échelle.
testing
Lance une réunion simulée avec plusieurs personas experts pour analyser un sujet sous des perspectives diverses, prendre une décision et proposer une solution avant implémentation. Peut optionnellement publier l'analyse de la réunion sur une issue GitLab ou GitHub liée.