By Parvez Hassan, Principal Engineer (Backend, AI & DevOps), OLX India

TL;DR
- AI made writing code faster, but not shipping. The gap was workflow, not tools.
- A defined workflow fixed inconsistency, rework, and untested code.
- Running agents in parallel with git worktrees was the biggest multiplier.
- Context files, domain skills, and short, simple output made it reliable.
The context
When I started my career, writing software meant writing every line by hand. When I got stuck, I had a browser full of tabs: Stack Overflow answers, official documentation, GitHub issues, and the occasional blog post that happened to describe my exact problem. A good engineer was someone who knew where to look and how to stitch the pieces together.
Then the tools started changing. IDEs got smarter autocomplete. AI assistants began suggesting whole lines, then whole functions. Before long, I was asking questions in a chat window instead of searching Stack Overflow. Today, at OLX, I describe what I want and AI agents write, test, and refactor the code while I review it. In a few short years, AI coding tools went from novelty to something nearly every engineer on my teams uses daily.
The promise was simple: AI writes code, so we ship faster. And on day one, it feels true. You describe a function, and it appears in seconds.
But a few months in, I noticed something. Engineers were busier with AI, yet delivery wasn’t dramatically faster. Some weeks it was slower. The speed of writing code had gone up, but the speed of shipping reliable software hadn’t kept pace.
The problem with developing with AI
When I looked closely at where things went wrong, the same eight issues kept showing up:
Inconsistent results
Ad-hoc prompting produced great output one day and unusable output the next. No repeatable process, just luck.
Code before understanding
AI jumps straight into code without asking what you want or why. Fast code, wrong problem, expensive rework.
No context
AI doesn’t know your architecture or conventions. Every session starts from zero, and engineers keep re-explaining the system.
Ignores domain standards
For microservices, AI gets boundaries, contracts, resilience, and security subtly wrong. It works in isolation but doesn’t fit the system.
Plausible but wrong
Confident code that looks right and isn’t. AI-written tests confirm what the code does, and get quietly rewritten as it changes.
Review fatigue
AI produces more than humans can comfortably read. Overwhelmed reviewers approve without reading, and bugs slip through.
Overengineering
Abstractions, layers, and configurability nobody asked for. Code someone reviews now and maintains forever.
One task at a time
We used AI as faster typing but kept working sequentially. That caps the gain at an improvement, not a multiplier.
I’ve used multiple AI tools extensively and seen these same issues in all of them. That told me something important.
None of these are tool problems. They’re workflow problems.
What I changed
Since the problems were in the workflow, the fix had to be a change in how I work. Here’s an overview of my setup, and which problem each part solves:
None of this depends on a specific tool. It lives in my repo and my workflow, so when a better model comes out, I plug it in and keep everything else. Here’s what took me from [X] to [Y], roughly 10x faster delivery of production-ready code.
1. Define a workflow, don’t just prompt
The first big unlock was replacing ad-hoc prompting with a defined AI workflow. The one I use, and recommend to everyone, is Superpowers. It turns the AI from an eager code generator into something closer to a disciplined senior engineer, with each step activating at the right moment.
Here’s what happens at each step:
- Brainstorming happens before anything gets built. The AI asks questions to draw out what you actually want and why, then plays its understanding back for correction. Small changes get agreed in chat; bigger projects get a written design document a builder could plan from.
- Using git worktrees kicks in after the design is approved. It creates an isolated workspace on a new branch, runs project setup, and verifies a clean test baseline.
- Writing plans breaks the approved design into bite-sized tasks of 2–5 minutes each, with exact file paths, complete code, and verification steps.
- Subagent-driven development or executing plans carries out the plan. Either a fresh subagent handles each task with a review after each one (most thorough), or everything runs in a single session with one review of the whole branch at the end (cheapest).
- Test-driven development enforces RED-GREEN-REFACTOR: write a failing test, watch it fail, write minimal code, watch it pass, commit. Code written before tests gets deleted.
- Requesting code review runs between tasks, checks work against the plan, and reports issues by severity. Critical issues block progress.
- Finishing a development branch verifies tests when all tasks are done, presents options (merge, PR, keep, or discard), and cleans up the worktree.
This one change fixed three problems at once. Brainstorming stops code before understanding. A repeatable process stops inconsistent results. Test-first development stops plausible but wrong. It bakes in the habits good engineers should have but often skip under pressure.
2. Make tests the contract
Superpowers enforces TDD, but I still ran into a problem many teams are now reporting: when AI writes both the code and the tests, can you trust the tests?
As features evolve, the agent refactors tests along with the code, so a test I reviewed last month may not check the same thing today. AI-written tests are also long and tedious to read, and often lean heavily on mocks. They end up confirming what the implementation does, bugs included, rather than what it should do. And in a rush to report “done,” an agent can quietly weaken a test.
Matteo Vaccari’s article Tests as data on martinfowler.com also shared approaches to solve the same problem. When AI writes the code, developers become its customers. So customer tests, written in the language of the business rather than the implementation, become the primary contract between us and the AI.
The practical idea is to move test cases out of test code and into data files:
- Black-box customer tests. Test behaviour through a service’s or component’s entry point, with no implementation details, so refactoring doesn’t break them.
- Just the facts, in tables or YAML. Each case is input, setup, and expected output. No boilerplate to read past.
- AI writes the test runner. A small runner reads the data files and executes them. Custom test DSLs and runners used to be expensive to build; with AI they’re cheap.
- Protect the contract. Data files the task shouldn’t touch are locked, or CI checks which files changed.
Here’s the shape of it, for a simple listing-price rule:
| test_name | category | price | expected |
|---|---|---|---|
| valid car listing | cars | 450000 | accepted |
| zero price | cars | 0 | rejected: price must be positive |
| negative price | mobiles | -500 | rejected: price must be positive |
| above category limit | mobiles | 9999999 | rejected: price above category limit |
Anyone, including a product manager, can read this and spot a missing case. Adding one is a new row, not a new test method. And if the AI changes this file, it stands out immediately in the diff.
Knowing which files a task should change makes unexpected edits easy to catch:
| Task | Production code | Test data | Test runner |
|---|---|---|---|
| New feature | Changes | Changes | Locked |
| Refactoring | Changes | Locked | Locked |
| More test coverage | Locked | Changes | Locked |
| Improving the test DSL | Locked | Changes | Changes |
TDD still helps in the agent’s inner loop, but customer tests stored as data give it something more valuable: an unambiguous definition of done that it can’t quietly rewrite.
3. Shift Left Review
We shifted testing left with TDD. We shifted security left with DevSecOps. With AI writing the code, I’ve found review needs the same treatment.
When code was expensive to write, reviewing it at the pull request stage made sense. Now code is cheap, and review is the bottleneck. An agent can produce a two-thousand-line PR in an afternoon, and the team has to make sense of it after the fact. Worse, the most important feedback, “this is the wrong approach,” arrives only once the work is done. At that point you either throw the work away, or, more often, approve it anyway because rewriting feels too costly.
Shift-left review moves the team’s review to the spec stage, before any code exists. The brainstorming step already produces a design document, a plan, and the customer test cases. That’s what the team reviews.
Traditional review
Shift-left review
Here’s what the team looks at, and when:
| Stage | What the team reviews | Cost of a change |
|---|---|---|
| Design | Approach, service boundaries, API contracts, risks | Minutes |
| Test data | Expected behaviour and missing edge cases | Minutes |
| Plan | Task breakdown and risky areas | Minutes |
| Code | Does it match the approved spec and tests? | Hours, if the direction was wrong |
Raise a spec PR first: the design document and the customer test files, with no production code. The team comments on it the same way they would on any PR. Once it’s approved, agents implement against it.
The code review at the end becomes much lighter. The direction is already agreed, the expected behaviour is already in the test data, and the AI code review step has done a first pass. Human reviewers just confirm the implementation matches what the team approved. Feedback is faster, rework drops, and the team stays aligned on what is being built, even when AI is doing most of the building.
Reviewing a page of spec takes minutes. Reviewing two thousand lines of AI code takes hours.
4. Break the sequential habit
As engineers, we’re tuned to work sequentially. One task at a time, maybe two if we’re juggling. That made sense when every line of code came from our own hands. Today, it’s a mental blocker that caps how fast we can go.
With AI, that constraint is gone. I can spin up as many agents as I need and run them in parallel. My job shifts from doing each task to orchestrating several at once: defining the work, dispatching it, and reviewing what comes back.
Before: sequential
After: parallel agents
Running in parallel, locally, in the same repo
The practical question is: how do multiple agents work on the same repo without stepping on each other? The answer is git worktrees combined with subagents.
Each worktree gives an agent its own isolated working directory and branch, all backed by the same repository. Subagents then execute tasks independently inside those worktrees. No conflicting edits, no half-finished changes leaking into each other, and everything runs on my local machine.
# One isolated workspace per task
git worktree add ../my-service-task-a -b task-a
git worktree add ../my-service-task-b -b task-b
# See all active workspaces
git worktree list
# Clean up when the task is merged
git worktree remove ../my-service-task-a
Superpowers handles most of this setup automatically, which removes most of the friction of getting started.
It feels uncomfortable at first. It’s also where most of the 10x came from.
5. Give AI the right context
AI output quality depends almost entirely on the context it gets. Out of the box, it doesn’t know your architecture, your conventions, or why a service looks the way it does. So I invest in context at three levels:
- Project-level AGENTS.md describes the project, its structure, how to build and test it, and the conventions to follow. It’s the first thing the agent reads.
- Rules encode the standards the agent must stick to, like layering, error handling, and naming.
- Package-level context files explain what each module does and the pitfalls specific to it, so the agent gets local knowledge exactly where it’s working.
Here’s the shape of a typical AGENTS.md:
# AGENTS.md
## Project
[Service name]: [one-line purpose]
## Build & test
- Build: [command]
- Test: [command]
## Conventions
- [e.g. handler → service → repository layering]
- [e.g. all external calls use timeouts and retries]
## Don'ts
- [e.g. never read another service's database directly]
This is also where most lessons from mistakes land (more on that below). Each time the agent breaks a convention, a new line goes into this file or the rules. It’s a one-time investment that keeps paying back on every task.
6. Bring backend best practices to AI
Superpowers gives a strong general workflow, but backend microservices have their own standards: service boundaries, API contracts, resilience, security, and testing. Generic AI often gets these subtly wrong, producing code that works locally but causes problems in a distributed system.
Here’s a typical example. Ask an AI assistant to “add a call to the pricing service”, and you get a working call. What you usually don’t get is a timeout, a circuit breaker, an idempotency key, an authorisation check scoped to the caller, or a test for what happens when pricing times out. Nothing is wrong with the code. It’s just missing everything that separates a demo from a service someone gets paged about.
public Order place(PlaceOrder cmd, Caller caller) {
+ authz.requireCanOrderFor(caller, cmd.customerId()); // secure-service
+ return idempotency.once(cmd.idempotencyKey(), () -> { // idempotency-and-immutability
Price price = pricing.quote(cmd.sku(), cmd.quantity()); // adapter now has a timeout,
// retry budget and breaker
return orders.save(Order.place(cmd, price));
+ });
}
+ // + component test: "pricing times out → 503, no order written" — test-strategy
So I built ai-coding-microservices-skills: 21 composable, open-source skills that hold an AI assistant to microservices standards. They encode what “done” means in a distributed system: where boundaries fall, what crosses them, how it fails, who is allowed to call it, and which test proves it. They work with Claude Code, Cursor, Codex, and any tool that supports the open Agent Skills format.
Three design principles
- Checks over advice. “Services should be resilient” changes nothing. “Does this call have an explicit timeout shorter than the caller’s deadline? If not, set one” changes the output. Every skill is written as concrete STOP-and-verify checks.
- Composability over one big document. Small, single-purpose skills load only when relevant. Writing an HTTP client pulls in the adapter, resilience, and security skills; writing a migration pulls in data access.
- Judgment handed back, not hidden. Sync or async, strong or eventual consistency, split or keep together: these are calls the AI must not make silently. Each skill routes them back to the engineer with options, consequences, and a recommendation.
Three tiers of skills
Principles
Single-concern guardrails that load automatically when the agent touches code they govern: service boundaries, clean architecture, domain modelling, data access, API contracts, resilience, idempotency, security, testing, and config.
AutomaticWorkflows
Multi-step procedures that compose the principles and pause at human approval gates: design, implement, review, and refactor.
You invoke theseProfiles
A guided interview that records your project’s real stack, so “add a circuit breaker” means your library, thresholds, and idioms instead of a generic pattern name.
Run once per projectThe delivery pipeline
- /stack-profile runs once. It detects your language, framework, message broker, and test tooling, asks only about what it couldn’t detect, and records it for every other skill to use.
- /design-service climbs from context to components, interactions, and contracts, stopping for approval at each level and leaving an approved blueprint. This is exactly what goes into the spec PR for shift-left review.
- /implement-service builds inside-out from the blueprint, running every applicable checklist before showing you anything.
- /review-service audits the change and reports severity-ranked findings, each tied to a file, a line, and the principle it breaks. In Claude Code, a separate reviewer subagent does the audit with no memory of having written the code.
- /refactor-safely writes characterisation tests first, then makes small, reversible steps, including extracting a service.
Every stage reads and writes to a shared project folder holding blueprints, decisions, and the context map. So the system starts with everything the first one already settled.
7. Keep output reviewable and simple
Speed is useless if humans can’t keep up with reviews. Three skills keep the output at a size and complexity people can actually check.
Caveman tackles review fatigue. AI produces a lot of content: long explanations, verbose summaries, walls of text. When humans get overwhelmed, we start approving without really reading. Caveman makes the AI respond in short, direct language. Less to read means I actually read it, and my reviews stay sharp.
i-have-adhd goes a step further. Caveman makes responses shorter; this skill makes them actionable. It leads with the next action, numbers multi-step tasks, cuts tangents, and ends with one concrete next step. Reviewers spend their attention on the critical steps, not on searching for them. Here’s the difference, using the example from the project’s README:
Before
Great question! Let me think about this. Your auth flow has a few moving pieces: the middleware, the token verification, and the cookie handling. Looking at src/auth.ts, the verifyToken function (around lines 42-58) seems to be using an older jsonwebtoken API. One approach would be to update the package and rewrite that function. After making the change, you’d want to run the auth tests to confirm nothing breaks. By the way, you might also want to look at your dependency versions overall. Hope this helps! Let me know if you want to dig deeper.
After
Edit src/auth.ts:42 to update the token validation.
- Open
src/auth.ts - Replace
verifyToken(lines 42–58) with the snippet below - Run
npm test -- auth.spec.ts
Next: paste the first failing line if any test fails.
Ponytail tackles overengineering. AI is eager to impress, and left unchecked, it adds abstractions, layers, and configurability nobody asked for. That code costs time to review and even more to maintain. Ponytail keeps the AI focused on the simplest solution that solves the problem.
8. Fix the system, not just the code
One habit ties all of this together: when the agent gets something wrong, I don’t just fix the code. I ask why my setup allowed it, then encode the fix as a new rule in AGENTS.md, a test, a lint check, or a skill. The same mistake doesn’t happen twice.
A better prompt helps one session. A better rule, test, or skill helps every session after it, for every engineer on the team. This idea of improving the environment around the agent is sometimes called harness engineering, and it’s a big part of why the speed-up kept growing instead of levelling off.
A real example: feature locking on our entitlement platform
Recently, I led the design and development of a feature locking system built on our entitlement platform. I built it with a junior engineer from my team, in Go, a language we picked for this service and one that was completely new to my teammate.
On paper, this was not a quick project. We had more than ten complex business use cases to support, including locking time periods, lock evaluation windows, and lock window open periods, and every one of them had to be dynamically configurable. Under our usual approach, the estimate reflected that complexity.
Most of our time went into the spec, not the code.
We spent the bulk of our effort on brainstorming, writing the spec, and reviewing it. Each use case was defined in detail and reviewed thoroughly by the team before any code was written. This was shift-left review in practice: the hard questions about edge cases and configuration got answered while changing direction still cost minutes.
Next, we set up a testing framework that expressed every use case as an acceptance test in integration format. These became the contract for the AI, in the same spirit as the customer tests described earlier, and the starting point of our TDD loop: the acceptance tests existed and failed before the implementation did.
Then execution moved fast
With approved specs and failing tests in place, we ran multiple agents in parallel, each working on a different use case in its own worktree. Every change went through AI code review first, followed by a lighter human review focused on whether the implementation matched the approved spec.
Because every use case was covered by an acceptance test, we didn’t need manual testing at all. A passing suite meant the behaviour was right, and we ended with 100% code coverage across all use cases. Overall, we delivered roughly 10x faster than our regular estimate.
What we still owned
AI wrote most of the code, but the decisions stayed with us: how the locking model should work, how to make every rule configurable without making the system fragile, which edge cases mattered, and whether each use case was specified correctly in the first place. That’s where most of our thinking went.
One more outcome I didn’t fully expect: a junior engineer who had never written Go before was contributing production-quality code from the start. Clear specs, acceptance tests, and review gates meant they could focus on understanding the problem and the design, and learn the language along the way, instead of being blocked by it.
How my role changed
As a Principal Engineer, my time used to be split across architecture discussions, design reviews, mentoring, and cross-team alignment. Hands-on coding was usually the first thing to get squeezed out. I’d find an hour here and there, but rarely enough to ship anything substantial.
That’s changed completely. With AI handling much of the implementation, I’m contributing far more code now than I have in years. A gap between meetings is enough to approve a design, dispatch a few agents, and come back to working changes ready for review. Work that once needed a dedicated block of focus time now fits around everything else I do.
What I do has shifted too. I write less code by hand and spend more time defining problems, approving designs, orchestrating parallel work, reviewing output, and improving my setup. But I’m shipping more than ever, while still doing the architecture and leadership work my role demands.
I used to think AI would make senior engineers less relevant. It’s been the opposite. Judgment, systems thinking, and the ability to break down problems matter more than ever, because now they’re applied at 10x the scale.
If you want to try this
- Adopt a defined workflow like Superpowers instead of ad-hoc prompting.
- Make customer tests the contract, stored as data the AI can’t quietly rewrite.
- Shift review left: get team feedback on the spec and test cases before code exists.
- Stop thinking sequentially. Run agents in parallel with git worktrees.
- Invest in context: AGENTS.md, rules, and package-level context files.
- Add domain skills for the standards your systems need.
- Keep output short and solutions simple so reviews stay meaningful.
- Turn every mistake into a rule, test, or skill, so it never repeats.
10x didn’t come from a tool. It came from changing how I work, and letting go of doing one thing at a time.
