Overview
This plugin performs comprehensive security review of code changes by analyzing diffs in the context of the entire codebase. It scales analysis depth based on codebase size, uses git blame to understand why code existed, calculates the impact radius of changes, and identifies test coverage gaps.Version: 1.0.0
Core Principles
Risk-First
Evidence-Based
Adaptive
Output-Driven
When to Use
Use this skill when you need to:- Review PRs, commits, or diffs for security vulnerabilities
- Detect security regressions (re-introduced vulnerabilities)
- Analyze the blast radius of code changes
- Check test coverage gaps for modified code
- Perform pre-merge security review for critical changes
Installation
Features
Risk-First Analysis
Changes are classified by risk level and prioritized accordingly:Git History Analysis
Usesgit blame to understand:
- Why removed code existed (was it a security fix?)
- When it was added (recent or legacy?)
- Who authored it (security-aware developer?)
- Commit messages revealing intent (CVE fix, security patch?)
Blast Radius Calculation
Quantifies the impact of changes by counting:- Direct callers of modified functions
- Transitive callers (functions calling the callers)
- Shared state dependencies
- Cross-module coupling
- 1-5 callers = Low blast radius
- 5-20 callers = Medium blast radius
- 20-50 callers = High blast radius
- 50+ callers = Critical blast radius (requires deep analysis)
Adaptive Depth Scaling
Workflow
The complete workflow spans Pre-Analysis + Phases 0-6:Pre-Analysis (Optional)
audit-context-building skill if availablePhase 0: Intake & Triage
Phase 1: Changed Code Analysis
Phase 2: Test Coverage Analysis
Phase 3: Blast Radius Analysis
Phase 4: Deep Context Analysis
Phase 5: Adversarial Analysis
Phase 6: Report Generation
Modular Documentation Architecture
This skill uses progressive disclosure for token efficiency:SKILL.md
methodology.md
adversarial.md
reporting.md
patterns.md
Example Usage
Quick Triage (Small PR)
- Classify risk level per file (2 HIGH, 3 LOW)
- Focus on 2 HIGH files only
- Git blame removed code
- Generate minimal report
Standard Review (Medium Codebase)
- Full workflow on HIGH RISK files
- Surface scan on MEDIUM
- Skip LOW risk files
- Complete report with all sections
Deep Audit (Large, Critical Change)
- Baseline context with audit-context-building
- Deep analysis on auth changes only
- Blast radius analysis
- Adversarial modeling
- Comprehensive report
Report Output
The generated markdown report includes:Executive Summary
Executive Summary
Critical Findings
Critical Findings
Test Coverage Analysis
Test Coverage Analysis
Blast Radius Analysis
Blast Radius Analysis
Historical Context
Historical Context
Actionable Recommendations
Actionable Recommendations
Red Flags (Stop and Investigate)
Immediate escalation triggers: These patterns require adversarial analysis even in quick triage.Rationalizations to Reject
"Small PR, quick review"
"Small PR, quick review"
Required action: Classify by RISK, not size
"I know this codebase"
"I know this codebase"
Required action: Build explicit baseline context
"Git history takes too long"
"Git history takes too long"
Required action: Never skip Phase 1
"Blast radius is obvious"
"Blast radius is obvious"
Required action: Calculate quantitatively
"No tests = not my problem"
"No tests = not my problem"
Required action: Flag in report, elevate severity
"Just a refactor, no security impact"
"Just a refactor, no security impact"
Required action: Analyze as HIGH until proven LOW
I'll explain verbally
I'll explain verbally
Required action: Always write report
Example Vulnerability: Security Regression
Git blame reveals removed security code:- Git blame: Removed code added 6 months ago in commit “Fix CVE-2023-12345”
- Risk: HIGH - validation removal on a known CVE fix
- Impact: Re-introduces buffer overflow vulnerability
- Blast radius: 47 callers of
processInput() - Verdict: Critical security regression
Example Vulnerability: Access Control Change
- Change: Visibility modifier
internal→external - Risk: HIGH - access control modification
- Impact: Anyone can now call
withdraw(), not just contract itself - Attack scenario: Attacker calls
withdraw()directly, drains contract - Severity: Critical
Quality Checklist
Before delivering a differential review:- All changed files analyzed
- Git blame on removed security code
- Blast radius calculated for HIGH risk changes
- Attack scenarios are concrete (not generic)
- Findings reference specific line numbers + commits
- Report file generated and saved
- User notified with summary
Integration with Other Skills
audit-context-building:- Pre-Analysis: Build baseline context before differential review
- Phase 4: Deep context on HIGH RISK changes
- Verify suspected vulnerabilities found during review
- Transform findings into formal audit reports
- Command:
issue-writer --input DIFFERENTIAL_REVIEW_REPORT.md --format audit-report
When NOT to Use
Do not use differential-review for:- Greenfield code (no baseline to compare)
- Documentation-only changes (no security impact)
- Formatting/linting (cosmetic changes)
- User explicitly requests quick summary only (they accept risk)
Related Skills
- Audit Context Building - Used for baseline analysis
- FP Check - Verify suspected vulnerabilities