strict-tdd
Use when enforcing TDD discipline — blocks writing production code unless a failing test exists first. Activate with /strict-tdd to enable session-scoped Red-Green-Refactor guardrail.
Best use case
strict-tdd is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use when enforcing TDD discipline — blocks writing production code unless a failing test exists first. Activate with /strict-tdd to enable session-scoped Red-Green-Refactor guardrail.
Teams using strict-tdd should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/strict-tdd/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How strict-tdd Compares
| Feature / Agent | strict-tdd | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use when enforcing TDD discipline — blocks writing production code unless a failing test exists first. Activate with /strict-tdd to enable session-scoped Red-Green-Refactor guardrail.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
SKILL.md Source
# Strict TDD Mode
When activated, this skill registers a session-scoped hook that enforces Red-Green-Refactor discipline.
## What It Does
Blocks writes to `src/` (production code) unless:
1. A test file exists that covers the target module
2. That test has at least one failing assertion (Red phase confirmed)
This prevents the common agent failure of writing test + implementation simultaneously.
## Activation
```
/strict-tdd
```
Remains active for the current session only.
## Hook Configuration
```json
{
"hooks": {
"PreToolUse": [
{
"matcher": "Write|Edit",
"hook": ".claude/skills/strict-tdd/scripts/enforce-red-phase.sh",
"condition": "file matches src/**/*.{ts,js} AND NOT src/**/*.test.{ts,js}"
}
]
}
}
```
## Enforcement Logic
```bash
#!/bin/bash
# enforce-red-phase.sh
# Called before any Write/Edit to src/ files
TARGET_FILE="$1"
TEST_FILE="${TARGET_FILE%.ts}.test.ts"
if [ ! -f "$TEST_FILE" ]; then
echo "BLOCKED: No test file found at $TEST_FILE"
echo "Write a failing test first (Red phase), then implement."
exit 1
fi
# Check if tests are currently failing (Red phase)
npx jest "$TEST_FILE" --passWithNoTests 2>/dev/null
if [ $? -eq 0 ]; then
echo "WARNING: Tests are passing. Are you in Green/Refactor phase?"
echo "If adding new behavior, write a failing test first."
fi
```
## Gotchas
- Only blocks src/ files — test files and config files are always writable
- During Refactor phase, tests should still pass — this is expected, don't treat as violation
- If test runner isn't installed, hook will error — ensure jest/vitest is available
- Agent may try to write to a different path to bypass — the hook should match all production code pathsRelated Skills
qe-visual-testing-advanced
Advanced visual regression testing with pixel-perfect comparison, AI-powered diff analysis, responsive design validation, and cross-browser visual consistency. Use when detecting UI regressions, validating designs, or ensuring visual consistency.
qe-verification-quality
Comprehensive truth scoring, code quality verification, and automatic rollback system with 0.95 accuracy threshold for ensuring high-quality agent outputs and codebase reliability.
qe-testability-scoring
AI-powered testability assessment using 10 principles of intrinsic testability with Playwright and optional Vibium integration. Evaluates web applications against Observability, Controllability, Algorithmic Simplicity, Transparency, Stability, Explainability, Unbugginess, Smallness, Decomposability, and Similarity. Use when assessing software testability, evaluating test readiness, identifying testability improvements, or generating testability reports.
qe-test-reporting-analytics
Advanced test reporting, quality dashboards, predictive analytics, trend analysis, and executive reporting for QE metrics. Use when communicating quality status, tracking trends, or making data-driven decisions.
qe-test-idea-rewriting
Transform passive 'Verify X' test descriptions into active, observable test actions. Use when test ideas lack specificity, use vague language, or fail quality validation. Converts to action-verb format for clearer, more testable descriptions.
qe-test-environment-management
Test environment provisioning, infrastructure as code for testing, Docker/Kubernetes for test environments, service virtualization, and cost optimization. Use when managing test infrastructure, ensuring environment parity, or optimizing testing costs.
qe-test-design-techniques
Systematic test design with boundary value analysis, equivalence partitioning, decision tables, state transition testing, and combinatorial testing. Use when designing comprehensive test cases, reducing redundant tests, or ensuring systematic coverage.
qe-test-data-management
Strategic test data generation, management, and privacy compliance. Use when creating test data, handling PII, ensuring GDPR/CCPA compliance, or scaling data generation for realistic testing scenarios.
qe-test-automation-strategy
Design and implement effective test automation with proper pyramid, patterns, and CI/CD integration. Use when building automation frameworks or improving test efficiency.
qe-technical-writing
Write clear, engaging technical content from real experience. Use when writing blog posts, documentation, tutorials, or technical articles.
qe-tdd-london-chicago
Apply London (mock-based) and Chicago (state-based) TDD schools. Use when practicing test-driven development or choosing testing style for your context.
qe-stream-chain
Stream-JSON chaining for multi-agent pipelines, data transformation, and sequential workflows