agentleFS
alex-voloshin-devalex-voloshin-dev/ai-skills/.agents/skills/run-tests/SKILL.md

run-tests

Skill2 starsChanged 6 months agoMITView on GitHub

Run tests workflow — execute test suite, analyze failures, auto-fix obvious issues, re-run. Follow-up skill for `feature-dev`, `bugfix`, and `pre-commit`. Uses the `test-strategy` skill.

50 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use prepare-release and commit.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ShopifySkill

    prepare-release

    Prepare the changeset-release/main branch for release by syncing version.ts files and running pnpm install

    Also in 3 projects that use this

  • SentrySkill

    commit

    Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 45 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read TESTING.md (if exists) for test commands, infrastructure, and credentials.

    line 19
  2. Distinctive:

    Output: Test names, pass/fail counts, error messages, stack traces

    line 40
  3. Distinctive:

    If tests fail, for each failure:

    line 44
  4. Distinctive:

    If the fix works, re-run the full suite to check for regressions

    line 73

“Common” is measured: kept by at least 6 in 10 of the 45 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Run Tests

Execute the project's test suite, analyze failures, attempt fixes, and re-run. Designed as a reusable follow-up skill called by feature-dev skill, bugfix skill, and pre-commit skill.

Uses test-strategy skill for test writing patterns and coverage targets.

1. Detect Test Stack

Read TESTING.md (if exists) for test commands, infrastructure, and credentials. Fall back to AGENTS.md and project config to determine:

SignalStackRunner
package.json + vitest/jestTypeScript/JSnpx vitest run / npx jest
pom.xml / build.gradleJavamvn test -q / gradle test
pyproject.toml / pytest.iniPythonpytest -x -q
go.modGogo test ./...
*.csproj.NETdotnet test

2. Run Tests

Execute the test suite:

// turbo
<test-command>

Capture:

  • Exit code: 0 = all pass, non-zero = failures
  • Output: Test names, pass/fail counts, error messages, stack traces

3. Analyze Failures

If tests fail, for each failure:

  1. Read the failing test — understand what it asserts
  2. Read the error message and stack trace — identify the actual vs expected
  3. Classify the failure:
ClassificationAction
Code bug — test is correct, implementation is wrongFix the implementation (Step 4)
Test bug — test is wrong or outdatedFix the test (Step 4)
Environment issue — missing dependency, port conflict, DB downReport to user (Step 5)
Flaky test — passes on re-run without changesFlag for investigation

4. Fix and Re-Run

For auto-fixable failures:

  1. Apply the appropriate stack-specific role (frontend-engineer role, java-engineer role, python-engineer role, etc.)
  2. Apply the minimal fix — do not refactor unrelated code
  3. Re-run the failing test(s) specifically:
StackRun Single Test
Vitestnpx vitest run <test-file>
Jestnpx jest <test-file>
pytestpytest <test-file>::<test-name> -v
JUnit/Mavenmvn test -pl <module> -Dtest=<TestClass>#<method>
Gogo test -run <TestName> ./path/...
  1. If the fix works, re-run the full suite to check for regressions
  2. Max 3 fix attempts per failure — if still failing after 3 tries, escalate to user

5. Coverage Check (if available)

Run coverage report:

StackCommand
Vitestnpx vitest run --coverage
Jestnpx jest --coverage
pytestpytest --cov=<package> --cov-report=term-missing
Gogo test -coverprofile=coverage.out ./... && go tool cover -func=coverage.out
JUnitmvn jacoco:report

Compare against test-strategy skill targets:

  • Line coverage ≥ 80% (hard minimum 60%)
  • Branch coverage ≥ 75% (hard minimum 50%)
  • New code coverage ≥ 90%

6. Summary

## Test Results

| Metric | Value |
|--------|-------|
| Total tests | X |
| Passed | X |
| Failed | X |
| Skipped | X |
| Duration | Xs |
| Coverage | X% (target: 80%) |

### Failures Fixed
- [test name] — [what was wrong] — [fix applied]

### Remaining Failures (needs attention)
- [test name] — [error] — [classification]

### Coverage Gaps
- [file/module] — [current%] — [uncovered lines]

**Overall**: ✅ PASS / ❌ FAIL — [action needed]

Integration

  • Called by: feature-dev skill, bugfix skill, pre-commit skill
  • Skills: test-strategy skill
  • Roles: qa-engineer role (test strategy), stack-specific role (implementation)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.