home / skills / sounder25 / google-antigravity-skills-library / 19_adversarial_reviewer
This skill generates a red-team critique of recent code to reveal weaknesses, edge cases, and overlooked assumptions before finalization.
npx playbooks add skill sounder25/google-antigravity-skills-library --skill 19_adversarial_reviewerReview the files below or copy the command above to add this skill to your agents.
---
name: Adversarial Reviewer
description: Generates a 'Red Team' critique of recent code or plans to identify weak assumptions and edge cases.
version: 1.0.0
author: Antigravity Skills Library
created: 2026-01-16
leverage_score: 5/5
---
# SKILL-019: Adversarial Reviewer
## Overview
Forces a context switch from "Builder" to "Attacker". Ideally used before finalizing any critical component (e.g. auth, payments, file I/O). It prepares a **structured prompt packet** that the agent then uses to critique its own work.
## Trigger Phrases
- `red team this`
- `adversarial review`
- `find bugs`
- `critique code`
## Inputs
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `--FilePath` | string | Yes | - | Path to the file to review |
| `--Mode` | string | No | `Security` | `Security`, `Performance`, or `Logic` |
## Outputs
### 1. Structured Prompt (Markdown)
A prompt template pre-filled with the code and specific attack vectors. **The Agent must then "simulate" the adversary by responding to this prompt.**
```markdown
# ⚔️ ADVERSARIAL REVIEW REQUEST
**TARGET:** src/Auth.cs
**MODE:** SECURITY
## INSTRUCTIONS
You are now the ADVERSARY. Break this code.
Look for:
1. Race Conditions
2. Replay Attacks
...
```
## Preconditions
1. Target file exists.
2. PowerShell 5.1+ or Core 7+.
## Safety/QA Checks
1. **Read-Only**: Does not modify the code; only reads it.
2. **Size Limit**: If file is massive (>10k lines), warns or truncates to prevent token overflow.
## Stop Conditions
| Condition | Action |
|-----------|--------|
| File not found | Return error |
## Implementation
See `scripts/prepare_review.ps1`.
## Integration with Other Skills
1. Call `prepare_review.ps1`.
2. **Agent Step**: Read the output text.
3. **Agent Step**: "Thinking" block -> Process the critique.
4. **Agent Step**: Generate list of fixes.
This skill generates a focused 'Red Team' critique of recent code or design plans to surface weak assumptions, edge cases, and attack vectors before release. It prepares a structured adversarial prompt packet that an agent uses to simulate an attacker and produce actionable findings. The skill is designed for final-stage reviews of high-risk components like auth, payments, and file I/O. Implementation is PowerShell-first and runs as a read-only analysis step.
The skill reads the target file and builds a pre-filled adversarial review prompt that specifies the review mode (Security, Performance, or Logic) and prioritized attack vectors. It enforces safety checks (read-only, size limits) and truncates or warns on very large files. The agent then consumes the prompt, adopts an adversary persona, lists vulnerabilities and edge cases, and returns prioritized fixes and mitigation steps.
Does the skill modify my code?
No. The skill is strictly read-only and only produces a prompt and critique; it never writes changes to source files.
What happens if the file is very large?
The skill warns or truncates the input beyond a configured threshold to avoid token overflow and encourages providing a representative excerpt.