tdd-mastery
Test-driven development workflow with Red-Green-Refactor cycle across languages
npx skills add rohitg00/awesome-claude-code-toolkit --skill tdd-mastery --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# TDD Mastery ## Core Cycle: Red-Green-Refactor 1. **Red** - Write a failing test that defines the desired behavior 2. **Green** - Write the minimum code to make the test pass 3. **Refactor** - Clean up while keeping tests green Never write production code without a failing test first. Each cycle should take 2-10 minutes. ## Test Structure Use the Arrange-Act-Assert pattern consistently: ``` Arrange: Set up test data and dependencies Act: Execute the behavior under test Assert: Verify the expected outcome ``` Name tests as `test_<unit>_<scenario>_<expected_result>` or `it("should <behavior> when <condition>")`. ## Jest / Vitest Patterns ```typescript describe("OrderService", () => { it("should apply discount when order exceeds threshold", () => { const order = createOrder({ items: [{ price: 150, qty: 1 }] }); const result = applyDiscount(order, { threshold: 100, percent: 10 }); expect(result.total).toBe(135); }); it("should throw when applying discount to empty order", () => { const order = createOrder({ items: [] }); expect(() => applyDiscount(order, defaultDiscount)).toThrow(EmptyOrderError); }); }); ``` Use `vi.fn()` / `jest.fn()` for mocks. Prefer dependency injection over modu
- Core Cycle: Red-Green-Refactor
- Test Structure
- Jest / Vitest Patterns
- pytest Patterns
- Go Testing Patterns
- Test Levels
- Coverage Rules
- Mocking Guidelines
- Anti-Patterns to Avoid
Jest/Vitest vitest run --coverage --coverage.thresholds.lines=80 --coverage.thresholds.branches=75 pytest pytest --cov=src --cov-fail-under=80 --cov-branch Go go test -coverprofile=cover.out -coverpkg=./... ./... go tool cover -func=cover.out
What does the tdd-mastery skill do?
Test-driven development workflow with Red-Green-Refactor cycle across languages
How do I install it?
Run `npx skills add rohitg00/awesome-claude-code-toolkit --skill tdd-mastery --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From rohitg00/awesome-claude-code-toolkit, a repository with 2,438 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.