Watch the seven part series

Build an AI software factory with Claude Code and ContextQA

A developer asks Claude Code to add a confirmation before someone sends more than $500. Ninety seconds later, the pull request has a preview. Would you merge it? Open the diff and try to answer three questions. Does exactly $500 go straight through? Does Cancel leave the form filled in? Can the same change accidentally interrupt someone requesting money?

One line for Claude Code, Codex or Cursor. See what it runs

Replay of the recorded run
  1. Add a confirmation before someone sends more than $500. Ticket CON-253.
  2. /cqa-author Use the five criteria in my ticket
  3. Asked 3 questions, including whether Escape counts as Cancel
  4. Proposed 10 tests and a shared sign in step. 6 selected.
  5. Excluded: the post payment summary drops cents. New ticket, own owner.
  6. Build it on a branch, open the PR, run the plan on its preview
  7. PR #3 opened. Preview serves head f4ebb62
  8. Run 786, PR preview, Chrome6/6 passed
  9. Reviewed and merged as a130856
  10. Run 787, merged build, Chrome6/6 passed
  11. Released v1.5.0 with run links. About 24 minutes from the first prompt.
Watch the real sessionOpen PR #3
  1. 1ticket
  2. 5acceptance criteria
  3. 6browser checks
  4. 1reviewed PR
  5. v1.5.0published release

Those questions are the work between a generated patch and a release. In this walkthrough, one ticket became five acceptance criteria, six browser checks, a reviewed PR and a published release. You can inspect the code, see which tests were kept, and repeat the workflow on your own feature.

What you’ll leave with: a repeatable path from a ticket to a tested build, a rule for sending failed work back for repair, and a release note that tells a reviewer exactly what passed. Start with one change. Once your team trusts the evidence, use the same path to triage a bug queue or process a small backlog.
Set up ContextQA using https://raw.githubusercontent.com/indivatools/contextqa-skills/main/llms-install.md. You have my OK to install or update the ContextQA skills and MCP server and sign me in.

Paste it into Claude Code, Codex or Cursor in your repo. The agent follows the ContextQA install guide: it installs or updates the skills and MCP server and opens the browser sign in.

Pick the result you need

How the factory fits into the AI SDLC

Your coding agent already reads tickets, writes code, runs local checks and opens PRs. Keep using those abilities. ContextQA gives that agent a second source of information: what a person with a particular role actually experienced on a deployed build. A pipeline connects the two. A product owner owns the expected behavior, an engineering team owns its merge policy, and the evidence survives the chat.

Stage Claude Code or another coding agent ContextQA through MCP or the configured integration What CI/CD or a person owns
Discover and specify Extract criteria, dependencies, ambiguities and risk Explore permitted staging journeys, read connected sources and propose coverage Owner resolves ambiguous product behavior
Implement Branch, make the change, run fast local checks, open the PR Derive checks from the ticket and existing journeys CI builds the candidate and deploys its preview
Verify Read failures alongside the diff and propose a repair Execute selected cases, record steps, expected vs. actual, environment and run IDs Bind the preview to the commit and protect approved assertions
Review and release Summarize the change, failures, exclusions and remaining risks Replay the same criteria on the merged deployment Reviewer approves or holds, deployment system promotes the tested artifact
Maintain Propose updates when code or requirements change Reassess PR impact, replay regressions and retain history Owners approve changes to intent and review release trends

A team using SonarQube can keep its static quality gate. A clean scan and a passing browser journey answer different questions about the same SHA. Teams using a different coding agent can keep the same ContextQA cases and release policy. The public skills support Claude Code and other MCP compatible clients.

Product ownerTicket and owner approved criteria
Coding agentBuilds on a branch
ContextQAPrepares checks from the ticket
CI/CDCI deploys the PR revision
ContextQARun the checks on that preview
GateEvidence for every required criterion?
ReviewerIndependent review and merge
CI + ContextQADeploy the merge revision and replay
ReleaseRelease with run links, or hold
Product failure: repair on the branch, redeploy, replay the unchanged caseBlocked or ambiguous: correct the setup or ask the owner, then run again
A product failure goes back to the deploy step. A blocked run goes back to the run. Only a build with evidence for every required criterion moves right.

Bring a project and one testable change

Bring A good first choice How you know it is ready
A repository and ticket Your fork of the payments demo or GrowthBook, plus one feature or reproducible defect You can create a branch and PR. The ticket names an actor, action and observable result.
A reachable app A PR preview or an isolated staging deployment, with the API reachable from the browser A ContextQA runner can sign in, perform one action and read the saved result.
Test identity and data One synthetic sender, one recipient and resettable records, or an isolated flag per run The role matches the ticket. Runs can create and clean up their own records. Store credentials in environment bindings.
ContextQA access A workspace, an environment, sufficient execution credits and permission to author and run cases The workspace, environment and test account are identifiable before the first run.
A coding agent and CI Claude Code for the recipe below, Git, your normal build and preview deployment You can retrieve the deployed revision from CI. A local Git SHA alone cannot identify what the browser loaded.
A release decision One reviewer and an agreed risk, retry and spending policy The team knows who can approve a changed requirement, an exception or a merge.

Install the skills and make the first connection

In your terminal, install the Claude Code plugin. It includes the skills and the hosted MCP connection.

Run in your terminal
claude plugin marketplace add indivatools/contextqa-skills
claude plugin install contextqa@contextqa

Start a Claude Code session in your repo, enter /cqa-init, and complete the browser sign in on first use. Confirm the organization, workspace and account. For Codex or another compatible client, run npx skills add indivatools/contextqa-skills, select the client, and configure its MCP connection to https://mcp.contextqa.com/mcp.

Paste this first task into the agent:

Paste into Claude Code
Show the connected ContextQA workspace, the staging environment and the enrolled repository. Tell me which preview URL and test identity this workflow will use, without printing credentials. Show the smallest saved case that can prove a signed-in page loads. Ask me to approve the execution. After the run, return the case ID, result link and last successful assertion.
First success: a named assertion on a signed in page passes from the runner. If login fails, check the environment, identity, API route and fixture before debugging the feature. If you have no saved case, use /cqa-author to create this one from the expected behavior, review its steps, then run it.

The flagship: ship one payments feature

1. Start where the recording started

Use a fresh clone to inspect the exact feature before you build your own version. These commands select the base revision and show the change that ultimately shipped. To open your own PR, clone your fork or configure your fork as the push remote.

Run in your terminal
git clone https://github.com/Shailesh93602/payments-demo.git
cd payments-demo
git switch -c lab/payment-confirmation cac41d9cc78781a73610fdc46fba8c335a9d7f00
git diff --stat HEAD v1.5.0

The PR head was f4ebb62 and the released merge was a130856. For a fresh local lab, use the Node and Yarn versions specified in the demo branch, install with yarn install --frozen-lockfile, seed the disposable database with yarn db:seed:dev, and build with yarn build. Deploy your candidate with your preview pipeline. Point the ContextQA environment at that deployment and verify its revision before execution.

2. Give the agent a contract a test can judge

The user story is simple: a sender can catch an expensive mistake before money moves. Write down both what the customer sees and what must happen to the transaction. Here is a reusable acceptance table derived from CON-253.

Criterion A useful fixture Observable check
AC1. Confirm large outgoing payments Pay $750, exactly $500, and $25 $750 opens a dialog naming amount and recipient. The other two take the usual path.
AC2. Confirm completes the payment Known sender and recipient, fresh transaction The confirmed payment appears for the expected amount and recipient.
AC3. Cancel preserves the form Start an over threshold payment, then cancel Form stays populated and the attempted payment has not posted.
AC4. The dialog displays cents accurately Try $500.01 on the Pay path The confirmation dialog shows $500.01. Track receipt formatting separately if it is outside the ticket.
AC5. Requests keep their existing behavior Request an over threshold amount The request follows its normal flow without a payment confirmation dialog.

For your own implementation, turn “payment has not posted” into a named observable, such as an unchanged transaction history after refresh. Give each run its own records. These are suggested lab fixtures and assertions. The historical release records the six selected tests and their scope.

3. Write the checks from the ticket and inspect what got excluded

Paste into Claude Code /cqa-author
/cqa-author Use the five criteria in my payment-confirmation ticket. Create or link a versioned requirement. Draft independent cases. For each case return its criterion ID, precondition, input, expected visible result and forbidden side effect. Ask about ambiguities. Show what you excluded, why, and which criterion would lose coverage if that case were removed.

In the recording, ContextQA asked three questions, including whether Escape or clicking outside counted as Cancel. The ticket did not specify either behavior. It generated ten proposed tests and one shared sign in item. Six tests were selected. A proposed check on the post payment summary exposed a scope decision: that screen could drop cents even though the new confirmation dialog formatted them correctly. Give that observation its own ticket and owner. An independent reviewer should see excluded checks alongside the passing ones.

4. Build, deploy and ask for execution evidence

Paste into Claude Code
Build the approved payment-confirmation change on a branch and open a PR. Keep the approved ContextQA assertions intact. Run the repository's fast checks. Wait for the preview deployment, record the deployed commit, and compare it with the PR head. Run the selected acceptance plan there. Return one row per criterion with case ID, result ID, expected and actual behavior, and a link. Mark anything that did not execute as pending.

For a PR in a GitHub checkout, gh pr view --json url,headRefOid,baseRefName gives you the GitHub side of the comparison. Obtain the running revision separately from deployment metadata or a version endpoint. A queue can say a plan is running before a single assertion executes. Keep the execution ID and poll it instead of creating duplicate plans.

5. Repair the right thing and release the tested revision

What the evidence shows What the factory should do
The right assertion ran on the right build and the product failed Send expected, actual, failed step and trace to the coding agent. Deploy its patch and replay the unchanged case.
A test stopped at sign in, a stale locator or missing fixture Classify the block. Repair the setup or review the test correction independently. Keep the original failure and replay.
A stakeholder changes what should happen Version the requirement, obtain owner approval and update its cases together.
Every required assertion passed Have the reviewer inspect the diff, exclusions and evidence. Merge under the repository’s policy and replay on the merged deployment.
What actually happened: all six selected checks passed on the PR build, then all six passed on the merged build in Chrome. The narrated runs were 786 and 787. The second execution had to be started as a full plan when a rerun request produced no new run. The video reports about 24 minutes from the first prompt to release and about 40 minutes from ticket filing. No product repair was required. Results lived in ContextQA and the terminal, so posting criterion level links directly on the PR is an improvement for your implementation.

Which skill should I reach for?

Developer task Skill to use Useful output
Check identity, repo integration or runner reachability cqa-init, cqa-integrations, cqa-environments, cqa-tunnel Correct workspace and a working runner to preview path
Turn a ticket into stable, runnable checks cqa-author, cqa-locators, cqa-suites-and-plans Reviewed assertions, typed steps and an environment bound plan
Review a diff, reproduce a report, investigate one failure or run a suite cqa-impact, cqa-bug-repro, cqa-debug, cqa-regression A scoped selection, reproduction, diagnosis or run result
Understand platform concepts or explore a disposable test app for functional defects contextqa, cqa-bug-hunter Platform guidance or candidate functional bugs to reproduce and review

The published skills have confirmation points for work that changes live state or spends credits. For unattended CI, make the repository, environments, allowed actions, spend limit, retry limit and escalations explicit before enabling triggers. Start with advisory PR comments. Promote the check to a required merge gate after the team has seen it distinguish a product defect, a fixture failure and an empty run.

Give every stage the same product context

The most useful thing to retain across agent sessions is the relationship between a product decision and the run that checked it. Start small. Store a Markdown or JSON index in the repo and link to the authoritative ticket, deployment and ContextQA results. A dedicated context service can use the same structure later. The example below is a proposed factory design.

Owner decision and requirement version
Ticket, code and approved crawl observations
PR, repository and deployed revision
Environment, role and test data
Behavior and acceptance IDs
Reviewed test case and fixture
ContextQA execution
Evidence and release decision
Release notes and next regression plan
Record Example Update it when
Intent CON-253, AC1, Pay over $500 opens confirmation, product owner approved Threshold or user visible behavior changes
Implementation and observed behavior Payment form handler, Pay dialog, Request route, signed in staging observation Code or a scoped crawl reveals a changed route or discrepancy
Verification method Reviewed case for $500.01, sender role, synthetic recipient and observable dialog text A fixture, selector or assertion changes
Execution evidence Repo, PR, deployed SHA, environment, browser, case version, result ID, observed amount Every execution. Preserve the previous result.
Decision Reviewer, disposition per criterion, open receipt issue, release tag The owner accepts a scope change or a new build is released

A crawl can discover a dialog. Only the owner or the approved spec establishes when it should appear. A screenshot can show what happened in one run. To reuse that evidence for a release decision, retain its build, role, environment and assertion. If the threshold changes to $800, the context index tells you which specs, cases, docs and release claims need another look.

Wire it into the CI/CD pipeline

Event Trigger and output Failure or retry behavior
A ticket is ready Register criteria, risk owner and fixtures. For a bug, reproduce on the baseline before editing code. Return a specific question when expected behavior or required data is missing.
A PR opens or its head changes Run build, types and unit checks. Start PR impact against the enrolled repo. Review proposed additions, edits and retirements. An impacted case list records selection. It supplies no execution verdict.
The preview becomes ready Check deployed SHA, identity and fixture. Run direct acceptance cases plus relevant existing regressions and prerequisites. Serialize jobs on a shared preview or use one preview per PR. Discard a stale decision when the head changes.
A case fails Classify product, test, environment, data or unresolved. Route evidence to the owner and replay after the repair. Keep a bounded repair budget. Escalate repeated identical failures and blocked privileged actions.
Merge completes Deploy the merge SHA, run the required acceptance or smoke plan again, link results in release notes. Hold promotion if the deployment or a required check is unverified.
A schedule fires Run a broader suite against stable staging, review flakes and test data, refresh stale coverage. Track recurring failures separately from confirmed product regressions.

Use the platform’s PR analysis settings to select the real base branch, target environment and review mode. If you require a pre merge check for new behavior and the integration only applies approved suggestions at merge, create and run a separately reviewed acceptance plan against the preview. Changes to which tests exist and execution of those tests are distinct pipeline events.

Suggested PR evidence block

Paste into the PR description
Ticket / spec version / criteria:
PR head / deployed SHA / environment / test identity:
Direct acceptance cases / impact-selected cases / exclusions:
Executed / passed / failed / blocked / skipped:
Per-criterion run links and first differing step:
Open risks / reviewer / merge decision:
Merged SHA / post-merge run / release:

Measure backlog, release velocity and engineering cost

Start with one team, one repo and one workflow. Select a comparable prior cohort and measure the same events through review and release. Compare features with features and reproducible defects with defects. Keep small samples and interruptions visible.

Question Measurement Decision it supports
Is the backlog shrinking? Track opening eligible backlog + new eligible tickets − verified closures. Also report age of the oldest tickets and the count waiting for fixture, clarification or human approval. Invest in missing fixtures or better intake if work is merely moving into a blocked queue.
Is triage faster? Median time from report to reproducible evidence or a specific information request. Count engineer touch minutes and handoffs per submitted report, including misses. Expand ticket triggered reproduction where it saves engineer time.
Are we releasing faster? Median and p90 time from ready ticket to deployed and verified release. Break out implementation, preview queue, test runtime, repair and review. Add isolated previews or parallel fixtures if waiting dominates.
Does it cost less? Add engineering and review labor at loaded rates to model, ContextQA, CI, preview and fixture costs. Divide that total by the number of verified changes. Compare with the same task mix and quality bar in the baseline period.
Did we preserve quality? Required criteria with a passing scoped result, escaped defects, reopened fixes, reruns due to flakes and decision overrides. Track per release. Expand autonomy only when throughput improves with acceptable quality.
Illustrative pilot math. Ten comparable fixes previously took 12 engineering and review hours. A pilot takes seven hours plus $110 of incremental tooling and execution. At an assumed $100/hour, the modeled cost goes from $1,200 to $810, or $120 to $81 per fix if all ten are verified. Replace every input with your own timesheets and usage, and use actual verified completions in the denominator. The recordings demonstrate elapsed time and individual outcomes. They do not establish a customer’s savings percentage.

Questions developers ask before trying it

Can I do this with Claude Code alone?

Claude Code can write and execute tests and can orchestrate CI. ContextQA is useful when another person needs a durable, independently reviewable requirement, saved case, deployed build result and replay history. MCP lets the developer operate that testing system from the chat they already use.

Do I need to migrate my existing test suite first?

Start with one existing high value journey and one direct acceptance case. Keep normal unit, build and static checks. Map existing coverage to the PR, then add the missing user behavior.

Does a browser pass establish production readiness?

It establishes the assertion that ran for a given build and environment. Add applicable API, persistence, permission, accessibility, browser, performance and integration criteria with explicit evidence and owners. The flagship’s Chrome run covers its payment acceptance scope.

What if I have no ticket system or no preview per PR?

Paste the approved spec into the agent and store it in the repo. With a shared staging URL, serialize candidates, record the deployed SHA, keep it fixed during execution and recheck before promotion. The batch episode shows the throughput price of sharing one preview.

What should I try first?

Pick the last small PR somebody manually clicked through before approving. Write down the single behavior they feared breaking. Use the skills to create one check, run it on the matching build, and put its evidence where the reviewer already works.

Try the factory on one pull request

Pick one behavior a reviewer currently checks by hand. Connect its preview, run the approved assertion and give the reviewer a result link tied to the candidate commit. If you prefer a known starting point, use the same payments change as the recording.