TDD pair programming with file watcher. Watches files for changes, runs them, reports RED/GREEN, and mentors following Scientific TDD rules. Use when the user wants to do TDD, pair program with tests, or have Claude watch and give feedback on code changes. Trigger on phrases like "tdd", "watch and test", "pair program", "red green refactor".
Pair programming with file watcher. The user codes, Claude watches, runs, and gives feedback.
Always read ~/.claude/CLAUDE.md and load the Scientific TDD rules. These rules govern ALL feedback during the session. Key rules to internalize:
The user provides a target to watch. Parse it:
scratch/graph.rb -> watch that file, run with appropriate commandscratch/ -> watch recursively with fswatch -1 -rscratch/graph.rb ruby -> watch file, run with specified commandIf no command is specified, infer from extension:
.rb -> ruby.py -> python3.rs -> rustc <file> -o /tmp/rustout && /tmp/rustout.go -> go run.js -> node.ts -> npx tsxfswatch -1 (or fswatch -1 -r for directories) as a background taskKeep it short. The user can read the code.
On GREEN (all assertions pass):
GREEN. {one-line summary of what changed if relevant}
Show stdout if there is any.
On RED (assertion or error):
RED. {which assertion failed and why, or the error}
Show the relevant error output.
On no change:
No changes.