Vibe Coding with AI Agents: A Test-Driven Development Workflow
Intensive work with AI coding agents reveals a shift in the development bottleneck: generating code is fast, but validating it takes time. This article explains how layered tests, submission gates, self-hosted CI, and change-based test routing can shorten feedback loops while keeping developers focused on requirements, architecture, and design review.
1. When Coding Is No Longer the Bottleneck
For an extended period, I spent close to 16 hours a day developing alongside AI agents. That was my actual routine, not a figure of speech: coding until six or seven in the morning, sleeping until noon, and remotely accessing a terminal from a mobile device during my commute so the agents could keep working.
What made this possible was a substantial improvement in the reasoning and execution capabilities of newer large language models. In my experience, they were much more reliable on long-running tasks than earlier models, with fewer hallucinations and better instruction following. Even complex tasks spanning dozens of steps rarely drifted off course.
Earlier models were more prone to losing sight of the original objective halfway through a task or getting stuck in a loop of repeatedly modifying the same code.
Once agents become reliable enough, the development bottleneck shifts:
- Previously: Writing code was slow, and human coding capacity limited throughput.
- Now: Code generation is nearly immediate, while testing, validation, and design review become the constraints.
Understanding this shift is the starting point for an effective AI-assisted development workflow.
2. Spend Tokens on the Testing System First
Early on, I invested a large amount of tokens and effort—not primarily in business features, but in improving the overall testing process.
The reason was straightforward. When AI-assisted development multiplies code output many times over, manual inspection and click-through testing cannot keep pace. A complete testing system separates code that “looks like it works” from code that has actually been validated.
I eventually maintained test coverage at a level I was comfortable with, using three practices:
- Layered testing: Unit tests cover core logic, integration tests cover interactions between modules, and end-to-end tests cover critical user journeys.
- Tests as a submission requirement: Agents must include test cases with new features. Changes cannot be merged if the tests fail.
- Tests as specifications: Assertions capture edge cases and failure paths, making the tests executable acceptance criteria.
An illustrative submission gate can be expressed in pseudocode:
def before_submit(agent_task):assert coverage(task.diff) >= THRESHOLDassert all_tests_pass_locally()assert lint_and_type_check_ok()agent.open_pull_request()
The priority is not simply generating more code. It is building a validation process that can keep up with that code.
3. Optimize the Pipeline: Self-Hosted CI and Test Routing
My workflow involves frequent commits, agent-created pull requests, and repeated test runs. To shorten the submit–feedback–fix cycle, I made two changes.
Self-hosted CI
I moved away from hosted runners and set up a continuous integration environment on a low-cost cloud server.
In this setup, I could control the queue, adjust concurrency, and reuse caches. Test runs no longer had to wait in a queue for a runner to start from cold, which noticeably shortened the feedback cycle.
Routing by Change Scope
Not every commit needs the full test suite. I routed changes to different pipelines based on their scope:
- Documentation or comment changes only: Skip tests and run formatting checks.
- Changes to a single module: Run the relevant unit tests for that module and its dependencies.
- Changes to shared libraries or core logic: Run the full regression suite.
Illustrative routing rules:
rules:- match: ["docs/**", "**.md"]pipeline: lint-only- match: ["services/auth/**"]pipeline: unit+integration(scope=auth)- match: ["lib/core/**"]pipeline: full-regression
The goal was to minimize average feedback time while preserving the necessary breadth and accuracy of testing.
One counterintuitive lesson emerged as the project grew: the “fast mode” advertised by many agent tools did not make the overall workflow much faster.
Much of the elapsed time was spent in deterministic test execution. The agent submitted a change, tests ran for five minutes, the change failed, the agent fixed it, and another five-minute run followed. Faster model output did little to reduce that waiting time.
In this workflow, enabling fast mode offered limited value. The more effective optimization was to make testing itself faster and more targeted.
4. Unlock Creativity: From Idea to Implementation
Once the testing workflow matured, development began to feel different: ideas could move much more freely into implementation.
A dependable safety net made that possible. When I described a requirement clearly, agents could usually implement it reliably and close to the intended result. When an implementation missed the mark, the testing system could expose the problem within minutes rather than letting it quietly enter the codebase.
That reduced the attention I had to spend worrying about implementation difficulty or accidental bugs. More of my effort could go toward deciding what to build and whether it was worth building.
The division of responsibilities also changed:
- AI agents: Generate code, refactor, add tests, fix failing cases, and write documentation.
- Humans: Define requirements, make architectural decisions, review proposed designs, and establish acceptance criteria.
Design review therefore became more important than ever. The central task was not inspecting every line of code, but evaluating the approach:
- Is this abstraction appropriate?
- Are the boundaries between components clear?
- Is this trade-off worthwhile?
The quality of those judgments sets the ceiling for the system as a whole.
5. The Feeling of Being Accelerated
People have asked what this intense creative experience feels like. I struggled to describe it until a trip to the airport, when I asked the driver to pick up the pace. As the car accelerated and pressed me back into the seat, I found the comparison.
Working this way feels like being pushed forward by a technological wave. Every moment the AI is working, it is turning another part of an idea into something tangible.
The satisfaction comes from creation and learning happening together. That may be one of the distinctive opportunities available to this generation of developers—and one of the biggest rewards for investing in the infrastructure of human–AI collaboration, including tests and CI pipelines.
6. A Reusable Workflow Checklist
These practices can be condensed into five steps:
- Choose an agent that stays reliable on long-running tasks. Reduce the time lost to task drift.
- Prioritize token spending on the testing system. Make test coverage part of the submission gate.
- Use frequent commits and automated pull requests. Shorten feedback loops with self-hosted CI and change-based test routing.
- Do not assume model “fast mode” will solve workflow delays. Much of the waiting happens during validation.
- Focus human effort on requirements and design review. Give ideas room to develop while agents handle implementation work.
With a sufficiently strong validation system, vibe coding becomes more than programming by intuition. It becomes a scalable, sustainable development workflow for the age of AI agents.
