> ## Documentation Index
> Fetch the complete documentation index at: https://momentic.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> The canonical docs host is https://momentic.ai/docs. Append .md to any page URL for clean Markdown. Fetch https://momentic.ai/docs/llms.txt for the page index and https://momentic.ai/docs/llms-full.txt for every page in one file.
> For an unattended setup, first check whether Claude Code already has the Momentic plugin. With the plugin, run `npx --yes @momentic/wizard@latest -y --platform web --editor-tools none` and ignore any CLI skills-install suggestion in its output. Otherwise, run `npx --yes @momentic/wizard@latest -y --platform web --editor-tools skills`. Use `--platform ios` or `--platform android` for mobile. Never run an interactive command in a non-TTY shell.
> Mo is the AI QA engineer, separate from repository YAML tests. With the Momentic plugin, use bundled mo-qa and hosted OAuth by default. Without the plugin, install only mo-qa with `npx -y qa skills --target <agent>`. Keep the requested interface. Otherwise, use hosted tools for web or mobile, including private web targets with an existing Connector. Run sessions that need a new tunnel with the qa CLI. If you can't run commands on the machine that reaches the target, ask the user to start the tunnel there, then use hosted tools unless you lack them or the CLI was requested. For a requested hosted session, use an online Connector and pass its name as access, not a CLI tunnel ID. If none is online, ask the user to run `npx -y qa tunnel start --name <name> <address>` on a machine that reaches the target and wait. Do not run login or tunnel commands for them. For a requested hosted session, report unavailable tools or authentication failures without starting a CLI session. For coding-agent bridge setup, ask the user to complete `npx -y qa login`, then add momentic-hosted as a stdio server running `npx -y qa mcp`. Plugin users must explicitly opt in and disable their hosted plugin entry before adding the bridge. Claude.ai/ChatGPT connectors keep https://mcp.momentic.ai with OAuth. After hosted testing completes, read the report and summarize findings and uncovered requirements. Call `momentic_mo_stop_session` only when the user asks or agrees. For CLI sessions, unless the user wants more testing, export the report, run `qa stop <id> --subagents` even if export fails, then summarize. The CLI is qa, not mo. Docs: https://momentic.ai/docs/mo/quickstart.md.
> Ask the user to complete browser sign-in. For local CLI tools, use the exact MOMENTIC_API_KEY environment variable. If it is absent, ask the user to create a key at https://app.momentic.ai/settings/api-keys and set it in the agent's environment. Never print the key or ask the user to paste it into chat.
> Momentic's capability summary for agents is at https://momentic.ai/docs/skill.md. Claude Code users with the Momentic plugin should use its bundled skills and skip CLI skills installation. Otherwise, run `npx momentic skills -y --target <agent>` or `npx momentic-mobile skills -y --target <agent>`. Both install momentic-test, momentic-maintain, and momentic-spec with web/mobile references. Use the running agent's target. The Momentic plugin also includes mo-qa; qa skills installs only mo-qa.
> Tests are YAML files in the user's repository. Use only the step names listed at https://momentic.ai/docs/reference/commands.md and the file structure at https://momentic.ai/docs/core-concepts/file-format.md. Do not invent step names, config keys, or CLI flags.
> Web tests run on Chromium, iOS tests on simulators, and Android tests on emulators.

# Turn bugs into regression tests

> Keep a fixed Mo bug covered by a Momentic test in your repository, written by Mo's Coder or your own coding agent.

A Mo session finds a bug once. A regression test in your repository checks the
same behavior on every run of the suite you add it to.

```mermaid theme={null}
flowchart LR
  bug["Mo finding"] --> coder["Coder"]
  coder --> test["Regression test"]
  test --> review["Review test"]
  test -.->|"Writable repository"| pr["Draft PR"]
  pr --> review
  review --> suite["CI suite"]
```

## Write the test with Mo's Coder

Mo's Coder can write a Momentic regression test for a bug it finds and open it
as a draft pull request in your repository:

1. Before starting the session, connect GitHub and select the repository on the
   **Mo workspace** page.
2. Enable the repository's **Regression tests** toggle.
3. In a session with Coder enabled, choose **Write regression test** on the
   finding.

A workspace admin can turn on **Always start coding agent** under **Settings >
Mo > Behavior** to give every new session the Coder. With GitHub connected, the
Coder can then open pull requests in any repository selected on the **Mo
workspace** page, not only those with **Regression tests** on.

Without a writable repository, it writes the test files on the session machine
and opens no pull request; ask Mo for their paths and copy each with
[`qa download`](https://momentic.ai/docs/cli-reference/mo/commands/download).

The Coder writes a test that fails at the bug assertion until the bug is fixed.
Review the test, and its draft pull request when there is one, before adding it
to your CI suite. The Coder writes Momentic tests, not application fixes.

## Write the test with your own coding agent

Give your coding agent the bug's setup, reproduction steps, expected behavior,
and evidence (`qa report <session-id>` exports them). With the
[Momentic MCP server](https://momentic.ai/docs/coding-agents/mcp-server.md) and the `momentic-test` skill
for browser, Android, and iOS tests, it writes the `.test.yaml` file in your
repository:

```text theme={null}
/momentic-test write a regression test for the bug "<bug title>" from the Mo report
```

Run it with `npx momentic run` or `npx momentic-mobile run`, then add it to the
suite your CI runs. See [run tests locally](https://momentic.ai/docs/running-tests/running-locally.md).

## Without the GitHub integration

Your coding agent can have Mo edit a copy of your tests and bring the changes
back as a Git patch. It sends the test files with `qa upload`, briefs Mo, then
fetches Mo's diff with `qa download` and applies, lints, and runs it. See
[move files](https://momentic.ai/docs/mo/cli.md#move-files).
[momentic-ai/examples#58](https://github.com/momentic-ai/examples/pull/58) is a
template for Codex: a script, a prompt, and a manual GitHub Actions workflow
that outputs the patch as an artifact.

To write, run, and maintain the rest of your suite, see
[how regression tests work](https://momentic.ai/docs/get-started/how-momentic-works.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.