kode loop, the test suite must be executed and the results verified before production code is accepted.
How TDD Mode works
TDD Mode activates aTDDEnforcer that runs before any file write. It inspects every file in the proposed patch and classifies each one as either a test file or a production file.
Test file detection: A file is considered a test file if its name matches any of these patterns:
If a patch contains only production files (no test files), the write is blocked with:
Configuring TDD Mode
Enable TDD Mode in.kode/kode.json under the engine section:
test_command, Kode auto-detects the correct command by scanning your project for language markers:
Detection walks the project tree, skipping
node_modules, .git, and vendor directories.
What happens in a loop with TDD Mode on
When you runkode loop with TDD Mode enabled, Kode enforces a strict test-first sequence:
Example configuration
Here is a completekode.json for a Go project with TDD Mode enabled:
Related pages
- Guides: Loop mode — full walkthrough of the
kode loopworkflow with test integration and rollback behaviour