The Ticket That Wrote Its Own Design Doc

How we built Astro at PayU on top of Cursor’s agent CLI, and what it changed about the way our engineers ship. 

Picture a Tuesday. 

A ticket lands in your queue: add a retry policy to a payment callback handler. It looks small. It always looks small. 

By Wednesday, you’ve asked product two clarifying questions. By Thursday, you’ve written a design note nobody asked for. On Friday the code is done and CI fails on a lint rule. By Monday, a reviewer asks the question that has haunted every pull request since the dawn of version control: 

“Why did you do it this way?” 

You remember. Mostly. It was four days ago. 

The hard part of that ticket was an afternoon of logic. The rest was the hand-offs: ticket to design, design to review, code to pipeline, pipeline to reviewer. Each one is small. Together they eat the week. 

AI coding tools got very good at the afternoon. They barely touched the week. So we built something for the week. 

Meet Astro

Astro is PayU’s internal control plane for automated software development. You describe a feature, or import a Jira ticket. Astro drafts a design, asks the questions that matter, stops for your approval when there are open questions or you ask for review, implements the change, and opens a GitLab merge request. 

The key is a division of labour. Cursor’s headless agent CLI reads the codebase, reasons about it and writes the code. Astro does everything around that: it queues the work, tracks state, enforces the gates, talks to Jira and GitLab, and keeps the audit trail. Think of the agent as a very fast engineer, and Astro as the process that keeps a very fast engineer honest. 

The lifecycle, in short: 

draft → queued → planning → plan review → running → awaiting review → succeeded 

The brackets mark a conditional stop. Plan review happens when the planner has open questions or the engineer asks for it, and Jira work can add an architecture review where the project has that stage. Otherwise Astro runs straight through. 

The gate: questions before code 

Left alone, a model goes from ticket to code at full speed. It also guesses: three retries or five, log the failure or surface it, keep the old behaviour or not. The guesses look exactly like decisions. 

We wanted them on the table. So Astro plans first. The agent drafts a technical design and emits a plan gate, a list of every decision it would otherwise have invented: scope, observable behaviour, contracts, anything expensive to undo. The engineer answers, the agent re-plans, and it repeats until nothing is ambiguous. 

The part we’re proudest of is that we limited the questions. The agent may not ask about status codes, variable names or helper functions, only about intent. One policy-level question beats six edge-case ones. An assistant that asks too much is almost as unhelpful as one that asks nothing. 

For Jira-linked work, the design is also posted back to the ticket, so the architecture review reads the same document the agent is about to implement. Nobody reviews one thing and ships another. 

What Cursor brings to the table 

Astro decides when work happens and whether it may proceed. Cursor decides how the code gets written. That split works because Cursor’s agent CLI was built to be driven by something other than a person. 

  • It runs headless. It works without anyone at the keyboard and streams structured events, so Astro can track progress, cost and failures. That turns a coding assistant into a worker you can queue, cancel, time out and retry. 
  • It reads before it writes. Each workflow gets an isolated git work-tree, plus a shared per-project checkout, so Cursor’s codebase index is usually reused instead of rebuilt. The agent has already seen how your project names things and structures tests. 
  • Its modes mean something. Plan mode reasons without editing a file, execute mode writes the code, and read-only ask mode answers a reviewer’s “why?”. 
  • It remembers. Astro saves the planning session and resumes it to implement, so the agent that writes the code is the one that did the thinking. CI fixes and review revisions resume it too. 
  • It matches the model to the job. Planning is mostly judgment, so it runs on a more capable model at low reasoning effort, and engineers can choose which one. Once the plan is settled, a smaller model at higher reasoning effort does the implementing. The aim is a lower cost per run: the expensive model works briefly, the cheaper one does the long stretch. 

So where does the accuracy come from? We don’t have a benchmark to quote, and no single layer gets the credit. It comes from stacking: indexed context, a plan before code, a reviewed plan, one continuous session, tests first, and CI as referee. Each layer catches what the one before it missed. 

What changed in the SDLC 

Astro doesn’t replace the lifecycle. It makes each stage cheaper to run. 

Design stopped being optional. Every workflow produces a technical design before code, and reviewers read an actual document that also lands in the repo. 

Jira updates itself. Status moves forward and design comments appear. Nobody has to remember. 

Reviewers can interrogate the change. Ask Astro sits on the workflow screen. A reviewer asks “why this approach?” and a read-only agent answers from the plan, the diff and earlier Q&A. It can’t change anything, only explain. 

Pipelines fail, then get fixed. When CI goes red, Astro reads the logs, classifies the failure and pushes a fix. Sonar findings, security hotspots, AI review comments and SCR reports feed the same pass. Attempts are capped, because automation that retries forever isn’t automation. It’s a loop. 

Back to Tuesday 

Replay that ticket. You describe the retry policy in a paragraph. Astro reads the repo and comes back with a draft design and three questions, not thirty. Do retries apply to every callback or only idempotent ones? What happens after the final failure? Is there an upper bound on total delay? 

You answer in two minutes. By the time your coffee is cold there’s a merge request. The design is attached, the tests came first, and Jira already knows. Days later, in review, someone asks, “why did you do it this way?” 

The answer is already on the page. 

What it means for developers 

We haven’t instrumented Astro well enough to publish before-and-after benchmarks, and we won’t invent a number. What we can describe is the shape of the change. 

  • The blank page is gone. A draft design and plan exist before you open an editor. 
  • Your attention moves up the stack, to the questions only you can answer: what should happen, what’s in scope. 
  • Reviews begin with context, not archaeology. 
  • Tests come first. Every prompt asks for a failing test. That is guidance, not a mechanical gate, and CI is the backstop. 

The trade is real. The engineer’s job tilts from writing toward specifying and reviewing, a different muscle that takes an adjustment period. 

Astro also sits among other tools. Cursor IDE is still where engineers do hands-on work, AI code review comments on merge requests, and Sonar and SCR run in the pipeline. Astro routes what they find back to the agent that wrote the code. 

Guardrails 

Speed without boundaries is just a faster way to make mistakes. Plan review stops execution whenever there are open questions or the engineer asks for it. Actions are role-gated and every create and cancel lands in an immutable audit log. Secrets are scrubbed from errors, and model choices are validated, never accepted as free text. The agent CLI sits behind a swappable interface (Cursor today, with Claude as a configurable alternative), so we’re not welded to one vendor. 

What we’d tell you if you’re building one 

The gate matters more than the model. Most of our quality gain came from surfacing assumptions early. 

Constrain the questions. Fewer, better, about intent. 

Make the state machine boring. Explicit states, retries and recovery paths were most of the work and nearly all of the reliability. 

Write where people already live. Jira, GitLab and CI were already home, so Astro writes to them. 

What’s next 

We want real numbers, and more repositories passing our readiness checks so more teams can use Astro safely. If you’re building something similar, start with the approval gate and the audit trail. Add automation after. 

The afternoon was never the problem. The week was. 

Astro is built and maintained by the Astro team at PayU, on top of Cursor’s agent CLI. 

0