Agentic Loops, Rules, Skills, and Constitution

How to keep AI speed without sacrificing engineering quality.

Alpha

Alpha

Feb 24, 2026 - 9 min read


Agentic Loops, Rules, Skills, and Constitution

I have spent a great deal of this year coding with agentic loops. This means I'm always hungry for the next prompt, waiting to press Enter and give more instructions to one of the many agents I'm working with.

The upsides are incredible. I create features at great speed relative to the pre-AI era. But code is also cheap now, so I can refactor, add, remove, move around, and translate code at a ridiculous fraction of what it used to cost.

However, this also means reviewing AI-generated code is often not only impractical, but a waste of time. Why review code I know I'm going to throw away or refactor?

The speed-quality paradox

Don't get me wrong: I do look at the code, especially where it matters. I know that when a bug shows up that's hard to fix through prompts, or when I notice performance drops, that's when I need to roll up my sleeves and investigate.

I still do that by asking the AI questions, sending it to look things up for me and come back with analysis. Then we put together a plan of action, and it does the refactor.

Yes, AI models have evolved at a crazy pace. However, our human biology has not changed a bit. We still operate with a very limited context window, and we can only process so much for so long before our competence drops and we get tired.

The telltale signs that I'm getting tired are scrolling too much YouTube Shorts, wanting to spend time chatting with friends, or losing patience with the model and cursing at it.

Given this limitation, context and attention are the most important resources at my disposal, so I need to maximize them.

But how do I ensure code quality is solid and still meets the standards and best practices I've developed, or acquired and found to be good? There are many ways to do this: rules, skills, and constitution.

Working within human limits

Rules

Rules enforce very clear standards relevant to a specific domain. For example, I follow the Bulletproof React model for file structure in React apps. This enforces putting each feature in its own folder, with all hooks, services, constants, components, and so on. At a glance, I can confirm whether the structure looks right.

Another rule of thumb is when a Rust file hits the 1,000-line mark. That's usually the telltale sign that the model is taking shortcuts, and it probably makes sense to re-add the rule to the context.

Skills

Skills are useful for teaching models about tools I want them to use. My favorite example is agent-browser, a CLI that lets the model control a headless Playwright session. Unlike the Playwright MCP, which bloats context, this tool does not, and it's only invoked when needed.

And Playwright itself is another super important part: it helps the model ensure its work isn't breaking. "Don't just tell me the web app is ready if you don't first start the server, go to port 3000, try it yourself, and ensure there are no bugs in the console or the server logs."

Constitution

Finally, constitution is an important piece of non-technical guidance that aims to enforce standards. Anthropic and OpenAI talk about constitutions and soul files as system prompts that steer the model in one direction or another.

So if the developer is no longer worrying about lines of code, they start worrying about orchestration and flow.

Orchestration questions that matter

Do you have one coding agent per feature, or per file? Do you have a planner first deciding what the pseudocode should look like, or do you skip that part? Should the same coding agent run tests and fix issues, or do we separate those two? Should we use SOTA models for writing code, or use cheaper models for that?

And when the code is written and tests pass, do we do another pass with a QA agent against the rules and constitution?

And that's only regarding writing. The biggest challenge in any codebase, or in using any AI, is memory.

Memory is the real bottleneck

How do I make sure the LLM is always up to date with what the codebase is about? If we are using custom code, how do we teach the AI about it without needing the AI to read that custom code every time?

It's important to remember that conversations with AI are always brand new. Even "chat" is mostly an illusion: on each message or tool call, the entire history is sent again to the agent.

Keeping rules and skills current

And we haven't even touched on maintaining skills and rules. A skill is a high-level explanation of what a feature is. That naturally becomes outdated when the underlying feature or codebase changes.

For example, if a skill explains Node.js v16 behavior and now we're on Node.js v18, the skill has to be updated. But what about deprecated code? Should the skill also include a list of deprecated pieces, or should that live in a secondary supporting Markdown file that we use only when we need to migrate?

That certainly is not a rule by itself. Rather, the web frontend rule should point to the skill when we need to fill in specific information.