From momentic-test
Classifies and explains Momentic test run failures by identifying root causes and categorizing issues using Momentic MCP tools.
How this skill is triggered — by the user, by Claude, or both
Slash command
/momentic-test:momentic-result-classificationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Momentic is an end-to-end testing framework where each test is composed of browser interaction steps. Each step combines Momentic-specific behavior (AI checks, natural-language locators, ai actions, etc.) with Playwright capabilities wrapped in our YAML step schema. When these tests are run, they produce results data that can be used to analyze the outcome of the test. The results data contains...
Momentic is an end-to-end testing framework where each test is composed of browser interaction steps. Each step combines Momentic-specific behavior (AI checks, natural-language locators, ai actions, etc.) with Playwright capabilities wrapped in our YAML step schema. When these tests are run, they produce results data that can be used to analyze the outcome of the test. The results data contains metadata about the run as well as any assets generated by the run (e.g. screenshots, logs, network requests, video recordings, etc.). Your job is to use these test results to classify failures that occurred in Momentic test runs.
momentic_get_run — Returns some metadata about the run and a summary of the full run results. Use the metadata to help you parse through the run results (e.g. which attempt to look at, which step failed, etc.). If the current run details were already supplied in the initial context, do not call this again for that same run unless you explicitly need a different attempt.
momentic_list_runs — Recent runs for a test so you can compare the result of past runs over time. Always pass gitBranchName when it exists on the run in question so that it's more likely you're looking at the same version of the test. Omit it when you need runs from other branches. Pass recovered=true when you want to inspect recovered runs.
momentic_get_step_result — Returns the result of a specific step, with other information such as full step trace and before/after screenshots. Use parentStepIdChain for steps nested inside other steps. Only request includeTrace=true when you need it, because it can be very large.
momentic_get_test_steps_for_run — Returns the simplified test steps recorded on a run (stepsSnapshot, beforeStepsSnapshot, afterStepsSnapshot). You can use this to understand the intent of the test if you need more information than what you can glean from the test name and description.
Start with the current run before relying on history.
momentic_get_run and identify the failing attempt, section (beforeSteps, main steps, or afterSteps), failing step, and any parentStepIdChain.Before classifying, be able to answer:
Avoid vague root causes such as "setup was unreliable" or "the page was in the wrong state." Name the broken postcondition directly: for example, "the row-level plus button was clicked, but the app stayed on the parent page instead of opening the child-page editor; the following global Add to assertion passed against unrelated page text, so the untargeted type step never entered the child title."
When momentic tests are run via the CLI, the results are stored in a "run group". The data for this run group is stored in a single directory within the momentic project. By default, the directory is called test-results, but can be changed in momentic project settings or on a single run of a run group. The run group results folder has the following structure:
test-results/
├── metadata.json data about the run group, including git metadata and timing info.
└── runs/ On zip for each test run in the run group.
├── <runId_1>.zip a zipped run directory containing data about this specific test run. Follows the structure described below.
└── <runId_2>.zip
When unzipped, run directories have the following structure:
<runId>/
├── metadata.json run-level metadata.
└── attempts/<n>/ one folder per attempt (1-based n).
├── metadata.json attempt outcome and step results.
├── console.json optional browser console output.
└── assets/
├── <snapshotId>.jpeg before/after screenshot for each step (see attempt metadata.json for snapshot ID).
├── <snapshotId>.html before/after DOM snapshot for each step (see attempt metadata.json for snapshot ID).
├── har-pages.log HAR pages (ndjson).
├── har-entries.log HAR network entries (ndjson).
├── resource-usage.ndjson CPU/memory samples taken during the attempt.
├── <videoName> video recording (when video recording is enabled).
└── browser-crash.zip browser crash dump (only present on crash).
When getting run results via the momentic MCP, tools such as momentic_get_run will return links to the MCP working directory (default .momentic-mcp). This directory will contain unzipped run result folders, following the structure above, named run-result-<runId>.
Certain step types that interact with elements have a "target" property, or locator, that specifies which element the step should interact with.
Locators identify elements by sending the page state html/xml to an llm as well as a screenshot. The llm identifies which element on the page the user is referring to. Momentic will attempt to "cache" the answer from the llm so that future runs don't require AI calls. On future runs, the page state is checked against the cached element to determine whether the element is still usable, or the page has changed enough such that another AI call is required.
A locator cache can bust for a variety of reasons:
You can find the cacheBustReason on the trace property in the results for a given step, but only when you explicitly request includeTrace=true. The cache property is also listed on the results, showing the full cache saved for that element.
Sometimes the element that was cached is not the element that the user intended to target. This can cause failures or unexpected behaviors in tests. In these cases, it helps to verify exactly why the wrong cache was saved in the first place. Only request includeTrace=true for these cache-debugging cases or when you suspect incorrect Momentic execution data. Use the runId property of the targetUpdateLoggerTags on the incorrect cache to get the details of the original run, calling momentic_get_run with this runId. This will return the run where the cache target was updated.
Cached modules skip executing their steps when the module cache key and resolved inputs are unchanged, and reuse the cached return value from the module's last step.
Authentication modules can also save and restore browser auth state from the module cache, including cookies, localStorage, and IndexedDB. They may use a page-content check after restoring auth state to decide whether the cache is still valid.
A file upload step prepares one file for the next native file picker, so it must run before the action that opens the picker.
Sources can be remote URLs, file:// references to earlier downloads, CLI-local paths, or uploaded user files. The step can also override the presented filename, and Momentic wires the prepared file into the browser's file chooser handling.
Past runs are comparison evidence, not a substitute for reconstructing the current run. Use them when the current run does not answer:
Use step results and screenshots on past runs to answer these questions. Do NOT rely only on summaries from momentic_get_run or momentic_list_runs to understand what happened in a test run. Look at the specific run details, including step results and screenshots, before citing a past run as evidence.
When looking at past runs, use the following workflow:
momentic_list_runs tool to identify the runs you want more detail on. Always pass gitBranchName when it exists on the run in question. Omit it when you need runs from other branches.momentic_get_run for that specific run to get the run details.momentic_get_step_result for the same step/container or closest equivalent you are comparing, especially for screenshots.When past runs are irrelevant because the current run already proves the root cause, say that briefly instead of forcing historical evidence.
When momentic_list_runs shows a passing run with attempts > 1, treat it as a partial failure worth investigating, not a clean passing run. Use the attemptNumber parameter to retrieve earlier failed attempt results for that run to understand what was going wrong before the retry succeeded.
get_test_steps_for_run to help you determine if the test itself changed between runs, although note that this tool returns a summary of each test step. If you suspect that specific details on certain steps have changed between test runs, full step details are included in the response from momentic_get_step_result; only request includeTrace=true when those fields and screenshots still are not enough.targetUpdateLoggerTags.runId.INFRA. First rule out missing data, wrong page state, changed app flow, bad locator/assertion, and setup failure.momentic_get_test_steps_for_run to determine what the test is intending to verify.beforeSteps or beforeResults) or teardown (afterSteps or afterResults) are pretty much always considered unrelated.INFRA failure is still INFRA regardless of whether it is in setup or the main section.Along with the category, determine one recoverability value:
RECOVERABLE — The failure can be automatically fixed by updating the test itself so that future runs pass.
ONE_TIME_RECOVERABLE — The failure can be recovered for this specific run without persisting a test change.
NON_RECOVERABLE — The failure cannot be automatically addressed and requires manual intervention.
module create-subpage-under-parent-page, the last invocation of module <name>, substep 4 (0-indexed), the failed setup assertion, etc. Tool calls still require exact IDs, but final reasoning should be readable.https://app.momentic.ai/runs/<runId>. Do not shorten UUIDs inside those URLs.Reasoning: <a few sentences tied to the earliest divergence, screenshots/traces, past runs if used, and test intent>
Category: <one id from the list>
Recoverable: <RECOVERABLE | ONE_TIME_RECOVERABLE | NON_RECOVERABLE>
Confidence: <high | medium | low>
Confidence levels:
high — direct evidence, such as a clear screenshot of a label change or crashmedium — strong inference from multiple signals but no single conclusive screenshot or data pointlow — ambiguous evidence; the classification required significant inference or the root cause is unclearUse these strings verbatim:
NO_FAILURE — The run had no failures; all attempts passed.APPLICATION_CHANGE — The test is out of date because the application's flow or UI has changed; updating the test to match the new behavior would permanently fix the failure.BUG — Something clearly went wrong in the application that shouldn't have, such as an error message appearing or expected content failing to render.TEST_AUTHORSHIP — The test can be permanently updated to prevent the failure while still validating its original intent, and you can recommend a specific authorship change such as adding or modifying a step, rewriting a vague assertion, or making a locator description more specific. If you cannot name a concrete change, choose a different category. Timeouts, slow page loads, and any failure whose recommended fix is to "wait longer" or to increase a timeout are NOT authorship issues — those are INFRA, even when the test could technically be edited to wait longer.
TEST_SETUP — Missing test data or files necessary to run the test, where the fix requires user action outside of the test itself.
INFRA — The failure was unrelated to the application or application code and was caused by an infrastructure outage, long load times, or some other issue due to outside factors.
MOMENTIC_ISSUE — Some issue occurred with the execution of the test or Momentic data was incorrect (e.g. cache is wrong, global locator redirect did something weird, AI hallucinations).
OTHER — The failure doesn't fit any of the other categories.npx claudepluginhub momentic-ai/skillsDebugs and fixes flaky Playwright E2E tests using LLM reports from GitHub Actions and Datadog. Use for investigating intermittent failures, triaging flakiness, or stabilizing tests.
Queries Playwright Reports Server for failing tests, flakiness, run history, failure clusters, and LLM-written analyses. Useful for triaging test failures and aggregate questions.
Creates, runs, and maintains Momentic E2E tests and modules (YAML files) using AI agents for browser automation. Supports caching, env context, and config overrides.