ersinkoc/security-check/sc-diff-report
Claude Code and agent skill by ersinkoc/security-check
- community
Checking that the SKILL.md file is still in the repository.
Incremental security scan for changed files only — optimized for PR and commit-level reviews
Install
npx vskill@latest install ersinkoc/security-check/sc-diff-reportSKILL.md
The same SKILL.md was published earlier as ersinkoc/security-check/sc-diff-report.
SC: Diff Report — Incremental Security Scan
Purpose
Performs a targeted security scan on only the files changed in a git diff, pull request, or recent commit. This enables fast, focused security feedback during code review without the overhead of a full codebase scan. Classifies findings as "new" (introduced by changes) vs "existing" (pre-existing in touched files).
Diff mode is always partial coverage. Apply the evidence contract in sc-orchestrator: verify causality against the base revision, independently challenge candidates, and never present unresolved or pre-existing leads as newly introduced vulnerabilities.
Activation
Activates when the user issues any of:
- "scan diff"
- "scan changes"
- "PR scan"
- "scan commit"
- "incremental scan"
Output
File: security-report/diff-report.md
Phase 1: Change Detection
Git Diff Extraction
Determine the diff scope based on user context:
PR Mode (most common):
Staged changes:
Last commit:
Custom range:
Changed File Inventory
From the diff output, build an inventory:
- Added files — entirely new files (highest priority)
- Modified files — existing files with changes
- Deleted files — removed files (check for orphaned references)
- Renamed files — detect renames with content changes
For each changed file, record:
- File path
- Change type (added/modified/deleted/renamed)
- Lines added (line numbers)
- Lines removed (line numbers)
- Total change size (lines added + removed)
Change Filtering
Filter out changes unlikely to have security impact:
- Documentation files (
.md,.txt,.rst) — skip unless they contain config - Test files — scan but mark as test context
- Generated files — skip (check for
generatedmarkers) - Lock files — delegate to sc-dependency-audit pattern matching
- Static assets (images, fonts, CSS) — skip
- Configuration files — keep, high priority for security review
Dependency Change Detection
If lock files or manifests changed:
package.json/package-lock.json— extract added/removed/updated packagesgo.mod/go.sum— extract module changesCargo.toml/Cargo.lock— extract crate changesrequirements.txt/poetry.lock— extract package changes- Flag newly added dependencies for supply chain review
Phase 2: Targeted Vulnerability Scanning
Skill Selection
Based on changed files, activate only relevant skills:
| Changed File Pattern | Skills to Activate | |
|---|---|---|
*.go | sc-lang-go, sc-sqli, sc-cmdi, sc-ssrf, sc-auth, sc-race-condition | |
*.ts, *.tsx, *.js, *.jsx | sc-lang-typescript, sc-xss, sc-sqli, sc-secrets, sc-auth | |
*.py | sc-lang-python, sc-sqli, sc-cmdi, sc-ssti, sc-deserialization | |
*.php | sc-lang-php, sc-sqli, sc-xss, sc-cmdi, sc-deserialization, sc-path-traversal | |
*.rs | sc-lang-rust, sc-cmdi, sc-race-condition | |
*.java, *.kt | sc-lang-java, sc-sqli, sc-deserialization, sc-xxe, sc-rce | |
*.cs | sc-lang-csharp, sc-sqli, sc-deserialization, sc-xxe | |
Dockerfile*, docker-compose* | sc-docker | |
*.tf, *.tfvars | sc-iac | |
.github/workflows/*, .gitlab-ci.yml | sc-ci-cd | |
*.graphql, *resolver*, *schema* | sc-graphql | |
*.proto | sc-api-security | |
.env*, *config*, *secret* | sc-secrets, sc-data-exposure | |
*auth*, *login*, *session* | sc-auth, sc-session, sc-jwt | |
*upload* | sc-file-upload | |
*redirect*, *callback* | sc-open-redirect |
Focused Scanning
For each activated skill:
- Provide the skill with ONLY the changed files and their full content
- Also provide the diff hunks showing exactly what changed
- Instruct the skill to focus on the changed lines but consider surrounding context
- The skill runs its standard Phase 1 (Discovery) and Phase 2 (Verification) but scoped to changed files
New vs Existing Classification
For each finding:
New finding (introduced by this change):
- The vulnerable code is in an added line (green in diff)
- A new file introduces a vulnerability pattern
- A modification removes a security control
- A configuration change weakens security
Confirm "new" by comparing the complete source-to-sink path and effective controls in both base and head. A changed line near an old root cause is not sufficient.
Existing finding (pre-existing, found while scanning touched file):
- The vulnerable code is in an unchanged line within a modified file
- The finding exists in surrounding context, not in the diff itself
Regression (re-introduced):
- A previously fixed vulnerability pattern reappears
- A security control that was present is now removed
Phase 3: Quick Verification
Apply a lightweight version of sc-verifier logic:
- Reachability: Is the changed code reachable from an entry point?
- Sanitization: Is there sanitization in the data flow?
- Framework protection: Does the framework auto-protect against this?
- Context: Is this test code or production code?
- Confidence scoring (same 0-100 scale)
- Trust boundary: name attacker, affected principal/resource, and meaningful result
- Causality: prove which changed behavior introduces or restores the boundary failure
- Verdict:
confirmed,needs_validation, orrejected; only confirmed records receive severity
Output Format
{relevant diff hunk}
PR Comment Format
For integration with PR workflows, also produce a concise summary suitable for a PR comment:
Performance Considerations
- Diff mode should complete significantly faster than a full scan
- Only read changed files and their immediate imports
- Skip skills that are irrelevant to the changed file types
- Limit context expansion to 2 levels of function calls from changed code
- Target scan time: under 2 minutes for typical PRs (< 50 files changed)
Common False Positives in Diff Mode
- Refactored code flagged as new vulnerability — code was moved, not introduced
- Test additions flagged — new tests often contain intentionally vulnerable patterns
- Configuration for development — dev-only settings in changed config files
- Renamed variables — security-sensitive variable renamed but same protection in place
- Import reordering — framework imports moved but middleware still applied
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/sc-diff-report/SKILL.md
Popularity
- Repository stars
- 46
- Repository forks
- 5
- 7-day trend score
- 19
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ersinkoc/security-check/sc-diff-report)