An engineer's manifesto for AI

Some principles I'm using to help guide how to work with, and get the best from AI. Work in progress...

Faster code generation is all good and well, but it raises the stakes in other ways. The cost of bad planning can have exponential impact in the modern SE world, sometimes before anyone even realises.

It can also lead to people being disconnected from the work and the why. Never a good thing in my book.

I'm working with the following non-exhaustive list to try and help navigate a landscape that can change on a daily basis.

1. Clearly define parameters

Make sure you provide guidance and guardrails for AI to work within. Things like agents.md rules and skills (see #6) all help AI to understand conventions and how things should be done. Along with what it should not be doing too.

2. Focus on determinism whenever you can

LLMs are famously non-deterministic. This can cause problems with verification and repeatable, consistent output. A clear definition on what needs to be done helps enormously here. You wouldn't give a human a poor project specification would you? (Would you!?). So make sure the spec is clear for AI too. A bad plan is a bad plan, whether it’s a human doing it or a machine.

3. Code is guilty until proven innocent

I know this has gone out of the window for some people, but I'm still standing by it. AI output should be reviewed by a human.

AI code must also pass tests, and ideally go through some sort of linter and/or fixer like Pint. It's also worth checking the tests it's made actually test the conditions. Look for false positives and logical fallacies.

4. Swap agents for creation and review

Don't let AI mark it's own homework! If the work is complex, critical or has a wide "blast radius" then I often like to do a quick local “PR” on what's been generated, and review the code using a different agent. Consider a different model too.

5. A working example is always best

If you have something that already works then I find AI is much better at delivering what you want. You can get it to look at a different repo if you want it to look elsewhere for "inspiration" or convention.

6. Use skills to provide context for complexity

I use skills to teach AI how I want something done. It might be how particular domain areas are built up, or how data is mapped to the frontend etc. etc. Whatever it is, if it's complex and you always want it done a certain way, consider a skill.