Skip to content
← Back to articles

Article

From Epic to Production: Using Agents to Deliver Features in Real Systems

This is the eighth article in the series about AI-friendly architecture. In the previous articles, we talked about context, documentation, observability, skills, Context Skills, agents, tools, MCP, guardrails, and harnesses.

Now we will bring these pieces together in a complete engineering workflow.

The idea is not to ask an agent to “implement a feature” and expect it to discover everything by itself. The goal is to show how an agent can help with a delivery from the moment we understand the epic until we monitor the change in production.

Writing the code is only one step. In many cases, it is not even the hardest one.

The epic

Let us use this request as an example:

As a customer, I want to request a partial refund for an order,
so I can return only some of the items I bought.

At first, this looks like a small change in the payment service.

But before writing code, we need to understand several things:

An agent that receives only the epic can produce a plausible solution that is still wrong.

Question the epic

The agent's first job should not be creating files. It should be turning the epic into questions.

Possible questions include:

The agent does not need to answer everything by itself. Its job is to take the right questions to the product owner and the teams involved.

Questioning the epic does not block the work. It turns unclear points into explicit decisions before they become bugs or rework.

A planning skill can guide the creation of these questions. The agent can check domain documentation and use a tool to find epics, requirements, and previous decisions.

Run the spike

After the goal is clear, the technical investigation begins.

The agent can use different Context Skills to investigate the problem. An order skill helps it understand order items and states. A payment skill explains the provider's rules. An observability skill shows how to investigate the current behavior.

The goal of the spike is not to produce a nice answer. It is to build a view based on evidence.

The agent can look for:

A reasonable investigation could follow this order:

  1. Find the order model or contract.

  2. Find the current cancellation flow.

  3. Find the payment provider integration.

  4. Find refund or cancellation tests.

  5. Find events published after a payment change.

  6. Find the consumers of those events.

  7. Check production signals to understand the current behavior.

The agent should not only find files with similar names. It needs to rebuild the flow and explain how the parts are connected.

Record the spike decision

The result of the spike should not remain only in the conversation history. It should become documentation that can be found during future investigations.

A decision document could look like this:

# Decision: partial refunds

## Context

An order can contain several items, but the current refund flow
works only with the total transaction amount.

## Options considered

- create a new transaction type;
- allow multiple refunds on the existing transaction;
- create a separate refund service.

## Decision

Use the existing transaction and track the total refunded amount.

## Consequences

- the external provider must support multiple refunds;
- the refund event must identify the items;
- the operation must be idempotent;
- old consumers must keep working.

## Risks

- two refund requests may run at the same time;
- the external and internal states may become different;
- some consumers may not know the new format.

This documentation helps the current team, but it also helps future agents and future work.

Every well-documented spike adds a new context source to the architecture. Over time, we stop depending only on code and build a map of decisions, contracts, and consequences.

Define what success means

Before creating tasks, we need to answer one simple question:

How will we know that this implementation solved the problem?

For a partial refund, success may mean:

These criteria matter more than the number of changed files. Implemented code does not automatically mean that the problem was solved.

We also need to measure the impact outside the system. If the goal is to let customers request partial refunds by themselves, fewer support requests about this process may be an important success metric.

This metric should be combined with technical signals. Fewer support requests are a success only if the error rate did not increase and refunds are being processed correctly. Otherwise, we may only be making the problem less visible to support.

That is why the definition of success should already point to observability work. These criteria must become metrics, queries, dashboards, and alerts.

Define and create the tasks

With the decisions and success criteria defined, the agent can break the delivery into tasks:

A tool can create these tasks in the system used by the team. A planning skill can define the minimum format for each task, including context, acceptance criteria, dependencies, and risks.

The agent can prepare the tasks, but the team must still confirm that the split correctly represents the work and ownership of each domain.

Define how to test

Before implementation, we need to decide how to validate the change in a non-production environment.

This may involve:

The agent can create test scenarios from the success criteria, but the team must check whether the environment can reproduce the important conditions of the real system.

A good question is:

What must be configured in QA for us to trust the result?

If the answer is “nothing,” the test has probably not been defined well enough.

Define observability before the code

Even before AI tools existed, it was good practice to decide how a change would be observed after release.

For each feature, we need to decide:

For partial refunds, we could track:

The agent can help write queries and configure dashboards, but deciding what to observe is an engineering decision. Without this work, the team can release the change and have no evidence that it worked.

Implement the code

Only now does implementation begin.

The agent can help to:

But it is important to understand the size of this step. Implementation is only one part of the cycle.

Understanding the problem, making decisions, defining success, preparing the environment, choosing signals, and planning operations may require more reasoning than writing the code itself.

The agent becomes more useful when it takes part in all these steps, not only when it receives a file to modify.

Create dashboards and alerts

Before the deployment, we need to prepare the operation of the feature.

This may include:

A dashboard without a clear operational question can become decoration. Each panel should help answer a question such as:

Deploy and monitor

The agent can prepare the pull request, the change record, and the deployment plan. It can summarize risks, list checks, and organize the steps.

Production execution must still follow the organization's policies. Depending on the risk, a person may need to approve the change record, review the pull request, and authorize the merge.

After deployment, monitoring should compare the observed behavior with the previous baseline:

The agent can check the signals and organize the analysis. The decision to continue, pause, or revert the change must follow the limits defined by the team.

Finish the delivery with documentation

The delivery does not end when the deployment is complete.

The document created during the spike should be updated with the real implementation result:

This closing step creates a learning cycle:

  1. The epic creates questions.

  2. The spike creates a decision.

  3. The implementation creates new behavior.

  4. Operations creates evidence.

  5. Documentation records what was learned.

  6. The next request starts with more context.

This is how a Context Architecture really grows. It is not a document created once. It is a body of knowledge that grows with the system.

Where do skills, tools, and MCP fit?

Each step can use a different combination:

The agent coordinates the workflow, but it does not need to carry all knowledge from all contexts at the same time. Each skill provides a specialization, and each tool performs a concrete capability.

The role of human review

The goal is not to remove the team from the engineering process.

The team still needs to:

The agent helps make preparation faster and more complete. It can move through different sources, find relationships that might be missed, and organize evidence in a format that is easier to review.

The decision remains the team's responsibility.

Conclusion

An agent can take part in the full life cycle of a feature without starting by writing code.

It can question an epic, run a spike, record decisions, define success criteria, create tasks, plan tests, prepare observability queries, implement changes, open a pull request, monitor a deployment, and update documentation.

This workflow works well only when context is available, connected, and reliable. Without documentation, decisions, observability, and skills, the agent tends to fill gaps with guesses.

With an AI-friendly architecture, the agent can work with evidence and make it clear what it knows, what it inferred, and what still needs to be decided.

This is where the conversation stops being only about generating code. The agent starts to take part in the engineering work that happens before, during, and after implementation.

Share LinkedIn WhatsApp X

Get new articles by email

One email when a new article comes out, in English and Portuguese. No spam, unsubscribe anytime.

Comments