Building a Software Factory: Jira Ticket In, Verified Feature Out

Table of contents

I move a Jira ticket to To Do, and my software factory, a Docker container of Claude Code agents, picks it up. About twenty minutes later there’s a pull request with tests written before the code, proof that those tests failed first and pass now, screenshots of the change, and a review from a second agent that didn’t write any of it. The factory checked the proof itself rather than taking the builder’s word for it.

When I merge the PR, the ticket moves to Done by itself. A third agent then checks every acceptance criterion in a real browser, without ever reading the code, and posts a verdict table on the ticket.

That’s the whole software factory: a builder, a reviewer and a verifier that never share a context, with plain code deciding what moves forward. It’s running against this site now, the code is public at software-factory, and the Software Factory product page shows what it does and how to set it up.

This post is the overview: what the factory is, the rules behind it, how a ticket moves through it (including how to get a stuck one moving again), and what happened on the first real ticket. Each part of the line has its own post, if you want the detail.


Where This Started

In August 2025 I wrote a Medium post about using GitHub Copilot to turn a Jira ticket into a Playwright test. The pitch was speed: give the agent a ticket ID and it writes the test, so nobody has to click through the acceptance criteria by hand.

In 2026, that’s no longer the hard part. Agents write the feature, the tests and the PR description. A few agents running in parallel produce more changes in a day than anyone can click through in a week. The scarce thing isn’t code or tests. It’s knowing whether what came out does what the ticket asked. I wrote about that shift in AI-First SDLC: Why Development Becomes a Loop.

The 2025 workflow also had a flaw built in. One agent read the ticket, wrote the test, ran it, and told me it passed. When the same agent builds something and reports on it, a misreading of the ticket shows up the same way in both. This factory is the rewrite, and its central idea is the opposite: don’t let the thing that built it be the thing that tells you it works.

Two things in the 2025 post were plainly wrong, so here they are:

  • The architecture. I wrote that “MCP sends the criteria to Copilot” and that Playwright MCP runs the generated test. In fact the agent is the client, and MCP servers are tools it calls. Playwright MCP drives a browser; it doesn’t run test files.
  • The overclaims. “Manual testing is obsolete” and “no human error” were wrong. Agents make their own errors. That’s why every step below leaves evidence, and why a human still decides what ships.

What a Software Factory Is

A software factory is a line where agents do most of the building and humans do two things: they set direction by writing the ticket, and they decide what ships by merging the PR. Everything between those two points runs by itself, and every step leaves evidence you can check without redoing the work.

The evidence is the point. A factory that says “done” with nothing to back it up is just a faster way to ship bugs.


The Line at a Glance

flowchart LR
    J["Jira: To Do<br/>label factory-enabled"] --> B["Build<br/>red → green<br/>(ticket-builder)"]
    B --> C{"Factory checks:<br/>red fails, green passes,<br/>no protected paths"}
    C -->|ok| E["Screenshots<br/>(evidence-capture)"]
    C -->|no| X["factory-blocked<br/>+ Jira comment"]
    E --> P["PR opened<br/>Jira: In Review"]
    P --> R["Review comments<br/>(pr-reviewer)"]
    R --> H["Human reviews<br/>and merges"]
    H --> D["Jira: Done"]
    D --> V["Verify in a browser<br/>(ticket-verifier)"]
    V --> VR["Verdict table<br/>on the ticket"]
Station Who Sees Produces
Build ticket-builder agent The ticket, the repo, CLAUDE.md A red commit, a green commit, a summary
Check Orchestrator (plain code) Git history, test exit codes Pass, or a blocked ticket with the reason
Evidence evidence-capture agent The ticket and the running app A screenshot per criterion
Review pr-reviewer agent The ticket, the diff, CLAUDE.md Inline review comments, never an approval
Merge You Everything above The decision
Verify ticket-verifier agent The ticket and the running app, no code PASS / FAIL / UNTESTABLE for each criterion

It all runs in one Docker container: a small TypeScript orchestrator, the Claude Code CLI run headless (claude -p), the gh CLI, and Playwright MCP with Chromium. The builder and reviewer run on Opus; the screenshot and verifier agents run on Sonnet.


Four Rules the Design Follows

Most decisions in the factory came from asking which of these rules applied.

1. Each agent sees only what its job needs. The builder can edit code. The reviewer can read the diff but can’t run anything. The verifier can’t see the code at all: it gets the ticket and a URL. This isn’t about saving tokens. Separate agents give you second opinions that can actually disagree with each other, and on the first ticket one did.

2. Code decides workflow state, never an agent. Agents don’t move tickets, open PRs or push branches. The orchestrator does all of that in ordinary TypeScript, based on things it can check: test exit codes, git history, PR state from the GitHub API. A builder can claim “all tests pass” in its summary. The factory ignores the claim and runs the tests itself.

3. Agents don’t hold the keys. The orchestrator holds a GitHub token that can push to your repo and a Jira token that can edit tickets. The agents run shell commands chosen by a language model, reading ticket text anyone with Jira access can write. Those two must never meet. That turned out to be harder than it sounds.

4. The factory knows nothing about your repo. Everything repo-specific lives in the repo, in a few contract files. Adding a second repo is one config entry plus an onboarding run, with no changes to the factory’s code.

Jira and GitHub are plug-ins

The same idea applies to the two services the factory talks to. The stages never call Jira or GitHub directly. They call a Tracker (find a queue of tickets, read one, route it to a repo, move it, label it, comment, attach screenshots) and a CodeHost (clone and push, find or open a PR, read its diff, post a review, link a committed screenshot). Jira and GitHub are the one vendor of each today.

Each repo in factory.config.yml names its vendors:

repos:
  - name: my-app
    git: git@github.com:you/my-app.git
    tracker: { type: jira, project: APP }   # optional `component: web`
    # host: { type: github }               # inferred from github.com URLs

Each vendor validates its own options when the config loads and checks its own environment variables, so JIRA_* and GH_TOKEN are required only if a repo uses that vendor. Adding GitHub Issues, Linear, GitLab or Bitbucket is one folder and one registry line, with no changes to the stages. The repo has guides for adding a tracker and adding a code host.


How a Ticket Moves Through the Factory

From Jira’s side, the whole factory is a status workflow plus a handful of labels. Knowing which ones matter is most of what you need to run it day to day.

flowchart LR
    T["To Do<br/>factory-enabled"] --> B["Build<br/>In Progress"]
    B --> P["PR + review<br/>In Review"]
    P --> M["You merge<br/>→ Done"]
    M --> V{"Verify"}
    V -->|all PASS| OK["factory-verified"]
    V -->|otherwise| NO["factory-verify-failed"]
    B -.->|any stage fails| X["factory-blocked"]

What the factory reads from a ticket

A ticket is picked up only if it’s in a project listed in factory.config.yml, has the factory-enabled label, and is in the status a stage looks for. From the ticket itself, the agents get only the summary and the description. Comments, attachments, linked issues and history are never fetched, and the builder, reviewer, screenshot agent and verifier all see the same text.

That has consequences:

  • The description is the specification. If the developer and the stakeholder agreed a change in the comments, write the outcome into the description. The builder builds from it, the reviewer reviews against it, and the verifier passes or fails the app against it. A change agreed only in a comment can make the verifier FAIL behaviour that is actually right.
  • Answers in comments are ignored. If the factory blocks a ticket and you reply in a comment, the next run won’t see it. Edit the description.
  • Every run starts fresh. A retry doesn’t carry over the previous attempt’s reason, review or verdicts.

Write acceptance criteria as numbered, checkable outcomes. Without them the builder derives its own from the description and says so, but the verifier may extract different ones, which is how a correct build ends up UNTESTABLE.

Four queues, one poll

Every 60 seconds, for each repo, the factory asks the tracker for four queues in this order (on Jira, each is a JQL query), one stage at a time:

Stage Picks tickets that Then
Close have factory-pr-open, aren’t in Done yet, and aren’t merged or blocked Merged PR: moves the ticket to Done. Closed without merging: blocks it. Still open: waits.
Verify are in Done, without a verdict label or factory-blocked Posts the verdict table and adds factory-verified or factory-verify-failed
Review have factory-pr-open and an open PR, and aren’t reviewed, merged or blocked Posts a COMMENT review once, adds factory-reviewed
Build are in To Do, without factory-building, factory-pr-open or factory-blocked Takes one ticket per poll: highest priority first, then oldest

Finishing work already in flight comes before starting anything new. Verify also picks up tickets you moved to Done by hand, as long as they have factory-enabled.

Labels are the state

Label Added when Who removes it
factory-enabled You opt the ticket in You
factory-building Build starts The factory, when the build succeeds or blocks
factory-pr-open The PR is opened You, to rebuild
factory-reviewed The review is posted You, to get another review or to rebuild
factory-merged The PR merged and the ticket moved to Done You, to rebuild
factory-verified Every criterion passed Nobody
factory-verify-failed Any criterion is FAIL or UNTESTABLE You, to verify again or rebuild
factory-blocked Any stage failed, with a “Factory stopped” comment You, to retry

A blocked ticket is skipped by every queue, and nothing retries on its own. That’s deliberate: a broken ticket can’t burn tokens in a loop.

When it stops, and how to restart it

Start with the “Factory stopped” comment. Fixes to what to build go in the description; fixes to the setup happen outside Jira.

Where Reason in the comment Fix
Build The builder stopped: the criteria are too vague Add or clarify acceptance criteria in the description
Build The builder stopped: blocked by something outside the repo Resolve the dependency
Build No factory.yml on the base branch Run onboard-repo on the repo. The ticket is fine.
Build The change touches protected paths A human makes that change, or you split the ticket
Build Red-green check failed, no commits, or the turn budget ran out Retry. If it repeats, the ticket is too big or unclear: split or tighten it.
Close PR closed without merging Reopen the PR, or rebuild
Any “Unexpected error” Check the factory logs, fix the cause, retry

Then change the ticket to match what you want next:

You want to Status Labels
Retry a build that blocked Move back to To Do Remove factory-blocked
Retry review, close or verify Leave it Remove factory-blocked
Get another review of an open PR Leave it Remove factory-reviewed
Verify again without rebuilding Leave it in Done Remove factory-verify-failed
Rebuild a ticket with an open or closed PR Move to To Do Close the PR if it’s open. Remove factory-blocked, factory-pr-open and factory-reviewed.
Rebuild a ticket that was already merged Move from Done to To Do Remove factory-pr-open, factory-reviewed, factory-merged and the verdict label

A rebuild force-pushes factory/KEY and opens a new PR. Forget to remove factory-pr-open and the ticket never re-enters the build queue; forget factory-merged and the new PR’s merge is never picked up.

Review comments and verdicts are yours to act on

The factory doesn’t fix anything after the PR is open. Before merge, fix review comments yourself on the factory/KEY branch and merge, remove factory-reviewed if you want a fresh review, or ignore a comment you disagree with, since the review is advisory.

After merge the code is already on the base branch, so a verdict points you at what to change:

  • FAIL, and the behaviour really is wrong: a bug the tests didn’t catch. Fix it in a new ticket or rebuild this one.
  • FAIL, but the app is right: the description is outdated. Update it, then remove factory-verify-failed.
  • UNTESTABLE because of wording: reword the criterion, then verify again.
  • UNTESTABLE because it couldn’t reach the state: fix the navigation doc, the seed data or the login wall in the target repo, then verify again.
  • A slow app or a flaky page: just verify again.

Edge cases worth knowing

  • Moving a ticket to Done by hand while its PR is open skips the close stage, so verify runs against the base branch without the change and will likely FAIL. Let the factory move tickets to Done.
  • A hard kill mid-build can leave factory-building on the ticket, which keeps it out of the build queue for good. Remove the label, move the ticket to To Do and check factory/KEY for a half-pushed branch. A normal stop finishes the current stage first.
  • A dry run changes no labels, so a long-running one rebuilds the same ticket every poll. Use it with --once.
  • Instructions written inside a ticket, about tools, credentials or skipping steps, are treated as data and reported in the agent’s summary, not followed.

The factory repo has the full version of this as a ticket lifecycle guide.


The Series

Each part of the line has its own post, about 6 to 9 minutes each:

  1. Part 1: Onboarding a Repo: the contract files, the onboard-repo skill, what it found on this site, and how to run the factory on your own repo.
  2. Part 2: Red-Green TDD an Agent Can’t Fake: how the builder works, how the factory checks the TDD claim itself, the screenshots, and the agent review.
  3. Part 3: A Verifier That Never Reads the Code: the station the factory exists for, and the first ticket where it disagreed with the builder.
  4. Part 4: Keeping Agents Away From the Keys: the orchestrator, the token leak I found in my own design, and how two Unix users fixed it.

The First Real Ticket, End to End

The first ticket wasn’t a toy. KAN-4 asked for voice input in the site’s ⌘K command palette, with 20 acceptance criteria covering listening states and a two-second silence timeout, Esc behaviour and permission errors, accessibility and reduced motion, privacy, and lazy loading.

Time Stage What happened
04:56 Build Picked up from To Do. About 7 minutes went on installing dependencies and downloading Chromium (browsers are now cached on a volume).
05:16 Check The suite failed at red commit 581aec50 and passed at green commit 3e19a187.
05:17 PR PR #3: 5 files, +727/-2. A voice module, palette changes, unit tests, end-to-end tests that mock the browser’s speech API, and a navigation-doc update.
05:20 Review 8 comments in 1.7 minutes.
10:48 Close I reviewed and merged. The ticket moved to Done within a minute.
10:51 Verify 1 minute in the browser: 11 PASS, 1 FAIL, 8 UNTESTABLE, posted to the ticket.

Cost: $2.23 in total, on a Claude subscription token:

Stage Cost
Build $1.41
Screenshots $0.10
Review $0.56
Verify $0.16

Two results made the case for the design. The review was worth reading: three of its eight comments were real issues, including one where the builder had quietly loosened its own red test. And the verifier disagreed with the builder. The builder had a passing test for “the first Esc stops listening”. The verifier, driving the merged site without reading any code, saw the first Esc close the palette instead. The factory couldn’t tell which side was right, and it didn’t pretend to: it put the disagreement on the ticket for a human. Part 3 covers that run in detail.

Six things broke along the way, from screenshots saved in the wrong folder to the agents being able to read the factory’s tokens. None of them showed up in the unit tests, and all of them showed up within an hour of the first real ticket. Each part of the series covers the ones in its station. The short version: run your factory on real work early.


Limits

  • The agents are still LLMs. Separate builder, reviewer and verifier agents don’t inherit each other’s mistakes, but each makes its own. On KAN-4 the reviewer invented a line number, the builder loosened its own test, and the verifier stopped after 6 turns. Every step leaves evidence because none of them should be taken at its word.
  • Red-green proves less than it sounds. It shows the tests failed before and pass after, not that they test the right thing. That’s why a human still merges.
  • Some things can’t be checked headless. Microphones and cameras, real permission prompts, other browsers and real payment flows come back UNTESTABLE, and a person has to check them.
  • It checks behaviour, not looks. For that I diff screenshots between releases with regress.
  • One ticket at a time, because builds share an app port and test data.
  • Jira and GitHub only, for now. Trackers and code hosts are pluggable, but those are the only vendors written so far.
  • Verification runs after merge, so it can’t stop a bad merge. Moving it before the human merge is a small change in the orchestrator’s poll loop.
  • There’s no fix-up loop. Review comments and verifier FAILs are never fed back to a builder. That would need a new stage that reruns the builder on the existing branch with them as input.
  • Ticket comments are never input. Only the summary and description reach the agents.
  • The builder decides when a ticket is too vague. A ticket that looks clear but is wrong gets built from criteria the builder made up, and the problem usually shows up only as UNTESTABLE or FAIL at verify.

Key Takeaways

  • Don’t let the builder grade its own work. A verifier that sees only the ticket and the running app catches what the builder’s tests were written to miss.
  • Let code own the workflow, not agents. Test exit codes, git history and PR state decide where a ticket goes. An agent’s “all tests pass” is a claim.
  • Give uncertainty its own verdict. UNTESTABLE points at a vague ticket or a real limit instead of hiding it behind a guess.
  • Stripping env vars is not isolation. Test your sandbox like an attacker before you trust it.
  • Keep repo knowledge in the repo. That’s what makes the factory generic.

The software factory doesn’t replace reviewing or testing. On KAN-4 it did the typing, ran the tests twice, took the screenshots, wrote a review worth reading, and found a disagreement nobody had noticed. My part was reading the PR, merging it, and settling the disagreement. That’s where I want my time to go.

The code, the plugin and the onboarding skill are all in the repository. To set it up on your own repo, start with the Software Factory product page, then Part 1: Onboarding for the detail.

esc