Agent skill

Test Driven Development

by johnku2011 in johnku2011/boilerplates-with-ai-skills

A skill your agent uses when implementing a feature or fixing a bug — TDD, red-green-refactor, failing test first, then minimal code, then refactor.

MITAuto-check: notesTesting & QA

Install Test Driven Development

skills CLI
$ npx skills add johnku2011/boilerplates-with-ai-skills --skill test-driven-development -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install johnku2011/boilerplates-with-ai-skills test-driven-development --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/johnku2011/boilerplates-with-ai-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/shared/skills/test-driven-development .claude/skills/test-driven-development && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
test-driven-development
GitHub stars
240
Token cost
~777 tokens
SKILL.md length
395 words
Files
1
Skills in repo
18
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when implementing a feature or fixing a bug — TDD, red-green-refactor, failing test first, then minimal code, then refactor.

  • Works in 4 steps: RED — Write one minimal test for one… → GREEN — Write the smallest code that… → REFACTOR — Clean up while staying green.… → …
  • Implementing a feature
  • SKILL.md covers Overview, When to Use, Red-Green-Refactor and Guidelines, plus 5 more sections
  • Calls npm

What it does

Test Driven Development is an agent skill from johnku2011/boilerplates-with-ai-skills. Use when implementing a feature or fixing a bug — TDD, red-green-refactor, failing test first, then minimal code, then refactor. Run npm test before claiming done.

Its SKILL.md is about 780 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts. Compatibility notes: Project test runner available (see AGENTS.md)

It sits in Testing & QA, covering Test-driven development. It works with npm. The licence is MIT.

When your agent uses it

  • Implementing a feature
  • Fixing a bug — TDD
  • Red-green-refactor
  • Failing test first

Example prompts

  • “/test-driven-development”

Requirements

  • Compatibility (from SKILL.md): Project test runner available (see AGENTS.md)
  • Pre-approved tools (allowed-tools): Read, Bash

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. RED — Write one minimal test for one behavior. Run it; confirm it fails
  2. GREEN — Write the smallest code that passes. Run the full suite.
  3. REFACTOR — Clean up while staying green. Do not add behavior.
  4. Repeat for the next increment.

What it can do on your machine

Read from SKILL.md and the folder at commit 475dc6a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Project test runner available (see AGENTS.md)

    From compatibility in the SKILL.md frontmatter.

Context cost

Test Driven Development loads about 777 tokens when it runs. Until then it costs about 47 tokens; SKILL.md has 395 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~47
When it runs · the whole SKILL.md, loaded when a task matches
~777

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Bash

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from johnku2011/boilerplates-with-ai-skills at commit 475dc6a, republished under its MIT licence (© johnku2011). 395 words, ~777 tokens.

Download SKILL.mdSave it as .claude/skills/test-driven-development/SKILL.md (or your agent's skills folder).
name
test-driven-development
description
Use when implementing a feature or fixing a bug — TDD, red-green-refactor, failing test first, then minimal code, then refactor. Run npm test before claiming done.
allowed-tools
Read, Bash
compatibility
Project test runner available (see AGENTS.md)
license
MIT
metadata.suite
quality

Test-Driven Development

Overview

Write a failing test before production code. Keep each cycle small and verify with this project's test command (see AGENTS.md).

Core principle: If you did not watch the test fail, you do not know if it tests the right thing.

Iron law: No production code without a failing test first.

When to Use

Always:

  • New features
  • Bug fixes
  • Behavior changes

Exceptions (ask your human partner):

  • Throwaway prototypes
  • Generated code
  • Pure configuration with no runtime behavior

Red-Green-Refactor

  1. RED — Write one minimal test for one behavior. Run it; confirm it fails for the expected reason (missing feature, not a typo).
  2. GREEN — Write the smallest code that passes. Run the full suite.
  3. REFACTOR — Clean up while staying green. Do not add behavior.
  4. Repeat for the next increment.

Guidelines

  • Prefer many small tests over one large test.
  • Test observable behavior (HTTP status/body, CLI output, return values), not private implementation details.
  • Run npm test after every change; do not claim completion on a red suite.
  • Keep tests deterministic: no wall-clock timing, network, or ordering flakes.
  • For UI or native screens, unit-test pure logic under src/; verify layout on a simulator only when the change is visual.
  • Use real code in tests; mock only at unavoidable boundaries.
Show full SKILL.md (187 more words)Show less

Verification Checklist

Before marking work complete:

  • Every new function or route has a test
  • Watched each new test fail before implementing
  • Failure was due to missing behavior, not setup errors
  • Wrote minimal code to pass each test
  • Full test suite passes
  • No new warnings in test output

If you cannot check every box, you skipped TDD — start over.

Bug Fixes

  1. Write a failing test that reproduces the bug.
  2. Fix with minimal code.
  3. Keep the test — it prevents regression.

Never fix bugs without a test.

Common Rationalizations

ExcuseReality
"Too simple to test"Simple code breaks. A test takes seconds.
"I'll test after"Tests that pass immediately prove nothing.
"Already manually tested"Manual checks are not repeatable in CI.
"Deleting code is wasteful"Unverified code is debt. Delete and rewrite with TDD.

Anti-patterns

  • Writing production code before any failing test.
  • Claiming done without running the project's test command.
  • Testing private functions instead of public behavior.
  • Mocking so heavily you test the mock, not the system.

Upstream Note

Adapted from obra/superpowers TDD workflow, trimmed for bwai boilerplates. Run bwai sync-upstream --skill test-driven-development to compare with upstream.

© johnku2011, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in shared/skills/test-driven-development of johnku2011/boilerplates-with-ai-skills.

Open the folder on GitHubat commit 475dc6a

Compare with similar skills

Test Driven Development next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Test Driven Development compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Test Driven Development this skilljohnku2011/boilerplates-with-ai-skills240—~777Automated safety check: NotesMIT
Devserithemage/serverless-openclaw196—~714Automated safety check: NotesNone
TDDRafaelGB/Obsidian-ZettelFlow174—~724Automated safety check: PassMIT
SDKkortix-ai/suna20k—~9.6kAutomated safety check: PassCustom licence
ImplementRafaelGB/Obsidian-ZettelFlow174—~1.7kAutomated safety check: PassMIT
TasksRafaelGB/Obsidian-ZettelFlow174—~573Automated safety check: PassMIT

Similar skills

  • Dev

    serithemage/serverless-openclaw

    Development workflow guide. An agent skill from serithemage/serverless-openclaw.

    196 GitHub stars~714 tokensUpdated 6 mo ago
    Testing & QAAuto-check: notes
  • TDD

    RafaelGB/Obsidian-ZettelFlow

    The test-driven development workflow for ZettelFlow — write a failing test first, run jest, use the Obsidian mock and the bare-specifier alias mappings, and know which code is unit-testable.

    174 GitHub stars~724 tokensUpdated today
    Testing & QAAuto-check passed
  • SDK

    kortix-ai/suna

    The hard rules for editing @kortix/sdk (packages/sdk) — a PUBLISHED npm package with constraints no other package in this repo has: TDD is mandatory (failing test first, gates run and pasted every…

    20k GitHub stars~9.6k tokensUpdated today
    Testing & QAAuto-check passed
  • Implement

    RafaelGB/Obsidian-ZettelFlow

    Stage 4 of the SDD pipeline — execute a ZettelFlow task checklist (in a GitHub issue comment) test-first (red → green → refactor), one commit per advance, keeping npm run verify green and CI green…

    174 GitHub stars~1.7k tokensUpdated today
    Testing & QAAuto-check passed
  • Tasks

    RafaelGB/Obsidian-ZettelFlow

    Stage 3 of the SDD pipeline — turn a ZettelFlow plan (in a GitHub issue comment) into an ordered TDD task checklist posted as a second issue comment.

    174 GitHub stars~573 tokensUpdated today
    Testing & QAAuto-check passed
  • Security Analyzer

    aiskillstore/marketplace

    Comprehensive security vulnerability analysis for codebases and infrastructure.

    430 GitHub stars~1.2k tokensUpdated today
    SecurityAuto-check: notes

More from johnku2011/boilerplates-with-ai-skills

All 18 skills in this repo
  • Project Security

    johnku2011/boilerplates-with-ai-skills

    A skill your agent uses when reviewing security-sensitive code paths — check auth, secrets, input validation, dependency risk, and data exposure before shipping.

    240 GitHub stars~650 tokensUpdated 1 mo ago
    Auto-check passed
  • Code Review

    johnku2011/boilerplates-with-ai-skills

    A skill your agent uses when reviewing a diff or pull request — check correctness, tests, readability, security, and server/client boundaries before approving.

    240 GitHub stars~708 tokensUpdated 1 mo ago
    Auto-check passed
  • Python API Design

    johnku2011/boilerplates-with-ai-skills

    A skill your agent uses when adding or changing FastAPI routes, dependencies, or tests in this Python service — keep endpoints typed, validated, and covered by pytest.

    240 GitHub stars~449 tokensUpdated 1 mo ago
    Auto-check passed
  • Bwai Advisor

    johnku2011/boilerplates-with-ai-skills

    Use before scaffolding a bwai project — runs the full startup-goal workflow then recommends the right boilerplate and outputs the exact bwai new command to run.

    240 GitHub stars~1.2k tokensUpdated 1 mo ago
    Auto-check passed
  • Deploy Vercel

    johnku2011/boilerplates-with-ai-skills

    A skill your agent uses when deploying or configuring this project on Vercel — env vars, build settings, serverless limits, and production checks for Next.js or Express.

    240 GitHub stars~660 tokensUpdated 1 mo ago
    Auto-check: notes
  • Express API Design

    johnku2011/boilerplates-with-ai-skills

    A skill your agent uses when adding or changing routes, middleware, or error handling in this Express.js API, to keep endpoints consistent, validated, and testable.

    240 GitHub stars~575 tokensUpdated 1 mo ago
    Auto-check passed

Works with

Categories

Questions about Test Driven Development

What does Test Driven Development do?

A skill your agent uses when implementing a feature or fixing a bug — TDD, red-green-refactor, failing test first, then minimal code, then refactor. Test Driven Development is an agent skill from johnku2011/boilerplates-with-ai-skills. Use when implementing a feature or fixing a bug — TDD, red-green-refactor, failing test first, then minimal code, then refactor.

When should I use Test Driven Development?

Test Driven Development fits situations like: implementing a feature; fixing a bug — TDD; red-green-refactor; failing test first.

How do I install Test Driven Development in Claude Code?

Run `npx skills add johnku2011/boilerplates-with-ai-skills --skill test-driven-development -a claude-code`. Or copy the skill folder (shared/skills/test-driven-development in johnku2011/boilerplates-with-ai-skills) into .claude/skills/test-driven-development in your project. Claude Code loads it when a task matches its description.

How do I install Test Driven Development in Codex?

Run `npx skills add johnku2011/boilerplates-with-ai-skills --skill test-driven-development -a codex`. Or copy the skill folder (shared/skills/test-driven-development in johnku2011/boilerplates-with-ai-skills) into .agents/skills/test-driven-development in your project. Codex loads it when a task matches its description.

Can I use Test Driven Development in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add johnku2011/boilerplates-with-ai-skills --skill test-driven-development -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/test-driven-development, .gemini/skills/test-driven-development, .github/skills/test-driven-development and .opencode/skills/test-driven-development in your project.

What does Test Driven Development need to run?

Going by SKILL.md and its folder, Test Driven Development needs the command-line tools its instructions call (npm). Its frontmatter pre-approves these tools: Read, Bash. Compatibility (from SKILL.md): Project test runner available (see AGENTS.md).

Does Test Driven Development access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Test Driven Development safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Test Driven Development use?

Test Driven Development is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Test Driven Development use?

About 777 tokens (SKILL.md is roughly 3.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Test Driven Development?

Skills that share tags, products or a category with Test Driven Development: Dev (serithemage/serverless-openclaw, 196 stars), TDD (RafaelGB/Obsidian-ZettelFlow, 174 stars), SDK (kortix-ai/suna, 20k stars) and Implement (RafaelGB/Obsidian-ZettelFlow, 174 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Test Driven Development?

johnku2011 (a GitHub user) maintains it in johnku2011/boilerplates-with-ai-skills, which has 240 GitHub stars. The repository holds 18 skills in this directory. The repository was last updated on August 24, 2026.

Source: johnku2011/boilerplates-with-ai-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.