
from zorai308
PreToolUse hook that blocks destructive git commands (push, reset --hard, clean, branch -D) so agents like Claude Code cannot run them without approval.
Installs a PreToolUse hook that intercepts and blocks dangerous Git operations before an agent (Claude Code) can execute them. The hook detects commands such as git push (including --force), git reset --hard, git clean -f/ -fd, git branch -D, and destructive checkout/restore patterns, returning a BLOCKED response so the calling agent is prevented from performing irreversible changes. This adds a safety layer for agents with shell or repo access.
Use this skill when running automated agents that may execute git commands in developer repositories or CI workspaces, particularly on shared machines or projects with important history. Ideal for preventing accidental force-pushes, history rewrites, or mass deletions by agents or untrusted scripts.
scripts/block-dangerous-git.sh (yes, has scripts).claude/settings.json or ~/.claude/settings.json, make executable, and test the hook with a sample command.Designed for Claude Code (PreToolUse hooks), but the pattern applies to any agent runtime that supports PreToolUse hooks and command interception.
This skill sets up a PreToolUse hook for Claude Code that blocks destructive git commands like push, reset --hard, and clean. The SKILL.md is well-structured with clear steps. The shell script ran but silently passed (exit 0) because jq was missing, which is a critical flaw — if jq is unavailable, the guardrail is bypassed entirely since the script never extracts the command to check. The dependency on jq is not documented in the skill.
jqSafety-oriented skill that blocks dangerous git commands. The silent fail-open when jq is missing is the most significant issue — a security guardrail that silently disables itself undermines its purpose. Should add a jq availability check at the top of the script and exit 2 (block) if jq is absent. Also should document jq as a dependency in SKILL.md.
Code Optimizer (Performance Audit)
Conducts deep performance audits across databases, memory, algorithms, concurrency, I/O, bundling, and more using specialist agents and pattern-based detection.
Knowledge Base (Help Center)
Guidance and templates for designing help center architecture, writing effective support articles, and optimizing search to maximize self-service deflection.
Weights & Biases (wandb)
Integrate Weights & Biases for ML experiment tracking: log metrics, hyperparameters, checkpoints, run sweeps and view collaborative dashboards.
EconML (Microsoft) — Heterogeneous Treatment Effects
Guidance and examples for using Microsoft EconML to estimate heterogeneous treatment effects (Double ML, Causal Forest, Deep IV) from observational data.