tdd-enforcer

Enforce TDD cycles and detect testing anti-patterns in Python test files.

Updated Mar 13, 2026
One-click install
npx skills add https://github.com/TECHKNOWMAD-LABS/cortex-research-suite --skill tdd-enforcer-techknowmad-labs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-enforcer
Source: https://github.com/TECHKNOWMAD-LABS/cortex-research-suite/tree/main/skills/tdd-enforcer
Command: npx skills add https://github.com/TECHKNOWMAD-LABS/cortex-research-suite --skill tdd-enforcer-techknowmad-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires defusedxml, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill ensures adherence to Test-Driven Development (TDD) principles, preventing code quality degradation by enforcing mandatory RED-GREEN-REFACTOR cycles and detecting common testing anti-patterns.

Core Features & Use Cases

  • TDD Enforcement: Mandates writing failing tests before implementation code.
  • Anti-Pattern Detection: Identifies 12 common testing anti-patterns (e.g., Assertion-Free, Giant Test, Flaky Tests).
  • Coverage Gating: Enforces minimum code coverage thresholds.
  • Test Quality Scoring: Provides a composite score for test suite quality.
  • Use Case: Integrate into your CI/CD pipeline to automatically block commits or pull requests that violate TDD rules, have insufficient test coverage, or contain significant testing anti-patterns, ensuring a high standard of code quality.

Quick Start

Run the tdd-enforcer skill to scan the tests directory for quality issues.

Frequently Asked Questions about tdd-enforcer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce test-driven development practices in a CI/CD pipeline?

You can enforce test-driven development by mandating RED-GREEN-REFACTOR cycles, detecting 12 common testing anti-patterns via AST parsing, and gating code coverage to block non-compliant pull requests in CI/CD automatically.

What are common Python testing anti-patterns and how can I detect them?

Common Python testing anti-patterns include Assertion-Free, Giant Test, and Flaky Tests. You can detect them using AST parsing to analyze test files, identify violations, and calculate a composite test quality score.

Can I gate code commits based on minimum test coverage thresholds?

Yes, you can gate code commits by enforcing minimum code coverage thresholds. The tool analyzes Python test files and blocks commits or pull requests that fall below the required coverage or violate TDD rules.

Does the TDD enforcement tool work with Python test files?

Yes, the TDD enforcement tool works with Python test files by utilizing AST parsing to analyze the code structure, identify testing anti-patterns, and verify RED-GREEN-REFACTOR cycles.

How do I calculate a test quality score for my codebase?

Calculate a test quality score by scanning your tests directory to analyze Python test files for violations of TDD principles and testing anti-patterns, providing a composite score for the suite.

Why should I mandate RED-GREEN-REFACTOR cycles in test automation?

Mandating RED-GREEN-REFACTOR cycles in test automation prevents code quality degradation by ensuring developers write failing tests before implementation code, maintaining strict TDD adherence throughout development.