momentic ai explore diffs a
commit range, identifies the user journeys that changed, and with --build
authors or edits Momentic tests to cover them, opening the new tests as a pull
request so coverage keeps pace with the product. See the
explore agent overview for the concept.
Run it on pushes to main — the same way Momentic dogfoods explore internally.
Each merge to main is explored once, against the change that just landed, so
coverage is authored for work that is already shipping rather than re-running on
every commit of every open branch.
Add the workflow
Add a workflow that runs explore whenever changes land onmain:
.github/workflows/momentic-explore.yml
fetch-depth: 0 gives the agent the history it needs to diff the pushed range.
Outside a pull request, momentic ai explore diffs the commit that just landed
(HEAD~1..HEAD), so a squash-merged PR is explored as a single change without
passing --base or --head.
MOMENTIC_API_KEY authenticates the run.
Create one here and add it as a
repository secret. The contents: write and pull-requests: write permissions
let the Momentic GitHub App open the pull request, which
uses your repository’s
pull request template.
Drop --build to have the agent only discover and log the changed journeys
without authoring tests — useful while you are evaluating what it would do.
Choose what a build produces
Set On successful explore in Settings > Explore to control what happens to the tests the agent authors:pull-request: open a PR with the new and edited tests. Best when you want generated coverage reviewed and merged like any other change.draft-pull-request: open the PR as a draft so a human marks it ready.direct-commit-except-main: commit and push to the checked-out branch. Onmainor a GitHub-protected branch, open a draft PR instead.patch: print agit apply-ready diff instead of opening a PR. Needs no GitHub App orpull-requests: write, so it is the option for forked-PR runs.nothing(default): leave the changes on disk.
momentic-explore/ branch, so generated coverage
lands in the same review flow as any other change.
Steer the agent
Append project-specific instructions with--prompt, or set a default custom
prompt in Settings > Explore:
Variations
For large repositories, run explore on a schedule or on demand instead of on every push tomain by swapping the trigger. Pass an explicit --base/--head
when the range is not the last commit:
momentic ai explore
reference for every flag. The same pattern works on
GitLab CI,
CircleCI, Jenkins,
and custom setups.