Building systems with AI: fast without breaking
Six rules from practice: plan first, tests first, verify on the real thing, security now, small reversible steps, people accountable.
Published
I use AI every day to write code and plan systems, and work that once took months now takes weeks. That speed is dangerous without rules: AI writes plausible code very fast, and wrong code just as fast. These are the rules I actually follow, collected in my jk framework.
1. Plan before building, even in a hurry
For anything bigger than a one-line fix, the AI writes a short plan first: which files change, why, and how we will know it is done. A person reads the plan and decides. Work heading the wrong way is caught before a single line of code exists.
2. Tests before code, and watch them fail first
The AI writes a test that states the behaviour I want, runs it to see it fail, and only then writes the code that makes it pass. A test that passes the first time proves nothing. This is the one tool that lets me trust code I did not type.
3. Verify on the real thing, not in your head
"Should work" does not count. Run the real check and read the output every time. My latest lesson: a page that looked perfect in Chrome lost its images on older iPhones because Safari could not read one way of setting colours. Every page now passes a test on the same engine as the iPhone before it goes live.
4. Security is not a later task
Every change goes through the same checklist: no passwords in code, permissions checked on the server, security headers in place. AI makes the checking fast, but irreversible decisions, such as deleting data or opening a port, are pressed by a person.
5. Small, reversible steps, written down
Split work into small pieces that are committed one at a time, so a mistake can be undone at once. Write a short note every time, so that you in six months, or whoever takes over, can understand without asking anyone.
6. People are accountable; AI is a tool
AI does not know what your factory is afraid of, which line must never stop, or who answers when the system fails. People set the problem, make the decisions and own every result. With that split, AI lets one person do the work of a small team without lowering quality.
The result
The whole Baan Rak Phak farm system, from boards and server to web, mobile app, edge host and leaf-image AI, was built by one person this way. So was the site you are reading.