# "Image to Code AI Subagents in Claude Code"
<!--
ref: @content/youtube/all-about-ai/2025-12-12-image-to-code-ai-subagents-in-claude-code
triggers: [need to generate code from an image, want to improve asset quality, looking for structured design output, require iterative refinement]
trigger_prompt: When the user wants to convert a visual specification into code and assets while ensuring high quality through iterative improvements.
version: 4
updated_at: 2026-10-31T19:09:42.865Z
-->

Claude Code (All About AI, 2025-12-12): Instead of writing long text specifications, generate one dense, legible layout image that encodes structure, design tokens, and content — then orchestrate Claude Code sub-agents to produce code, assets, screenshots, and iterative refinements against it.

The All About AI host walks through a hands-on Claude Code experiment that uses specialized sub-agents and a vision model to build a fully styled Path of Exile 2 build guide page from a single spec image.

## Core Thesis
Instead of writing long text specifications, generate one dense, legible layout image that encodes structure, design tokens, and content — then orchestrate Claude Code sub-agents to produce code, assets, screenshots, and iterative refinements against it. This "image-driven" workflow compresses spec-writing into visual form and uses a closed screenshot → critique → iterate loop to recover the polish that single-shot generation can't deliver.

## Key Insights
- **One orchestrator + four sub-agents** beats a monolithic prompt: an image generator (Nano Banana Pro), a style/asset agent, a screenshot agent, and an iteration agent each have narrow, swappable responsibilities.
- **Nano Banana Pro renders legible text inside images**, which is what makes a "spec image" viable as a replacement for written specs.
- **Mandatory minimum iteration count (3 cycles)** forces polish passes that a one-shot agent would skip; the user decides whether to continue past the floor.
- **Inspiration folders** (reference images + `build.txt`) provide grounding context that propagates a consistent art style across every generated asset.
- **Per-agent model selection** (Opus vs. Haiku, or inherit from parent) lets you spend compute where it matters — heavy reasoning on iteration, cheaper models on screenshot/critique.
- **Generate assets contextually**, not upfront — sub-agents adapt icons, hero art, and UI elements to the actual layout as it emerges.
- **Limitations are real**: build errors surface, some asset slots stay as placeholders, and domain accuracy (e.g., skill trees) is approximate, not authoritative.

## Actionable Takeaways
1. Define sub-agents via `/agents` in Claude Code with explicit per-agent model choices.
2. Use a vision model to produce a single layout/spec image before any code is written.
3. Wire the orchestration sequence into `claude.md` so the main agent doesn't need re-prompting each run.
4. Stage inspiration assets (reference images, brand guides, mood boards) in a known folder the style agent reads.
5. Build a screenshot → critique → iterate loop with a fixed minimum cycle count (e.g., 3) before exiting.
6. Let asset generation happen on-demand during the build, not as a pre-pass.

## Notable Quotes
> "This is more like a spec-driven or image-driven way of writing code."

> "An image is worth more than a thousand words kind of thinking part."

> "This is like a closed loop where we... recursively, not really, but improve the page over time."

> "I think this is a super cool way to use this sub agents and I'm going to explore this more."

---

*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).*