Agent skill
test
Use this skill to run tests, identify failures, and fix them. Triggered by "run tests", "fix failing tests", "make tests pass", or "/test".
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/test-imran-ml-claude-skills
SKILL.md
Test Runner & Fixer
Run the test suite and automatically fix any failures.
Current Test Status
!npm test -- --passWithNoTests 2>&1 | tail -30
Instructions
-
Run the tests (filtered to
$ARGUMENTSif provided):bashnpm test $ARGUMENTS # or: pytest $ARGUMENTS # or: go test ./... # or: cargo test -
For each failing test: a. Read the test file to understand what's being tested b. Read the source file being tested c. Identify the root cause (test wrong? source wrong? missing mock?) d. Fix the root cause — prefer fixing source bugs over changing tests e. Only update a test if it's clearly wrong or testing the wrong thing
-
Re-run tests to confirm they pass
-
If tests still fail after 2 attempts at fixing, report:
- The exact error message
- What you tried
- Your hypothesis for the root cause
- Ask the user how to proceed
Rules
- Never delete tests to make them "pass"
- Never change assertions to match wrong behavior
- Do NOT mock the database in integration tests
- Run the full suite at the end to check for regressions
- If adding new tests, follow the existing test file structure
$ARGUMENTS
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?