· 6 min read
How I work with AI as a developer: plan, build, review
In my last article I wrote about four automations that took repetitive work off my team: site setup, on/offboarding, deployments and checks before merge. The natural follow-up question is: how do you actually build these things with AI, and how do you trust the result?
The short answer: I don't ask AI to "build me an automation". I run the same process every time, and AI does most of the typing inside it. Here it is.
The problem with "just ask the AI"
If you give an AI a one-line request, you get a confident answer. Sometimes it is good. Often it solves a slightly different problem from yours, makes ten decisions you did not know were being made, and looks finished before it is.
None of that is the AI's fault. It is the same thing that happens when you give a vague task to a new colleague. The fix is also the same: be clear about the goal, agree on the decisions, split the work, check it.
So I treat AI like a very fast, very capable new team member who knows nothing about our procedures and never gets tired.
Step 1: Design first, and write it down
Every automation starts with a short design document, not with code. The AI drafts it from a conversation with me, and it always has the same parts:
- Goal. One or two sentences. What is true when this is done?
- Today and after. A table of each step: how it is done now, and how it will be done after. Steps that stay manual are listed too, on purpose.
- Decisions. Every choice that shapes the result, written as a plain sentence.
The "decisions" list is the most valuable part. While drafting, the AI asks me questions it would otherwise have answered silently: Should the account be deleted or locked? Who gets the files? What happens if a name matches two people? I answer them one round at a time, and each answer goes into the document with a date.
For one automation there were three rounds of these questions before a single line of code existed. That felt slow at the time. It was much faster than finding out after the build.
Try this: before your next AI-assisted task, ask the AI to list every decision it would need to make, and answer them yourself first.
Step 2: A plan with small tasks and hard limits
Once the design is agreed, the AI turns it into a build plan: a list of small tasks, each with what to change, how to test it and what "done" means.
The plan also has a section I consider essential: limits. Things the work may not do, no matter what. For example:
- Nothing is pushed or published until I say so.
- The first tasks only work locally. Nothing touches a live server.
- Every task that changes something real starts with my explicit go-ahead.
These limits make it safe to let the AI work through many tasks on its own. The early, risky-looking work happens where it cannot hurt anything, and the steps that touch real systems are short, few and done with me watching.
Try this: write down what the AI may not do before you write down what it should do.
Step 3: Build with tests, in a safe place
The AI writes the code task by task, and every task comes with tests. For scripts that run on servers, the tests run in a throwaway copy of the server environment on my own machine, so the code is proven before it ever reaches the real one.
When a bug is found, the rule is: first write a test that fails because of the bug, then fix it, then watch the test pass. It sounds like a formality. It is what stops the same bug from coming back three changes later.
The first real run is also planned in advance. For the site setup automation, it was a throwaway test site that was deleted afterwards. For on/offboarding, it was a test person, created and then offboarded again as a full loop.
Try this: ask for the test before the fix. If the AI cannot write a test that fails, it has not really found the bug.
Step 4: An independent review
When a piece of work is finished, a separate AI session reviews it, without the history of how it was built. It reads the design and the code fresh and reports what it finds, ranked by how serious it is.
This step pays for itself every time. On one deploy automation, the review found one critical problem, four important ones and nine small ones in code that already had dozens of passing tests. All the serious ones were fixed, each with a new failing test first. The small ones were either fixed or consciously left as they are, with a note saying why.
Try this: never let the same conversation that wrote the code be the only one that checks it.
Step 5: The human steps stay human
Some steps should not be done by AI at all, and I make that part of the design rather than an afterthought.
- Confirmation before every real change. Every automation shows a preview and waits for my "yes".
- Access stays with people. At one point the AI needed to change a live server and merge a change without the usual review. It was not allowed to, and that was the right outcome. It prepared a small, checked script, and I ran that step myself.
- Judgment stays with people. Which accounts to lock, which emails to send, what is too risky to automate at all.
The goal is not to remove people from the process. It is to remove people from the boring parts of it.
Step 6: Write down where you stopped
Every automation has one short reference document: what it does, what is live, what is still manual, and where to pick up next time. The AI updates it as part of the task, not as a separate chore at the end.
This matters more with AI than without it. A new conversation starts with no memory of the last one. A good reference document is how the next session, or the next colleague, gets back up to speed in a minute instead of an hour.
What this looks like in practice
For a typical automation, the time splits roughly like this:
- Most of my time goes into the design questions and the review findings.
- Most of the AI's time goes into writing code, tests and documents.
- Very little of anyone's time goes into fixing things after go-live.
It is not the fastest way to get something. It is the fastest way I have found to get something I trust enough to run on real accounts and live servers.
Where to start
You do not need the whole process on day one. If you only take one thing from this article, take Step 1: before the AI writes code, have it write down the goal and every decision it would need to make, and answer those decisions yourself.
The code gets better. More importantly, it becomes your solution, not the AI's guess at it.
Working on something similar, or want to compare notes? Get in touch.