Setup & Installation
Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:
What This Skill Does
tdd-helper wraps task execution to enforce test-first discipline. It refuses to run production code if tests are absent or failing, and can optionally treat lint warnings as errors. Configuration is via environment variables or a JSON file.
Unlike invoking pytest directly, it enforces the test-first constraint at the process level, so agents cannot bypass the cycle even when code is generated dynamically.
When to use it
- Blocking agent-generated code from running before tests pass
- Enforcing test presence in automated pipelines
- Running pytest suites before executing generated scripts
- Treating lint warnings as hard errors in CI workflows
- Guarding non-deterministic agent outputs with regression checks
Example Workflow
Here's how your AI assistant might use this skill in practice.
User asks: run my_script.py, but only if all tests in tests/ pass
- 1Agent calls tdd.py with --tests tests/ --run 'python my_script.py'
- 2tdd.py checks that tests/ exists and contains test files
- 3tdd.py runs pytest on the test suite
- 4If any test fails or no tests are found, tdd.py exits with an error and blocks execution
- 5If all tests pass, tdd.py runs my_script.py
my_script.py executes only after the full test suite passes