Skip to content
Back to skills

Tdd Strict

ASecurity

Use when high-assurance reliability is required (Bug fixes, Critical Features, Quality Hardening).

  • 6 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 9, 2026
ai-agentspythongo

Works with

  • cli

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned October 9, 2026

npx -y skills add MatrixFounder/Agentic-development --skill tdd-strict --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tdd Strict?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Tdd Strict
[![Security: A β€” Skills Directory](https://www.skillsdirectory.com/api/skills/matrixfounder-tdd-strict/badge)](https://www.skillsdirectory.com/skills/matrixfounder-tdd-strict)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: tdd-strict
description: "Use when high-assurance reliability is required (Bug fixes, Critical Features, Quality Hardening)."
tier: 3
version: 1.0
---
# Strict TDD Protocol (High Assurance)

This skill enforces a rigorous, evidence-based TDD cycle designed to eliminate "lucky passes" and "code hallucinations". It is stricter than the standard `tdd-stub-first`.

> [!IMPORTANT]
> **ACTIVATION:** This skill replaces the standard TDD cycle. When active, you MUST follow the **Strict Cycle** below.

## 1. The Strict Cycle (Red-Red-Green-Refactor)

You must strictly follow this 4-step loop for EVERY test case.

### Step 1: Write Test + `EXPECTED_FAIL_REASON`
Write the test case (or stub) and explicitly comment what exact error it *should* raise.
*   **Why**: Prove that you know *why* it fails.
*   *Example*:
    ```python
    # EXPECTED_FAIL_REASON: AssertionError: Expected 200 OK, got 404 because endpoint is not registered.
    def test_create_user(client):
        resp = client.post("/users", json={"name": "Alice"})
        assert resp.status_code == 200
    ```

### Step 2: Verify Fail (The "Red" Check)
Run the test. It **MUST FAIL**.
1.  **Check**: Does the actual error match `EXPECTED_FAIL_REASON`?
2.  **Pass (on Fail)**: If it fails as expected -> Proceed.
3.  **Fail (on Logic)**: If it crashes with `SyntaxError` or `ImportError` -> Fix the test, do not touch code.
4.  **Fail (on Pass)**: If the test passes immediately -> **STOP**. You have a Logic Leak or a bad test. Delete code and investigate.

### Step 3: Minimal Code Implementation (The "Minimalism Law")
Implement **ONLY** the code required to make the test pass.
*   **Prohibited**: "While I'm here, I'll add the update method too."
*   **Prohibited**: Adding generic exception handlers `try: ... except: pass` just to silence errors.
*   **Prohibited**: Speculative architecture not required by the test.

> [!CRITICAL]
> **Dead Code Rule**: If you write a line of code, ask: "If I delete this line, will the current test fail?" If the answer is No, DELETE IT.

### Step 4: Verify Pass + `EXPLAIN_PASS_REASON`
Run the test. It MUST PASS.
1.  **Log**: Explicitly state why it passed now.
    *   *Example*: "PASS: Validated that registration logic now writes to DB returning 200."
2.  **Refactor**: Now (and only now) you may clean up the code.

## 2. Red Flags (Stop Conditions)

*   🚩 **Lucky Pass**: You wrote a test and it passed immediately. **STOP**. Investigate why your test is ineffective.
*   🚩 **Speculation**: You are writing code for a "future requirement" not covered by the current failing test. **STOP**. Delete it.
*   🚩 **Silent Failures**: You saw a failure, didn't check the reason, and started coding. **STOP**. Verify the reason first.

## 3. Usage Context

*   **When to use**:
    *   Implementing Critical Core Features.
    *   Fixing Bugs (Regression prevention).
    *   When explicitly instructed to use "Strict Mode".
*   **When NOT to use**:
    *   Exploratory Prototyping (Spikes).
    *   Initial Project Bootstrapping (creating large empty class structures).

Files in this skill

  • SKILL.md3 KB
  • assets/template.txt46 B
  • examples/usage_example.md86 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…