[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77TQFA7SXSVG8K5YCHVSJQX":3,"skill-same:01M77TQFA7SXSVG8K5YCHVSJQX":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M77TQFA7SXSVG8K5YCHVSJQX","momentic-maintain",null,"Diagnose, classify, triage, and repair failing Momentic tests with MCP run tools, the Momentic CLI, and manual run artifacts. Use when a developer asks what happened on a branch, DevX or on-call asks why main is red, or the user wants to inspect classifications, de-flake quarantined or recovered tests, reduce retries, re-classify runs, run AI triage, or repair failures.","Reihantt6\u002Fsns-myagent","Reihantt6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F219822095?v=4","01M77KK94PV8B7C2D9XWXNS8DJ","Mohamad Reihan tegar prasetya","01M77KK958QFMTHYXGXFV7KZ79",2,"MIT","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fmomentic-maintain\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\ndescription: \"Diagnose, classify, triage, and repair failing Momentic tests with MCP run tools, the Momentic CLI, and manual run artifacts. Use when a developer asks what happened on a branch, DevX or on-call asks why main is red, or the user wants to inspect classifications, de-flake quarantined or recovered tests, reduce retries, re-classify runs, run AI triage, or repair failures.\"\n---\n# Maintain Momentic tests\n\nFind the earliest point where a run entered a bad state, classify the cause from\nevidence, and repair the test when a durable test change is appropriate. Use MCP\nfor targeted investigation, `momentic ai classify` for a fresh classifier\nverdict, and `momentic ai triage` for automated repair and verification.\n\nDo not weaken a test to hide an application bug, missing fixture, invalid\ncredentials, outage, or Momentic defect. Report those causes instead of changing\nthe test to pass.\n\n## Common workflows\n\n- **What happened on my branch?** Call `momentic_list_runs` with the exact `gitBranchName` and bounded `start`\u002F`end`. Start without a status filter, then narrow to `FAILED`, `CANCELLED`, or `recovered=true`. Open exact candidates and compare with main only for a concrete cross-branch question.\n- **Why is main red?** List `FAILED` runs on the actual main branch over the incident window and paginate through every page needed for the claim. Narrow with `failureCategory` when investigating a known category, but group symptoms only after inspecting representative runs and step evidence. Read each exact run's saved classification before optionally re-classifying it.\n- **De-flake and reduce recovery latency.** Use `momentic_quarantine_list` for quarantined tests, `recovered=true` for successful runs that needed recovery, and `minAttempts` for retry-heavy runs (`2` means at least one retry; `3` means at least two). Inspect earlier attempts, prioritize repeated same-intent failures, fix the earliest unstable postcondition, and measure again.\n\nKnow the discovery limits:\n\n- `momentic_list_runs` filters by test, branch, status, quarantine, recovery, effective failure category, minimum total attempts, and time. `failureCategory` uses a manual classification when present, otherwise the automated classification.\n- `momentic_quarantine_list` filters by quarantine date and returns each active quarantine's latest retained failed CLI run. It does not filter by branch or classification.\n- A category or retry threshold can still span multiple pages. Paginate through all `pageCount` pages needed before calling an inventory exhaustive.\n\n## Maintenance workflow\n\n1. Start from the exact run, branch, run group, commit, or local results target.\n2. Inspect existing automated\u002Fmanual classifications and heal state first.\n3. Reconstruct exact failures with MCP and only the necessary run history.\n4. Explain the earliest divergence and broken postcondition before editing.\n5. Classify afresh only when useful; persist a verdict only when requested.\n6. Prepare the exact app and fixtures, then triage when repair is appropriate.\n7. Review the diff and replay evidence; re-run inconclusive repairs.\n8. Report diagnosis, repair, verification, delivery, and remaining blockers.\n\n## Inspect the existing classification\n\nFetch raw run metadata before MCP investigation when an API key is available:\n\n```bash\nRUN_ID=\"\u003Crun-id>\"\nMOMENTIC_SERVER_URL=\"${MOMENTIC_SERVER:-https:\u002F\u002Fapi.momentic.ai}\"\nRUN_INSPECTION_DIR=\"$(mktemp -d)\"\n\ncurl --fail --silent --show-error \\\n  -H \"Authorization: Bearer ${MOMENTIC_API_KEY:?Set MOMENTIC_API_KEY}\" \\\n  \"${MOMENTIC_SERVER_URL}\u002Fv1\u002Fruns\u002F${RUN_ID}\u002Fmetadata\" \\\n  -o \"${RUN_INSPECTION_DIR}\u002Fmetadata.json\"\n\njq '{\n  runId: .id,\n  status,\n  failureReason,\n  classification: .failureDetails.classification,\n  manualClassification: .failureDetails.manualClassification,\n  healStatus,\n  healDetails\n}' \"${RUN_INSPECTION_DIR}\u002Fmetadata.json\"\n```\n\nDo not treat a missing field as proof that no human reviewed the failure until\nthe metadata request succeeds for the exact run and organization. Do not echo,\nlog, or commit the API key. Treat downloaded metadata and signed artifact URLs\nas sensitive run data.\n\n`momentic_get_run` intentionally removes prior classification and heal fields\nfrom the evidence it returns so a fresh investigation is not anchored by an old\nverdict. Use the metadata endpoint or dashboard for the existing verdict, then\nuse MCP for the underlying evidence.\n\n## Helpful MCP tools\n\n`momentic_get_run` - Return run metadata and a summary of the full result tree.\nUse it to identify the attempt, failed section, failing step, and nested parent\nchain. If the current run is already loaded, call it again only for a different\nattempt or missing data.\n\n`momentic_list_runs` - List recent runs for the test. Always pass\n`gitBranchName` when it exists on the target run so comparisons are more likely\nto use the same test version. Omit it only when cross-branch history answers a\nspecific question. Pass `recovered=true` to inspect recovered runs.\nPass `failureCategory` to select effective manual\u002Fautomated classifications and\n`minAttempts: 2` or higher to find retried runs.\n\n`momentic_quarantine_list` - List active local test quarantines and each test's\nlatest retained failed CLI run. Use a bounded quarantine-date range.\n\n`momentic_get_step_result` - Return command details, before\u002Fafter screenshots,\nand optionally the full trace for one step. Pass `parentStepIdChain` for nested\nsteps. Request `includeTrace=true` only when screenshots and normal fields do\nnot answer the question.\n\n`momentic_get_test_steps_for_run` - Return the simplified test definition\nrecorded on a run. Use it when test intent remains unclear or when comparing\nwhether the authored test changed between runs.\n\n`momentic_submit_result_classification` - Persist a manual MCP classification.\nCall it only after the investigation is complete and only when the user asked to\nrecord the verdict. Do not call it in addition to `ai classify --save` for the\nsame conclusion.\n\n## Investigation workflow\n\nStart with the current run before relying on history.\n\n1. Call `momentic_get_run` and identify the failing attempt, section (`beforeSteps`, main steps, or `afterSteps`), failing step, and any `parentStepIdChain`.\n2. Pull the failing step result with screenshots and trace. If the step is nested, also pull the nearest parent container or module result.\n3. Decide whether the failing step's before-screenshot is the correct baseline for that action. If it is already wrong, walk backward through the current run until you find the step\u002Fcontainer that produced that bad state.\n4. For repeated modules or repeated workflows, compare invocations inside the same current run before comparing older runs. The later failure is often caused by an earlier invocation that succeeded, recovered, or left an invalid postcondition.\n5. Treat successful containers with failed or recovered child steps as partial failures until you inspect the container's final after-screenshot and URL.\n6. Use past runs only for specific comparison questions once the current-run behavior is understood.\n\nBefore classifying, be able to answer:\n\n- What is the test's intended behavior?\n- What is the earliest divergent step\u002Fcontainer?\n- What did that step intend to do?\n- Which element\u002Fstate did it actually interact with or observe?\n- What changed in the screenshot, URL, DOM, trace, or recovery log after the step?\n- Why is the later failure a consequence of that earlier divergence?\n\nAvoid 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.\"\n\n## Evidence standards\n\n- Screenshots are the default truth source for page state. Use trace fields and DOM\u002FHTML to explain why the screenshot changed or did not change.\n- Verify every causal claim. Do not say an overlay, side peek, modal, or menu was present unless the relevant before\u002Fafter screenshot, URL, or DOM proves it.\n- Separate \"the target is missing now\" from \"the browser is in the state where that target should exist.\" A missing target is often a symptom of an earlier failed action.\n- For click\u002Ftype\u002Faction steps, record the intended action, actual interacted element when available, before\u002Fafter URL, and whether the expected UI state appeared.\n- For assertions, check whether the assertion is scoped enough to prove the intended state. A broad page-content assertion can pass for unrelated text.\n- For recovery, inspect both the failed child step and the recovered container final state. Recovery can pass a retried assertion while leaving state that later steps did not expect.\n\n## Run AI classification\n\n`momentic ai classify` runs Momentic's result-classification agent over failed\nruns. It reads the run artifacts, uses relevant run history and repository\ncontext, and returns a category, recoverability, confidence, reasoning, and\ncitations. It explains the failure; it does not edit the test.\n\nUse one selector per command:\n\n```bash\nnpx momentic ai classify --run-id \"$RUN_ID\" --output-format json\nnpx momentic ai classify --run-group-id \"\u003Crun-group-id>\"\nnpx momentic ai classify --git-commit \"\u003Ccommit-sha>\"\n```\n\n- Omit `--save` for a diagnostic re-classification. Add `--save` only when the\n  new verdict should replace the saved classification on the local archive or\n  cloud run.\n- Use `--no-cache` when the existing cached classifier result is suspected to\n  be stale and the user explicitly needs a fresh analysis.\n- Use `--skip-classified` when resuming a batch without revisiting runs that\n  already have saved classifications.\n- Use `--output-format json` for automation and multi-run bookkeeping.\n- Classify multiple related run IDs together when useful, but keep each result\n  mapped to its exact run.\n\nFor one run in a real terminal, keep the classifier conversation open:\n\n```bash\nnpx momentic ai classify --run-id \"$RUN_ID\" --interactive\n```\n\nUse the chat to ask why it chose the category, what evidence it relied on, how\nthe current run differs from a prior run, or what a durable fix would require.\nInteractive classification is single-run only, requires stdin to be a TTY, and\ncannot be combined with JSON output.\n\n## Prepare triage\n\nTreat application readiness as a hard precondition. Triage replays the test in\na real browser; it cannot repair a test against an unavailable app, missing\nfixture, wrong environment, unseeded database, invalid account, or cold compiler.\n\nBefore triage:\n\n1. Read `momentic.config.yaml`, the target test and its setup modules, repository\n   scripts, and the CI workflow that normally runs the test. Use the same URL,\n   environment, credentials, headers, files, services, and data fixtures.\n2. Confirm `MOMENTIC_API_KEY`, project configuration, dependencies, and the\n   requested browser are available.\n3. Inspect `git status` and preserve unrelated work. Decide the repair delivery\n   before running the command; do not let an unknown dashboard default create a\n   pull request or commit unexpectedly.\n4. Build the application before starting triage. Prefer a production or\n   otherwise precompiled build and a stable server over Next.js, webpack, Vite,\n   or another development server that compiles routes incrementally.\n5. Start every required service and wait for the actual readiness URL. Warm any\n   unavoidable dev-only compilation path before triage and verify that the\n   relevant route no longer shows a compile\u002Floading screen or incurs a long\n   first request.\n6. Run a focused smoke or the failing test once when necessary to prove the app,\n   fixture, authentication, and browser are ready. Fix setup failures before\n   blaming triage.\n7. Start with `--parallel 1`. Raise it only when the machine has enough CPU and\n   memory for one browser and application workload per worker.\n\nIf the repository exposes a stable server command, either start it separately\nor let triage own it with `--start` and `--wait-on`:\n\n```bash\n# Build first; use the repository's actual commands and readiness URL.\npnpm build\nnpx momentic ai triage --run-id \"$RUN_ID\" \\\n  --start \"pnpm start\" \\\n  --wait-on \"http:\u002F\u002Flocalhost:3000\u002Fhealth\" \\\n  --parallel 1 \\\n  --yes \\\n  --on-heal-success nothing\n```\n\nDo not copy these example commands blindly. Discover the real build, start, and\nreadiness contract from the repository and CI configuration.\n\n## Run AI triage\n\n`momentic ai triage` groups failures by shared root cause, decides which ones\nare repairable, edits the relevant tests, replays them in a browser, and accepts\nonly repairs that satisfy its verification. It can leave changes locally,\nproduce a patch, commit, or open a pull request. It cannot fix an application\nbug, external outage, or missing fixture by changing a test.\n\nRun classification first when the user wants an explicit diagnosis, then pass\nthe same target to triage:\n\n```bash\nnpx momentic ai classify --run-id \"$RUN_ID\" --output-format json\nnpx momentic ai triage --run-id \"$RUN_ID\" \\\n  --parallel 1 \\\n  --yes \\\n  --on-heal-success nothing\n```\n\nFor a local run group, pass the results directory instead:\n\n```bash\nnpx momentic ai triage .\u002Ftest-results \\\n  --parallel 1 \\\n  --yes \\\n  --on-heal-success nothing\n```\n\nBest practices:\n\n- Pass multiple related run IDs after one `--run-id` so the bucketing agent can\n  group shared causes. Do not launch one competing triage command per run.\n- Set `--on-heal-success` explicitly: use `nothing` for local review, `patch`\n  for a portable diff, or a pull-request\u002Fcommit behavior only when the user\n  asked for that delivery.\n- Pass `--yes` only after the environment and delivery choice are confirmed so\n  dependency prompts do not stall an autonomous run.\n- Use `--dry-run --no-save` to inspect bucketing without editing tests or saving\n  triage metadata. Dry-run is not a repair attempt.\n- Use `--regenerate-heal` only when a cached heal is stale or failed and a new\n  repair should be generated from scratch.\n- Keep the command attached and monitor reasoning, tool calls, browser progress,\n  CPU, and memory. Several minutes without browser progress can indicate app\n  startup, cold compilation, resource pressure, or a missing fixture.\n- Inspect every resulting diff. Do not accept deleted assertions, broadened\n  checks, arbitrary sleeps, or longer timeouts that merely conceal the cause.\n- Do not remove quarantine solely because triage produced a patch. Re-run the\n  repaired test first.\n\nUse interactive triage when the user wants to question the repair agent:\n\n```bash\nnpx momentic ai triage --run-id \"$RUN_ID\" \\\n  --parallel 1 \\\n  --yes \\\n  --on-heal-success nothing \\\n  --interactive\n```\n\nInteractive triage requires a TTY, cannot be combined with `--json`, and is\navailable only when the command runs the bucketing agent. Use it to ask why a\nfix was accepted or rejected, what setup it observed, and what evidence remains\nunresolved.\n\n## Download run artifacts manually\n\nPrefer MCP for ordinary inspection because `momentic_get_run` downloads and\nextracts cloud attempts automatically. Use the API when MCP output is missing,\nwhen raw files must be grepped, or when independently verifying the agent.\n\nThe export endpoint returns run metadata plus one short-lived signed ZIP URL per\nattempt; it does not return one combined run ZIP. Download and extract them\nwithout printing the URLs:\n\n```bash\nRUN_ID=\"\u003Crun-id>\"\nMOMENTIC_SERVER_URL=\"${MOMENTIC_SERVER:-https:\u002F\u002Fapi.momentic.ai}\"\nRUN_INSPECTION_DIR=\"$(mktemp -d)\"\n\ncurl --fail --silent --show-error \\\n  -H \"Authorization: Bearer ${MOMENTIC_API_KEY:?Set MOMENTIC_API_KEY}\" \\\n  \"${MOMENTIC_SERVER_URL}\u002Fv1\u002Fruns\u002F${RUN_ID}\u002Fexport\" \\\n  -o \"${RUN_INSPECTION_DIR}\u002Fexport.json\"\n\njq '.run' \"${RUN_INSPECTION_DIR}\u002Fexport.json\" \\\n  > \"${RUN_INSPECTION_DIR}\u002Fmetadata.json\"\n\njq -r '.attemptZipUrls | to_entries[] | select(.value != null) |\n  [(.key + 1), .value] | @tsv' \"${RUN_INSPECTION_DIR}\u002Fexport.json\" |\n  while IFS=$'\\t' read -r attempt url; do\n    mkdir -p \"${RUN_INSPECTION_DIR}\u002Fattempts\u002F${attempt}\"\n    curl --fail --silent --show-error \"$url\" \\\n      -o \"${RUN_INSPECTION_DIR}\u002Fattempt-${attempt}.zip\"\n    unzip -q \"${RUN_INSPECTION_DIR}\u002Fattempt-${attempt}.zip\" \\\n      -d \"${RUN_INSPECTION_DIR}\u002Fattempts\u002F${attempt}\"\n  done\n```\n\nInspect `metadata.json`, each attempt's `metadata.json`, screenshots, DOM\nsnapshots, console logs, HAR logs, video, resource usage, and crash archives.\nKeep attempt numbers intact. Do not commit the export response, run artifacts,\nsigned URLs, credentials, or customer data. Remove the temporary directory when\nthe investigation is complete.\n\n## Background\n\n### Test run result structure\n\nWhen 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:\n\n```\ntest-results\u002F\n├── metadata.json         data about the run group, including git metadata and timing info.\n└── runs\u002F                 On zip for each test run in the run group.\n    ├── \u003CrunId_1>.zip         a zipped run directory containing data about this specific test run.  Follows the structure described below.\n    └── \u003CrunId_2>.zip\n```\n\nWhen unzipped, run directories have the following structure:\n\n```\n\u003CrunId>\u002F\n├── metadata.json           run-level metadata.\n└── attempts\u002F\u003Cn>\u002F           one folder per attempt (1-based n).\n    ├── metadata.json       attempt outcome and step results.\n    ├── console.json        optional browser console output.\n    └── assets\u002F\n        ├── \u003CsnapshotId>.jpeg     before\u002Fafter screenshot for each step (see attempt metadata.json for snapshot ID).\n        ├── \u003CsnapshotId>.html     before\u002Fafter DOM snapshot for each step (see attempt metadata.json for snapshot ID).\n        ├── har-pages.log         HAR pages (ndjson).\n        ├── har-entries.log       HAR network entries (ndjson).\n        ├── resource-usage.ndjson CPU\u002Fmemory samples taken during the attempt.\n        ├── \u003CvideoName>           video recording (when video recording is enabled).\n        └── browser-crash.zip     browser crash dump (only present on crash).\n```\n\nWhen 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-\u003CrunId>`.\n\n### Element locators\n\nCertain step types that interact with elements have a \"target\" property, or **locator**, that specifies which element the step should interact with.\n\n#### Locator caches\n\nLocators identify elements by sending the page state html\u002Fxml 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.\n\nA locator cache can bust for a variety of reasons:\n\n- the element description has changed, in which case we'll always bust the cache\n- the cached element could not be located in the current page state\n- the cached element was located in the page state, but fails certain checks specified on the cache entry, such as requiring a certain position, shape, or content.\n\nYou 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.\n\n#### Identifying bad caches\n\nSometimes 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.\n\n### Module caching\n\nCached 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.\n\nAuthentication 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.\n\n### File uploads\n\nA file upload step prepares one file for the next native file picker, so it must run before the action that opens the picker.\n\nSources can be remote URLs, `file:\u002F\u002F` 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.\n\n## Using past runs\n\nPast runs are comparison evidence, not a substitute for reconstructing the current run. Use them when the current run does not answer:\n\n- When did this test start failing?\n- What differed vs the last passing run?\n- Did the same action behave differently on an earlier run?\n- Is this a test weakness, an application change, a real application bug, or a temporary slowdown?\n\nUse 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.\n\nWhen looking at past runs, use the following workflow:\n\n1. Call the `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.\n2. Call `momentic_get_run` for that specific run to get the run details.\n3. Call `momentic_get_step_result` for the same step\u002Fcontainer or closest equivalent you are comparing, especially for screenshots.\n\nWhen past runs are irrelevant because the current run already proves the root cause, say that briefly instead of forcing historical evidence.\n\n### Multi-attempt runs\n\nWhen `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.\n\n### Flakiness and intermittent failures\n\n- Call a test flaky only when the same app and test behavior fails intermittently.\n  One failure is insufficient; rule out application and test changes using run\n  evidence before attributing the pattern to flakiness.\n\n### Test temporality\n\n- Any past results may not necessarily match today’s test file. The test may have changed, meaning the result was on a different version of the test.\n- You can call `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.\n\n## Common failure modes to watch for\n\n- A setup module appears to pass but leaves the wrong page, overlay, filter, search, selected row, or side peek open. Classify from the step\u002Fcontainer that left the bad postcondition, not only from the next step that failed.\n- A click reports success and targets the intended element, but the application does not transition to the intended state. Verify the post-state; do not assume the click worked because the locator was correct.\n- A weak global assertion such as \"page contains X\" passes because unrelated text on the page matches. The next step may then type or click in the wrong context.\n- A type step without a specific target can silently type nowhere useful if the preceding action failed to focus the intended field.\n- A locator or cache can be technically valid but semantically wrong. Check the interacted element and, for bad caches, inspect the original cache-update run from `targetUpdateLoggerTags.runId`.\n- A recovered step can hide the first failure. Inspect failed child steps inside recovered modules and compare the recovered final state to the next step's expected baseline.\n- A timeout is not automatically `INFRA`. First rule out missing data, wrong page state, changed app flow, bad locator\u002Fassertion, and setup failure.\n\n## Identifying related vs unrelated issues\n\n- Determine intent from the test name, description, and simplified steps. Treat\n  failures outside that intent, including most setup\u002Fteardown failures, as\n  unrelated. Relatedness qualifies bugs and changes; it does not change an\n  `INFRA` failure into another category.\n\n## Bug vs change\n\n- Bug: something very clearly went wrong when it should not have, such as an error message appearing. It is obvious just by looking at a single step or two that this is a bug.\n- Change: a clear change in the application behavior that you can prove through screenshots.\n\n## Recoverability\n\nAlong with the category, determine one recoverability value:\n\n- `RECOVERABLE` — The failure can be automatically fixed by updating the test itself so that future runs pass.\n  - Examples: an application change that requires a test update; vague locators or assertions that can be rewritten to pass stably.\n- `ONE_TIME_RECOVERABLE` — The failure can be recovered for this specific run without persisting a test change.\n  - Examples: a random modal that can be dismissed without affecting test purpose; a temporary delay where waiting or retrying would likely succeed.\n- `NON_RECOVERABLE` — The failure cannot be automatically addressed and requires manual intervention.\n  - Examples: missing credentials; missing local files required for upload; outages likely caused by third-party systems where test steps cannot fix the issue.\n\n## Formal classification output\n\n- Exactly one category id — no new labels, no multi-label.\n- Ground your decision in data. Be sure that you've fully investigated the run before assigning the category.\n- Prefer human-readable references over UUIDs when the step\u002Fmodule can be identified colloquially: `module create-subpage-under-parent-page`, `the last invocation of module \u003Cname>`, `substep 4 (0-indexed)`, `the failed setup assertion`, etc. Tool calls still require exact IDs, but final reasoning should be readable.\n- When referencing past runs in final output, use clickable Momentic URLs rather than bare UUIDs: `https:\u002F\u002Fapp.momentic.ai\u002Fruns\u002F\u003CrunId>`. Do not shorten UUIDs inside those URLs.\n- The reasoning must include the earliest divergent step\u002Fcontainer and the broken postcondition it produced, not just the final failing step.\n\n```text\nReasoning: \u003Ca few sentences tied to the earliest divergence, screenshots\u002Ftraces, past runs if used, and test intent>\nCategory: \u003Cone id from the list>\nRecoverable: \u003CRECOVERABLE | ONE_TIME_RECOVERABLE | NON_RECOVERABLE>\nConfidence: \u003Chigh | medium | low>\n```\n\nConfidence levels:\n\n- `high` — direct evidence, such as a clear screenshot of a label change or crash\n- `medium` — strong inference from multiple signals but no single conclusive screenshot or data point\n- `low` — ambiguous evidence; the classification required significant inference or the root cause is unclear\n\n## Category ids\n\nUse these strings verbatim:\n\n- `NO_FAILURE` — The run had no failures; all attempts passed.\n- `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.\n- `BUG` — Something clearly went wrong in the application that shouldn't have, such as an error message appearing or expected content failing to render.\n- `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.\n  - Examples: race conditions that can be fixed by adding or modifying steps **other than** waits\u002Ftimeouts (e.g. replacing a \"type with pressEnter\" step with an explicit \"select from list\" step so the test no longer races the application); vague assertions or locator descriptions that can be rewritten to be more specific.\n- `TEST_SETUP` — Missing test data or files necessary to run the test, where the fix requires user action outside of the test itself.\n  - Examples: missing file for a file upload step; missing or incorrect credentials needed by the test.\n- `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.\n  - Examples: browser crash; high resource usage; rate limiting; a step or assertion that timed out waiting for the page or application to reach a slow-but-eventual state.\n- `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).\n  - Examples: unexpected behavior when viewing the run trace; the AI clearly misread or hallucinated data that is unambiguous in the screenshot, and no reasonable test alternative exists to avoid the AI step.\n- `OTHER` — The failure doesn't fit any of the other categories.\n","# Maintain Momentic tests\n\nFind the earliest point where a run entered a bad state, classify the cause from\nevidence, and repair the test when a durable test change is appropriate. Use MCP\nfor targeted investigation, `momentic ai classify` for a fresh classifier\nverdict, and `momentic ai triage` for automated repair and verification.\n\nDo not weaken a test to hide an application bug, missing fixture, invalid\ncredentials, outage, or Momentic defect. Report those causes instead of changing\nthe test to pass.\n\n## Common workflows\n\n- **What happened on my branch?** Call `momentic_list_runs` with the exact `gitBranchName` and bounded `start`\u002F`end`. Start without a status filter, then narrow to `FAILED`, `CANCELLED`, or `recovered=true`. Open exact candidates and compare with main only for a concrete cross-branch question.\n- **Why is main red?** List `FAILED` runs on the actual main branch over the incident window and paginate through every page needed for the claim. Narrow with `failureCategory` when investigating a known category, but group symptoms only after inspecting representative runs and step evidence. Read each exact run's saved classification before optionally re-classifying it.\n- **De-flake and reduce recovery latency.** Use `momentic_quarantine_list` for quarantined tests, `recovered=true` for successful runs that needed recovery, and `minAttempts` for retry-heavy runs (`2` means at least one retry; `3` means at least two). Inspect earlier attempts, prioritize repeated same-intent failures, fix the earliest unstable postcondition, and measure again.\n\nKnow the discovery limits:\n\n- `momentic_list_runs` filters by test, branch, status, quarantine, recovery, effective failure category, minimum total attempts, and time. `failureCategory` uses a manual classification when present, otherwise the automated classification.\n- `momentic_quarantine_list` filters by quarantine date and returns each active quarantine's latest retained failed CLI run. It does not filter by branch or classification.\n- A category or retry threshold can still span multiple pages. Paginate through all `pageCount` pages needed before calling an inventory exhaustive.\n\n## Maintenance workflow\n\n1. Start from the exact run, branch, run group, commit, or local results target.\n2. Inspect existing automated\u002Fmanual classifications and heal state first.\n3. Reconstruct exact failures with MCP and only the necessary run history.\n4. Explain the earliest divergence and broken postcondition before editing.\n5. Classify afresh only when useful; persist a verdict only when requested.\n6. Prepare the exact app and fixtures, then triage when repair is appropriate.\n7. Review the diff and replay evidence; re-run inconclusive repairs.\n8. Report diagnosis, repair, verification, delivery, and remaining blockers.\n\n## Inspect the existing classification\n\nFetch raw run metadata before MCP investigation when an API key is available:\n\n```bash\nRUN_ID=\"\u003Crun-id>\"\nMOMENTIC_SERVER_URL=\"${MOMENTIC_SERVER:-https:\u002F\u002Fapi.momentic.ai}\"\nRUN_INSPECTION_DIR=\"$(mktemp -d)\"\n\ncurl --fail --silent --show-error \\\n  -H \"Authorization: Bearer ${MOMENTIC_API_KEY:?Set MOMENTIC_API_KEY}\" \\\n  \"${MOMENTIC_SERVER_URL}\u002Fv1\u002Fruns\u002F${RUN_ID}\u002Fmetadata\" \\\n  -o \"${RUN_INSPECTION_DIR}\u002Fmetadata.json\"\n\njq '{\n  runId: .id,\n  status,\n  failureReason,\n  classification: .failureDetails.classification,\n  manualClassification: .failureDetails.manualClassification,\n  healStatus,\n  healDetails\n}' \"${RUN_INSPECTION_DIR}\u002Fmetadata.json\"\n```\n\nDo not treat a missing field as proof that no human reviewed the failure until\nthe metadata request succeeds for the exact run and organization. Do not echo,\nlog, or commit the API key. Treat downloaded metadata and signed artifact URLs\nas sensitive run data.\n\n`momentic_get_run` intentionally removes prior classification and heal fields\nfrom the evidence it returns so a fresh investigation is not anchored by an old\nverdict. Use the metadata endpoint or dashboard for the existing verdict, then\nuse MCP for the underlying evidence.\n\n## Helpful MCP tools\n\n`momentic_get_run` - Return run metadata and a summary of the full result tree.\nUse it to identify the attempt, failed section, failing step, and nested parent\nchain. If the current run is already loaded, call it again only for a different\nattempt or missing data.\n\n`momentic_list_runs` - List recent runs for the test. Always pass\n`gitBranchName` when it exists on the target run so comparisons are more likely\nto use the same test version. Omit it only when cross-branch history answers a\nspecific question. Pass `recovered=true` to inspect recovered runs.\nPass `failureCategory` to select effective manual\u002Fautomated classifications and\n`minAttempts: 2` or higher to find retried runs.\n\n`momentic_quarantine_list` - List active local test quarantines and each test's\nlatest retained failed CLI run. Use a bounded quarantine-date range.\n\n`momentic_get_step_result` - Return command details, before\u002Fafter screenshots,\nand optionally the full trace for one step. Pass `parentStepIdChain` for nested\nsteps. Request `includeTrace=true` only when screenshots and normal fields do\nnot answer the question.\n\n`momentic_get_test_steps_for_run` - Return the simplified test definition\nrecorded on a run. Use it when test intent remains unclear or when comparing\nwhether the authored test changed between runs.\n\n`momentic_submit_result_classification` - Persist a manual MCP classification.\nCall it only after the investigation is complete and only when the user asked to\nrecord the verdict. Do not call it in addition to `ai classify --save` for the\nsame conclusion.\n\n## Investigation workflow\n\nStart with the current run before relying on history.\n\n1. Call `momentic_get_run` and identify the failing attempt, section (`beforeSteps`, main steps, or `afterSteps`), failing step, and any `parentStepIdChain`.\n2. Pull the failing step result with screenshots and trace. If the step is nested, also pull the nearest parent container or module result.\n3. Decide whether the failing step's before-screenshot is the correct baseline for that action. If it is already wrong, walk backward through the current run until you find the step\u002Fcontainer that produced that bad state.\n4. For repeated modules or repeated workflows, compare invocations inside the same current run before comparing older runs. The later failure is often caused by an earlier invocation that succeeded, recovered, or left an invalid postcondition.\n5. Treat successful containers with failed or recovered child steps as partial failures until you inspect the container's final after-screenshot and URL.\n6. Use past runs only for specific comparison questions once the current-run behavior is understood.\n\nBefore classifying, be able to answer:\n\n- What is the test's intended behavior?\n- What is the earliest divergent step\u002Fcontainer?\n- What did that step intend to do?\n- Which element\u002Fstate did it actually interact with or observe?\n- What changed in the screenshot, URL, DOM, trace, or recovery log after the step?\n- Why is the later failure a consequence of that earlier divergence?\n\nAvoid 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.\"\n\n## Evidence standards\n\n- Screenshots are the default truth source for page state. Use trace fields and DOM\u002FHTML to explain why the screenshot changed or did not change.\n- Verify every causal claim. Do not say an overlay, side peek, modal, or menu was present unless the relevant before\u002Fafter screenshot, URL, or DOM proves it.\n- Separate \"the target is missing now\" from \"the browser is in the state where that target should exist.\" A missing target is often a symptom of an earlier failed action.\n- For click\u002Ftype\u002Faction steps, record the intended action, actual interacted element when available, before\u002Fafter URL, and whether the expected UI state appeared.\n- For assertions, check whether the assertion is scoped enough to prove the intended state. A broad page-content assertion can pass for unrelated text.\n- For recovery, inspect both the failed child step and the recovered container final state. Recovery can pass a retried assertion while leaving state that later steps did not expect.\n\n## Run AI classification\n\n`momentic ai classify` runs Momentic's result-classification agent over failed\nruns. It reads the run artifacts, uses relevant run history and repository\ncontext, and returns a category, recoverability, confidence, reasoning, and\ncitations. It explains the failure; it does not edit the test.\n\nUse one selector per command:\n\n```bash\nnpx momentic ai classify --run-id \"$RUN_ID\" --output-format json\nnpx momentic ai classify --run-group-id \"\u003Crun-group-id>\"\nnpx momentic ai classify --git-commit \"\u003Ccommit-sha>\"\n```\n\n- Omit `--save` for a diagnostic re-classification. Add `--save` only when the\n  new verdict should replace the saved classification on the local archive or\n  cloud run.\n- Use `--no-cache` when the existing cached classifier result is suspected to\n  be stale and the user explicitly needs a fresh analysis.\n- Use `--skip-classified` when resuming a batch without revisiting runs that\n  already have saved classifications.\n- Use `--output-format json` for automation and multi-run bookkeeping.\n- Classify multiple related run IDs together when useful, but keep each result\n  mapped to its exact run.\n\nFor one run in a real terminal, keep the classifier conversation open:\n\n```bash\nnpx momentic ai classify --run-id \"$RUN_ID\" --interactive\n```\n\nUse the chat to ask why it chose the category, what evidence it relied on, how\nthe current run differs from a prior run, or what a durable fix would require.\nInteractive classification is single-run only, requires stdin to be a TTY, and\ncannot be combined with JSON output.\n\n## Prepare triage\n\nTreat application readiness as a hard precondition. Triage replays the test in\na real browser; it cannot repair a test against an unavailable app, missing\nfixture, wrong environment, unseeded database, invalid account, or cold compiler.\n\nBefore triage:\n\n1. Read `momentic.config.yaml`, the target test and its setup modules, repository\n   scripts, and the CI workflow that normally runs the test. Use the same URL,\n   environment, credentials, headers, files, services, and data fixtures.\n2. Confirm `MOMENTIC_API_KEY`, project configuration, dependencies, and the\n   requested browser are available.\n3. Inspect `git status` and preserve unrelated work. Decide the repair delivery\n   before running the command; do not let an unknown dashboard default create a\n   pull request or commit unexpectedly.\n4. Build the application before starting triage. Prefer a production or\n   otherwise precompiled build and a stable server over Next.js, webpack, Vite,\n   or another development server that compiles routes incrementally.\n5. Start every required service and wait for the actual readiness URL. Warm any\n   unavoidable dev-only compilation path before triage and verify that the\n   relevant route no longer shows a compile\u002Floading screen or incurs a long\n   first request.\n6. Run a focused smoke or the failing test once when necessary to prove the app,\n   fixture, authentication, and browser are ready. Fix setup failures before\n   blaming triage.\n7. Start with `--parallel 1`. Raise it only when the machine has enough CPU and\n   memory for one browser and application workload per worker.\n\nIf the repository exposes a stable server command, either start it separately\nor let triage own it with `--start` and `--wait-on`:\n\n```bash\n# Build first; use the repository's actual commands and readiness URL.\npnpm build\nnpx momentic ai triage --run-id \"$RUN_ID\" \\\n  --start \"pnpm start\" \\\n  --wait-on \"http:\u002F\u002Flocalhost:3000\u002Fhealth\" \\\n  --parallel 1 \\\n  --yes \\\n  --on-heal-success nothing\n```\n\nDo not copy these example commands blindly. Discover the real build, start, and\nreadiness contract from the repository and CI configuration.\n\n## Run AI triage\n\n`momentic ai triage` groups failures by shared root cause, decides which ones\nare repairable, edits the relevant tests, replays them in a browser, and accepts\nonly repairs that satisfy its verification. It can leave changes locally,\nproduce a patch, commit, or open a pull request. It cannot fix an application\nbug, external outage, or missing fixture by changing a test.\n\nRun classification first when the user wants an explicit diagnosis, then pass\nthe same target to triage:\n\n```bash\nnpx momentic ai classify --run-id \"$RUN_ID\" --output-format json\nnpx momentic ai triage --run-id \"$RUN_ID\" \\\n  --parallel 1 \\\n  --yes \\\n  --on-heal-success nothing\n```\n\nFor a local run group, pass the results directory instead:\n\n```bash\nnpx momentic ai triage .\u002Ftest-results \\\n  --parallel 1 \\\n  --yes \\\n  --on-heal-success nothing\n```\n\nBest practices:\n\n- Pass multiple related run IDs after one `--run-id` so the bucketing agent can\n  group shared causes. Do not launch one competing triage command per run.\n- Set `--on-heal-success` explicitly: use `nothing` for local review, `patch`\n  for a portable diff, or a pull-request\u002Fcommit behavior only when the user\n  asked for that delivery.\n- Pass `--yes` only after the environment and delivery choice are confirmed so\n  dependency prompts do not stall an autonomous run.\n- Use `--dry-run --no-save` to inspect bucketing without editing tests or saving\n  triage metadata. Dry-run is not a repair attempt.\n- Use `--regenerate-heal` only when a cached heal is stale or failed and a new\n  repair should be generated from scratch.\n- Keep the command attached and monitor reasoning, tool calls, browser progress,\n  CPU, and memory. Several minutes without browser progress can indicate app\n  startup, cold compilation, resource pressure, or a missing fixture.\n- Inspect every resulting diff. Do not accept deleted assertions, broadened\n  checks, arbitrary sleeps, or longer timeouts that merely conceal the cause.\n- Do not remove quarantine solely because triage produced a patch. Re-run the\n  repaired test first.\n\nUse interactive triage when the user wants to question the repair agent:\n\n```bash\nnpx momentic ai triage --run-id \"$RUN_ID\" \\\n  --parallel 1 \\\n  --yes \\\n  --on-heal-success nothing \\\n  --interactive\n```\n\nInteractive triage requires a TTY, cannot be combined with `--json`, and is\navailable only when the command runs the bucketing agent. Use it to ask why a\nfix was accepted or rejected, what setup it observed, and what evidence remains\nunresolved.\n\n## Download run artifacts manually\n\nPrefer MCP for ordinary inspection because `momentic_get_run` downloads and\nextracts cloud attempts automatically. Use the API when MCP output is missing,\nwhen raw files must be grepped, or when independently verifying the agent.\n\nThe export endpoint returns run metadata plus one short-lived signed ZIP URL per\nattempt; it does not return one combined run ZIP. Download and extract them\nwithout printing the URLs:\n\n```bash\nRUN_ID=\"\u003Crun-id>\"\nMOMENTIC_SERVER_URL=\"${MOMENTIC_SERVER:-https:\u002F\u002Fapi.momentic.ai}\"\nRUN_INSPECTION_DIR=\"$(mktemp -d)\"\n\ncurl --fail --silent --show-error \\\n  -H \"Authorization: Bearer ${MOMENTIC_API_KEY:?Set MOMENTIC_API_KEY}\" \\\n  \"${MOMENTIC_SERVER_URL}\u002Fv1\u002Fruns\u002F${RUN_ID}\u002Fexport\" \\\n  -o \"${RUN_INSPECTION_DIR}\u002Fexport.json\"\n\njq '.run' \"${RUN_INSPECTION_DIR}\u002Fexport.json\" \\\n  > \"${RUN_INSPECTION_DIR}\u002Fmetadata.json\"\n\njq -r '.attemptZipUrls | to_entries[] | select(.value != null) |\n  [(.key + 1), .value] | @tsv' \"${RUN_INSPECTION_DIR}\u002Fexport.json\" |\n  while IFS=$'\\t' read -r attempt url; do\n    mkdir -p \"${RUN_INSPECTION_DIR}\u002Fattempts\u002F${attempt}\"\n    curl --fail --silent --show-error \"$url\" \\\n      -o \"${RUN_INSPECTION_DIR}\u002Fattempt-${attempt}.zip\"\n    unzip -q \"${RUN_INSPECTION_DIR}\u002Fattempt-${attempt}.zip\" \\\n      -d \"${RUN_INSPECTION_DIR}\u002Fattempts\u002F${attempt}\"\n  done\n```\n\nInspect `metadata.json`, each attempt's `metadata.json`, screenshots, DOM\nsnapshots, console logs, HAR logs, video, resource usage, and crash archives.\nKeep attempt numbers intact. Do not commit the export response, run artifacts,\nsigned URLs, credentials, or customer data. Remove the temporary directory when\nthe investigation is complete.\n\n## Background\n\n### Test run result structure\n\nWhen 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:\n\n```\ntest-results\u002F\n├── metadata.json         data about the run group, including git metadata and timing info.\n└── runs\u002F                 On zip for each test run in the run group.\n    ├── \u003CrunId_1>.zip         a zipped run directory containing data about this specific test run.  Follows the structure described below.\n    └── \u003CrunId_2>.zip\n```\n\nWhen unzipped, run directories have the following structure:\n\n```\n\u003CrunId>\u002F\n├── metadata.json           run-level metadata.\n└── attempts\u002F\u003Cn>\u002F           one folder per attempt (1-based n).\n    ├── metadata.json       attempt outcome and step results.\n    ├── console.json        optional browser console output.\n    └── assets\u002F\n        ├── \u003CsnapshotId>.jpeg     before\u002Fafter screenshot for each step (see attempt metadata.json for snapshot ID).\n        ├── \u003CsnapshotId>.html     before\u002Fafter DOM snapshot for each step (see attempt metadata.json for snapshot ID).\n        ├── har-pages.log         HAR pages (ndjson).\n        ├── har-entries.log       HAR network entries (ndjson).\n        ├── resource-usage.ndjson CPU\u002Fmemory samples taken during the attempt.\n        ├── \u003CvideoName>           video recording (when video recording is enabled).\n        └── browser-crash.zip     browser crash dump (only present on crash).\n```\n\nWhen 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-\u003CrunId>`.\n\n### Element locators\n\nCertain step types that interact with elements have a \"target\" property, or **locator**, that specifies which element the step should interact with.\n\n#### Locator caches\n\nLocators identify elements by sending the page state html\u002Fxml 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.\n\nA locator cache can bust for a variety of reasons:\n\n- the element description has changed, in which case we'll always bust the cache\n- the cached element could not be located in the current page state\n- the cached element was located in the page state, but fails certain checks specified on the cache entry, such as requiring a certain position, shape, or content.\n\nYou 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.\n\n#### Identifying bad caches\n\nSometimes 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.\n\n### Module caching\n\nCached 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.\n\nAuthentication 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.\n\n### File uploads\n\nA file upload step prepares one file for the next native file picker, so it must run before the action that opens the picker.\n\nSources can be remote URLs, `file:\u002F\u002F` 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.\n\n## Using past runs\n\nPast runs are comparison evidence, not a substitute for reconstructing the current run. Use them when the current run does not answer:\n\n- When did this test start failing?\n- What differed vs the last passing run?\n- Did the same action behave differently on an earlier run?\n- Is this a test weakness, an application change, a real application bug, or a temporary slowdown?\n\nUse 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.\n\nWhen looking at past runs, use the following workflow:\n\n1. Call the `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.\n2. Call `momentic_get_run` for that specific run to get the run details.\n3. Call `momentic_get_step_result` for the same step\u002Fcontainer or closest equivalent you are comparing, especially for screenshots.\n\nWhen past runs are irrelevant because the current run already proves the root cause, say that briefly instead of forcing historical evidence.\n\n### Multi-attempt runs\n\nWhen `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.\n\n### Flakiness and intermittent failures\n\n- Call a test flaky only when the same app and test behavior fails intermittently.\n  One failure is insufficient; rule out application and test changes using run\n  evidence before attributing the pattern to flakiness.\n\n### Test temporality\n\n- Any past results may not necessarily match today’s test file. The test may have changed, meaning the result was on a different version of the test.\n- You can call `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.\n\n## Common failure modes to watch for\n\n- A setup module appears to pass but leaves the wrong page, overlay, filter, search, selected row, or side peek open. Classify from the step\u002Fcontainer that left the bad postcondition, not only from the next step that failed.\n- A click reports success and targets the intended element, but the application does not transition to the intended state. Verify the post-state; do not assume the click worked because the locator was correct.\n- A weak global assertion such as \"page contains X\" passes because unrelated text on the page matches. The next step may then type or click in the wrong context.\n- A type step without a specific target can silently type nowhere useful if the preceding action failed to focus the intended field.\n- A locator or cache can be technically valid but semantically wrong. Check the interacted element and, for bad caches, inspect the original cache-update run from `targetUpdateLoggerTags.runId`.\n- A recovered step can hide the first failure. Inspect failed child steps inside recovered modules and compare the recovered final state to the next step's expected baseline.\n- A timeout is not automatically `INFRA`. First rule out missing data, wrong page state, changed app flow, bad locator\u002Fassertion, and setup failure.\n\n## Identifying related vs unrelated issues\n\n- Determine intent from the test name, description, and simplified steps. Treat\n  failures outside that intent, including most setup\u002Fteardown failures, as\n  unrelated. Relatedness qualifies bugs and changes; it does not change an\n  `INFRA` failure into another category.\n\n## Bug vs change\n\n- Bug: something very clearly went wrong when it should not have, such as an error message appearing. It is obvious just by looking at a single step or two that this is a bug.\n- Change: a clear change in the application behavior that you can prove through screenshots.\n\n## Recoverability\n\nAlong with the category, determine one recoverability value:\n\n- `RECOVERABLE` — The failure can be automatically fixed by updating the test itself so that future runs pass.\n  - Examples: an application change that requires a test update; vague locators or assertions that can be rewritten to pass stably.\n- `ONE_TIME_RECOVERABLE` — The failure can be recovered for this specific run without persisting a test change.\n  - Examples: a random modal that can be dismissed without affecting test purpose; a temporary delay where waiting or retrying would likely succeed.\n- `NON_RECOVERABLE` — The failure cannot be automatically addressed and requires manual intervention.\n  - Examples: missing credentials; missing local files required for upload; outages likely caused by third-party systems where test steps cannot fix the issue.\n\n## Formal classification output\n\n- Exactly one category id — no new labels, no multi-label.\n- Ground your decision in data. Be sure that you've fully investigated the run before assigning the category.\n- Prefer human-readable references over UUIDs when the step\u002Fmodule can be identified colloquially: `module create-subpage-under-parent-page`, `the last invocation of module \u003Cname>`, `substep 4 (0-indexed)`, `the failed setup assertion`, etc. Tool calls still require exact IDs, but final reasoning should be readable.\n- When referencing past runs in final output, use clickable Momentic URLs rather than bare UUIDs: `https:\u002F\u002Fapp.momentic.ai\u002Fruns\u002F\u003CrunId>`. Do not shorten UUIDs inside those URLs.\n- The reasoning must include the earliest divergent step\u002Fcontainer and the broken postcondition it produced, not just the final failing step.\n\n```text\nReasoning: \u003Ca few sentences tied to the earliest divergence, screenshots\u002Ftraces, past runs if used, and test intent>\nCategory: \u003Cone id from the list>\nRecoverable: \u003CRECOVERABLE | ONE_TIME_RECOVERABLE | NON_RECOVERABLE>\nConfidence: \u003Chigh | medium | low>\n```\n\nConfidence levels:\n\n- `high` — direct evidence, such as a clear screenshot of a label change or crash\n- `medium` — strong inference from multiple signals but no single conclusive screenshot or data point\n- `low` — ambiguous evidence; the classification required significant inference or the root cause is unclear\n\n## Category ids\n\nUse these strings verbatim:\n\n- `NO_FAILURE` — The run had no failures; all attempts passed.\n- `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.\n- `BUG` — Something clearly went wrong in the application that shouldn't have, such as an error message appearing or expected content failing to render.\n- `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.\n  - Examples: race conditions that can be fixed by adding or modifying steps **other than** waits\u002Ftimeouts (e.g. replacing a \"type with pressEnter\" step with an explicit \"select from list\" step so the test no longer races the application); vague assertions or locator descriptions that can be rewritten to be more specific.\n- `TEST_SETUP` — Missing test data or files necessary to run the test, where the fix requires user action outside of the test itself.\n  - Examples: missing file for a file upload step; missing or incorrect credentials needed by the test.\n- `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.\n  - Examples: browser crash; high resource usage; rate limiting; a step or assertion that timed out waiting for the page or application to reach a slow-but-eventual state.\n- `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).\n  - Examples: unexpected behavior when viewing the run trace; the AI clearly misread or hallucinated data that is unambiguous in the screenshot, and no reasonable test alternative exists to avoid the AI step.\n- `OTHER` — The failure doesn't fit any of the other categories.\n",{"description":7},"main","58843b159d7a4050d6b785a98b908cce505c0b92","agent\u002Fskills\u002Fmomentic-maintain",0,"https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent","https:\u002F\u002Fgithub.com\u002FReihantt6","reihsns.web.id","2026-08-19 20:08:18",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add Reihantt6\u002Fsns-myagent --skill momentic-maintain",{"tool":38,"command":39},"bunx","bunx skills add Reihantt6\u002Fsns-myagent --skill momentic-maintain",{"tool":41,"command":42},"pnpm","pnpm dlx skills add Reihantt6\u002Fsns-myagent --skill momentic-maintain","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fmomentic-maintain\u002FSKILL.md",true,[],[47,54,61,68,75,82],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":19},"01M77XDCYZ407XYMF2T4P6F7VT","youtube-transcript","Extract transcripts from YouTube videos. Use when the user asks for a transcript, subtitles, or captions of a YouTube video and provides a YouTube URL (youtube.com\u002Fwatch?v=, youtu.be\u002F, or similar). Supports output with or without timestamps.","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fyoutube-transcript\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M77XD7PBC98J6MXGJJ2TJ8DX","youtube-thumbnail-design","YouTube thumbnail design with specific dimensions, contrast rules, and mobile preview optimization. Covers safe zones, text placement, face expression psychology, and A\u002FB testing. Use for: YouTube thumbnails, video cover images, click-through optimization. Triggers: youtube thumbnail, thumbnail design, video thumbnail, click through rate, ctr optimization, youtube cover, video cover image, thumbnail maker, thumbnail tips, youtube design, video preview image","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fyoutube-thumbnail-design\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M77XD2541C8HXJ6RHYZP4NGJ","youtube-short-maker","Make YouTube Shorts that hold attention with Pexo — vertical 9:16, fast-paced, hook in the first 3 seconds. Describe your topic and Pexo writes the script, generates the shots, picks the models, and assembles a finished Short with music and captions. Use for YouTube Shorts: \"youtube short\", \"make a youtube short\", \"shorts video\", \"short-form video\". NOT for long-form or landscape video.","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fyoutube-short-maker\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M77XCXKVSYK7KTZ3PQBVVGFD","xcode-project-setup","Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fxcode-project-setup\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M77XCR1DV8ZQK2NHWKVY4EWX","x402","Set up Browser Use Cloud payments with x402 — pay per request from a crypto wallet (USDC on Base mainnet), no signup or API key. Two setups it works out up front — \"just use it\" (set up a wallet so you or Claude Code can run cloud browser tasks paid from the wallet — Claude writes and runs throwaway scripts, nothing touches your codebase) or \"build it in\" (install the SDK and write the key + code into your project). Walks through wallet setup, funding, .env, and a ~$1 test run. Use when the user asks about x402, pay-per-use, USDC payments, or wants Browser Use Cloud without an API key. For the free-tier signup (reverse-CAPTCHA → API key), use `browser-use cloud signup` or the `cloud` skill instead.","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fx402\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M77XCMD3R3ZBZQQSW6E0793B","x-twitter-scraper","Build GitHub Copilot workflows with Xquik X API SDKs, REST endpoints, hosted Apify Actor runs, MCP tools, TweetClaw OpenClaw plugin installs, signed webhooks, tweet search, user lookup, follower exports, media actions, and agent automation.","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fx-twitter-scraper\u002FSKILL.md",[],[]]