Generate or run tests. Auto-detects test framework, generates comprehensive tests for source files, or runs existing test suites with failure analysis.
64
75%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./src/resources/skills/test/SKILL.mdAccepts optional arguments:
run: run the existing test suite and analyze results<quick_start>
<step_1_detect_framework>
Detect the test framework and conventions before doing anything else.
Check these sources in order:
package.json (Node/JS/TS projects):
scripts.test for the test commanddevDependencies for jest, vitest, mocha, ava, tap, node:test, playwright, cypressjest or vitest config keysConfig files:
jest.config.*, vitest.config.*, .mocharc.*, ava.config.*pytest.ini, pyproject.toml (look for [tool.pytest]), setup.cfggo.mod (Go projects use go test by default)Cargo.toml (Rust projects use cargo test)Existing test files:
*.test.*, *.spec.*, *_test.*, test_*.* files__tests__/ vs tests/ vs test/)Record your findings:
</step_1_detect_framework>
<step_2_handle_arguments>
Route based on the argument provided.
generate_testsrun_testssuggest_tests</step_2_handle_arguments>
<generate_tests>
Generate tests for the specified source file.
A. Read and analyze the source file:
B. Read existing test files in the project (1-2 files minimum):
C. Generate tests covering:
D. Place the test file correctly:
.test.ts, .spec.js, _test.go, test_*.py, etc.)E. Run the generated tests immediately to verify they pass.
</generate_tests>
<run_tests>
Run the existing test suite and analyze results.
A. Determine the test command:
package.json scripts.test for Node projectspytest for Python projectsgo test ./... for Go projectscargo test for Rust projectsB. Run the tests:
C. Analyze results:
D. Present a summary:
Test Results: X passed, Y failed, Z skipped
Failures:
1. [test name] - [brief diagnosis]
Fix: [specific suggestion]
2. [test name] - [brief diagnosis]
Fix: [specific suggestion]</run_tests>
<suggest_tests>
Suggest what to test when no arguments are given.
A. Check recent changes:
Working directory check: if your dispatch context specifies a working directory and
pwddoes not match it, prefix the git commands below with-C <that path>(e.g.git -C /path/to/worktree diff --name-only HEAD~5).
git diff --name-only HEAD~5 to find recently changed filesgit diff --name-only --cached for staged filesB. Check test coverage gaps:
C. Present suggestions:
Suggested files to test (based on recent changes and coverage gaps):
1. [file path] - modified recently, no test file exists
2. [file path] - modified recently, tests exist but may need updating
3. [file path] - no test coverage found
Run `/test <file path>` to generate tests for any of these.
Run `/test run` to run the existing test suite.</suggest_tests>
</quick_start>
<critical_rules>
</critical_rules>
<success_criteria>
Before completing:
</success_criteria>
33c00aa
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.