Adversarial red team analysis of a diff file for PR review.
Performs adversarial red team analysis on diff files for pull request security review.
/plugin marketplace add abossenbroek/abossenbroek-claude-plugins/plugin install red-agent@abossenbroek-claude-pluginsAdversarial red team analysis of a diff file for PR review.
/redteam-pr:diff <diff_file> [mode]
diff_file (required):
/redteam-pr:diff changes.patchmode (optional):
quick - Fast 2-3 vector analysis, skip groundingstandard - Balanced 5-6 vectors with basic grounding (default)deep - All categories + meta-analysis with full groundingfocus:[category] - Deep dive on specific category (e.g., focus:reasoning-flaws)You are the MINIMAL entry point for PR red team analysis of diff files. Your ONLY job is to:
Use the Read tool to get the diff content from the provided file path.
If the file does not exist or cannot be read, inform the user and exit.
Launch the pal-availability-checker agent to detect if PAL MCP is available:
Task: Launch pal-availability-checker agent
Agent: agents/pal-availability-checker.md
Prompt: Check if PAL MCP is available and list models
Parse the YAML result and include pal_available: true/false in the snapshot.
This step is NON-BLOCKING - continue regardless of result. PAL is optional.
Determine mode from command arguments:
standardParse the diff file to build structured metadata:
From unified diff format:
--- a/... and +++ b/... lines+, excluding +++)-, excluding ---)Calculate risk_score per file:
Classify pr_size:
Create a YAML-formatted snapshot with structured data:
snapshot:
mode: [parsed mode]
git_operation: "diff_file"
source_file: [path to diff file]
pal_available: [true/false from Step 2]
pal_models: [list of models if available, empty if not]
diff_metadata:
pr_size: [tiny/small/medium/large/massive]
files_changed:
- path: [file path]
additions: [number]
deletions: [number]
change_type: [added/modified/deleted/renamed]
risk_score: [0.0-1.0]
total_additions: [sum]
total_deletions: [sum]
total_files: [count]
diff_output: |
[Full content of the diff file]
If pr_size is "large" or "massive", use the AskUserQuestion tool to let the user scope the analysis:
Question: "This PR has {total_files} files with {total_additions + total_deletions} lines changed. How would you like to proceed?"
Options:
1. label: "Analyze all files"
description: "Complete analysis of all changes. May take 2-5 minutes for massive PRs."
2. label: "High-risk files only [RECOMMENDED]"
description: "Focus on files with risk_score > 0.7. Faster and catches critical issues."
3. label: "Specific files/directories"
description: "You choose which files or directories to analyze."
Based on the user's choice:
diff_metadata.files_changedrisk_score > 0.7src/auth/*)", then filter files_changed to matchUpdate diff_metadata.files_changed with the filtered list before proceeding.
Use the Task tool to launch a SINGLE agent:
Task: Launch pr-analysis-coordinator agent
Agent: agents/pr-analysis-coordinator.md
Prompt: [Include the full YAML snapshot]
Return the coordinator's markdown report DIRECTLY to the user.
DO NOT:
ONLY return the final sanitized markdown report.
This command is the FIREWALL between main session and PR analysis work: