test-first
Skill0 starsChanged 10 months agoMITView on GitHub
Test-first development practices for high-quality code
29 other projects use a version of this.
Adopted by
Most recently taken up by
- romerma/mstacktheir own version, first seen Nov 29, 2026
- Stelliad/stelliad-skillstheir own version, first seen Nov 22, 2026
- anivar/agentic-sdlctheir own version, first seen Nov 16, 2026
- iaintsaket/how-saket-claudestheir own version, first seen Nov 15, 2026
- llopresto87/Cypresstheir own version, first seen Nov 11, 2026
- TheLunchTrae/claude-code-configstheir own version, first seen Nov 8, 2026
Used with
Projects with it also use security-sweep, understand and 8 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.
paulocsbSkillsecurity-sweep
Comprehensive security audit of the app: RLS coverage, leaked secrets, auth flows, OWASP-style checks. Use periodically (before big releases, before onboarding many new friends, or after sensitive changes to policies/auth).
Also in 3 projects that use this
agoodwaySkillunderstand
Multi-specialist collaborative analysis to understand how features, functions, or components work
Also in 3 projects that use this
danpegSkillbug-hunt
Run adversarial bug hunting on your codebase. Uses 3 isolated agents (Hunter, Skeptic, Referee) to find and verify real bugs with high fidelity. Invoke with /bug-hunt, /bug-hunt [path], or /bug-hunt -b <branch> [--base <base>].
Also in 3 projects that use this
GitHubSkillrefactor
Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.
Also in 4 projects that use this
MicrosoftSkillapi-design
Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.
Also in 3 projects that use this
Google CloudSkilltriage
Gather context on a change or bug and plan the implementation.
Also in 3 projects that use this
Other versions29 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 29
- JordanCoin/codemap★ 715same name
- NoobyGains/godmode★ 140same name
- llopresto87/Cypress★ 121same name
- claude-world/director-mode-lite★ 80same name
- bmtrnavsky/disciplined-vibe-coding★ 27same name
- s-hiraoku/synapse-a2a★ 17same name
- dfedoryshchev/weftworks★ 5same name
- Stelliad/stelliad-skills★ 4same name
- eeshsaxena/agent-skills★ 2same name
- iaintsaket/how-saket-claudes★ 2same name
19 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.
- CLAUDE.mdCLAUDE.md
- templates/CLAUDE.mdCLAUDE.md
- quality-gatesSkill
- task-decompositionSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 24 edited versions we read keep these.
3
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 29
Before writing any implementation:
- Distinctive: line 47
Write the simplest code that makes the test pass:
- Distinctive: line 51
Don't add features: - Only what the test needs
“Common” is measured: kept by at least 6 in 10 of the 24 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-First Development
The Red-Green-Refactor Cycle
┌─────────────────────────────────────┐
│ │
▼ │
[RED] │
Write a failing test │
│ │
▼ │
[GREEN] │
Write minimal code to pass │
│ │
▼ │
[REFACTOR] │
Improve code, keep tests green ─────────┘Phase 1: RED - Write a Failing Test
Before writing any implementation:
- Define the behavior - What should happen?
- Write the test - Assert the expected outcome
- Run the test - Confirm it fails
- Verify the failure - It should fail for the right reason
// Good: Test defines behavior clearly
test('should reject invalid email', () => {
const user = new User({ email: 'not-an-email' });
expect(user.isValid()).toBe(false);
expect(user.errors).toContain('Invalid email format');
});Phase 2: GREEN - Make It Pass
Write the simplest code that makes the test pass:
- Don't over-engineer - Just make it work
- Don't optimize - That comes later
- Don't add features - Only what the test needs
// Minimal implementation to pass the test
class User {
isValid() {
return this.email.includes('@');
}
}Phase 3: REFACTOR - Improve the Code
With tests green, safely improve:
- Remove duplication - DRY up the code
- Improve naming - Make intent clear
- Simplify logic - Reduce complexity
- Run tests after each change - Stay green
// Refactored with better validation
class User {
private static EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
isValid() {
return User.EMAIL_REGEX.test(this.email);
}
}Test Structure: AAA Pattern
test('descriptive name of behavior', () => {
// Arrange - Set up test data
const input = createTestInput();
// Act - Execute the code under test
const result = functionUnderTest(input);
// Assert - Verify the outcome
expect(result).toEqual(expectedOutput);
});What to Test
Always Test
- Happy path (normal operation)
- Edge cases (empty, null, boundary values)
- Error cases (invalid input, failures)
- State transitions
- Public API contracts
Sometimes Test
- Complex private methods (via public API)
- Integration points
- Performance-critical paths
Never Test
- Third-party library behavior
- Trivial getters/setters
- Framework internals
- Implementation details
Test Quality Checklist
- Test name describes the behavior, not implementation
- Test is independent (no shared mutable state)
- Test has one logical assertion
- Test fails for the right reason
- Test is deterministic (no flakiness)
- Test runs fast (< 100ms for unit tests)
Common Patterns
Testing Async Code
test('fetches user data', async () => {
const user = await fetchUser(123);
expect(user.name).toBe('Alice');
});Testing Errors
test('throws on invalid input', () => {
expect(() => parseDate('invalid')).toThrow('Invalid date format');
});Testing Side Effects
test('logs error on failure', () => {
const mockLogger = jest.fn();
processData(invalidData, { logger: mockLogger });
expect(mockLogger).toHaveBeenCalledWith('Error processing data');
});Anti-Patterns to Avoid
- Test implementation, not behavior - Tests break on refactor
- Multiple assertions testing different things - Hard to diagnose
- Shared mutable state - Flaky, order-dependent tests
- Testing private methods directly - Couples to implementation
- Excessive mocking - Tests pass but code is broken
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.

