One-click install
npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill tdd-cogni-ai-ou
Or copy as Structured Prompt for Agentā–¼
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/Cogni-AI-OU/cogni-ai-agent-skills/tree/main/tdd
Command: npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill tdd-cogni-ai-ou

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TDD prevents fragile, late-discovered bugs by enforcing a contract-first workflow where tests define expected behavior before implementation.

Core Features & Use Cases

  • Testability audit: Performs an inversion-of-control and state-access review to ensure the code can be verified through observable behavior.
  • Red-Green-Refactor execution: Guides the exact lifecycle from failing test creation to minimal implementation and safe refactoring.
  • Failure-focused run rules: Directs how to interpret test failures, eliminate flakiness, and ensure non-destructive test isolation.
  • Negative-space coverage: Requires explicit assertions for error paths, boundaries, and untrusted input vectors, not just happy paths.
  • Use cases: Writing new features with behavioral contracts, fixing regressions with precise coverage, and de-risking refactors by anchoring correctness in tests.

Quick Start

Use the tdd skill to write a failing test first, expand coverage to boundary and error cases, implement the minimal code to pass, and then refactor safely.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I start test-driven development for a new feature?ā–¼

Test-driven development begins by writing a failing test that defines the expected behavior before any implementation. You then write minimal code to pass the test, expand coverage to error paths, and refactor safely while maintaining strict red-green-refactor sequencing.

What is negative-space testing and do I need it for regression coverage?ā–¼

Negative-space testing requires explicit assertions for error paths, boundaries, and untrusted input vectors rather than just happy paths. It is essential for regression coverage because it validates system behavior across unit and integration boundaries where failures commonly originate.

How do I eliminate flaky tests during refactoring?ā–¼

To eliminate flaky tests during refactoring, apply failure-focused run rules that enforce non-destructive test isolation and proper failure interpretation. Avoid over-mocking by relying on observable behavior verification through inversion-of-control and state-access reviews.

What is a testability audit and when should I perform one?ā–¼

A testability audit is an inversion-of-control and state-access review that ensures code can be verified through observable behavior. You should perform one before writing tests to guarantee your architecture supports reliable behavioral contracts and reduces flakiness.

Can I use test-driven development for fixing bugs and regressions?ā–¼

Test-driven development is effective for fixing bugs and regressions because it enforces a contract-first workflow where precise test coverage anchors correctness. You write a failing test reproducing the regression, implement the fix, and verify behavior across boundaries.

Why does my test suite break when I refactor code?ā–¼

Test suites break during refactoring when tests lack behavioral contracts or depend on implementation details rather than observable behavior. Following strict red-green-refactor sequencing and performing testability audits beforehand anchors correctness and prevents fragile failures.