Pre-Commit Security Checks
Run security and quality scans before committing code or opening pull requests.
Installation
- Make sure Claude is on your device and in your terminal.
Skills load from
~/.claude/skills/when Claude Code starts up — so you need it on your machine first. If you don't have it yet, install it once with the command below, then runclaudein any terminal to verify.One-time setupnpm i -g @anthropic-ai/claude-codeAlready have it? Skip ahead.
- Paste into Claude Code or into your terminal.
This copies the whole skill folder into
~/.claude/skills/trace-mcp-pre-commit-nikolai-vysotskyi/— the SKILL.md plus any scripts, reference docs, or templates the skill ships with. Works for every skill.What this command does
- Makes a new, empty temporary folder.
- Downloads the skill's folder,
skills/trace-mcp-pre-commit, fromgithub.com/nikolai-vysotskyi/trace-mcp(branchmaster), the GitHub repository it's listed from. You get the version that is there now, not a copy we keep. - Copies that folder to
~/.claude/skills/trace-mcp-pre-commit-nikolai-vysotskyi/. - Deletes the temporary folder.
Installing runs none of the skill's files; it only downloads and copies them. When you later use the skill, Claude follows its SKILL.md and may run scripts that come with it. Read them first.
Faster alternative (instruction-only skills)
Skips the clone and grabs only the SKILL.md file. Don't use this if the skill ships Python scripts, reference markdowns, or asset templates — they won't be downloaded and the skill will fail when it tries to load them.
Quick install (SKILL.md only)Sign up to copy - Restart Claude Code.
Quit and reopen Claude Code (or any other agent that loads from
~/.claude/skills/). New skills are picked up on startup. - Just ask Claude.
Skills auto-activate when your request matches the skill's description — no slash command needed. Trigger phrases live in the skill's own frontmatter; you can read them in the “What this skill does” section above.
Prefer to read the source first? Open on GitHub.
When Claude uses it
Run trace-mcp security, quality-gate, and antipattern checks before committing or opening a PR. Activate when the agent is about to create a commit or pull request in a project indexed by trace-mcp.
What this skill does
trace-mcp — Pre-Commit & Pre-PR Checks
Before creating a commit or opening a pull request, run the trace-mcp validation suite. Fix any critical or high findings before committing.
When to Use
- The user asks to commit, stage, or push changes
- The user asks to open a PR
- The agent has finished implementing a feature or fix and is about to hand off
Checklist
1. Security scan
scan_security({ rules: ["all"] })
OWASP Top-10 vulnerability scan across the changed scope. If the change touches untrusted data flows, add:
taint_analysis({})
Trace untrusted sources to sensitive sinks (SQL, shell, file system, HTTP).
2. Quality gates on the changed scope
check_quality_gates({ scope: "changed" })
Validates complexity, coverage, duplication, and any project-configured gates on only the files you changed.
3. Antipattern scan
detect_antipatterns({})
Flags N+1 queries, eager loading, inefficient iteration, and language-specific performance footguns.
4. Symbol-level diff for the PR description
compare_branches({ branch: "current" })
Produces a symbol-level diff (functions added/removed/modified, signatures changed, exports changed). Use this as the basis for an accurate PR description instead of a raw line diff.
5. Bug prediction (optional, for risky changes)
predict_bugs({})
get_risk_hotspots({})
Flags files where the combination of high complexity and high churn makes regressions likely. If your change touches a hotspot, add extra tests.
Fix or Escalate
- Critical / High findings: fix before committing. Do not suppress without discussion.
- Medium findings: fix if cheap, otherwise note in the PR description.
- Low / Info findings: note in the PR description.
After Commit
If the commit is part of a larger series, consider:
get_changed_symbols({ since: "<base-ref>" })
to generate an accurate changelog entry grounded in the symbol graph rather than commit messages.
Related skills
Documentation Co-Authoring
anthropics
Guide structured workflows for writing docs, proposals, and technical specs collaboratively.
MCP Server Builder
anthropics
Build protocol servers that connect language models to external APIs and services.
Skill Builder & Optimizer
anthropics
Create, edit, and optimize Claude skills with performance testing and benchmarking.
Multi-Component Web Artifacts
anthropics
Build complex React artifacts with Tailwind CSS and shadcn/ui components.