testing
Skill7 starsChanged 9 months agoMITView on GitHub
Use when implementing any feature or bugfix - before writing implementation code. Write the test first, watch it fail, then implement.
123 other projects use a version of this.
Adopted by
Most recently taken up by
- timmo001/skillstheir own version, first seen Oct 5, 2026
- kortix-ai/sunatheir own version, first seen Oct 5, 2026
- gilsmt/skillstheir own version, first seen Oct 4, 2026
- andeeplus/aplustheir own version, first seen Oct 4, 2026
- JetBrains/intellij-communitytheir own version, first seen Oct 3, 2026
- shinpr/codex-workflowstheir own version, first seen Oct 2, 2026
Used with
Projects with it also use oss-pr, pr-automation and 10 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.
CES-LtdSkilloss-pr
Use when creating a pull request, after committing changes, or when user invokes /oss-pr. Covers branch management, quality checks, commit, push, and PR creation.
Also in 3 projects that use this
CES-LtdSkillpr-automation
PR Automation Orchestrator: poll open PRs, check CI, run review, fix, and merge eligible PRs. Use when: (1) Invoked by daemon via scripts/pr-automation.sh, (2) User says "/pr-automation".
Also in 3 projects that use this
ffsshhttiikkSkillcicd
Continuous integration and delivery pipelines
Also in 4 projects that use this
ffsshhttiikkSkillnetworking
Practical application and coding skills for Networking
Also in 3 projects that use this
JohnJBorenSkillci-cd
CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies
Also in 9 projects that use this
Cogni-AI-OUSkilldotfiles
Reference for repository dotfiles, including their purposes, standard configurations, and usage guidelines. You MUST load this skill when configuring, troubleshooting, or understanding repository dotfiles.
Also in 3 projects that use this
- +2 more from CES-Ltd
- +1 more from ffsshhttiikk
Other versions123 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 123
- lobehub/lobehub★ 83ksame name
- iOfficeAI/AionUi★ 33ksame name
- JetBrains/intellij-community★ 21ksame name
- kortix-ai/suna★ 20ksame name
- modelcontextprotocol/inspector★ 11ksame name
- microsoft/fast★ 9.7ksame name
- bytebase/dbhub★ 3.6ksame name
- theopenco/llmgateway★ 1.7ksame name
- BankrBot/skills★ 1.2ksame name
- microsoft/CCF★ 875same name
113 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 repository26 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- templates/CLAUDE.mdCLAUDE.md
- atlas-completeSkill
- atlas-executeSkill
- atlas-initSkill
- atlas-planSkill
- atlas-reviewSkill
- atlas-statusSkill
- atlas-syncSkill
- atlas-triageSkill
- brainstormingSkill
- committingSkill
- creating-prSkill
- debuggingSkill
- explaining-codeSkill
- frontend-designSkill
- mcp-builderSkill
- receiving-feedbackSkill
- refactoringSkill
- scaffoldingSkill
- security-auditSkill
- skill-creatorSkill
- verifyingSkill
- webapp-testingSkill
- web-artifacts-builderSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 10 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 105 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Write the test first. Watch it fail.
- Distinctive: line 16
If you didn't watch the test fail, you don't know if it tests the right thing.
- Distinctive: line 18
Write code before the test?
- Distinctive: line 39
Write one minimal test showing what should happen.
- Distinctive: line 72
Test fails (not errors)
- Distinctive: line 80
Write the simplest code to pass the test.
- Distinctive: line 104
Don't add features, refactor other code, or "improve" beyond the test.
- Distinctive: line 128
Keep tests green. Don't add behavior.
- Distinctive: line 138
Test passes immediately (didn't watch it fail)
- Distinctive: line 169
Test-first forces you to see the test fail, proving it actually tests something.
“Common” is measured: kept by at least 6 in 10 of the 105 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-Driven Development
Write the test first. Watch it fail. Write minimal code to pass.
The Iron Law
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRSTIf you didn't watch the test fail, you don't know if it tests the right thing.
Write code before the test? Delete it. Start over.
When to Use
Always:
- New features
- Bug fixes
- Refactoring
- Behavior changes
Exceptions (ask first):
- Throwaway prototypes
- Generated code
- Configuration files
Thinking "skip TDD just this once"? Stop. That's rationalization.
Red-Green-Refactor
RED - Write Failing Test
Write one minimal test showing what should happen.
// Good: Clear name, tests real behavior, one thing
test('rejects empty email', async () => {
const result = await submitForm({ email: '' });
expect(result.error).toBe('Email required');
});// Bad: Vague name, tests mock not code
test('form works', async () => {
const mock = jest.fn().mockResolvedValue('success');
await submitForm(mock);
expect(mock).toHaveBeenCalled();
});Requirements:
- One behavior per test
- Clear descriptive name
- Real code (no mocks unless unavoidable)
Verify RED - Watch It Fail
MANDATORY. Never skip.
npm test path/to/test.test.tsConfirm:
- Test fails (not errors)
- Failure message is expected
- Fails because feature missing (not typos)
Test passes? You're testing existing behavior. Fix the test.
GREEN - Minimal Code
Write the simplest code to pass the test.
// Good: Just enough to pass
function validateEmail(email: string): string | null {
if (!email?.trim()) return 'Email required';
return null;
}// Bad: Over-engineered
function validateEmail(
email: string,
options?: {
allowEmpty?: boolean;
customRegex?: RegExp;
onValidate?: (email: string) => void;
}
): ValidationResult {
// YAGNI - don't add features not tested
}Don't add features, refactor other code, or "improve" beyond the test.
Verify GREEN - Watch It Pass
MANDATORY.
npm test path/to/test.test.tsConfirm:
- Test passes
- Other tests still pass
- Output clean (no errors, warnings)
Test fails? Fix code, not test.
REFACTOR - Clean Up
After green only:
- Remove duplication
- Improve names
- Extract helpers
Keep tests green. Don't add behavior.
Repeat
Next failing test for next feature.
Red Flags - STOP and Start Over
- Code before test
- Test after implementation
- Test passes immediately (didn't watch it fail)
- Can't explain why test failed
- "I'll test after"
- "Too simple to test"
- "Just this once"
- "Already manually tested it"
- "Keep as reference" (delete means delete)
All of these mean: Delete code. Start over with TDD.
Common Rationalizations
| Excuse | Reality |
| "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
| "I'll test after" | Tests passing immediately prove nothing. |
| "Already manually tested" | Ad-hoc ≠ systematic. No record, can't re-run. |
| "Need to explore first" | Fine. Throw away exploration, start with TDD. |
| "Test hard = skip it" | Hard to test = hard to use. Simplify design. |
| "TDD will slow me down" | TDD faster than debugging. |
| "Deleting X hours is wasteful" | Sunk cost fallacy. Keeping unverified code is debt. |
Why Order Matters
"I'll write tests after to verify it works"
Tests written after code pass immediately. Passing immediately proves nothing:
- Might test wrong thing
- Might test implementation, not behavior
- You never saw it catch the bug
Test-first forces you to see the test fail, proving it actually tests something.
Quick Reference
Test Types
| Type | Purpose | Dependencies |
| Unit | Single function/method | Mock externals |
| Integration | Multiple components | Real dependencies |
| E2E | Full user workflow | Full system |
What to Test
Always test:
- Happy path (normal usage)
- Edge cases (empty, null, boundaries)
- Error handling (invalid input, failures)
Skip testing:
- Framework code (React, Express)
- Third-party libraries
- Simple getters/setters
Verification Checklist
Before marking complete:
- Every new function has a test
- Watched each test fail before implementing
- Each test failed for expected reason
- Wrote minimal code to pass each test
- All tests pass
- Tests use real code (mocks only if unavoidable)
Can't check all boxes? You skipped TDD. Start over.
Example: Bug Fix with TDD
Bug: Empty email accepted
RED
test('rejects empty email', async () => {
const result = await submitForm({ email: '' });
expect(result.error).toBe('Email required');
});Verify RED
$ npm test
FAIL: expected 'Email required', got undefinedGREEN
function submitForm(data: FormData) {
if (!data.email?.trim()) {
return { error: 'Email required' };
}
// ...
}Verify GREEN
$ npm test
PASSREFACTOR - Extract validation if needed.
When Stuck
| Problem | Solution |
| Don't know how to test | Write desired API first. Write assertion first. |
| Test too complicated | Design too complicated. Simplify interface. |
| Must mock everything | Code too coupled. Use dependency injection. |
| Test setup huge | Extract helpers. Still complex? Simplify design. |
See Also
- frameworks.md - Framework-specific patterns (Jest, Vitest, Pytest)
- patterns.md - Common test patterns and examples
- anti-patterns.md - Testing mistakes to avoid
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.

