TDD Enforcement Algorithm

Enforce test-first development using an algorithmic decision tree.

17|Updated Oct 13, 2025
One-click install
npx skills add https://github.com/cipherstash/cipherpowers --skill tdd-enforcement-algorithm
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: TDD Enforcement Algorithm
Source: https://github.com/cipherstash/cipherpowers/tree/main/plugin/skills/testing/tdd-enforcement-algorithm
Command: npx skills add https://github.com/cipherstash/cipherpowers --skill tdd-enforcement-algorithm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers (and AI agents) often bypass Test-Driven Development (TDD) under pressure, leading to untested code and technical debt. This Skill provides a strict algorithmic decision tree to enforce test-first development, including mandatory deletion of untested code, ensuring robust, well-tested software.

Core Features & Use Cases

  • Test-First Mandate: Algorithmically checks for a failing test before allowing implementation code to be written.
  • Untested Code Deletion: Provides a recovery algorithm that mandates deleting any code written without a preceding failing test, overriding "sunk cost" rationalizations.
  • Invalid Conditions List: Explicitly invalidates common excuses for skipping TDD (e.g., "too simple," "time pressure"), ensuring compliance.
  • Use Case: When an agent is about to write a new function, this Skill ensures it first writes a failing test. If the agent accidentally writes code without a test, the Skill forces deletion, guaranteeing TDD compliance and preventing untested code from entering the codebase.

Quick Start

Before writing any implementation code:

The Skill will check: "Does a failing test exist for this code?"

If NO: STOP writing code. Write the failing test first.

If you've already written code without tests:

The Skill will prompt: "Delete the untested code. Execute: git reset --hard OR rm [files]."

Frequently Asked Questions about TDD Enforcement Algorithm

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

FAQPage Schema
How do I enforce test-driven development in my workflow?▼

Test-driven development enforcement uses an algorithmic decision tree to mandate writing a failing test before any implementation code. The Skill checks whether a test exists first; if not, it blocks code writing and requires the test to be written immediately, ensuring every feature has prior test coverage.

What happens if I write code without a failing test first?▼

If code is written without a preceding failing test, the Skill's recovery algorithm mandates deletion of the untested code using git reset --hard or file removal. This prevents technical debt and enforces strict test-first compliance regardless of time pressure or code complexity.

Can I use this Skill to remove untested code that already exists?▼

Yes. The Skill provides explicit recovery rules to identify and delete any code written without a preceding failing test. It overrides common rationalizations like "too simple" or "time pressure" to guarantee that only test-backed code remains in the codebase.

How does the algorithm decide whether to block code or delete it?▼

The Skill applies deterministic boolean checks with a single execution path: before writing code, it verifies a failing test exists; if absent, code writing stops. If code already exists without tests, the algorithm mandates immediate deletion with no interpretive flexibility or exceptions.

What invalid reasons does this Skill reject for skipping TDD?▼

The Skill explicitly invalidates common excuses including "code is too simple," "time pressure," "deadline constraints," and "sunk cost." It enforces algorithmic compliance with no room for rationalization, ensuring robust and well-tested software across all code paths.

Does this work with Git workflows?▼

Yes. The Skill integrates with Git, using commands like git reset --hard to enforce untested code deletion when recovery is needed. It works within existing Git-based workflows to ensure test-first development at the version control level.