# Plan-Build-Verify — Safe AI Coding with Approval & TDD

> Enforce a disciplined Planner → Builder → Verifier engineering pipeline with human approval gates, root-cause analysis, TDD, and independent verification—preventing unapproved AI edits or unverified fixes.

Plan-Build-Verify — Safe AI Coding with Approval & TDD is a free AI agent skill on Agensi by PocketAgent Lab, in Workflow Automation. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [PocketAgent Lab](https://www.agensi.io/creators/zanta-ho)
- Category: [Workflow Automation](https://www.agensi.io/skills/workflow-automation)
- Version: 3.4
- Last updated: 2026-11-26
- Security: scan passed (2026-11-26); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/plan-build-verify-safe-ai-coding-with-approval-tdd
- Tags: code-review, security, productivity, coding, workflow, planning, verification, code-quality-review

## About this skill

Stop letting AI agents rewrite half your codebase without permission—or claim "all tests pass" without running a single check.

When handling multi-file features, risky refactors, or tricky bugfixes, single-prompt coding often leads to scope creep, broken invariants, and endless trial-and-error loops. **plan-build-verify**
enforces a strict three-phase engineering workflow with explicit human approval gates and evidence-backed verification.

### How the Pipeline Works

1. **Planner (Read-Only Analysis)** → Explores governance, baseline Git state, acceptance criteria, and invariants, then writes `plan.md` (`status: draft`) and **stops for your explicit approval**.
2. **Builder (Scoped Implementation)** → Implements only within the approved plan scope using Root Cause Analysis (RCA) and TDD (`RED → GREEN → REFACTOR`), optionally slicing work to subagents, and
   records raw test/lint outputs in `build-summary.md`.
3. **Verifier (Independent Review)** → Reviews modified files and command evidence against acceptance criteria and invariants, then issues a formal verdict (`Pass`, `Conditional Pass`, `Fail`, or
   `Blocked`) in `verification-report.md`. **Verifier never edits source code.**

### Key Guarantees

- **Mandatory Human Approval Gate**: No silent auto-proceed after planning; any edit to `plan.md` resets approval status.
- **Bounded Fix Budget (Max 2 Rounds)**: Prevents infinite retry loops (`Fix-Round` is cumulative per `Task-ID`). Expected TDD `RED` steps and environment `Blocked` states do not consume budget.
- **Evidence-Based Verification**: Every test, lint, and typecheck output is recorded with executor identity (`user` or `agent`) and checked against your pre-existing Git baseline.
- **EDR & Locked-Down Environment Ready**: Defaults to `user-executed` mode (the agent gives consolidated commands for you to run). `agent-executed` and `auto` modes require explicit authorization.
- **Zero-Trust Artifact Contracts**: `Task-ID`, `Plan-Revision`, and append-only `Round Log` trails prevent context drift across sessions or subagent handoffs.
- **Built-In Safety**: Automatic `[REDACTED]` secret scrubbing in artifacts, untrusted-content isolation, and zero unauthorized `git commit` or `git push`.

### When Not to Use

Skip this pipeline for trivial one-file edits, typo fixes, or zero-risk tweaks.

### What's Included

- **`SKILL.md`**: Complete Planner, Builder, and Verifier protocol (`v3.3.1`).
- **`references/reliable-engineering.md`**: Systematic Root Cause Analysis and TDD (`RED → GREEN → REFACTOR`) rules.
- **`references/subagent-dispatch.md`**: Task slicing, permission inheritance, write-collision prevention, and evidence aggregation.

## Requires

- User able to run shell commands (for user-executed mode)
- Python 3.10+ or Node.js 18+ (for running verification commands)
- Git
- Optional: Docker (for sandboxed execution)
- Optional: pytest, ruff, mypy, or equivalent test/lint/typecheck tools

Requires an AI agent with native file read/write/search tools and a Git repository.

## Known limitations

Does not replace architectural judgment; Planner quality depends on codebase exploration depth. User-executed mode requires manual command execution. Fix budget (2 rounds) may need an explicit user reset for complex legacy refactors. Verifier cannot edit code—it only reports defects. No built-in support for non-Git VCS.

## 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 Plan-Build-Verify — Safe AI Coding with Approval & TDD 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

### Can I skip the Planner phase for simple changes?

Only for trivial one-file edits with no risk, and only with explicit user consent.

### What happens if the Verifier returns Fail?

A fix round starts (Fix-Round increments). Builder addresses only the reported issues within the approved scope, up to 2 fix rounds per task.

### Does a new Plan-Revision reset the fix budget?

No. Fix-Round is cumulative per Task-ID. Only an explicit user instruction resets it.

### What if my environment blocks command execution (EDR, group policy)?

The default user-executed mode works everywhere—the agent provides consolidated commands for you to run and never assumes shell access.

---

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.
