Agent Skill · Currents

fix-failing-tests

Fix tests that failed in CI, using the results Currents recorded — errors, steps, traces, screenshots and console output. Use when CI is red, a pull request check failed, a build broke, someone asks why a test failed, or you are given a Currents run or test link. Works from a developer's machine or from a CI job that runs after the tests failed.

Provider: Currents Path in repo: fix-failing-tests/SKILL.md

Skill body

Fix Failing Tests

Fix the tests that failed in a CI run, from what Currents recorded while they ran. The output is a code change and a short report: per test, the cause, the change and how you checked it.

The tests already ran in CI. Do not run the whole suite to find out what failed: the CI run is the record, and it has the traces, screenshots and console output a local run may not reproduce.

To show that a change works rather than fix a failure, use collect-evidence.

Rules

Say which run you are fixing

Before changing anything, name the run: branch, commit, when it ran, and how many tests failed. A run for the wrong commit is the most common way to fix the wrong thing, and the person reading this is the one who notices.

When you work in a checkout, compare the run’s commit with HEAD. If they differ, say so; the failure may already be fixed, or the code may have moved.

Fix the cause, not the symptom

Do not add retries, raise timeouts, or skip or quarantine a test to make it pass, unless the person asked for that. If the cause is outside the code — a test environment, a third-party service, data — say so instead of changing the test.

Flaky tests are yours to judge

A test marked flaky failed an attempt and passed on a retry. Read its failed attempt like any other failure, then decide whether it is worth fixing now, and say what you decided and why. A flaky test usually points at a race, shared state or an order dependency; name which one when you can.

Do not commit or push without asking

Leave the change in the working tree unless the person asked you to commit, push or open a pull request.

Requirements

Workflow

1. Find the run

Use the most exact thing you have, in this order:

  1. A Currents link. https://app.currents.dev/run/<runId> gives the run. https://app.currents.dev/instance/<instanceId>/test/<testId>, or its short form /i/<instanceId>/test/<testId>, gives one test.
  2. A CI build ID — in CI, the value the test job passed to the Currents reporter. currents-find-run with ciBuildId and projectId is an exact match.
  3. A pull request. currents-list-pull-requests with the PR number, then its latest run.
  4. The branch. currents-find-run with branch returns the most recent completed run, which can be for an older commit than the one you are on.

currents-get-projects gives the projectId when you do not have it.

If the run is still going (currents-get-runs shows it RUNNING or FAILING), stop and say so. Fixing half a run means fixing again when the rest fails.

2. Read the failures

Call currents-get-context with format: "md":

Read the run first to see what failed and which failures share a cause, then one test at a time for the ones you fix. Tests that failed with the same error usually have one fix.

Open the linked files when the error alone does not say enough. The error context is the page’s accessibility tree at the moment of failure; the trace is what the test did. A Playwright trace has two links: explore trace is the trace summary in markdown (the actions, console and network, with links on to frames and DOM snapshots at the failure); download trace is the zip, for Playwright’s trace viewer. Start with explore trace.

3. Fix

Change the code or the test, whichever is wrong. Keep the change to what the failure needs.

4. Check the fix

Run only the tests you fixed, locally, when the repository allows it — for example npx playwright test <spec> -g "<test title>". Do not report the local run to Currents.

When the tests cannot run here (in CI without the app, or with services you do not have), say that the next CI run is the check. Once it passes, collect-evidence can show the fix on the pull request.

5. Report

Per test: what failed, the cause, the change, and how you checked it. List any test you left alone and why — flaky tests you judged not worth fixing now, or failures whose cause is outside the code.

Handing the failures to someone else

When asked to hand the failures to a reviewer, a teammate or another agent without Currents access, create a link with currents-create-share-link and purpose: "fix". It is public until it expires — one day by default — so create one only when asked. Needs the shares:write scope.

Running in CI

A CI job that runs after the test job failed can use this skill unattended. Give it the same CI build ID and project ID the test job gave the Currents reporter, and say what to do with the result, for example: open a pull request with the fix and comment on the original pull request. Authenticate with a CURRENTS_API_KEY.

Troubleshooting

Work with this as data

Every skill here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for agent skills

4 MCP tools reach this
  • find_skillsBrowse and filter every skill in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This skill
curl "https://apis.io/api/v1/skills/fix-failing-tests"
All agent skills
curl "https://apis.io/api/v1/skills?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.