← ClaudeAtlas

applying-tcr-with-agentslisted

Applies TCR (test && commit || revert) discipline as a workflow and guardrail for AI-assisted software development. Sets up TCR scripts, selects revert strategies, integrates with tool-specific hooks, and configures guardrails for autonomous agent loops. Use when implementing test-and-commit-or-revert workflows, adding automatic revert on test failure, setting up agent coding loops with safety nets, enforcing small steps via automatic commit on green and revert on red, or when the user mentions TCR, test && commit || revert, automatic revert on failing tests, or coding loop guardrails.
msewell/agent-stuff · ★ 0 · AI & Automation · score 70
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