一键导入
security
Security review and safe-op patterns. Use when reviewing for vulnerabilities, setting up hooks, or protecting files.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Security review and safe-op patterns. Use when reviewing for vulnerabilities, setting up hooks, or protecting files.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Promotes recurring feedback into the right skill, then guides /compact at phase boundaries.
Testing guidance for pytest, Jest/Vitest, Go, and TDD. Use when writing tests or improving coverage.
Methodical debugging with evidence and hypothesis testing. Use when troubleshooting fails or root cause is unclear.
Create new skills, commands, hooks, or subagents. Use when adding capabilities to Claude Code or Cursor.
PostgreSQL patterns for queries, schema, indexing, security. Use when writing SQL, designing schema, or adding indexes.
Reviews a GitHub PR diff for correctness, security, tests, architecture. Use when asked to review a PR or pull request.
| name | security |
| description | Security review and safe-op patterns. Use when reviewing for vulnerabilities, setting up hooks, or protecting files. |
Wait for response.
| Response | Action | |----------|--------| | 1, "review", "vulnerabilities" | Run security code review workflow below | | 2, "hooks", "safety" | See `workflows/setup-hooks.md` — install scripts | | 3, "file protections", "protect" | See `workflows/setup-hooks.md` — protect-files.sh | | 4, "deep review", "comprehensive", "audit" | See `workflows/deep-review.md` — comprehensive 10-dimension security audit with checklists |<code_review_workflow> When reviewing code for security:
Scan for OWASP Top 10. Reference the canonical checklist in ~/.claude/rules/security/references/owasp-checklist.md (the entry pointer lives at ~/.claude/rules/security/RULE.md §"OWASP / Common Vulnerability Checklist"). Don't re-list categories here; for each match, capture file:line + severity + remediation per the per-finding format below.
For each finding:
Never mark complete without:
<hooks_reference>
The hooks/ directory contains ready-to-install safety scripts:
block-dangerous-commands.sh — Primary hook. Blocks rm -rf /, dd to disks, fork bombs, mkfs, and git force pushes. Exits 2 (hard stop). block-dangerous-bash.sh — Compatibility alias. Delegates to block-dangerous-commands.sh; use when your hooks.json references the "bash" filename. protect-files.sh — Blocks writes to ~/.ssh, ~/.gnupg, ~/.aws/credentials, and any paths in PROTECTED_PATHS or ~/.claude/protected-paths.txt. Exits 2 (hard stop).
To install (Claude Code) — add to ~/.claude/settings.json:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [{"type": "command", "command": "bash ~/.claude/hooks/block-dangerous-commands.sh"}]
},
{
"matcher": "Write|Edit",
"hooks": [{"type": "command", "command": "bash ~/.claude/hooks/protect-files.sh"}]
}
]
}
}
Copy hook files: cp hooks/block-dangerous-commands.sh hooks/block-dangerous-bash.sh hooks/protect-files.sh ~/.claude/hooks/ && chmod +x ~/.claude/hooks/*.sh
</hooks_reference>
<non_hook_platforms> Cursor / GitHub Copilot / Gemini — no native hook system.
Instead, add a "never do" list to the project's AGENTS.md (or GEMINI.md) and to the AI's always-on rules:
NEVER run: rm -rf /, git push --force, dd to /dev/sd*, mkfs, fork bombs.
NEVER write to: ~/.ssh/, ~/.gnupg/, ~/.aws/credentials, .env files with real secrets.
The safety is enforced by instruction, not by a hard block. For high-risk environments, prefer Claude Code with hooks. </non_hook_platforms>
<success_criteria> Security review: All OWASP Top 10 categories checked. Findings with severity + specific fixes. Safety setup: Hooks installed, tested with a blocked command, protecting key paths. </success_criteria>