Programming · Testing
testing
/testing
Use when writing, changing, or reviewing tests, or when fixing a bug.
For whom
- Author
- adelrodriguez ↗
- Repository
- skills ↗
- Licence
- MIT
- Last repository change
- 11.11.2026
Assessment and security
96/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability21 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
Deprecation
No signals detected. Repository changed on 11.11.2026, without references to retired models or APIs.
Licence
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Use when writing, changing, or reviewing tests, or when fixing a bug.
Original author description
Use when writing, changing, or reviewing tests, or when fixing a bug.
How it works
- Start from the repository
- Place the test next to its file
- Test through the interface
- Fix a bug test-first
- Strengthen weak tests
- Delete low-value tests
- Test public types
- Check the tests
- Return the result
Original SKILL.md headings · 76 lines, 627 words
SKILL.md preview
---
name: testing
description: Use when writing, changing, or reviewing tests, or when fixing a bug.
---
# Write tests
Write tests that prove behavior. A test earns its place when it fails if the behavior it covers breaks.
## Start from the repository
Before writing, read the repository's test setup, helpers, fixtures, and the existing tests near the code. Match their structure and naming. Run the test command from the repository's scripts, such as `package.json`, rather than calling the runner directly.
## Place the test next to its file
Put each test in a `__tests__` folder next to the file it tests, so the tests stay with the code without breaking up the folder's file list:
```
src/billing/
__tests__/
invoice.test.ts
invoice.ts
payment.ts
```
When the repository already places tests another way, follow the repository.
## Test through the interface
- Test what a caller can observe through the module's interface. The `codebase-design` skill defines the interface.
- Assert on results and outcomes, not on internal state, private functions, or the order of internal calls.
- Check that each test would survive a refactor that keeps the behavior. A test that changes when only the implementation changes is testing past the interface.
- Use real dependencies or local stand-ins, such as PGLite for Postgres, before mocks. Mock only third-party services you do not control.
## Fix a bug test-first
1. Write a test that reproduces the bug through the interface.
2. Run it, and confirm that it fails for the reason the bug describes. Read the failure message, not only the exit code.
3. Fix the code.
4. Run the test and confirm that it passes. Then run the rest of the suite.
If the test setup cannot reproduce the bug, say so, and record how you reproduced it instead.
## Strengthen weak tests
A test is weak when it passes even though the behavior is broken. Look for these signs:
- It asserts only that a value is defined or truthy, or that a call does not throw.
- It asserts on the mocks it set up rather than on the result.
- It snapshots a large output that no reviewer reads.
To check a test, temporarily break the behavior, such as by inverting a condition, and confirm that the test fails. Restore the code, then confirm that the test passes. Strengthen a weak test by asserting the exact value or outcome.
## Delete low-value tests
Delete a test when any of these is true:
- Another test already covers the same behavior.
- It tests a private detail that tests at the interface now cover.
- It tests the framework, the language, or a library rather than this code.
- The code or behavior it tests no longer exists.
- It is skipped or marked as a todo, and no issue tracks making it pass.
## Test public types
When the change adds or changes an exported type, test the type. Use the repository's tool, such as Vitest's `expectTypeOf`, or `@ts-expect-error` lines that the type checker runs. Test that valid uses compile and that invalid uses fail.
## Check the tests
- Every new or changed test fails when the behavior it covers breaks.
- A bug fix includes a test that failed before the fix, or records why the test setup cannot reproduce the bug and how the bug was verified.
- Each test sits in the `__tests__` folder next to the file it tests, or follows the repository's placement.
- No test asserts on internal state or private calls.
- Every exported type that changed has a type test.
- The full suite passes.
## Return the result
List the tests you added, strengthened, and deleted, with one line of reason each. For a bug fix, show the failing output from before the fix and the passing output after it.
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · adelrodriguez/skills | 96 | MIT |
| iuliandita/skills | 100 | MIT |
| wrongstack/wrongstack | 100 | MIT |
| langwatch/langwatch | 100 | Apache-2.0 |
| mcouthon/agents | 100 | MIT |
| nteract/nteract | 100 | BSD-3-Clause |
| kettleofketchup/DraftForge | 100 | GPL-3.0 |
| skillberry-ai/cap-evolve | 100 | Apache-2.0 |
| TheBeardedBearSAS/claude-craft | 100 | MIT |
Database snapshot: 13.11.2026 · package version a95f355757dd (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 90testing-python
Stratégie de Tests Python 3.14+. Use when writing tests, reviewing test coverage, or setting up testing. - 100writing-tests
Write deterministic tests that fail for real product defects. Use when adding tests, fixing flakes, or reviewing test coverage and reliability. - 100bogusz
QA testing orchestrator driven by a per-project test profile. Use for /bogusz, or when asked to test or plan tests for a feature, PR or API; validate a bug and file an issue; check a UI flow with screenshots; run load tests, benchmarks or security scans; or analyze a past session's testing. - 100testing-quality
Use when selecting, writing, debugging, or reviewing tests and quality gates for application changes or regressions. - 100testing-cli-changes
Use when writing or fixing tests in the tycoon-cli repo, when a CLI-surface bug slipped past in-process tests (PATH resolution, Rich rendering, console-script wiring, exit codes), when snapshot tests fail after changing user-facing strings, or when adding runnable bash examples… - 100unit-testing
Writes and updates unit tests for new or changed code in the project's existing framework and style, covering happy, error and boundary paths, then runs them with coverage and fixes failures. Use when implementing a feature or bug fix that needs tests, when asked to add or…