unit-testing
Skill1 starsChanged 2 months agoApache-2.0View on GitHub
2. Match the project's existing test file convention (naming, folder location, assertion style) rather than imposing a default. Look at one existing test file first if any exist. 3. NEVER let tests touch a real database, real files outside a temp directory, or make real network/API calls. Use the language's standard mocking/faking approach: - Python: monkeypatch / unittest.mock, tmp_path fixture - JS/TS: jest.mock() / vi.mock(), a temp dir via fs.mkdtemp - Go: interfaces + fake implementations, t.TempDir() - Java: Mockito,…
20 other projects use a version of this.
Adopted by
Most recently taken up by
- reddygopalkrishna/developer-agent-skillstheir own version, first seen Nov 8, 2026
- petrkindlmann/qa-skillstheir own version, first seen Oct 25, 2026
- lggarrison/agent-skillstheir own version, first seen Oct 25, 2026
- r-portas/skillstheir own version, first seen Oct 20, 2026
- prinx/agentstheir own version, first seen Oct 20, 2026
- sb-dev/narrative-production-skillstheir own version, first seen Oct 20, 2026
Used with
Projects with it also use database-testing, contract-testing and 4 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.
petrkindlmannSkilldatabase-testing
Validate database integrity, test migrations forward and backward, verify schema constraints, manage seed data, detect migration drift, and identify query performance issues. Covers PostgreSQL, MySQL, MongoDB with Prisma, TypeORM, Drizzle, and SQLAlchemy, plus Testcontainers test databases. Use when: "database test," "migration test," "migration rollback," "rollback test," "data integrity," "SQL test," "schema validation," "seed data," "query performance," "Testcontainers." Not for: synthetic data generation/masking at scale — use test-data-management; Docker/IaC test-environment provisioning — use test-environments; SQL injection — use security-testing. Related: test-data-management, test-environments, security-testing, ci-cd-integration.
Also in 3 projects that use this
petrkindlmannSkillcontract-testing
Implement consumer-driven contract testing with Pact-JS (v16). Covers consumer test writing, broker-driven provider verification, Pact Broker setup, can-i-deploy as a deployment gate, webhook-triggered verification, pending pacts, and schema-first vs consumer-first approaches (OpenAPI/Ajv, Schemathesis). Use when: "contract test," "Pact," "consumer-driven," "API contract," "provider verification," "can-i-deploy." Not for: stubbing or mocking a dependency to isolate a test — use service-virtualization; general REST/GraphQL endpoint assertions against your own API — use api-testing. Related: api-testing, service-virtualization, ci-cd-integration, test-environments.
Also in 3 projects that use this
jarosser06Skilltest-strategy
Plans pytest test strategies for Drift's 90%+ coverage requirement using coverage analysis, edge case identification, and test suite design. Use when determining what tests to write, analyzing coverage gaps, or planning test strategies.
Also in 4 projects that use this
etewiahSkille2e-testing
Playwright E2E testing and Lighthouse performance auditing. Use when setting up E2E tests, running Playwright tests, performing Lighthouse audits, or debugging E2E test failures.
Also in 4 projects that use this
Microsoft AzureSkillrelease-readiness
Complete ODIN release documentation and validation checks before declaring user-visible work complete, preparing a release, or opening the Release-to-main pull request.
Also in 3 projects that use this
Microsoft AzureSkillgit-workflow
Squad branching model: dev-first workflow with insiders preview channel
Also in 4 projects that use this
Other versions20 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 20
- pulsejet/memories★ 3.9ksame name
- lichtblick-suite/lichtblick★ 1.2ksame name
- javierbrea/eslint-plugin-boundaries★ 1ksame name
- petrkindlmann/qa-skills★ 209same name
- kid-sid/claude-spellbook★ 190same name
- reddygopalkrishna/developer-agent-skills★ 8same name
- dprakash2101/dotnet-production-agent-skills★ 4same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- sb-dev/narrative-production-skills★ 2same name
- axross/skills★ 1same name
10 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository4 other files it gives its agents.
- code-navigationSkill
- file-editingSkill
- git-operationsSkill
- security-reviewSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 0 are common, 11 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 17 edited versions we read keep these.
11
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 5
Before reading any target file to understand what to test, follow the code-navigation skill's rules (get_file_info first, large …
- Distinctive: line 20
NEVER let tests touch a real database, real files outside a temp directory, or make real network/API calls.
- Very specific: line 32
Every bug that gets found and fixed in this session should get a regression test that would have caught it - not just a fix.
- Very specific: line 37
Test the failure path, not just the happy path: what happens when a dependency call throws/errors, when input is null/None/undefined, when …
- Distinctive: line 42
Keep tests fast and independent - no sleeps/timers as a substitute for proper synchronization, and no test may depend on another test's …
- Distinctive: line 46
When fixing a bug elsewhere in the codebase, add or update its test in the same session - not as a separate follow-up.
- Distinctive: line 50
Write the tests and run them once to confirm they at least execute without collection errors.
- Distinctive: line 55
Always cleanup testing artifacts (like newly created temp files, local temp databases, or environment variables) after the test runs, …
- Distinctive: line 61
Before writing any test, read the target file's own import statements first to know its ACTUAL dependencies.
- Distinctive: line 64
When tests fail, fix ONE failure at a time: read only the relevant test + relevant source function (not the whole file via read_local_file …
- Distinctive: line 69
Never use shell redirects (2>&1, 2>nul, >, |) with execute_shell_command
- Distinctive: line 72
When a test fails, first determine WHICH side is wrong - the test's assumption, or the source code's behavior - before fixing either one.
- Distinctive: line 74
Never weaken an assertion just to make it pass without understanding why it failed.
- Very specific: line 76
When mocking a third-party library/SDK, only look at HOW the target file uses it (which methods/attributes it calls, in what shape) - do …
“Common” is measured: kept by at least 6 in 10 of the 17 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.
Files
Unit Testing Skill
Description: Use this whenever asked to write, run, or fix unit tests for any project, regardless of language (Python, JavaScript/TypeScript, Go, Java, Rust, etc).
Rules for this task
- Before reading any target file to understand what to test, follow the code-navigation skill's rules (get_file_info first, large view_file_lines ranges, no repeated list_directory calls). Do not read a file 6 times in 150-line chunks when one get_file_info + 2-3 well-sized reads would do.
- Detect the project's language and existing test framework before writing
anything. Check for config/lockfiles first:
pytest.ini/pyproject.toml-> pytest;package.json-> check for jest/vitest/mocha;go.mod-> Go's built-intestingpackage;pom.xml/build.gradle-> JUnit;Cargo.toml-> Rust's built-in#[test]. Never introduce a second test framework into a project that already has one. - Match the project's existing test file convention (naming, folder location, assertion style) rather than imposing a default. Look at one existing test file first if any exist.
- NEVER let tests touch a real database, real files outside a temp
directory, or make real network/API calls. Use the language's standard
mocking/faking approach:
- Python: monkeypatch / unittest.mock, tmp_path fixture
- JS/TS: jest.mock() / vi.mock(), a temp dir via
fs.mkdtemp - Go: interfaces + fake implementations,
t.TempDir() - Java: Mockito, JUnit's
@TempDir - Rust: trait objects + fakes,
tempfilecrate A fake must match the real dependency's interface/contract exactly (same method names, same call signature) so it fails loudly if the real interface changes.
- Every bug that gets found and fixed in this session should get a
regression test that would have caught it - not just a fix. Name the test
after the bug's symptom, not generically (e.g.
test_archive_does_not_duplicate_on_reload, nottest_archive_2). - Test the failure path, not just the happy path: what happens when a dependency call throws/errors, when input is null/None/undefined, when an ID or path doesn't exist, when a boundary value is hit (empty list, max length, zero).
- Keep tests fast and independent - no sleeps/timers as a substitute for proper synchronization, and no test may depend on another test's side effects or run order. Every test must pass alone AND in any order.
- When fixing a bug elsewhere in the codebase, add or update its test in the same session - not as a separate follow-up. An unfixed bug without a regression test can silently reappear later.
- Write the tests and run them once to confirm they at least execute without collection errors. Report the pass/fail count and list any failures with their error messages - but do NOT attempt to fix the source code or the test assertions afterward. Stop here and let the user decide what to do with the failures.
- Always cleanup testing artifacts (like newly created temp files, local temp databases, or environment variables) after the test runs, ensuring no leftover garbage files in the project workspace.
- Stay scoped to the target file only. Do not read sibling files (config, init, other modules) unless the target file's imports require understanding them. If unsure whether pytest/test deps are installed, check pyproject.toml/requirements.txt ONCE at the very start, before reading any other file.
- Before writing any test, read the target file's own import statements first to know its ACTUAL dependencies. Never guess or add unrelated packages (e.g. requests, pandas) that the target file doesn't import.
- When tests fail, fix ONE failure at a time: read only the relevant test + relevant source function (not the whole file via read_local_file or sub-agent), make the fix, re-run only that test file, then move to the next failure. Do not scatter-search multiple failing test names at once with search_in_files.
- Never use shell redirects (2>&1, 2>nul, >, |) with execute_shell_command
- it runs with shell=False and redirects will not work; the tool already returns both stdout and stderr separately.
- When a test fails, first determine WHICH side is wrong - the test's assumption, or the source code's behavior - before fixing either one. Never weaken an assertion just to make it pass without understanding why it failed. State explicitly which side you're fixing and why.
- When mocking a third-party library/SDK, only look at HOW the target file uses it (which methods/attributes it calls, in what shape) - do not read the library's own source code in .venv/site-packages, node_modules, or vendor directories to "verify" the interface. Match only the exact call pattern found in the target file being tested.
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
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.

