An AI agent that writes tests first, then code that passes
LLMs write code; this tool writes the test, then iterates until the code actually works.

What it does
Micro Agent is a CLI tool that generates a unit test from your prompt, then writes and rewrites code until that test passes. It deliberately refuses to be an end-to-end developer—no installing dependencies, no cross-file refactoring, no autonomous repo-wide chaos. It edits one file at a time and stops when the tests go green.
The interesting bit
The project treats narrow scope as a feature. While general-purpose coding agents compound errors like a Roomba stuck under furniture, Micro Agent limits itself to a single file and a definitive test case. It even offers an experimental visual-matching mode that iterates on UI code until a rendered screenshot matches a reference image, using Claude for visual feedback and OpenAI for the code generation.
Key highlights
- Generates tests automatically, then iterates code against them (default limit is 10 runs)
- Explicitly avoids multi-file edits, module installation, or other operations the authors deem “highly likely to cause havoc”
- Supports OpenAI, Claude, Ollama, Groq, or any OpenAI-compatible endpoint
- Experimental visual matching compares rendered output to a screenshot, optionally integrating with Figma via Visual Copilot
- Interactive mode asks clarifying questions instead of guessing
Caveats
- Visual matching is flagged as experimental and under active development
- The visual feature requires an Anthropic API key; the README notes OpenAI is “simply just not good at visual matching”
- It will not handle cross-file changes or dependency management, by design
Verdict
Worth a look if you want an AI pair programmer that knows its limits. Skip it if you need an agent to scaffold entire projects or refactor across your whole codebase.
Frequently asked
- What is BuilderIO/micro-agent?
- LLMs write code; this tool writes the test, then iterates until the code actually works.
- Is micro-agent open source?
- Yes — BuilderIO/micro-agent is open source, released under the MIT license.
- What language is micro-agent written in?
- BuilderIO/micro-agent is primarily written in TypeScript.
- How popular is micro-agent?
- BuilderIO/micro-agent has 4.3k stars on GitHub.
- Where can I find micro-agent?
- BuilderIO/micro-agent is on GitHub at https://github.com/BuilderIO/micro-agent.