← Writings

Build the House First

Everyone's talking about what agents can do. Few are talking about what they need.

An agent without constraints doesn't build — it drifts. It'll generate code, make decisions, take actions—confidently, quickly, and often in the wrong direction. The capability isn't the bottleneck. The structure is.

I've learned this the hard way. You give an agent a vague prompt and full autonomy, and it will produce something. It might even look impressive at first glance. But run it twice and you get two different results. Push it to an edge case and it falls apart. The output wasn't reliable—it was lucky.

What changed everything was investing in the boring stuff. Tests. Rules. Typed contracts. Clear boundaries around what the agent can and can't touch. Not because the AI is dumb, but because intelligence without constraints is chaos. This is true for humans too—we just call it discipline.

Think of it like building a house. The agent is the crew. Talented, fast, tireless. But without blueprints, building codes, and inspections, talent just means you get a beautiful disaster faster.

What actually matters

Tests are the foundation. Not just to catch bugs—to define what correct looks like. When an agent can run a test suite and know whether its work holds up, it stops guessing. Tests turn a creative process into a verifiable one.

Rules are the walls. Cursor rules, linting configs, type systems, naming conventions—these aren't restrictions. They're the shape of the house. They tell the agent how to think inside your codebase, not just any codebase.

Constraints are the roof. Scope boundaries. File permissions. Approval gates. The things that keep the agent from remodeling the kitchen when you asked it to fix a faucet.

The counterintuitive part

More constraints lead to better output. Not because you're limiting the AI, but because you're giving it a clearer picture of success. A well-defined problem is already half-solved.

The developers getting the most out of agents right now aren't the ones with the best prompts. They're the ones with the best systems. Their repos are well-tested, well-typed, well-documented. The agent walks in and immediately understands what good looks like.


The agent is the easy part. Building a house worth working in—that's the craft.