kit-test-writing
Skill0 starsChanged 20 days agoMITView on GitHub
Write tests for existing code using the project's test framework and conventions, covering behavior, edge cases, and failure paths. Use when the user asks to add tests, improve test coverage, or write tests for a specific module or function. Do not use for fixing failing tests (use kit-debugging) or for implementing new behavior; this skill does not change the code under test.
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Test the code as it is. Do not change the code under test unless the user asks.
- Very specific: line 13
If the project has no tests, use the framework its tooling implies (for example the test script in package.json, or pytest configuration).
- Distinctive: line 17
Read the code and its callers to learn the intended behavior: inputs, outputs, errors, and side effects.
- Distinctive: line 19
Test observable behavior through the public interface.
- Distinctive: line 24
Run the new tests and the existing suite.
- Very specific: line 33
Use: "Add tests for src/slugify.js." "Our date utilities have no tests.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Writing tests
Test the code as it is. Do not change the code under test unless the user asks.
1. Learn the project's testing setup
- Find the test framework, runner command, file locations, naming patterns, helpers, and fixtures already in use. Read a few existing tests and match their style.
- If the project has no tests, use the framework its tooling implies (for example the
testscript inpackage.json, orpytestconfiguration). If nothing is set up, propose a minimal setup and ask before adding dependencies.
2. Decide what to test
- Read the code and its callers to learn the intended behavior: inputs, outputs, errors, and side effects.
- Cover typical cases, boundaries (empty, zero, one, maximum, unusual characters), invalid input and error paths, and important interactions.
- Test observable behavior through the public interface. Avoid asserting on private details or mocking what can be used directly.
3. Write and run the tests
- Give each test a descriptive name and one reason to fail. Keep tests deterministic and independent.
- Run the new tests and the existing suite.
- If a test reveals that the code does not do what its documentation, types, or callers expect, do not weaken the test to make it pass and do not silently fix the code. Report the discrepancy with the failing case, and either leave the test out or mark it with the project's skip or expected-failure convention, as the user prefers.
4. Report
List the tests added and what each covers, the commands run and their results, and any suspected bugs found.
Examples
- Use: "Add tests for src/slugify.js." "Our date utilities have no tests; cover them."
- Skip: "The checkout test is failing." (use kit-debugging) "Add a slug uniqueness check." (feature work)
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- kit-code-reviewSkill
- kit-commitSkill
- kit-debuggingSkill
- kit-documentationSkill
- kit-feature-implementationSkill
- kit-pull-requestSkill
- kit-refactoringSkill
- kit-security-auditSkill
- kit-testing-rulesSkill
- kit-test-writingSkill
- kit-typescript-rulesSkill
- kit-code-reviewSkill
- kit-commitSkill
- kit-debuggingSkill
- kit-documentationSkill
- kit-feature-implementationSkill
- kit-pull-requestSkill
- kit-refactoringSkill
- kit-security-auditSkill
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.

