一键导入
init
// Initialize workspace TDD Guardian config and enable strict hooks for test/coverage enforcement.
// Initialize workspace TDD Guardian config and enable strict hooks for test/coverage enforcement.
| name | init |
| description | Initialize workspace TDD Guardian config and enable strict hooks for test/coverage enforcement. |
Create .claude/tdd-guardian/config.json using project-appropriate commands.
testCommandcoverageCommandmutationCommand (optional)enforceOnTaskCompleted — run gates automatically on task completionblockCommitWithoutFreshGate — block commit/push/publish without fresh gatesfalse (non-blocking). Skills, agents, and slash commands still work — only automatic blocking is opt-in.Default config template:
{
"enabled": true,
"enforceOnTaskCompleted": false,
"blockCommitWithoutFreshGate": false,
"gateFreshnessMinutes": 120,
"bypassEnv": "TDD_GUARD_BYPASS",
"preflightCommand": "",
"testCommand": "pnpm test",
"coverageCommand": "pnpm test -- --coverage",
"coverageSummaryPath": "coverage/coverage-summary.json",
"coverageThresholds": {
"lines": 100,
"functions": 100,
"branches": 100,
"statements": 100
},
"coverageMode": "absolute",
"smartStaleness": true,
"requireMutation": false,
"mutationCommand": ""
}
"absolute" (default): must meet configured thresholds"no-decrease": blocks only if coverage decreased from recorded baseline (useful for projects with pre-existing coverage gaps)When smartStaleness: true (default), stale gate timestamps are allowed if no source files have changed since the last gate pass. This prevents unnecessary re-runs when stepping away from the project.
If project is not Node-based, replace commands with project-native equivalents.
Validate test strength with mutation testing and harden weak assertions. Covers Stryker (JS/TS), mutmut (Python), go-mutesting (Go), and cargo-mutants (Rust).
Enforce coverage thresholds AND test quality — coverage without behavioral assertions is meaningless.
Produce findings-first code review with severity ordering, test-gap findings, and test-quality audit.
Build a comprehensive test matrix for changed behavior with explicit assertion strategy per case.
Global TDD governance policy. Enforces plan-first development, behavior-driven test quality, and strict completion gates.
Orchestrate strict TDD implementation across planner, implementer, test designer, coverage auditor, mutation auditor, and reviewer subagents.