install
source · Clone the upstream repo
git clone https://github.com/TypedDevs/bashunit
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/TypedDevs/bashunit "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/tdd-cycle" ~/.claude/skills/typeddevs-bashunit-tdd-cycle && rm -rf "$T"
manifest:
.claude/skills/tdd-cycle/SKILL.mdsource content
TDD Cycle
Execute a complete Red -> Green -> Refactor cycle.
Workflow
1. Verify Task File
Check for
.tasks/YYYY-MM-DD-*.md. If missing, create one before proceeding.
2. RED — Write Failing Test
- Show test inventory from task file, ask which test to implement
- Study patterns from existing tests (unit ->
, doubles ->assert_test.sh
)doubles_test.sh - Write the failing test following Arrange-Act-Assert
- Run:
— must fail./bashunit path/to/test.sh - Verify failure is for the RIGHT reason (not syntax error or wrong setup)
- Update task file: current red bar + logbook entry
3. GREEN — Make It Pass
- Write minimal code in
— only enough for THIS testsrc/ - Run:
— must pass./bashunit path/to/test.sh - Update task file: check off test + logbook entry
4. REFACTOR — Improve Code
- Improve readability, naming, extract duplication — no behavior changes
- Run tests after each change
- Quality checks:
make sa && make lint && shfmt -w . - Full suite:
./bashunit tests/ - Update task file with refactoring notes
5. Next Test
Show updated test inventory. Ask if continuing or done.
Critical Rules
- Never skip RED — always verify test fails first
- Minimal code in GREEN — resist feature creep
- All tests green during REFACTOR — revert if broken
- Update task file after each phase