All skills
brianlovin avatar

/tdd

@b04ee57 official

Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.

Use this Skill: https://skilld.dev/gh/brianlovin/claude-config/tdd

This session only. Nothing lands on disk.

deep-modules.md

≈310 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Deep Modules

From "A Philosophy of Software Design":

Deep module = small interface + lots of implementation

┌─────────────────────┐
│   Small Interface   │  ← Few methods, simple params
├─────────────────────┤
│                     │
│                     │
│  Deep Implementation│  ← Complex logic hidden
│                     │
│                     │
└─────────────────────┘

Shallow module = large interface + little implementation (avoid)

┌─────────────────────────────────┐
│       Large Interface           │  ← Many methods, complex params
├─────────────────────────────────┤
│  Thin Implementation            │  ← Just passes through
└─────────────────────────────────┘

When designing interfaces, ask:

  • Can I reduce the number of methods?
  • Can I simplify the parameters?
  • Can I hide more complexity inside?

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides instructions and best practices for Test-Driven Development (TDD), focusing on the 'red-green-refactor' workflow and interface design. No security issues were detected.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    6/6 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at b04ee57. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Dormantupdated 8 months ago

README badge

README badge for brianlovin/claude-config/tdd

Guides AI agents through test-driven development using vertical slices (one test, one implementation cycle) rather than writing all tests upfront. Emphasizes behavior-focused integration tests over implementation details, with concrete planning, tracer bullet, and refactor phases.

Generated from the current SKILL.md.

What's the difference between testing behavior vs. implementation details?
Behavior tests exercise real code paths through public APIs and describe what the system does (e.g., 'user can checkout with valid cart'). Implementation tests couple to internal structure, mock collaborators, or test private methods. The warning sign: tests break when you refactor code but behavior hasn't changed.
Should I write all tests first, then all implementation?
No. Writing all tests in bulk before any implementation (horizontal slicing) produces tests that verify imagined behavior and data structure shapes rather than actual user-facing behavior. Instead, use vertical slices: one test → one implementation → repeat, so each test responds to what you learned from the previous cycle.
What does a tracer bullet mean in TDD?
A tracer bullet is the first test-implementation cycle: write one test for one specific behavior, watch it fail (RED), then write minimal code to pass it (GREEN). This proves the path works end-to-end before incrementally adding more tests and code.
When should I refactor?
Only after all your tests pass (GREEN). Look for duplication, opportunities to deepen modules, or SOLID principle applications. Never refactor while RED. Run tests after each refactor step to confirm behavior is preserved.
How do I know which behaviors to test?
Confirm with the user upfront which behaviors matter most. You can't test everything. Focus testing effort on critical paths and complex logic, not every edge case. Get user approval on the plan before starting.

Generated from the current SKILL.md. These answers refresh after source changes.