Make your project AI proof
Martijn
How to set up your project so AI agents use fewer tokens, require fewer human interventions and produce better results.
TL;DR: You, the engineer, should spend most of your time on the system around your codebase and make sure the code is well structured.
Why do we need this?
We want to work more efficiently with AI while keeping quality high, but which areas have the most impact? This article identifies common principles used by leading AI engineers and highlights where to focus your efforts. (Surprise: it's your codebase. No magic prompting recipes here.)
Stop setting the thinking level to "max hope for the best" and apply these principles instead.
Though inspired by Matt Pocock and Lauren Tan, this article does not require a particular set of skills or tools; it explains the impact of the different areas you can optimize.
Codebase
Leading AI engineers agree on this: your current code has the greatest influence on the code agents write next. Your existing code is the agent's main input. One terrible workaround can become a pattern that agents copy everywhere.
Some takeaways:
- Code smells. Periodically scan your codebase for workarounds, code smells and technical debt, and fix them.
- Ban what needs nuance. For example, the Grok Bot team banned
useEffectbecause it requires nuance. Agents don't have nuance, so they are not allowed to use it. - Group code by feature, rather than technical purpose:
- It minimizes the amount of context your agent needs to implement a feature.
- It minimizes the amount of context agents and humans need to review it.
- It makes it easier to colocate tests.
Static analysis
Give agents fast feedback through type checks, linting, tests and dependency graphs. Automated checks are now 'cheap' in the sense that they only cost CPU cycles and provide agents with fast feedback. Strict rules used to be a pain for manual development; for agents, they are the guardrails we need.
What we use ourselves:
biomefor linting.- Testing: unit tests, integration tests and end-to-end (e2e) tests.
knipto tell the agent to clean up unused code.dependency-cruiserto enforce rules such as no cross-feature imports and no util-to-util imports.
Way of working
The most important distinction here is between implementing and reviewing. Matt argues that the implementer is overloaded because it has to read all, or at least most, of the code to implement a working feature. The review session has far less to do, so checking coding standards should be left to the review step.
/plan,/refine,/grill-me: there are plenty of choices. Agree on specs before kicking off an implementation. We also use this step to agree on test cases and prevent tautological tests.- Implement: have your agent implement the agreed tests first, then make the tests pass (red-green implementation).
- Review: use a new session to review what has been implemented, and give it
CODING_STANDARDS.md. - Improve: close the loop. Automate checks for everything that needed correction, and update your checks and
CODING_STANDARDS.md. This builds a proper system and prevents the same mistakes from happening again.

Agent instructions
AGENTS.md
Use AGENTS.md only to tell your agent how to run tests and checks and where to find basic code entry points. Keep it small. Keep coding standards outside this file. Tell your agents to run checks from fast to slow for faster feedback loops: type checks, unit tests, integration tests, then e2e tests.
Keep your coding standards out of AGENTS.md. Keep them in a separate file, such as CODING_STANDARDS.md, for your reviewer only.
Verification
Give your agents tools and instructions to verify their own work in a browser, a test environment, a real database, etc.
Pinelab tips:
- Classify PRs as
high,mediumorlowrisk so you know where to spend the most time. - Ask your agents to include handover instructions in PRs so you can easily verify the work: screenshots, steps to reproduce and screen recordings.
- Include instructions on how to verify work in the production environment after deployment.
Resources
- ↗ Why software fundamentals still matter, Matt Pocock
- ↗ All code is slop, Lauren Tan
- ↗ Lauren Tan on Grok Bot and lint rules, Teamday
- ↗ No tautological tests, Matt Pocock
- ↗ TDD skill
- ↗ Retro skill
- ↗ Code review skill
- ↗ Biome
- ↗ Knip
- ↗ dependency-cruiser
Need help? Contact us.