Agent skill · Testing & QA

tdd-mastery

Test-driven development workflow with Red-Green-Refactor cycle across languages

Rohit Ghumare73,165★ · +3,601/wk · 3 repos on radarProfile →
claude-codeApache-2.0
Install
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.

Facts
Files in the skill folder: 1
SKILL.md size: 4 KB
Bundled scripts: none
Path: skills/tdd-mastery/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 2,438
Language: JavaScript
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 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

What's inside
Steps it walks through
  1. Core Cycle: Red-Green-Refactor
  2. Test Structure
  3. Jest / Vitest Patterns
  4. pytest Patterns
  5. Go Testing Patterns
  6. Test Levels
  7. Coverage Rules
  8. Mocking Guidelines
  9. Anti-Patterns to Avoid
Commands it runs
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
More from awesome-claude-code-toolkit
All skills →
About this skill
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.

Keep going