test-driven-development

test-driven-development is a skill for Claude Code, Codex from PedroMosquera/squadai. It costs 12 tokens per session (665 once invoked), scanned A, original, MIT.

A test-driven development workflow built around the red-green-refactor cycle. TDD means writing a failing test, adding the smallest code that passes it, and then improving the code without changing its behaviour.

In plain words
What is it for?
Use it to implement features or fixes one tested behaviour at a time, followed by cleanup once the tests pass.
Why use it?
It keeps implementation tied to observable behaviour and helps reveal regressions by running the tests throughout the work.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to implement features or fixes one tested behaviour at a time, followed by cleanup once the tests pass.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pedromosquera/squadai/test-driven-development
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add PedroMosquera/squadai --skill test-driven-development
Clone the repo
git clone --depth 1 https://github.com/PedroMosquera/squadai

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for test-driven-development

README.md
[![agentmods](https://agentmods.dev/badge/skills/pedromosquera/squadai/test-driven-development/github.svg)](https://agentmods.dev/skills/pedromosquera/squadai/test-driven-development)
Your own site
<a href="https://agentmods.dev/skills/pedromosquera/squadai/test-driven-development"><img src="https://agentmods.dev/badge/skills/pedromosquera/squadai/test-driven-development/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for test-driven-development

Your own site · 80×15
<a href="https://agentmods.dev/skills/pedromosquera/squadai/test-driven-development"><img src="https://agentmods.dev/badge/skills/pedromosquera/squadai/test-driven-development.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 665 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00012 $0.00665
Opus 5.5 $0.00005 $0.00266
Sonnet 5.5 $0.00002 $0.00133
Haiku 4.5 $0.00001 $0.00067

Measured 1mo ago against content hash 951780ff34fe, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

test-driven-development scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

internal/assets/skills/tdd/test-driven-development/SKILL.md · 92 lines

How it starts

The opening of the file, as written. The whole thing — 92 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Test-Driven Development Skill

Implement code using the red-green-refactor cycle. This skill is used by the Implementer to write code driven by failing tests.

Core Principle

Write the MINIMUM code to make a failing test pass. No more. Then refactor to improve quality without changing behavior.

Steps

Phase 1: RED (write a failing test)

  1. Pick the next test from the implementation plan.
  2. Write the test code first, before any implementation.
  3. Run the test: it MUST fail (red). If it passes without implementation, the test is not testing the right thing.
  4. Read the failure message. It tells you exactly what to implement.

Phase 2: GREEN (make the test pass)

  1. Write the MINIMUM implementation to make the failing test pass.
    • No extra logic, no anticipated future use cases
    • Hardcoding is acceptable at this stage if it makes the test pass
    • Copy-paste is acceptable if it moves quickly to green
  2. Run the test: it MUST pass (green).
  3. Run ALL tests: ensure no regressions.
  4. Do NOT refactor yet.

Phase 3: REFACTOR (improve the code)

  1. Only after tests are green, improve code quality.
    • Remove duplication
    • Improve naming
    • Extract helper functions
    • Simplify logic
  2. Run tests after every change; refactoring must not break anything.
  3. Do NOT add new behavior during refactoring.
  4. When satisfied, move to the next test in the plan.

Rules

  • Never skip the red phase; always write the test first
  • Never write more code than needed to pass the current test
  • Never refactor while red; only refactor on green
  • Commit after each green-refactor cycle (small, frequent commits)
  • If a test is hard to write, it signals a design problem, so fix the design

Test Structure

Follow table-driven tests for multiple scenarios:

func TestFunctionName(t *testing.T) {
    tests := []struct {
        name    string
        input   InputType
        want    OutputType
        wantErr bool
    }{
        {name: "happy path", input: ..., want: ..., wantErr: false},
        {name: "empty input", input: ..., want: ..., wantErr: true},
    }
    for _, tt := range tests {
        t.Run(tt.name, func(t *testing.T) {
            got, err := FunctionName(tt.input)
            if (err != nil) != tt.wantErr {
                t.Errorf("unexpected error: %v", err)
            }
            if got != tt.want {
                t.Errorf("got %v, want %v", got, tt.want)
            }
        })
    }
}

Read the full file on GitHub · 92 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed 951780ff34fe
  2. 3mo ago First seen · 92 lines · 12 tokens per session scan A 54032c8a9961

Subscribe to this mod's changes

test-driven-development is a skill published in the GitHub repository PedroMosquera/squadai (10 stars, last pushed 1mo ago), licensed MIT. It adds 12 tokens to every session and 665 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

test-driven-development compared with skills from other repositories

test-driven-development next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
test-driven-developmentPedroMosquera/squadaiSkill101mo agoMITA12Claude Code, Codex
am-command-buildsampleXbro/agentsmeshSkill31yesterdayMITA18Claude Code, Codex
red-green-refactorrohitg00/skillkitSkill1.6k6mo agoApache-2.0A90Claude Code, Codex
test-driven-developmentsampleXbro/agentsmeshSkill31yesterdayMITA50Claude Code, Codex
workflow-patternswshobson/agentsSkill43k2d agoMITA35Claude Code
skillshare-implement-featurerunkids/skillshareSkill3.6kyesterdayMITA114Claude Code
shared/tddechoVic/boss-skillSkill6315d agoMITA32Claude Code