agentleFS
d-o-hubd-o-hub/github-template-ai-agents/.agents/skills/test-runner/SKILL.md

test-runner

Skill2 starsChanged 10 days agoMITView on GitHub

Execute tests, analyze results, and diagnose failures across any testing framework. Use this skill when running test suites, debugging failing tests, or configuring CI/CD testing pipelines — even if they just say "run the tests" or "why is this test failing". Not for debugger (build/deploy/runtime failures outside a suite), testing-strategy.

19 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use error-handling, code-reviewer and 2 more.

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.
  • MicrosoftSkill

    error-handling

    统一错误处理系统。在添加 API 端点、修改错误处理、添加前端 API 调用、编写错误相关测试时使用。

    Also in 3 projects that use this

  • GoogleSkill

    code-reviewer

    Also in 3 projects that use this

  • CloudflareSkill

    security-audit

    Security guidance and vulnerability review for codebases, APIs, services, CLI tools, libraries, and daemons. Use for security questions, focused reviews, vulnerability research, security audits, or pen tests. Run the complete workflow only for explicit codebase audit or pen-test requests, full/comprehensive/end-to-end reviews, or requested report artifacts.

    Also in 3 projects that use this

  • SentrySkill

    review

    Fixture review skill.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 18 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Run tests locally before commit

    line 145
  2. Distinctive:

    Write edge case tests

    line 146
  3. Distinctive:

    Keep tests fast (<100ms)

    line 148
  4. Distinctive:

    Use sleep without reason

    line 159

“Common” is measured: kept by at least 6 in 10 of the 18 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

Test Runner

Expert skill for test execution and failure diagnosis.

Quick Start

Test Checklist:
- [ ] Environment configured
- [ ] Tests run or failures captured
- [ ] Failed tests diagnosed
- [ ] Coverage report generated

When to Use

  • Running test suites
  • Debugging failing tests
  • Setting up CI/CD pipelines
  • Analyzing test coverage
  • Identifying flaky tests

Framework Commands

JavaScript

jest                    # Run all
jest path/to/test.ts    # Specific file
jest --coverage       # With coverage
jest --watch          # Watch mode

Python

pytest                  # Run all
pytest tests/test.py    # Specific file
pytest --cov=src        # With coverage
pytest -v              # Verbose

Rust

cargo test              # Run all
cargo test test_name    # Specific test
cargo test -- --nocapture  # Show output

Go

go test ./...           # Run all
go test -v ./...        # Verbose
go test -cover ./...    # With coverage

Bash

bats tests/             # Run all
bats tests/file.bats    # Specific file

Diagnosing Failures

Step 1: Identify Error Type

PatternLikely CauseAction
AssertionError: expected X got YLogic errorCheck implementation
TimeoutErrorAsync issueCheck async/await
ModuleNotFoundErrorMissing depInstall dependency
panic: runtime errorGo panicCheck nil/bounds

Step 2: Isolate Test

pytest test.py::test_func -v     # Python
jest --testNamePattern="test"     # Jest
cargo test test_name               # Rust

Step 3: Check Environment

pip list | grep pytest            # Python
npm list jest                      # Node
# ./scripts/setup-test-db.sh       # Test data (create if needed for project)

Coverage Analysis

Generate Reports

# Jest
jest --coverage --coverageReporters=text-summary

# Python
pytest --cov=src --cov-report=html

# Rust
cargo tarpaulin --out Html

# Go
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out

Coverage Targets

TypeMinimumTarget
New project70%85%
Legacy50%70%
Critical path90%95%

Flaky Test Detection

# Run multiple times
for i in {1..10}; do pytest || echo "Failed run $i"; done

# Identify patterns:
# - Time-based (timeout issues)
# - State-dependent (order matters)
# - Async race conditions

Best Practices

DO:

  • Run tests locally before commit
  • Write edge case tests
  • Mock external dependencies
  • Keep tests fast (<100ms)
  • Clean up test state
  • Use descriptive names

DON'T:

  • Skip tests without TODO
  • Hardcode timeouts
  • Test implementation details
  • Share mutable state
  • Ignore flaky tests
  • Use sleep without reason

Quality Criteria

  • Tests run or failures diagnosed
  • Coverage meets targets
  • No flaky tests
  • Test environment documented
  • CI/CD configured
  • Clear error messages

See Also

  • testing-strategy — Choose testing approaches and plan test suites (incl. its testdata appendix)
  • nested-build-isolation — Isolate nested subprocess builds, tests, or coverage runners
  • dogfood — Exploratory testing of web applications

Rationalizations

RationalizationReality
"Tests pass on my machine, CI must be flaky"Environment differences are real; CI is the source of truth for reproducibility.
"I'll fix the failing test later"Deferred test failures accumulate and mask real regressions.
"Coverage doesn't matter, I write good tests"Coverage metrics catch blind spots that human judgment misses.

Red Flags

  • Tests skipped without a tracked follow-up
  • Coverage drops below minimum thresholds on new code
  • Flaky tests re-run instead of root-caused

References

  • agents-docs/SKILLS.md - Skill framework guide

Voice & Context

  • Default: professional + blog
  • Reference: voice-profiles skill for definitions and auto-detection.

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.