DEV Community

Cover image for A Practical Guide to Engineering with AI Agents
Julien Avezou
Julien Avezou Subscriber

Posted on

A Practical Guide to Engineering with AI Agents

My job as a software engineer has changed drastically over the last five years.

I feel that the biggest shift happened in just the last 12 months.

I remember the early days when I was getting AI-driven autocomplete suggestions for a few lines of code. I found this mind-blowing.

Then came AI chat interfaces. Suddenly I could ask questions about code and generate entire functions along with explanations. This gave Stack Overflow a run for its money.

Fast-forward to today.

I don't spend a day without interacting with multiple AI agents that assist me in my daily tasks: exploring, planning, implementing, testing and debugging.

Not because I am being lazy or taking shortcuts. AI has fundamentally changed the playing field.

My colleagues use AI. If I don't make use of these new tools too, I will lag behind.

With this comes a shift of expectations at work.

There are obvious upsides.

I can unlock new capabilities, ship code faster, and automate tasks that previously demanded considerable time.

There are also some downsides.

It feels like there is more information to deal with: a lot of verbose AI-generated documentation, multiple prototypes, more PRs to review in a day, frequent context switching.

Producing more code at a faster pace doesn't necessarily mean we are getting better at understanding it.

The way I work has changed.
But my responsibilities have not.

On the contrary, I would argue that it's more important to preserve engineering judgment in today's agentic era of software development.

The next productivity bottleneck will probably not be code generation but rather code comprehension, validation, and review.

In this article, I'll walk you through four areas I've been exploring along with some practical exercises and advice to put these ideas into practice in your own work.

A visual sketch of the 4 main sections of this article


1. Make your Repositories AI-ready

Your repo is part of the prompt

The codebase your agents are working in is important to consider.

An AI agent needs to navigate your repository, understand its architecture and make decisions based on the retrievable information.

This is where repository structure and documentation become key.

Here are some practices that have helped me recently:

  • clear repository structure: organize code around understandable domains or features with discoverable entry points and tests
  • meaningful naming conventions: prefer descriptive names that communicate responsibility over generic names
  • project-level instructions: use files such as AGENTS.md to document how an agent should inspect, plan, implement and validate changes
  • system context: use a CONTEXT.md or equivalent to explain the product, key workflows and domain concepts
  • Architectural Decision Records (ADRs): preserve the reasoning behind crucial technical decisions helping to explain the why behind a system

ADRs are retrievable engineering judgment.

None of this is fundamentally new.

We've always valued readable code and clear documentation.

Now AI agents benefit from those same engineering practices.

🛠️ Try this: Agent Navigation Check 🛠️

Before asking an agent to implement a change, ask it to explain how the relevant part of your repository works.

Before proposing a change, tell me:

1. Which domain or feature owns this behavior?
2. What files are the entry points?
3. Which tests define expected behavior?
4. What dependencies cross the boundary?
5. Which files should remain untouched?
Enter fullscreen mode Exit fullscreen mode

If the agent struggles to answer these questions, investigate why.

Maybe some documentation is lacking or naming conventions are inconsistent.


2. Context Engineering

Relevant context beats more context.

An important lesson I've learned is that giving an agent more information doesn't necessarily lead to better results.

The challenge isn't simply giving agents access to information, such as your whole codebase.

It's helping your agents retrieve the right information for a given task.

I like to think about this through layers of context:

  • task context: what are we trying to accomplish?
  • local code context: which files and tests are directly involved?
  • system context: how does the change fit into the bigger picture?
  • historical context: why was the system designed this way?
  • constraint context: what are the invariants?
  • review context: how to validate the implementation?

Not all tasks require looking at all layers.

The goal is to identify the smallest amount of information for the agent to work reliably.

🛠️ Try this: Thin Slice Pattern 🛠️

For a small feature or behavior change, start with the relevant entry point, implementation, types, closest related test, and one existing pattern to follow.

Then ask the agent:

Inspect the provided files and identify the smallest safe change that satisfies the acceptance criteria.

First return:

- Existing pattern
- Files likely to change
- Implementation plan
- Risks
- Tests

Do not code yet.
Enter fullscreen mode Exit fullscreen mode

This encourages the agent to understand the existing implementation before proposing changes, rather than following the first plausible approach.

Also I find it useful to leverage mistakes that an agent makes.

Ask why it happened. Don't just correct the agent and move on.

Is the underlying problem missing context? Documentation that needs updating? Ambiguous project instructions?

Turn your agent failures into better repositories.


3. Adopt AI-native Workflows

Plan first, code second.

Coding agents can move fast.

That's powerful, but it can also encourage us to skip steps where important engineering decisions are usually made.

For bigger changes, I usually separate planning from building.

Before asking my agent to implement a feature, I want to first understand the problem and propose an approach.

This has led to me embracing spec-driven development.

My implementation plans have become engineering artifacts used by agents.

I start by defining the intent behind the change.

Then I create a specification and share it with my team for review as you would a regular PR.

Once the specification is reviewed and approved, I start implementing in small increments.

I treat approved specifications as immutable. When requirements change, I create a new linked specification documenting the changes and their rationale.

🛠️ Try this: Plan-First Prompt 🛠️

Do not implement yet. 

Inspect the issue and provided context. 

Return:

1. Your understanding of the goal
2. Relevant existing patterns
3. Files likely to change
4. Proposed implementation steps
5. Risks and assumptions
6. Test plan
7. Open questions that require human judgment
Enter fullscreen mode Exit fullscreen mode

It's much cheaper to correct a flawed plan than a large implementation built around that plan.

Another interesting pattern is giving agents distinct responsibilities:

  • planner
  • builder
  • reviewer
  • security advisor

Add human-in-the-loop checkpoints for approvals and merge decisions.

Introduce structure and independent perspectives where agents actually improve engineering quality, rather than just adding as many agents as possible.


4. Establish Engineering Guardrails

Automate execution, not accountability.

As AI agents gain abilities, the question becomes:

How much useful work can we safely delegate?

Every agent needs different levels of permission depending on the nature of its role.

🛠️ Try this: Audit your agent permissions 🛠️

Classify the levels of access your coding agents currently have.

Level        Permission              Appropriate use

1            Read-only               Inspect code, explain architecture, propose plans
2            Local workspace         Edit locally and run safe tests
3            Branch-limited          Create commits and PRs on isolated branches
4            CI-integrated           Run CI, comment on PRs, apply scoped fixes
5            Production-adjacent     Deployment and operational actions under strict approval
Enter fullscreen mode Exit fullscreen mode

Higher permissions are to be granted intentionally, with appropriate approval and audit mechanisms.

Permissions are only one part of the equation.

Human review remains essential.

AI-assisted code reviews act as an additional line of defense, helping to identify potential problems earlier.

I think reviewability should be treated as an engineering constraint, not an afterthought.

Keep PRs small so they can be more easily reviewed by others.

Finally, autonomy means observability becomes increasingly important.

Structured logs, tracing, meaningful tests, and an auditable history of agent actions help understand where things break when something goes wrong.

Autonomy should come with more observability, not less.


Introducing Thinking in the Age of AI - Agent Edition

I cover these concepts in more depth in my latest guide of the Thinking Engineer series: Thinking in the Age of AI - Agent Edition.

This guide is to help engineers leverage AI with intention to unlock higher productivity levels while preserving engineering judgment along the way.

It includes:

  • 8 parts covering AI-ready repositories, context engineering, AI-native workflows, debugging, guardrails, failure modes, and multi-agent workflows
  • 9 reusable templates including AGENTS.md, CONTEXT.md, ADRs, implementation plans, PR reviews, and AI usage policies
  • practical exercises and checklists that can be applied directly to your own workflows

I've previously shared other guides in this series:

  • Thinking in the Age of AI - Individual Edition
  • Thinking in the Age of AI - Team Edition
  • Thinking in the Age of AI - Builder Edition

Each guide serves a different purpose.

The Agent Edition guide is primarily aimed at engineers who already have solid engineering fundamentals and want to go further in their use of coding agents.

The goal is to design better loops between humans, agents, code and context.

Use AI. Don't outsource your judgment.


Now it's your turn!

I'd love to hear about your experiences working with AI agents.

How are you using agents to improve your engineering workflows?

Where are you encountering the biggest bottlenecks?


A cover photo of the Agent Edition guide

Get Thinking in the Age of AI - Agent Edition here.

Any feedback and reviews are much appreciated!

Top comments (8)

Collapse
 
leob profile image
leob • • Edited

Great overview, great structure!

I don't yet go about things as methodically as you, but I've started Claude Code on a Laravel project, and the quality of what it produces is astonishingly good - I even review very little of the code it produces (mainly frontend ATM), I just run it and check if it works, and if it looks okay - minimal reviewing needed ...

I'm at the point where I'm going to transition to some more complex stuff (backend, with more heavy "business logic"), and then I'm certainly going to review things more carefully (planning to let the AI agent part of the reviewing, of course with a final "human" check).

My personal tip: use Laravel with your favorite AI coding agent!

Laravel (full-stack framework with a very extensive ecosystem around it) comes with a "standard" structure/layout for your projects, which covers the first point of your list "for free" - and it comes with extensive (and very capable) skills, MCP tools, and other AI goodies (for various coding agents) "out of the box" ...

Works very well, with minimal effort on the developer's part - the tooling has simply become that good over the last few years!

Collapse
 
javz profile image
Julien Avezou •

Thanks leob!
I haven’t looked much into Laravel. It follows the MVC pattern which resonates with me as I started programming using Ruby in Rails which is also MVC.
I will look into this and perhaps build a project with it to compare.

Collapse
 
leob profile image
leob • • Edited

Yeah it's MVC, absolutely, but goes quite a bit beyond that - and the standardization of the structure/architecture of Laravel applications is what makes it so "accessible" to AI coding agents (coupled with the skills and other AI goodies which Laravel bundles in its AI package) ...

It's particularly effective if you choose a "starter kit" for the frontend part based on "Inertia" - Inertia is a technique/framework which "automagically" links your frontend (that could be React, or Vue, etc) with the backend API - no manual integration of the frontend and backend, it's completely seamless (works a little bit like TurboLinks in Rails, but more sophisticated) ...

Couple that with something like Tailwind and ShadCN (comes out of the box with those "starter kits"), and you've got a completely predictable "standards based" full-stack setup which covers everything and the kitchen sink - kind of "tailor-made" for development with an AI coding agent "sidekick" - it doesn't really get easier and "lower friction" than that !

P.S. I worked with Rails previously, but that was a very long time ago - the philosophy of Rails and Laravel are very similar (Laravel was heavily inspired by Rails, kind of like a Rails "clone" for PHP), but I think by now it's surpassed Rails in terms of popularity (worldwide), size/breadth of ecosystem, and overall "growth" ...

Picked as gem Thread Thread
 
javz profile image
Julien Avezou •

Gotcha, good to know! The setup does sound appealing.
I will give it a try :D

Collapse
 
robertpaschal profile image
Odinaka Robert Nnamani •

the next bottleneck being comprehension instead of generation is the honest part. more code faster just means more to review.

Collapse
 
leob profile image
leob •

True, but AI can help with reviewing as well, and it's already pretty good at that (and quickly becoming better) - I've seen some amazing examples of that ...

Collapse
 
javz profile image
Julien Avezou •

I do feel that there is more code to review that is why it’s important to have strict rules such as keeping PRs small and scoped and using AI agents to review code as an additional line of defense but not rely only on that. It’s important your team is involved in reviewing PRs for knowledge sharing.

Collapse
 
robertpaschal profile image
Odinaka Robert Nnamani •

fair, the review side is moving fast too. the catch is when the reviewer nods along with the writer and both of them are wrong.