applying-tcr-with-agentslisted
Install: claude install-skill msewell/agent-stuff
# Applying TCR with Agents
TCR automatically commits when tests pass and reverts when they fail. Every
surviving change keeps the system green. Broken code never persists.
## Setup
1. Copy `scripts/tcr.sh` from this skill into the project root.
2. Make it executable: `chmod +x tcr.sh`.
3. Add `.agent-failures.log` to `.gitignore` (prevents failure logs from
being committed by `git add -A`).
4. Verify the project has at least one git commit and a working test command.
## Incompatibility with classical TDD red-phase discipline
In classical TDD, a lone failing test is written first and confirmed to fail
before any implementation is written. **TCR makes that impossible:** a
failing test triggers a full revert, destroying the test itself. There is no
stable red phase.
When using TCR, replace the red/green/refactor cycle with the rule in step 3
below: test and implementation are written together as one coherent atomic
change. This is TCR's substitute for the red phase — the discipline comes
from keeping the unit as small as possible, not from a separate failing-test
step. Do not apply a red-first TDD workflow alongside mechanical TCR
automation.
## Workflow
Work in small, atomic steps. Each step includes both a test and the
implementation to pass it, committed as a single unit.
1. **Reset the failure log:** `> .agent-failures.log`
2. **Identify the smallest next increment.** Pick one behavior that can be
tested and implemented together.
3. **Write the test and implem