Posted on Jan 1, 1

The 8 factor AI Coding Guide

  • Test: I must have a fast, comprehensive suite of tests. Fast feedback loops are paramount. The longer an Agent continues down a path with a bad assumption, the harder it is to recover.
  • Modularize: I must architect my code modularly, as to minimize the context needed by the Agent.
  • Sandbox: I must run code in a sandbox that allows the agent to run wild. If I need to approve every tool use, I’ll never unlock its full potential.
  • Manage Processes: My code should run in a separate thread from my agent. IE if I work on a web server, the agent can’t start it as that will hang the agent. Live reload it in another thread, and send the logs somewhere the agent can check.
  • Automate: I must make my development environment trivial to spin up, so that I can have many copies going simultaneously for parallel AI development.
  • Document: Planning is more important than coding. Every code change should be preceded by the generation of a clear step by step plan with outcomes the agent can follow. That plan will persist across sessions, and act as long term memory for the agent. Ideally use Claude Code, Gemini, and Codex to check each others work when planning
  • Tool: MCPs supercharge my agent by allowing it to view my project with playwright, load additional information with websearches, and generally have more deterministic tools to take action.
  • Contract: I must use a statically typed language that can be quickly compiled to find errors. Interfaces limit the surface area needed to be loaded into context, and compilations find a class of bugs AI can create.