# Code changes (/guides/codebases)

Unit tests prove the code does what the code says. Stunt Double proves a user
can still do what they came for. Wired into a coding agent and GitHub, it
closes the loop between "the diff looks right" and "the flow works": every
change that reaches a preview deployment can be tried end to end by an AI
persona before merge, with results reported where engineers already look.

<Callout variant="who">
  Engineers using Claude Code, Cursor, Windsurf, or any MCP-capable coding agent, and teams that
  want user-level verification in their PR flow.
</Callout>

## Setup [#setup]

1. **Connect your coding agent.** For Claude Code, the
   [Stunt Double plugin](/mcp/clients/claude-code-plugin) bundles the MCP
   server with skills and agents; Cursor has a
   [plugin](/mcp/clients/cursor) too. Any other MCP-capable agent takes the
   server URL, as **[Connect a client](/mcp/connect)** describes. You authorize
   in the browser on first use; no API keys.

2. **Connect [GitHub](/integrations/github)** for the repositories you work
   in, so agents can read PRs and post results, and automations can trigger on
   GitHub events.

3. **Teach your agent the habit.** Add a note to your repo's agent
   instructions (`CLAUDE.md`, `.cursorrules`, etc.) so verification happens by
   default, not on request:

   ```markdown
   ## Verification

   After a change is deployed to a preview URL, verify it with Stunt Double
   (use the verify_change MCP prompt): run a checklist over the affected user
   flows and report per-check results with evidence. Post the results on the
   pull request. If a checklist for the flow already exists, re-run it rather
   than creating a new one.
   ```

## Workflow: verify a PR on its preview deployment [#workflow-verify-a-pr-on-its-preview-deployment]

The `verify_change` prompt encodes the whole loop, or drive it
conversationally:

> “The preview for this branch is at my-branch-preview.vercel.app. Verify the
> signup changes and post results on the PR.”

<FlowStrip
  nodes={[
    { label: 'Preview deploys', sub: 'PR opens a URL' },
    { label: 'Checklist runs', sub: 'Actor walks the flow' },
    { label: 'Fix and re-run', sub: 'Agent reads evidence' },
    { label: 'Verdict on the PR', sub: 'Pass/fail per check' },
  ]}
/>

Your agent will:

1. Create (or reuse) a checklist against the preview URL, with instructions
   derived from the diff and 4 to 8 pass/fail checks: the new behavior,
   adjacent flows, and error states.
2. Run it; an actor drives a real browser through the flows and records
   evidence per check.
3. On failures, read the evidence, propose or apply the fix, and re-run.
4. Post a verdict comment on the PR: pass/fail per check with evidence
   highlights.

Since the coding agent both wrote the change and read the failure evidence,
the fix loop is tight: no repro steps, no handoff.

<TextureBreak />

## Workflow: checks that run themselves [#workflow-checks-that-run-themselves]

Checklists persist, so verification compounds into a regression net:

- **On deploys**: a workflow with a Vercel or GitHub event trigger re-runs the
  critical checklists on every deploy or PR, with notification steps for
  failures and GitHub comment / actor PR review steps to report inline.
- **On a schedule**: cron-triggered workflows (daily against production) catch
  regressions that arrive via dependencies, config, or content rather than
  code.

Set both up in one shot with the `setup_guardrails` prompt. After a few PRs
you accumulate a library of user-flow checks that no one has to remember to
run.

## Workflow: from bug report to fix without a human repro [#workflow-from-bug-report-to-fix-without-a-human-repro]

Comments people leave through the [feedback widget](/guides/feedback-widget)
(pinned to an element, with a screenshot and device info) are agent-readable:

> “Triage the new feedback on the dashboard project; reproduce anything that
> looks like a bug.”

The agent clusters reports, reproduces suspects with targeted checklist runs,
fixes what it can in the codebase, verifies on the preview, and updates the
feedback status. The `triage_feedback` prompt packages this.

## Tips [#tips]

- Actors have their own email inboxes, so flows behind OTP or magic-link auth
  are testable end to end.
- Keep checks user-phrased ("a new user can complete signup with a magic
  link") rather than DOM-phrased ("the submit button is enabled"); they
  survive refactors.
- Small focused checklists beat one giant one: clearer failure signal, cheaper
  re-runs.
- Runs are async and take a few minutes; agents should poll for results
  rather than assume completion.
