Overnight AI Development
Using TDD as a specification language for AI agents
"Build a user login system" is ambiguous. I know what I mean. The AI doesn't. It'll guess, and it'll guess wrong, and I'll wake up to a session-based auth system when I wanted JWT.
Tests aren't ambiguous. A test says: this input produces that output. This action triggers that event. This error shows that message. No interpretation needed.
So the idea: write the tests before bed. Let an AI implement them overnight. Wake up and check if the tests pass.
Files as workflow
The whole system runs on files moving through directories. No database, no dashboard, no project management tool. Just a filesystem.
project/ ├── backlog/ # I add feature requests here ├── analysis/ # AI analyst writes test specs ├── approved/ # I approve or reject specs ├── development/ # AI dev implements against specs └── done/ # completed, tests passing
Everything is visible. ls backlog/ tells you what's queued. git log development/ tells you what the AI worked on. No hidden state. Debug with cat and grep.
The overnight loop
Before bed: review the AI analyst's test specs. Approve what looks right. Reject what doesn't, with notes. The expensive human judgment happens here — deciding what to build and whether the spec captures it correctly.
Overnight: the dev agent processes approved items. Runs tests. Commits results. Model swaps in and out of memory to stay within the Pi's limits. Rate limiting keeps power draw reasonable. Git checkpoints before each implementation so rollback is a one-liner.
Morning: check what got built. Run integration tests. Move good implementations to done, kick problems back to analysis. The whole cycle takes maybe fifteen minutes of human time per day.
Why tests first
Analysis is cheap. Writing test specs costs less compute than implementation. Human review of a test spec is fast — you can read ten tests in the time it takes to review ten implementations. Most bad ideas die in analysis before burning dev compute.
Tests are also the acceptance criteria. No "is this what you wanted?" conversation. Either the tests pass or they don't. The AI's output is evaluated by the same tests the human approved. No subjectivity at the gate.
And the tests survive. When I refactor later, the specs still hold. When I swap out the AI model, the acceptance criteria don't change. The human's intent is captured in code, not in a chat history that expires.
The goal
A backlog processor that runs on a Raspberry Pi with a solar panel. You stay the product owner. The AI handles the mechanical work. Files and scripts doing real work while you sleep.
No sprint planning. No standups. No estimation. Just a backlog and tests.