Enforces Test-Commit-Revert (TCR) discipline by blocking direct git commits and requiring all changes to pass tests before committing. Protects critical scripts and config files.
This skill enforces Test-Commit-Revert (TCR) discipline for codebases that require all changes to pass tests before being committed. It blocks direct git commits and mandates using a TCR script that automatically reverts changes if tests fail.
1. **Blocks Direct Commits**: Disables auto-commits and dirty-commits to prevent bypassing TCR
2. **Enforces TCR Script**: Requires all commits to go through `./scripts/tcr.sh`
3. **Protects Critical Files**: Makes TCR scripts and configuration files read-only
4. **Maintains Discipline**: Ensures code quality by requiring passing tests before any commit
When operating under TCR Jail:
1. **NEVER use direct git commit commands**
- Do not use `git commit`
- Do not enable auto-commits
- All commits MUST go through the TCR script
2. **Always commit using the TCR script**
- Command: `./scripts/tcr.sh "your commit message"`
- The script will automatically:
- Run tests
- Commit if tests pass
- Revert changes if tests fail
3. **Respect read-only files**
- Never modify files in the read-only list:
- `.git/**` - Git internals
- `scripts/tcr.sh` - TCR commit script
- `scripts/revert-to-safe.sh` - Revert utility
- `scripts/verify-jail.sh` - Jail verification
- `scripts/setup-tcr-jail.sh` - Jail setup
- `.claude/**` - Claude configuration
- `.opencode/**` - OpenCode configuration
- `.aider*` - Aider configuration files
- `.cursorrules` - Cursor rules
- `.cursorignore` - Cursor ignore patterns
4. **When you need to commit**
- Write your code changes
- Ensure tests are updated or created
- Run: `./scripts/tcr.sh "descriptive commit message"`
- If tests fail, changes will auto-revert - fix and try again
5. **If blocked from committing**
- You will see: "STOP! You must use ./scripts/tcr.sh to commit."
- This is intentional - use the TCR script instead
- Direct git commits are forbidden in this workflow
```bash
./scripts/tcr.sh "Add new feature X"
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/tcr-jail-enforced-test-commit-revert/raw