testing skill
Implements Test-Driven Development by writing failing tests before writing minimal implementation code to ensure quality and correct behavior.
- GitHub stars
- 7
- Files
- 4
- Last commit
- May 12, 2026
- License
- MIT
- Allowed tools
- —
What does the testing skill do?
testing implements Test-Driven Development by writing failing tests before writing minimal implementation code to ensure quality and correct behavior.
Summary generated from the skill's SKILL.md.
About the testing skill
Implementing new features, fixing bugs, or refactoring code through strict Test-Driven Development is what this skill enables. Developers use this process to ensure every piece of production code is backed by a verified failing test before any implementation begins. By following the Red-Green-Refactor cycle, an agent ensures that tests actually validate behavior rather than just passing immediately due to existing code.
When an agent loads this skill, it should prioritize writing a single minimal test that describes a specific behavior. The agent must then run commands like npm test to confirm the test fails for the expected reason. Only after this verification should the agent write the simplest possible code to pass the test. This approach prevents over-engineering and ensures that the resulting software meets the exact requirements of the test cases without adding unnecessary features.
What an agent can do with it
- 1Develop new featuresCreate a new function by first writing a failing test that defines the expected behavior.
- 2Verify test validityConfirm that a test is actually testing the intended logic by watching it fail first.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the testing skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the testing skill in Plugin
/plugin marketplace add AvinashP/AgentsAtlas /plugin install agents-atlas@agents-atlas
Install the testing skill in Claude Code
~/.claude/skills/testing/SKILL.md
$ npx degit AvinashP/AgentsAtlas/skills/testing ~/.claude/skills/testingInstall the testing skill in Claude Code (project)
.claude/skills/testing/SKILL.md
$ npx degit AvinashP/AgentsAtlas/skills/testing .claude/skills/testingInstall the testing skill in Codex
~/.agents/skills/testing/SKILL.md
$ npx degit AvinashP/AgentsAtlas/skills/testing ~/.agents/skills/testingInstall the testing skill in Gemini CLI
~/.gemini/skills/testing/SKILL.md
$ npx degit AvinashP/AgentsAtlas/skills/testing ~/.gemini/skills/testingInstall the testing skill in Claude.ai
npx degit AvinashP/AgentsAtlas/skills/testing testing && zip -r testing.zip testing # claude.ai → Customize → Skills → + → Create skill → Upload a skill → testing.zip
SKILL.md
View on GitHubTest-Driven Development
Write the test first. Watch it fail. Write minimal code to pass.
The Iron Law
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
If 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.ts
Confirm:
- 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.ts
Confirm:
- 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 undefined
GREEN
function submitForm(data: FormData) {
if (!data.email?.trim()) {
return { error: 'Email required' };
}
// ...
}
Verify GREEN
$ npm test
PASS
REFACTOR - 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
Files in this skill
4testing skill questions
How do I install the testing skill in Claude Code?
Run npx degit AvinashP/AgentsAtlas/skills/testing ~/.claude/skills/testing. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the testing skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
What should I do if my test passes immediately?
If the test passes immediately, you are likely testing existing behavior rather than a new feature. You must fix the test and ensure you watch it fail first.