Test Driven Development logo

Test Driven Development

Community
AlexAI-MCP
test-driven-development

Apply a disciplined red-green-refactor workflow in Claude Code. Use when adding behavior safely, reproducing a bug before fixing it, designing APIs from the outside in, or strengthening change confidence with targeted tests.

Overview

PublisherAlexAI-MCP
Repositoryhermes-CCC
Skill nametest-driven-development
Stars
134
Forks
22
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by AlexAI-MCP on GitHub. Read the source before you install it.

Installation

Install the Test Driven Development AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/AlexAI-MCP/hermes-CCC/tree/master/skills/test-driven-development
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AlexAI-MCP/hermes-CCC.git /tmp/hermes-CCC
mkdir -p .claude/skills
cp -r /tmp/hermes-CCC/skills/test-driven-development .claude/skills/test-driven-development
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Test Driven Development in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Test Driven Development on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Test Driven Development is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Test-Driven Development

Purpose

  • Drive implementation from observable behavior.
  • Reproduce bugs before fixing them.
  • Keep code changes tightly coupled to expected outcomes.
  • Use tests as design tools, not just safety nets.
  • Reduce regressions by proving each behavior change.

Activation Signals

  • Use this skill when adding a new feature with clear acceptance behavior.
  • Use this skill when fixing a bug that should never recur.
  • Use this skill when API shape is easier to design from usage than internals.
  • Use this skill when reviewers will ask for evidence.
  • Use this skill when the codebase already has a strong test culture.

Core Cycle

  1. Write a failing test.
  2. Run the smallest test scope and watch it fail for the right reason.
  3. Implement the smallest change that makes it pass.
  4. Re-run the test.
  5. Refactor while keeping tests green.
  6. Expand coverage only when a new behavior boundary appears.

Red Phase

  • Express one behavior at a time.
  • Name the test after the behavior, not the implementation.
  • Ensure the failure is caused by missing behavior, not a broken fixture.
  • Keep setup minimal.
  • Prefer explicit assertions over snapshot sprawl unless snapshots are already standard.
  • For bug fixes, make the failing test mirror the actual defect.

Green Phase

  • Implement the smallest viable change.
  • Do not optimize before the test passes.
  • Avoid speculative abstractions.
  • If several code paths fail, make one behavior pass first.
  • Keep the first passing diff small enough to reason about.

Refactor Phase

  • Remove duplication exposed by the passing test.
  • Improve names and structure.
  • Preserve behavior while simplifying code.
  • Re-run relevant tests after each meaningful refactor.
  • Stop refactoring once readability improves and the tests still describe the behavior clearly.

Bug-Fix TDD

  • Reproduce the bug in a failing test before touching the fix.
  • If reproduction is expensive, build a narrow harness.
  • If the bug is timing-sensitive, isolate the timing dependency rather than sleeping more.
  • If the bug cannot be reproduced, treat the fix as higher risk and document why.

Test Selection Rules

  • Use unit tests for pure behavior and deterministic branching.
  • Use integration tests for component boundaries and data flow.
  • Use end-to-end tests only when lower layers cannot express the guarantee.
  • Put the regression test at the lowest layer that still captures the defect.

Assertion Rules

  • Assert the most important observable outcome first.
  • Prefer stable assertions over implementation detail checks.
  • Avoid asserting on incidental formatting unless formatting is the feature.
  • For collections, assert the contract that matters: count, key values, order, or identity.

Good Test Names

  • test_search_returns_ranked_results_for_partial_match
  • test_login_redirect_does_not_loop_when_session_is_hydrated
  • test_serializer_rejects_missing_required_field

Bad Test Names

  • test_fix
  • test_works
  • test_api
  • test_stuff

Useful Commands

bash
pytest tests/test_module.py::test_specific_behavior -vv
pytest tests/ -k "auth and redirect" -vv
ruff check path/to/file.py

Design Benefits To Exploit

  • Tests clarify API ergonomics.
  • Tests reveal hidden dependencies.
  • Tests pressure functions toward clean inputs and outputs.
  • Tests expose when code is too coupled to mock cleanly.

Decision Rules

  • If a feature request has no acceptance behavior, clarify before writing code.
  • If the first test is too hard to write, the design seam may be missing.
  • If the code needed to pass the test is huge, the test scope is probably too broad.
  • If refactoring requires changing many tests, the tests may be overfit to internals.

Anti-Patterns

  • writing tests after the implementation and calling it TDD
  • changing the test to match a broken implementation
  • asserting on private internals instead of behavior
  • creating giant fixture setups for simple behavior
  • using TDD language while skipping the red phase

Output Contract

When reporting TDD progress, include:

  • failing test added
  • implementation change
  • verification command
  • refactor notes
  • remaining coverage gaps

Example Status Block

markdown
TDD status:
- Red: added failing regression test for partially hydrated session redirect
- Green: updated middleware guard to wait for token presence
- Refactor: simplified session-check helper naming
- Verify: pytest tests/test_auth.py::test_login_redirect_does_not_loop_when_session_is_hydrated -vv

Coverage Guidance

  • Start with one high-signal test.
  • Add neighboring tests only when the bug or feature has multiple edges.
  • Do not explode the matrix on the first pass.
  • Prefer targeted new tests over broad rewrites of existing suites.

Failure Modes

  • wrong failure reason in red phase
  • massive green-phase implementation
  • no refactor after a crude passing patch
  • tests too brittle to survive harmless refactors
  • overuse of mocks where real data flow would be clearer

Recovery Moves

  • Rewrite the test if it fails for the wrong reason.
  • Split one large behavior into multiple smaller tests.
  • Move down a layer if end-to-end setup is hiding the real contract.
  • Replace mocks with real collaborators when possible.

Checklist

  1. Name the behavior.
  2. Write the failing test.
  3. Confirm the right failure.
  4. Implement the smallest fix.
  5. Re-run the narrow test.
  6. Refactor with tests green.
  7. Run adjacent coverage.
  8. Report evidence, not confidence alone.

Frequently asked questions

What does the Test Driven Development AI skill do?

Apply a disciplined red-green-refactor workflow in Claude Code. Use when adding behavior safely, reproducing a bug before fixing it, designing APIs from the outside in, or strengthening change confidence with targeted tests.

Why use Test Driven Development on TypingMind?

Because you install it once and use it with any model. Test Driven Development is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Test Driven Development in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/AlexAI-MCP/hermes-CCC/tree/master/skills/test-driven-development. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Test Driven Development?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Test Driven Development?

As many as you like. As long as a model supports skills, you can use Test Driven Development with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Test Driven Development AI skill free?

Yes. It is published on GitHub by AlexAI-MCP under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇