momentic-spec skill turns a
user story into a .test.yaml file before anyone writes product code. The agent
reads the story, maps the acceptance criteria to steps and assertions, and
writes the file into your repository. Once the feature is usable in your app,
the agent prepares the test state and runs the smallest affected set at an
end-to-end checkpoint. Long runs require confirmation. The test is plain YAML,
so you edit it in a pull request like any other file.
Setup
Install the MCP server and the skills with the CLI. Both commands are described in Building with AI:MOMENTIC_API_KEY in its environment and a reachable app to
test: a local 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, paste the story after the skill name:apply-promo-code.test.yaml
fill, which replaces the field’s current value instead
of appending to it. See type.
The agent does not run the test right away. Momentic runs are end-to-end checks
against the real UI, so the skill waits until the feature is implemented and a
user can exercise it in the app. At that point the agent prepares the required
data and account state, enables the affected tests, and proposes the smallest
relevant run. It asks for confirmation before a long run; an explicit request to
run those tests counts as confirmation.
Edit the generated test
The file lives in your repository, so review it 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: Applygives the runtime one action to perform, where “click the apply button” leaves the path to an AI action. Steps lists the preset steps. - Match each check to the contract in the story. If the story fixes an exact total, verify it with an element-content or JavaScript check rather than a qualitative AI assertion.
- Move shared setup such as log-in into a module so every test generated from a story reuses it.
disabled: true and run the edited file
locally before you push:
What to expect
- Give the agent explicit acceptance criteria. Clarify missing expected behavior before treating a generated test as the product contract.
- Both AI actions and preset steps can target elements by description. Keep a future specification disabled until the required UI and dependencies exist.
- When the UI changes later, locator auto-healing re-resolves a stale target during the run, and failure recovery can clear an obstruction and retry. See AI test maintenance.
For tests scoped to a code change instead of a story, see Generate tests from
a pull request
diff.