security-scan-diff
Scan for malicious code in git diff between a tag/commit and HEAD
Best use case
security-scan-diff is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Scan for malicious code in git diff between a tag/commit and HEAD
Teams using security-scan-diff should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/security-scan-diff/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How security-scan-diff Compares
| Feature / Agent | security-scan-diff | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Scan for malicious code in git diff between a tag/commit and HEAD
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
target_ref = $ARGUMENTS
If target_ref is not provided, ask the user which tag or commit to compare against HEAD.
## Overview
Thoroughly check for malicious code in the diff between `${target_ref}` and the latest commit (HEAD).
## Steps
1. Verify the target ref exists and get the diff scope.
- Run `git log ${target_ref}..HEAD --oneline` to list commits.
- Run `git diff ${target_ref}..HEAD --stat` to get file change statistics.
- Categorize changed files into: CI/CD workflows, source code, and config/docs.
2. Execute the following security reviews in parallel using subagents:
- Call security-reviewer subagent to review CI/CD and workflow files (`.github/`, `scripts/`) for:
- Secret exfiltration
- Script injection (`${{ github.event.* }}` direct expansion in `run:`)
- Suspicious external URLs/API connections
- Privilege escalation or token misuse
- Malicious command execution (`curl | bash`, `eval`, base64 decode execution)
- Supply chain attack patterns (suspicious npm packages, unsigned action references)
- Dangerous `pull_request_target` usage
- Call security-reviewer subagent to review source code files (`src/`) for:
- Arbitrary code execution (`eval`, `Function` constructor, suspicious `child_process` usage)
- Path traversal (`../..` directory escape)
- Command injection (user input passed directly to shell commands)
- Suspicious external communication (`fetch`, `http.request`, `axios` to external URLs)
- Unauthorized filesystem operations
- Credential/token leakage (hardcoded tokens, logging sensitive values)
- Dependency tampering (suspicious `package.json` changes)
- Backdoor patterns (obfuscated code, suspicious conditionals, hidden functionality)
- Prototype pollution and deserialization vulnerabilities
- Supply chain attacks (suspicious new dependency packages)
- Call security-reviewer subagent to review config and documentation files for:
- Suspicious dependencies or scripts in `package.json`
- Suspicious registries or URLs in lockfiles
- Security rule relaxation in config schemas or linter configs
- Suspicious settings in devcontainer or editor configs
- Phishing URLs in documentation
- Malicious instructions in AI rule/subagent/skill definitions
3. Integrate the results from all subagents and produce a unified report in the following format:
```
## Security Review Report: ${target_ref} -> HEAD
### Conclusion
- Whether malicious code was detected or not
### Check Results Summary Table
| Check Item | Result |
|------------|--------|
| ... | ... |
### Findings (if any)
| Severity | Description | File | Risk |
|----------|-------------|------|------|
| ... | ... | ... | ... |
### Recommendations (if any)
- Actionable recommendations for each finding
### Positive Observations
- Good security practices found in the diff
```Related Skills
rulesync
Generates and syncs AI rule configuration files (.cursorrules, CLAUDE.md, copilot-instructions.md) across 20+ coding tools from a single source. Use when syncing AI rules, running rulesync commands, importing or generating rule files, or managing shared AI coding configurations.
skill-creator
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
release-dry-run
Dry run for release: summarize changes since last release and suggest version bump.
playwright-cli
Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
git-worktree-runner
Manages git worktrees using git-worktree-runner (gtr). Use when the user needs to create, list, remove, or navigate worktrees with `git gtr` commands, open editors or AI tools in worktrees, manage parallel development branches, or check out GitHub PRs (including from forks) into worktrees.
draft-release
Draft a new release of the project.
create-scrap-issue
Create a GitHub issue that consolidates passed content into a single scrap issue with background context and solution details, labeled as maintainer-scrap. Use when the user wants to create a scrap issue, jot down notes as a GitHub issue, or save findings for later.
create-issue
Create a GitHub issue with detailed description, purpose, and appropriate labels
review-pr
Review a pull request for code quality and security issues. Use when the user wants to review a PR, check PR code changes, or audit a pull request. Triggers on: "review PR", "review pull request", "check this PR", "/review-pr".
review-and-comments
Review a PR for code quality and security issues, then post review comments on it. Runs review-pr followed by post-review-comments sequentially.
rebase-latest-main
Fetch latest origin/main and rebase it onto the current branch, resolving conflicts if necessary. Use when the user wants to rebase on main, update their branch with latest main, or sync with upstream.
post-review-comments
Post line-level review comments and an overall review comment on a PR in English with a natural, concise writing style