Agents

7 Principles for Using AI Coding Agents Well

To use AI agents like teammates rather than tools, what do you need? Seven principles that hold up in practice, from task definition to verification.

Start with the core

The quality of an AI agent's output is proportional to the quality of your instructions. With the same model and the same codebase, the result changes completely depending on how you instruct it. Many people assume "if the output is weak, just switch to a better model" — but in practice, fixing your instruction style alone makes most problems disappear. Before switching models, check these seven things first.

This post isn't about any one tool. It's about working principles that hold regardless of which AI coding agent you use — Claude Code, Cursor, Codex, whatever. At the end, though, we'll talk about how to enforce these principles not through human discipline but through the structure of the tool.

1. Define the task precisely

The most common failure comes from vague instructions. "Fix login" leaves out what needs fixing and what "fixed" even looks like. The agent fills the blanks with its own guesses, and if those guesses miss your intent, the result is wrong from the start.

Instead, state the outcome and the done-condition.

  • ❌ "Fix login"
  • ✅ "Fix the bug where email validation passes an empty string, and add tests for three failing cases — empty string, whitespace, and malformed format. Existing passing cases must still pass."

The second instruction contains all of it: what (the bug), how to confirm it's fixed (three tests), and the regression guard (keep existing cases green). A good task definition is a definition you can judge complete. If you can't answer "is this done?" with yes or no, the task isn't fully defined yet.

2. Give enough context, but not too much

An agent only knows what you give it. Withhold the relevant files, coding conventions, and constraints, and you'll get code that ignores project norms. Conversely, cram in unrelated information and you pollute the context, burying the signal that actually matters.

The knack is relevance. Give only the files and rules this task needs, and leave the rest out. Delegate broad exploration that has to sweep many files to a subagent, and take back only the conclusion — instead of piling the whole file-by-file search into your main context, you get back a one-line result like "this logic lives in auth/session.ts:42." That keeps the main agent's context clean and leaves room for judgment.

3. Split into small units

One decision at a time. That's the rhythm of agent work. A giant instruction like "rebuild the entire auth system" makes it easy for the agent to lose the thread mid-way, and hard to trace where things went wrong when they do.

Break large work so that each stage is independently verifiable. As in the diagram below, decompose one goal into several tasks with clear done-conditions — each task can be picked up in parallel by a different agent, and if one fails it doesn't bleed into the others.

Large goalAdd coupons to the checkout module① Coupon APIDone whenunit tests pass② Coupon formDone whenvalidity shown in UI③ Failure testsDone when3 edge cases covered
Decompose one large goal into small tasks with clear done-conditions. Each piece is verified independently, and different agents can take them on in parallel.

Splitting into small units has another payoff. When each piece is small, it's easy to roll back, and when something breaks the scope is narrow enough to pin the cause fast. This connects directly to principle 6 below (work reversibly).

4. Build in verification

"Written" is not done. "Confirmed with a test" is done. Don't stop at having the agent write code — require it to run and verify its own work, then report the result.

Concrete ways to build verification into your instructions:

  • Make the definition of done observable. "Show that the build passes, the three new tests are green, and no existing test broke."
  • Have the agent run it directly. Make the agent run type checks, lint, and tests, and present the logs as evidence. It's far cheaper for the agent to catch a failure on the spot than for a human to run it later and discover it.
  • Guard against false completion. "All done" and the actual passing test output are two different things. Demand evidence that the type check and tests passed.

Completion without verification is a guess. Making the agent actually run its own work — this one habit raises reliability the most.

5. Separate roles

Ask one agent to explore, implement, and review, and it ends up reviewing what it built itself. Like people, agents go easy on their own work. So separate the perspectives. Put an exploring agent, an implementing agent, and a review agent that tries to refute the result on separate seats, and quality rises noticeably.

The especially powerful move is adversarial review. Instead of "check whether this code is correct," tell the reviewer "try to break this code. Find an input that makes it fail." A review that assumes success skims past defects; a review aimed at refutation digs into edge cases. Here's what that review loop looks like.

Implementwrite codeAdversarial reviewtry to refuteDonerefute fails → passdefect found → back to implement
The implement → adversarial review → verdict loop. If review finds a defect it goes back to implementation; only when refutation fails does it move on to done.

Running several reviewers and deciding by majority vote makes it sturdier still. Give one the correctness lens, one the security lens, one the performance lens, and a defect one perspective misses, another catches. This diversity of perspective filters far more than running the same review three times.

6. Work reversibly

Agents are fast — and being fast, they also go fast in the wrong direction. That's why keeping a reversible state matters at every step.

  • Commit often, in small units. When each stage lives in a commit, you can return to exactly the last good point when things drift.
  • Do risky changes in an isolated workspace. When several agents touch the same files at once, they overwrite each other's work. Run each agent in its own isolated worktree, and you can push in parallel without conflicts, merging back into the main workspace only when the result is good.

The safety net of reversibility is what lets you experiment boldly in parallel. Without it, one wrong automated change wipes out hours of work.

7. Make it observable

If you can't see what an agent is doing, you can't control it. When you're talking one-on-one with a single agent, scrolling up shows you what happened — but the moment several agents move at once, that approach collapses. Once "who finished what, what's waiting for review, where it's stuck" scatters, the benefit of parallelism turns into chaos.

So you need a mechanism that converges progress into one place. Make tasks into tickets, track state on a board, and keep each agent's decisions and results in a log. That way you never lose the whole picture, even with many agents working at once.

Sequential vs. parallel — why observability is the price of parallelism

These principles earn their keep the moment you push multiple tasks in parallel. In sequential execution, task A must finish before B, and B before C — wall-clock time is the sum of each stage. Run non-dependent tasks in parallel, and the total collapses to the slowest one.

Sequential — sum of stagesTask ATask BTask Ctimetotal = A + B + CParallel — the slowest oneTask ATask BTask Ctotal =max(A, B, C)
Sequential takes the sum of the stages; parallel takes only the slowest one. But parallel is controllable only when observability, verification, and rollback are in place.

The catch is that parallelism isn't free. Three agents running at once are three times faster — but they can also go wrong in three places at once. So parallel is controllable only when the earlier principles are in place: precise task definitions (1) split the work so it doesn't overlap, verification (4) makes each one accountable for its own result, reversibility (6) isolates failures, and observability (7) shows the whole at a glance. Parallelism without observability is just fast chaos.

Let the tool enforce these

Knowing the principles and following them every time are different things. Lean on human discipline alone and it's the first thing to break when you're busy. So the final piece of advice is this — instead of remembering the principles, ride a tool that makes them structural.

Marblo is a desktop app that ports these seven directly into structure. Define tasks as tickets, and done-conditions stick around (1, 4); the orchestrator decomposes a large goal into small tasks (3), assigns each agent a role (5), tracks progress on a kanban board (7), and runs them in parallel in isolated worktrees while converging review at a single REVIEW column to keep everything reversible (6). Because it orchestrates heterogeneous agents — Claude, Codex, and Antigravity at once — you get the benefit of parallelism without losing control.

Principles get forgotten; the flow stays. A good tool enforces good habits.

Comments

Comments are coming soon.