Enable TDD Dev Mode for the session
Enables strict Test-Driven Development mode for the session. Automatically detects test frameworks and enforces Red→Green→Refactor cycles for all coding tasks.
/plugin marketplace add hculap/better-code/plugin install tdd-dev@better-codeActivate TDD Dev Mode for this session. From now on, apply strict Test-Driven Development practices to all coding requests.
Before creating the flag file, detect the test command:
.claude/tdd-dev.local.md in project rootpackage.json exists: Use npm test or check for vitest/jest in devDependenciespyproject.toml or pytest.ini exists: Use pytestgo.mod exists: Use go test ./...strict if not configuredCRITICAL: Create the flag file that enables hook enforcement.
.claude/ directory exists in project root.claude/.tdd-mode-active with the following JSON content:{
"active": true,
"activatedAt": "[current ISO timestamp]",
"strictness": "strict",
"testCommand": "[detected or configured test command]"
}
This file signals to hooks that TDD mode is active and stores the detected configuration for use by commands and hooks.
CRITICAL: Create the cycle state file that tracks TDD phases.
Create .claude/.tdd-cycle-state with the following JSON content:
{
"phase": "red",
"testFilesWritten": [],
"testsRan": false,
"testsFailed": false
}
This file tracks the current TDD phase:
The hooks use this file to enforce the TDD cycle:
Set the following TDD mode state:
Provide a brief orientation:
TDD Dev Mode: ACTIVE
Configuration:
Strictness: [mode]
Test Command: [command]
Available Commands:
/tdd-dev:feature "<description>" - Implement new feature with TDD
/tdd-dev:bug "<description>" - Fix bug with regression test first
/tdd-dev:refactor "<target>" - Safe refactoring with test coverage
Flags (any command):
--strict / --standard / --relaxed - Override strictness
--no-refactor - Skip refactor phase
--file <path> - Target specific file
How it works:
1. All coding requests now follow Red→Green→Refactor
2. Tests are written BEFORE implementation
3. Changes require failing tests first (in strict mode)
After activation:
Confirm activation and await user's first TDD task.