Chemaclass/satscribe / .claude/skills/tdd
tdd
VerifiedImplement a feature test-first with strict red-green-refactor
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 1.4 KB |
SKILL.md
View on GitHub---
description: Implement a feature test-first with strict red-green-refactor
argument-hint: "<what to build>"
disable-model-invocation: true
allowed-tools: "Read, Write, Edit, Glob, Grep, Bash(vendor/bin/phpunit *), Bash(composer *), Task"
---
# TDD Workflow
Implement `$ARGUMENTS` test-first. Never skip red.
Test conventions (suites, mocking, naming) are in `.claude/rules/testing.md` — read it, don't re-derive.
For a multi-step feature where you want the discipline enforced turn by turn, delegate to the **`tdd-coach`** agent instead.
## RED
1. Identify module and layer — Action in `Application/`, value object in `Domain/Data/`, repository in `Infrastructure/Repository/`.
2. Declare the interface in `Domain/` first. That is the requirement, written down.
3. Write **one** failing test. `tests/Unit/<Module>/` unless it needs DB or HTTP, then `tests/Feature/`.
4. Run it and confirm it fails **for the right reason**:
```bash
vendor/bin/phpunit tests/Unit/<Module>/<Name>Test.php
```
Passing now means it proved nothing — fix the test, not the code.
## GREEN
5. Minimal implementation. No speculative branches, no extra methods.
6. Add the `$singletons` binding.
7. Re-run.
## REFACTOR
8. Improve naming, extract methods, remove duplication — green after every step.
9. Gate:
```bash
composer test
```
Loop back to RED for each additional behavior. Never batch several tests before implementing.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |