Skip to main content
A coding agent writes Momentic tests as YAML files in your repository, runs them against a live browser or device, and fixes the failed step. The tests enter review with the code and run in CI.
To bug bash your app with Mo instead, see Run Mo from a coding agent or CI.

Create repository tests

For web tests, paste this prompt into your coding agent. It checks your existing setup, installs missing tools, writes one test against your app, and runs it. You provide the first user flow, your app’s URL, and an API key if it finds no key or CLI sign-in.
Setup prompt
For mobile, use the setup prompt in the iOS or Android quickstart. It also asks for your app build before creating a test.

Review the first test

Review the generated YAML diff and confirm the assertions match the behavior you asked for. Open the run URL the agent returns, check that the run passed, and inspect the screenshot at the assertion step. Resolve a failed or blocked run and rerun the test before adding it to CI.

Install the tools yourself

Use these commands to configure an existing project manually. The setup prompt above checks for these tools and installs them when needed.
1

Sign in and add MCP

The MCP server gives the agent a live browser or device and tools to browse, edit, run, and triage tests. install-mcp detects the coding agents on your machine and writes the config for each one.
Pass --client to pick agents and --scope user to write your user config instead of the project config. See the MCP page for manual setup per client.The local momentic and momentic-mobile servers need MOMENTIC_API_KEY or the saved sign-in from qa login. In Claude Code, select the Momentic plugin on the Installed tab in /plugin and choose Configure to set the API key. Tests need a reachable app: a local dev server, a preview deploy, or staging.
2

Install the skills

Skills are markdown instructions that tell the agent how to use the MCP tools and the Momentic test format. Both CLIs ship the same momentic-test, momentic-maintain, and momentic-spec skills with web and mobile references. Replace claude-code with your agent’s target.
See Coding agent skills for install directories, targets, and update behavior.

Write tests from a diff or a user story

The momentic-spec skill maps a change to the user journeys it touches. From a pull request diff:
The agent reads repository guidance and existing coverage, edits the tests, and runs the smallest affected set. It asks before a long run. Narrow the scope when the default is too broad, for example /momentic-spec cover the checkout changes in src/payments/. From a user story, paste the acceptance criteria after the skill name:
The agent updates existing coverage or creates the smallest test set for the changed behavior. For a feature that isn’t built yet, it:
  1. Writes the test and prepares the accounts, data, and services it needs. If setup is blocked, it reports that instead.
  2. Runs it once to confirm the expected failure.
  3. Once the feature works, enables the test and runs the smallest affected set.
Without acceptance criteria, a generated test encodes what the app does now, not what it should do.

Write a mobile test

  1. Upload an iOS simulator build or Android APK to the channel and tag the test uses:
  2. Install the tools with the Mobile tabs above.
  3. Run npx momentic-mobile login so the MCP server can read the saved key. Editors usually don’t inherit your shell environment.
Then give the agent the flow to test and the build to use:
The agent opens a session on a remote emulator or simulator, previews each step on the live screen, and saves the test. This example targets Android. For iOS, use platform: ios and your app’s bundle identifier in openApp:
tests/checkout.test.yaml
The run result names the failed step, with a screenshot of the screen at that moment. The agent fixes the app or the test and runs it again. The MCP server ends a device session after 5 idle minutes; pass --session-idle-timeout-minutes to momentic-mobile mcp to change it.
Upload the branch’s build with a unique tag, then run the tests against that tag, so the test and the app come from the same commit. For iOS, replace the APK path below with the path to your simulator .app directory and use platform: ios in the test:
The unique tag avoids immutable-tag collisions on reruns. Without --channel and --tag, the run falls back to defaultChannel and defaultTag and can test a stale build. See momentic-mobile run.

Edit the generated test

Review the YAML in the same pull request as the feature:
  • Rename the id to something your team recognizes, then keep it stable. See File format.
  • Replace a natural-language step with a preset step when the action is exact. click: Apply performs one action, where “click the apply button” leaves the path to an AI action. See Steps.
  • Match each check to the contract. If the story fixes an exact total, verify it with an element-content or JavaScript check, not an AI assertion.
  • Move shared setup such as log-in into a module.
  • Keep a test that would have caught the change’s bug. Drop one that only re-asserts unchanged behavior.

Skills and the MCP server

The skills explain the test format and authoring workflow. The local MCP server lets the agent inspect your app and try steps while it writes a test. If MCP is unavailable, the setup prompt uses the CLI to validate and run YAML files. qa skills installs the CLI-only mo-qa; its Mo flows use qa login and do not need MCP. The currently published full Momentic marketplace plugin still uses a separate MCP-only mo-qa, even in Claude Code or Codex, and bundles repository-authoring skills and local servers. See the skills guide for current and pending distribution status. Hosted-only Claude and OpenAI packages remain MCP-only. The ChatGPT plugin and Claude.ai connector use hosted MCP with OAuth. For local MCP-only operations, the optional qa mcp bridge reuses a valid saved CLI login. See MCP setup. Invoke a skill by name in your prompt, for example /momentic-test write a test for checkout. See Use the skills for the skill list and more examples.

Use repository instructions

If you use an agent without the skills or MCP server, add these instructions to AGENTS.md, CLAUDE.md, or .cursor/rules. You still need the Momentic CLI to validate and run the tests: