# Autopilot - Red/Blue Adversarial Coding Workflow

> Goal in, merged code out: blind red-team acceptance tests vs blue-team implementation, layered QA, two gates under your control.

Autopilot - Red/Blue Adversarial Coding Workflow is a free AI agent skill pack (several skills in one listing) on Agensi by String Zhao, in Testing & Debugging. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [String Zhao](https://www.agensi.io/creators/string-zhao)
- Category: [Testing & Debugging](https://www.agensi.io/skills/testing-debugging)
- Uses: 2
- Version: 1.0
- Last updated: 2026-10-11
- Security: scan passed (2026-10-11); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/autopilot-red-blue-adversarial-coding-workflow
- Tags: code-review, testing, ai-agents, automation, red-team, workflow, agents, debugging

## About this skill

Autopilot is a full-cycle autonomous engineering workflow plugin for Claude Code. It does not start writing code when you describe a goal — it first produces a design document. You can require manual approval at both gates, or let it self-approve low-risk designs and auto-merge fully verified work; every decision is logged to the state file either way.

**The core idea is information isolation.** After the design gate clears, two independent agents run in parallel:

- **Blue team** receives the design doc and implementation plan, and writes the code.
- **Red team** receives *only* the design doc — it cannot see blue's code — and writes acceptance tests blind.

Red-team tests therefore represent design intent, not a rubber stamp of whatever got implemented. If the implementation drifts from the design, the tests catch it.

**Five-layer QA** — no "tests pass, ship it":

1. Red acceptance tests — a failure means the code drifted from the design
2. Type check, lint, unit tests, and build verification, run in parallel
3. Two independent AI reviews: design conformance, then code quality
4. Real-scenario smoke tests: boot the server, hit the API, run the CLI
5. Regression checks, with conditional performance tiers for hot paths

**Systematic debugging, not shotgun fixing.** On failure: observe the full error, form a causal hypothesis, verify with a minimal experiment, only then fix. A failing red test means the implementation gets fixed. Red tests are hash-locked against tampering: changing one requires an explicit, logged evidence trail, never a silent edit. Up to 3 auto-fix rounds, then control returns to you.

**Knowledge capture.** After merge, design decisions and debugging lessons are distilled into a project knowledge base and loaded automatically on similar future tasks.

**What's inside:** main 6-phase state machine (design, implement, qa, auto-fix, merge, done) with Git worktree isolation; design-phase brainstorm skill; smart commit skill; project-health doctor skill; multi-task DAG orchestration skill; stop-hook phase enforcement.

**Transparency note:** as a plugin, autopilot registers Claude Code hooks (Stop / SessionStart / WorktreeCreate) that run the bundled scripts in scripts/ and hooks/, including automatic worktree bootstrap with dependency install. Review these files before installing; the full source is on GitHub.

Iterated through daily dogfooding in real projects since January 2026. Free, open source (MIT); canonical source: https://github.com/strzhao/autopilot

(This listing packages the same plugin; install as a Claude Code plugin for the full hook-driven experience.)

## Requires

- Python
- Node.js
- tsc
- Playwright
- stryker
- c8
- jest

## Known limitations

Requires Git for worktree isolation and Node.js for state orchestration. Works best when installed as a plugin to enable automated hooks.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Autopilot - Red/Blue Adversarial Coding Workflow skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does the 'adversarial implementation' prevent bugs compared to standard Claude Code prompts?

The skill uses Git worktrees to isolate a 'Blue Team' (coder) from a 'Red Team' (tester). This prevents the agent from writing tests that merely confirm its own bugs, ensuring that acceptance tests are based on design requirements rather than the implementation logic.

### What are the specific environment requirements to run this skill?

Autopilot requires a local installation of Claude Code, Git (for worktree management), and a Node.js environment to run the state machine and the visual design review server.

### Can I use Autopilot with languages other than TypeScript?

While it works best with modern TypeScript/JavaScript stacks, the underlying five-layer QA and scientific debugging workflow can be adapted to any language that supports CLI-based linting and testing tools.

### Does the 'autopilot' name mean it will modify my codebase without my supervision?

No, the agent will never write code or commit changes without your explicit sign-off on the initial Architectural Design and the final QA report. You remain the final gatekeeper for all codebase modifications.

### What exactly is included in the purchase of this skill?

You receive the full state orchestration scripts, the visual design review server package, and the configuration templates needed to integrate the workflow directly into your Claude Code environment.

### How are updates handled if Claude Code releases a major breaking change?

Updates are delivered via the marketplace; you will receive notifications when new versions are released to handle Claude Code API changes or to add new QA layer integrations.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
