Skip to main content

Teaching AI Coding Agents to Build It Right the First Time

· 6 min read
Sajeetharan Sinnathurai

One of the slides in my talk had a question: What did your agent promote you to?

A faster developer? Or a full-time reviewer?

I like that question because it gets past the excitement of watching code appear on a screen. An agent can finish a task quickly and still leave you with plenty of work: checking assumptions, correcting the approach, and explaining the same project rules again.

On November 26, I spoke about this at WeAreDevelopers Conference India 2026 in Bengaluru. The session was called Teaching AI Coding Agents to Build It Right the First Time.

The recording is now available, and you can browse the slides in your browser. Here are a few things I wanted people to take away from it.

Speaking on Stage 3 at WeAreDevelopers Conference India 2026, with the slide asking what your agent promoted you to

On Stage 3 in Bengaluru. A question worth asking before we celebrate how much code an agent produced.

The query works. That's not the end of the review.​

I used an Azure Cosmos DB conference app to make the problem concrete.

Suppose the app needs to retrieve one item. The agent generates a query, the app returns the right result, and the feature appears to work. But if we already have the item's ID and partition key, a point read is the more appropriate operation. Getting the same result doesn't make the two approaches equivalent.

That distinction is easy to miss in a small demo. With more data and more requests, the cost of the access pattern becomes harder to ignore.

This is why "make it work" isn't enough direction. The agent needs to know what a good implementation looks like for this application. How do we access the data? Which operations should we prefer? What should we measure before we accept the change?

Those are engineering decisions. Generating the code faster doesn't make them go away.

I don't want to explain the same thing every Tuesday​

Correcting an agent once is understandable. Correcting it for the same mistake across several tasks is a sign that the guidance belongs somewhere more durable than a chat.

That's where reusable skills help.

For database work, a skill can bring in the relevant guidance about data access, partitioning, or SDK usage when the agent needs it. The point isn't to write a magic prompt. It's to make useful domain knowledge available at the moment an implementation decision is being made.

It also needs to work for the team, not just for whoever happens to have the best personal prompt. People use GitHub Copilot, Claude Code, Cursor, and other tools. Keeping the guidance in the repository makes it easier to share and review, even when the tool-specific setup differs.

But there is a catch: a skill file can become another dumping ground.

Adding every lesson, exception, and documentation page feels helpful until the agent has to work through all of it for a small change. I would rather give it a short, relevant set of instructions and a way to find the details than make it read everything every time.

A little planning saves a lot of reviewing​

Another part of the talk was about intent, context, and acceptance.

Before asking an agent to build a feature, I want to be able to explain what the feature is for and how we'll know it is finished. That doesn't require a huge document. It does require more than "build me a conference app."

For example:

  • Which user workflow are we trying to support?
  • What existing architecture does the implementation need to fit?
  • What data and tools does it actually need?
  • What would make us reject the result, even if the happy path works?

Starting in plan mode gives us a chance to catch a wrong assumption before it becomes a collection of changed files.

I don't think every task needs a ceremony. A small bug fix and a new application deserve different amounts of planning. But skipping the thinking doesn't remove the work. It usually moves it into the review.

Attendees seated in front of Stage 3 during the session at WeAreDevelopers Conference India 2026

A view of the session from the audience.

"The agent can call it" isn't a permission model​

MCP tools give agents access to useful capabilities and real application context. They also make it important to be precise about what an agent is allowed to do.

Reading information and changing it aren't the same kind of action. Neither are inspecting a development environment and operating on production.

Instructions can tell the agent what it should do. Authentication, authorization, and approval boundaries need to enforce what it can do. A sentence asking it to be careful is not a substitute.

This connects with something I spoke about earlier in Bengaluru and Chennai: useful context and clear boundaries belong together.

Passing tests are useful. So is knowing what they test.​

I do want agents to write tests. I don't want a green test run to end the conversation automatically.

If the agent misunderstands the requirement, it can carry the same misunderstanding into both the implementation and the tests. Everything agrees with everything else. Unfortunately, everything can still be wrong.

The acceptance criteria need to come from the problem we're solving. For the database example, returning the right item is one check. Choosing the right access pattern and checking request-unit consumption are separate checks.

The guidance needs checking too. As models improve, some instructions become unnecessary, and others turn out not to help. Keep representative tasks and regression checks, then use that evidence to decide what to keep. An ever-growing instruction file isn't automatically a better one.

Less babysitting, not less ownership​

The title says "the first time," but I don't mean that a sufficiently clever skill file will make every agent output correct.

I mean we should stop treating repeated correction as an unavoidable part of the workflow. If we know an engineering rule matters, we can make it explicit. If an action needs approval, we can enforce that. If an implementation has to meet a performance requirement, we can test it.

I enjoy how quickly these tools let me try things. I also want to understand the result well enough to put my name on it.

Thank you to the WeAreDevelopers organizers and everyone who joined the session in Bengaluru.

If this sounds familiar, the full talk is about 27 minutes:

Watch Teaching AI Coding Agents to Build It Right the First Time

View the presentation slides. Use the left and right arrow keys to move between slides, or press F for fullscreen.

And if you try one thing from it, make it this: take a correction you've given your agent more than once, and decide where it really belongs. A reusable skill? A test? A permission check? It probably deserves a better home than your next prompt.

Ask Sajee

A contact guide, not live chat.

What would you like help with?