Skip to main content
A coding agent with the Momentic MCP server and the momentic-spec skill closes the “we changed code but did not add tests” gap: it reads the diff, maps the user journeys it changed, and authors .test.yaml files into the PR’s working tree so they enter review with the code.

Setup

Both come from the CLI, documented in Building with AI:
The agent needs a MOMENTIC_API_KEY in its environment and a reachable app to test: the PR’s dev server, a preview deploy, or staging.

In your coding agent

Inside Claude Code, Cursor, Codex, or another agent with the Momentic MCP server and skills installed:
The agent reads the diff through your repo’s context, writes tests into the working tree, and runs each one before handing back. Because the tests land in the same branch, they enter review with the change and run in the same CI job as the rest of your suite, so you need no extra workflow. Point the agent at the diff when the default scope is too broad, for example /momentic-spec cover the checkout changes in src/payments/. A repo-level agent rules file (CLAUDE.md, AGENTS.md, .cursor/rules) that names your app URLs and auth path keeps every run consistent.
For autonomous bug finding rather than diff-scoped tests, use Mo. Mo is in private beta, so sign up to get onboarded.

What to expect

  • Generated tests cover journeys (sequences a user can take), not unit-level coverage. They complement, not replace, tests you write deliberately.
  • Review for intent: delete steps that assert incidentals, tighten postconditions to the actual contract of the change.
  • Tests are most valuable on the diff that motivated them. If a generated test would have caught this PR’s bug, keep it; if it only re-asserts unchanged behavior, drop it.