test-writing
Skill54 starsChanged 6 months agoMITView on GitHub
Writes meaningful tests that actually catch bugs.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- wilbeibi/wilbeibi-skillstheir own version, first seen Sep 7, 2026
- NVIDIA/torch-harmonicstheir own version, first seen Jul 13, 2026
- jnMetaCode/skillettheir own version, first seen Jun 10, 2026
- kumar303/pietheir own version, first seen Jun 8, 2026
- kwhorne/elyra-skillstheir own version, first seen May 22, 2026
- plipowczan/claude-piv-skeletontheir own version, first seen Jan 22, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- NVIDIA/torch-harmonics★ 710same name
- plipowczan/claude-piv-skeleton★ 4same name
- wilbeibi/wilbeibi-skills★ 2same name
- jnMetaCode/skillet★ 1same name
- kumar303/pie★ 1same name
- kwhorne/elyra-skills★ 1same name
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 repository31 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- architecture-sketchingSkill
- autonomous-bug-fixSkill
- behavioral-foundationSkill
- brainstormingSkill
- codebase-onboardingSkill
- code-reviewSkill
- debuggingSkill
- demand-eleganceSkill
- derive-nfr-from-driverSkill
- derive-security-from-riskSkill
- dispatching-parallel-agentsSkill
- durable-workSkill
- executing-plansSkill
- finishing-a-development-branchSkill
- plan-before-codeSkill
- pr-workflowSkill
- receiving-code-reviewSkill
- refactoringSkill
- requesting-code-reviewSkill
- requirements-elicitationSkill
- safety-guardrailsSkill
- security-auditSkill
- self-improvementSkill
- subagent-strategySkill
- traceability-gateSkill
- using-git-worktreesSkill
- using-superpowersSkill
- verify-before-doneSkill
- template-skillSkill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 5 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
NOT when the user explicitly asked for a spike or throwaway script.
- Very specific: line 63
Use grep for test_* or *.spec.* files and view one of them.
- Distinctive: line 93
Write a test that reproduces the bug.
- Distinctive: line 94
Run it. Confirm it fails for the right reason.
- Distinctive: line 96
Run it. Confirm it passes.
- Distinctive: line 97
Run the full suite — no regressions.
- Very specific: line 101
Run the suite via the powershell tool.
- Very specific: line 105
DO NOT: write tests that cannot fail (assert user is not None on a freshly constructed object).
- Very specific: line 106
DO NOT: test implementation details (e.g.
“Common” is measured: kept by at least 6 in 10 of the 4 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
Test Writing Skill
Produces tests that fail when the code is wrong — not tests that exist for coverage theatre. Covers happy path, edge cases, error paths, and state transitions. Does NOT chase 100% coverage as a goal; chases meaningful coverage that catches real regressions.
When to Use
- Writing tests for new code or features.
- Adding coverage to an untested area before changing it.
- A bug slipped through that tests should have caught.
- Practicing test-driven development.
- The
verify-before-doneskill flagged missing coverage. - NOT when the user explicitly asked for a spike or throwaway script.
Prerequisites
- A test framework installed for the stack (pytest, vitest, jest, go test, xUnit, JUnit).
- Ability to run the test suite via the
powershelltool. - The
view,edit, andgreptools to read existing patterns. - A baseline run of the existing suite passing.
How to Run
1. Read existing tests with `view`/`grep` to copy the project's pattern.
2. List scenarios: happy path, edges, errors, state transitions.
3. Write one test per scenario using Arrange-Act-Assert.
4. Run the suite — confirm new tests pass and nothing else broke.
5. If TDD: write the test first, watch it fail for the right reason, then implement.Quick Reference
| Stack | Framework | Run command |
| TypeScript | Vitest / Jest | npm test or npx vitest |
| Python | pytest | pytest or python -m pytest |
| Java | JUnit 5 | mvn test or gradle test |
| Go | testing | go test ./... |
| .NET | xUnit | dotnet test |
| Scenario type | Must cover |
| Happy path | Valid input → expected output |
| Edge case | Empty, null, boundary, maximum size |
| Error case | Invalid input, dependency failure, timeout |
| State transition | Stateful object moves between valid states |
Procedure
Step 1: Read the Existing Pattern
Use grep for test_* or *.spec.* files and view one of them. Match the project's naming, location, fixtures, and assertion style. Do not introduce a second testing dialect.
Step 2: Enumerate Scenarios
For the code under test, list:
- Happy path inputs.
- Edge cases (empty, null, boundary, max).
- Error cases (invalid input, dependency failure).
- State transitions, if stateful.
Step 3: Write Arrange-Act-Assert
def test_calculate_discount_for_premium_user():
# Arrange
user = create_user(tier="premium")
order = create_order(total=100.00)
# Act
discount = calculate_discount(user, order)
# Assert
assert discount == 20.00Name tests as documentation: test_login_with_expired_token_returns_401, not test_login.
Step 4: For Bug Fixes — Test First
- Write a test that reproduces the bug.
- Run it. Confirm it fails for the right reason.
- Implement the fix.
- Run it. Confirm it passes.
- Run the full suite — no regressions.
Step 5: Run and Record
Run the suite via the powershell tool. Capture pass/fail counts and paste them into the tasks/todo.md Verification Results block (per verify-before-done).
Pitfalls
- DO NOT write tests that cannot fail (
assert user is not Noneon a freshly constructed object). - DO NOT test implementation details (e.g. mocking that
quicksortwas called). Test the behavior. - DO NOT mock the world. Prefer real collaborators where the cost is acceptable.
- DO NOT ignore a flaky test — fix it or delete it. A flaky test erodes trust in the whole suite.
- DO NOT chase 100% coverage as a target. Coverage is a metric, not a mission.
Verification
- Every new test was observed to fail before it passed (TDD) OR a deliberate mutation was introduced to confirm it fails.
- The full suite is green after the change.
- Test names describe scenario + expected behavior.
- Each bug fix has a regression test that would have caught the original bug.
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.

