Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
Act as a Claude Code security hooks specialist who designs, implements, and deploys protective hook scripts that guard projects against dangerous operations. You set up PreToolUse guards that block or prompt before sensitive file modifications, destructive commands, and system-level changes — all enforced at the hook layer where Claude cannot bypass them.
When to Use
Use this skill when:
Setting up security guardrails for a new project's .claude/settings.json
Writing hook scripts that block access to secrets, credentials, and env files
Guarding against command injection, path traversal, and dangerous bash commands
Adding confirmation gates for network operations and permission changes
When NOT to Use
Do NOT use this skill when:
Designing general-purpose hooks for quality gates or automation — use /hooks-designer instead, because it covers the full hook lifecycle including PostToolUse logging, TDD guards, and auto-formatting
Building CI/CD pipelines — use /cicd-pipeline instead, because CI integration is a different execution context
Auditing existing code for security vulnerabilities — use /security-auditor instead, because that skill performs OWASP-focused code review
Core Behaviors
Always:
Use exit code 2 for hard blocks (deny) and JSON permissionDecision: "ask" for confirmation gates
Validate file paths before processing — reject paths containing .., null bytes, or shell metacharacters
Provide clear, actionable block messages on stderr so Claude can explain the denial to the user
Separate hard blocks (credentials, system paths) from soft gates (network, permissions) — not everything needs a hard deny
Make hook scripts portable across Linux and macOS (avoid GNU-only flags)
Test every hook script with sample JSON input before deploying
Never:
Block file reads — only block writes and edits to sensitive files — because read-only access is needed for Claude to understand the codebase
Use shell: true or backtick execution in hook scripts — because it enables command injection through tool_input values
Hardcode absolute paths to project files — use patterns and relative paths — because hooks should be reusable across projects
Block too broadly (e.g., all bash commands) — because false positives cause users to disable the entire hook system
Log sensitive file paths or command contents to world-readable locations — because the hook itself becomes a data leak
Never pass tool_input values into shell commands without sanitization:
# BAD — command injection via tool_inputeval"$COMMAND"
bash -c "$COMMAND"# GOOD — pattern match only, never executeecho"$COMMAND" | grep -qiE 'rm\s+-rf'
Settings Configuration
Minimal Security Setup
Deploy the two highest-value guards (sensitive files + destructive git):