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. Provide the first user flow and your app’s URL. If no credential works, the agent asks you to sign in with the CLI. For headless setup, provide an organization API key instead.Setup prompt
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. Pass
install-mcp detects the coding agents on your
machine and writes the config for each one.--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
See Coding agent skills for install directories,
targets, and update behavior.
momentic-test, momentic-maintain, and momentic-spec skills with web
and mobile references. Replace claude-code with your agent’s target.Write tests from a diff or a user story
Themomentic-spec skill maps
a change to the user journeys it touches. From a pull request diff:
/momentic-spec cover the checkout changes in src/payments/.
From a user story, paste the acceptance criteria after the skill name:
- Writes the test and prepares the accounts, data, and services it needs. If setup is blocked, it reports that instead.
- Runs it once to confirm the expected failure.
- Once the feature works, enables the test and runs the smallest affected set.
Write a mobile test
-
Upload an iOS simulator build or
Android APK to the channel and tag the test
uses:
- Install the tools with the Mobile tabs above.
-
Run
npx momentic-mobile loginso the MCP server can read the saved key. Editors usually don’t inherit your shell environment.
platform: ios and your app’s bundle identifier in openApp:
tests/checkout.test.yaml
--session-idle-timeout-minutes to momentic-mobile mcp to change it.
Gate the pull request on the build it uploads
Gate the pull request on the build it uploads
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 The unique tag avoids immutable-tag collisions on reruns. Without
.app directory and use
platform: ios in the test:--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
idto 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: Applyperforms 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.
Write your first test with MCP
The agent writes a.test.yaml, runs it through the MCP server, reads the
structured failure with the failed step, screenshot, and trace, then fixes its
own test.
Verify the server with claude mcp list in Claude Code, or turn it on in
Cursor’s MCP settings. Start a new chat. This web example uses an email-only
login flow. Replace the URL and test account with your app’s values, and adapt
the steps to your login flow.
1
Write the test
Ask the agent to write a test with a base URL:
2
Run and repair the test
Ask the agent to run the test and fix any failures:
3
Commit the test
Review the resulting file, then commit it:
momentic-test skill covers the
authoring flow, and GitHub Actions runs the
test in CI. The test opens the top-level url before it runs the steps:
login.test.yaml
Skills and the MCP server
Use skills for test format and authoring workflow, and the local MCP server to inspect your app and try steps. If MCP is unavailable, the setup prompt uses the CLI to validate and run YAML files. For Mo distributions and the plugin conflict, see the skills guide; for MCP authentication and recovery, 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 toAGENTS.md, CLAUDE.md, or .cursor/rules. You still need the Momentic CLI to
validate and run the tests: