# How to Build the Most Powerful System for AI Coding (Full Breakdown)
<!--
ref: @content/youtube/cole-medin/how-to-build-the-most-powerful-system-for-ai-coding-full-breakdown
tags: [dark factory, autonomous coding, PRD to pull request, headless agents, builder and validator, holdout scenarios, blue-green deployment, GitHub issues automation]
version: 2
updated_at: 2026-11-24T05:25:17.198Z
-->

**[Watch on YouTube](https://www.youtube.com/watch?v=eecUhBpTz_g)**

# How to Build the Most Powerful System for AI Coding (Full Breakdown)

*Synthesized from Cole Medin, 2026-08-14.*

Cole Medin presents solo, introducing a skill that builds an "AI dark factory": a repository that takes a product spec and produces tested, deployable code with minimal human involvement. The video is sponsored by Parallel, a web-search infrastructure service for agents.

## Core Thesis
Cole argues that the next level of AI programming is a dark factory, where a specification goes in and a validated, deployable result comes out, with humans setting goals rather than reviewing each step. He says this is experimental and only reliable for some work, so he recommends staying at the human-in-the-loop level until the system is trusted. His skill encodes what he learned building his own factory, which he says took months and millions of tokens.

## Key Insights
- **Autonomy levels.** He uses the car analogy from Dan Shapiro's five levels of AI programming: level 0 is spicy autocomplete; levels 1 and 2 are companion-style assistance; level 3 is where the agent writes most code and the human plans and checks; levels 4 and 5 are the dark factory.
- **Setup interview.** The skill asks how autonomous the factory should be, which AI coding workflow to mirror (his example: prepare, plan, implement, test, judge, PR), and what the testing strategy is, then builds the system from the PRD.
- **Management layer.** It creates three files: global rules, factory rules (stricter limits, such as small one-at-a-time tasks, that apply only inside the factory) and a mission.md with goals and out-of-scope items. The factory may reject specs that conflict with the mission.
- **Intake as GitHub issues.** Each spec is a GitHub issue. A cron job runs every 30 minutes, labels issues to keep state between runs, and works in a fixed priority: fix open pull requests first, then review them, then start approved tasks, then pick up new work. He keeps parallelism low to stay within request limits.
- **Headless agents.** Each stage runs as a background agent call (Claude Code, Codex, Pi, AMP and others support headless mode). He uses his open-source Archon tool, but the skill works without it.
- **Builder and validator.** A separate validator agent reviews each pull request without seeing the plan. Holdout scenarios, written before the build and hidden from the builder, define what success looks like; the validator runs them separately, and failures return to the builder.
- **Deployment.** Merging does not deploy by itself; the factory uses blue-green deployment, updating a standby version before switching traffic to avoid downtime.
- **Example.** A tower-defense browser game built from the skill, which he frames as a test of breadth rather than depth.
- **Parallel sponsor segment.** Parallel's monitor feature runs a standing web search that fires a webhook on new results, and its pricing is per request rather than per token.

## Actionable Takeaways
1. Start with a PRD in an empty folder, then run the setup interview and answer every question, including how autonomous the factory should be.
2. Keep factory-only rules stricter than everyday rules, such as one small task at a time.
3. Put a mission file with out-of-scope items in the repo so the agent can reject specs that conflict with the goals.
4. Separate builder and validator, and hide holdout tests from the builder.
5. Use blue-green deployment so merged code is released only after the standby version is updated.
6. Keep a human review gate in place until the factory has earned trust.

## Notable Quotes
> "An AI dark factory is a repository that independently deploys its own code." — Cole Medin

> "The main idea is to have a very clear separation of builder and validator functions." — Cole Medin

---

*Related: `@content/youtube/cole-medin/gpt-6-astra-just-made-ai-software-factories-real-here-s-how-to-run-one` · `@content/youtube/cole-medin/im-building-an-ai-dark-factory-that-ships-its-own-code-public-experiment` · `@content/youtube/cole-medin/the-best-ai-coding-setup-isnt-the-most-autonomous-one-heres-why`*

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*