Red: failing tests first, locked
Gate: L7-build (red half). The tests are written by batuta:test-author, never by the agent that will write the code.
- Brief and launch the test-author with the
briefanddelegateskills (subagent_type="batuta:test-author", model fromroute show). Each test file carries one marker line# REQ: <requirement id>(// REQ: ...in JavaScript or TypeScript). - Run the project's test command. Every new test must fail for the right reason (the missing behavior), not for an import error or a typo. A test that passes before the code exists tests nothing: fix the test.
- Lock the files by hash (a dry run first):
python "${CLAUDE_PLUGIN_ROOT}/scripts/batuta.py" tdd lock --task T-001 tests/test_x.pypython "${CLAUDE_PLUGIN_ROOT}/scripts/batuta.py" tdd lock --task T-001 tests/test_x.py --apply - Commit the red step with the C32 message, naming the files explicitly:
python "${CLAUDE_PLUGIN_ROOT}/scripts/batuta.py" tdd commit --red T-001 -m "TITLE" tests/test_x.py --apply - Check the history so far:
python "${CLAUDE_PLUGIN_ROOT}/scripts/batuta.py" tdd check - Hand over to the
greenskill. A locked test changes only through an approved change request (seegreen); the locked-tests guard denies any other edit.
On a non-zero exit: exit 1 from tdd lock is a refusal (a changed hash without an approved request, a path outside the
repository); exit 1 from tdd check is a broken rule (a red commit whose tests are not locked or do not fail): fix and
re-run, never edit the lock file by hand. Exit 2 is a warning (for example no red commit yet): report it.