In a previous post, I described giving an AI agent one instruction:
Implement Jira ticket ABC-123.
It comes back with a tested PR, with automated review feedback already addressed.
A considerable amount of preparation sits behind that sentence.
The agent needs to understand how we build software in that specific organization, what business problem it is solving, and what evidence we expect when it finishes.
That preparation starts before the first implementation ticket.
At the beginning of a project, have the AI perform an extensive analysis of an existing codebase from another project—one that reflects the engineering standards you want to carry forward.
Ask it to trace how the system actually works:
“Follow our coding standards” becomes much more useful when it comes with concrete examples.
House style includes naming and formatting. It also includes decisions such as where a transaction begins, how a failure propagates, and whether a new abstraction earns its existence.
The analysis should produce a proposed engineering guide, with references to the code that supports each recommendation.
Then the team reviews it.
An existing codebase contains both deliberate standards and historical compromises. Some patterns deserve to become instructions. Others deserve a small plaque explaining what happened.
Next, have the AI analyze substantial commits from the strongest engineers on the team.
Look at feature implementations, bug fixes, refactors, and changes made during review. Include the associated PR discussions and design decisions where they are available.
The finished code shows the current structure. The changes reveal what experienced engineers chose to improve, simplify, protect, or remove.
Look for recurring judgments:
A commit shows a decision. It doesn’t always explain why that decision was made. The AI should identify proposed rules and supporting examples; the lead should confirm which rules apply to the new project.
That gives you something much more useful than “write clean code.”
You get a documented account of what this team considers good engineering, including the things its reviewers consistently watch for.
Put the approved guidance in versioned repository documentation and agent instructions. Make the relevant sections available to each new session. Turn the rules that can be checked automatically into lint rules, tests, or CI checks.
The payoff is that the lead’s standards become available before the agent writes the first draft.
The next skill is learning to write tickets an agent can act on.
Consider:
As a UI developer, I need a Save button.
That tells us something about the proposed implementation. It tells us very little about the problem.
Compare it with:
Partners need to save an incomplete funding request and resume it in a later session without losing their work.
Now we can define observable acceptance criteria:
The ticket should also identify relevant dependencies, reference established architectural patterns, and describe the evidence required for acceptance.
The button can emerge from that specification.
AI can help draft these tickets, propose missing cases, and identify ambiguities. The analyst and business expert still need to settle the business decisions. The developer needs to check that the scope and dependencies make sense.
Technical work belongs here too. A migration, performance improvement, or infrastructure change can have a precise outcome and measurable acceptance conditions without pretending to be a user clicking something.
A useful ticket gives the agent enough information to act and the reviewer enough information to judge.
Once tickets describe observable outcomes, the testing framework should produce evidence against those outcomes.
For browser workflows, Playwright can capture screenshots, videos, and traces. Build the reporting integration so selected evidence is attached to the Jira ticket, with links to the full report and larger artifacts where appropriate. The reviewer should be able to open the ticket and see:
For the saved-application example, a screenshot of a “Saved” message proves very little about persistence. The test needs to save the draft, end the session, start another session, and verify the values. Screenshots and video make that sequence easier to inspect. Assertions establish whether the expected behavior occurred.
Capture evidence for selected successful acceptance scenarios as well as failures. A framework configured to record only failures won’t provide much demonstration material for completed work.
And review the tests against the agreed acceptance criteria. An agent can write an implementation and a test that share the same misunderstanding.
Evidence is useful when it supports a specific claim about a specific version of the software.
Individual test reports help you review a change. Consistent results across runs help you understand the project.
Have the test frameworks emit, or be adapted into, a common versioned schema. At minimum, capture:
| Information | What to record |
|---|---|
| Traceability | Jira key, acceptance criterion, stable test identifier |
| Execution | Run identifier, timestamp, environment, browser or platform where relevant |
| Code | The commit or build actually tested |
| Outcome | Status, attempt number, duration, error details |
| Evidence | Object keys or links for screenshots, videos, traces, and logs |
| Format | Schema version |
Keep failures, retries, and skipped tests visible. A test that passes on its third attempt has a different history from one that passes immediately.
Playwright’s reporters provide structured output you can normalize into this shared format. Other test frameworks can feed the same dataset through their own reporters or adapters.
Store the normalized records in S3 as JSON Lines, with one complete record per test attempt. Keep screenshots, videos, and other binary artifacts under separate prefixes, referenced from those records.
Then use Athena to query the results across runs.
With ticket and acceptance-criterion mappings available alongside the results, you can investigate questions such as:
Athena queries the structured results. The associated screenshots, videos, and traces remain available for inspection when a result needs explaining.
This also gives the AI a much better basis for investigation: a consistent record of what ran, against which code, and what happened.
The reference codebase supplies examples. The commit history supplies engineering decisions. The team turns those observations into explicit standards.
The Jira ticket supplies the business problem and acceptance conditions.
The testing framework produces evidence, and the reporting system makes that evidence inspectable across changes and over time.
Together, those pieces give the agent a useful definition of what good work looks like—and give the humans a practical way to evaluate it.
That is how you tame the beast.
Give it the house rules, a real business problem, and a definition of done it has to demonstrate.