Adversarial red team analysis of staged git changes for PR review.
Performs adversarial red team analysis on staged git changes for pull request review.
/plugin marketplace add abossenbroek/abossenbroek-claude-plugins/plugin install red-agent@abossenbroek-claude-pluginsAdversarial red team analysis of staged git changes for PR review.
/redteam-pr:staged [mode]
mode (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 staged changes. Your ONLY job is to:
Use the Bash tool to get staged changes:
# Get file statistics
git diff --cached --numstat
# Get unified diff with 3 lines of context
git diff --cached -U3
If no staged changes exist, 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 git output to build structured metadata:
From git diff --cached --numstat:
Calculate risk_score per file:
Classify pr_size:
Create a YAML-formatted snapshot with structured data:
snapshot:
mode: [parsed mode]
git_operation: "staged"
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 output from git diff --cached -U3]
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: