macos-programmer
macOS-specific development patterns, platform APIs, and decision frameworks. Use when developing Mac apps, macOS applications, Cocoa/AppKit code, or making…
Core TDD philosophy and testing principles. Use when writing tests interactively or need testing guidance. Emphasizes tests as contracts, mock boundaries not internals, and implementation fixes over test changes.
$ npx -y skills add Pyroxin/opinionated-claude-skills --skill test-driven-development --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/test-driven-developmentContext preview
The summary Claude sees to decide when to auto-load this skill.
Core TDD philosophy and testing principles. Use when writing tests interactively or need testing guidance. Emphasizes tests as contracts, mock boundaries not internals, and implementation fixes over test changes.
name: test-driven-development description: Core TDD philosophy and testing principles. Use when writing tests interactively or need testing guidance. Emphasizes tests as contracts, mock boundaries not internals, and implementation fixes over test changes.
**For system-level design principles and architectural boundaries, see the `software-engineer` skill.**
<core_philosophy> **Foundation**: TDD is an application of contract-based design. Tests define the contract an implementation must fulfill—they are specifications, not afterthoughts. This connects directly to the abstraction principles in the `software-engineer` skill.
**Tests = Contracts**: Tests represent business requirements and expected behavior. They are contracts the implementation must fulfill. Never compromise test integrity to achieve green tests.
**Tests are source of truth**: When tests fail, fix the implementation. Only change tests when requirements change or test has a verified bug. </core_philosophy>
<architectural_boundaries> **Identify architectural boundaries** in your system:
</architectural_boundaries>
<unit_definition> **What constitutes a "unit":**
A "unit" is a cohesive component at an architectural boundary:
</unit_definition>
<mocking_rules> **When to mock:**
**When NOT to mock:**
</mocking_rules>
<test_balance> **Balance unit and integration tests:**
</test_balance>
<example> **Layered data store (hexagonal architecture):**
┌───────────────────────────────────────────────────────┐ │ Application Core │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │ │ Domain │ │ Service │ │ Use Case │ │ │ │ Models │ │ Layer │ │ Layer │ │ │ └─────────────┘ └─────────────┘ └─────────────┘ │ │ │ ├───────────────────────BOUNDARY────────────────────────┤ │ │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │ │ Database │ │ External │ │ HTTP │ │ │ │ Adapter │ │ API │ │ Client │ │ │ └─────────────┘ └─────────────┘ └─────────────┘ │ └───────────────────────────────────────────────────────┘
</example>
<test_doubles> **Understanding test double types** aids in communicating test intent. This taxonomy was formalized by Gerard Meszaros in *xUnit Test Patterns* (2007):[^1]
| Type | Purpose | When to Use | |------|---------|-------------| | **Stub** | Returns predetermined values | When behavior doesn't affect test outcome | | **Mock** | Verifies interactions occurred | When the interaction IS the behavior being tested | | **Fake** | Working implementation (simplified) | When real implementation too slow/complex | | **Spy** | Records calls for later verification | When need to verify after execution |
**Key insight**: Overuse of mocks often indicates testing implementation rather than behavior. Prefer stubs when possible; use mocks when interactions are the contract.
[^1]: Gerard Meszaros. 2007. *xUnit Test Patterns: Refactoring Test Code*. Addison-Wesley. </test_doubles>
<design_steps> **When designing tests:** 1. Identify architectural boundaries in the system 2. Determine what constitutes a "unit" (component, layer, module) 3. Plan unit tests for each unit with dependencies mocked at boundaries 4. Plan integration tests crossing boundaries with real implementations 5. Ensure tests verify usage/requirements, not implementation details </design_steps>
<failure_response> **When test fails:** 1. Read test to understand expected behavior 2. Debug implementation to find why it doesn't meet expectations 3. Fix implementation, never "fix" test to pass </failure_response>
<quality_criteria> **Test quality requirements:**
</quality_criteria>
<tdd_cycle> 1. **Write failing tests FIRST** based on requirements (including desired usage pattern
This project descends from the personal prompts I'd been keeping for Claude Code prior to the release of skills and plugins. Over time it's also evolved into a sandbox where I figure out what makes Claude reliably good at a task, and find prompts that work.
macOS-specific development patterns, platform APIs, and decision frameworks. Use when developing Mac apps, macOS applications, Cocoa/AppKit code, or making…
Swift-specific idioms, tooling, and philosophy for both application development and command-line scripting. Use when working with Swift code, including Swift…
Fish shell scripting judgment frameworks and critical idioms. Use when writing Fish scripts or shell automation. Focuses on when to use Fish vs bash,…
Java-specific tooling, documentation standards, testing practices, and modern idioms. Use when working with Java code or Java-based projects on the JVM.
Clojure-specific philosophy, idioms, and judgment frameworks. Use when working with Clojure code. Emphasizes data-oriented design, runtime validation with…
Racket-specific tooling, libraries, idioms, and language-oriented programming philosophy. Use when working with Racket code. Emphasizes LOP, contracts, macros,…