Agent skill

TDD

by jellydn in jellydn/my-ai-tools

Guide through the Red-Green-Refactor cycle for test-driven development

MITAuto-check passedTesting & QA

Install TDD

skills CLI
$ npx skills add jellydn/my-ai-tools --skill tdd -a claude-code

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

GitHub CLI
$ gh skill install jellydn/my-ai-tools tdd --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/jellydn/my-ai-tools.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/tdd .claude/skills/tdd && 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
tdd
GitHub stars
123
Token cost
~1.1k tokens
SKILL.md length
545 words
Files
2
Skills in repo
33
Repo updated
First seen
Licence
MIT

At a glance

Guide through the Red-Green-Refactor cycle for test-driven development

  • Works in 3 steps: Red: Write a failing test that defines… → Green: Write minimal code to make the… → Refactor: Improve code quality while…
  • Tasks that involve Test-driven development
  • SKILL.md covers Usage, Actions, TDD Principles and Process, plus 2 more sections
  • Calls npm and pnpm

What it does

TDD is an agent skill from jellydn/my-ai-tools. Guide through the Red-Green-Refactor cycle for test-driven development

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `templates/test-template.md`). Compatibility notes: cline, claude, opencode, amp, codex, gemini, cursor, pi

It sits in Testing & QA, covering Test-driven development. The repository describes itself as: Comprehensive configuration management for AI coding tools - Replicate my complete setup for Claude Code, OpenCode, Amp, Li, Codex and Claude Code Switch with custom… The licence is MIT.

When your agent uses it

  • Tasks that involve Test-driven development

Example prompts

  • “/tdd”

Requirements

  • Compatibility (from SKILL.md): cline, claude, opencode, amp, codex, gemini, cursor, pi

Workflow steps

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

  1. Red: Write a failing test that defines desired behavior
  2. Green: Write minimal code to make the test pass
  3. Refactor: Improve code quality while keeping tests green

What it can do on your machine

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

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm
    • pnpm

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

  • Network

    No URLs in SKILL.md. Its commands use npm and pnpm, which can reach the network depending on how they are called.

    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

    cline, claude, opencode, amp, codex, gemini, cursor, pi

    From compatibility in the SKILL.md frontmatter.

Context cost

TDD loads about 1.1k tokens when it runs. Until then it costs about 19 tokens; SKILL.md has 545 words of instructions outside code blocks.

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

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 passed

The automated check found no risky patterns in SKILL.md.

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 jellydn/my-ai-tools at commit 62c9227, republished under its MIT licence (© jellydn). 545 words, ~1,149 tokens.

Download SKILL.mdSave it as .claude/skills/tdd/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
tdd
description
Guide through the Red-Green-Refactor cycle for test-driven development
compatibility
cline, claude, opencode, amp, codex, gemini, cursor, pi
license
MIT
hint
Use when doing test-driven development with Red-Green-Refactor cycle
user-invocable
true
metadata.audience
all
metadata.workflow
testing

Test-Driven Development (TDD)

Guides you through the complete TDD workflow with Red-Green-Refactor cycle.

Usage

/tdd <ACTION> [ARGUMENTS]

Actions

  • start <FEATURE> - Initialize TDD session for a feature
  • red <TEST_NAME> - Create failing test (Red phase)
  • green - Run tests and implement code (Green phase)
  • refactor - Guide refactoring process (Refactor phase)
  • cycle <FEATURE> - Run complete Red-Green-Refactor cycle
  • watch - Start test watcher for continuous feedback
  • status - Show current test status and next steps

TDD Principles

The Red-Green-Refactor Cycle
  1. Red: Write a failing test that defines desired behavior
  2. Green: Write minimal code to make the test pass
  3. Refactor: Improve code quality while keeping tests green
Best Practices
  • Write tests first - Tests define the interface and behavior
  • Small steps - Make tiny, incremental changes
  • Fast feedback - Run tests frequently for immediate validation
  • Clean code - Refactor regularly to maintain quality
  • One concept per test - Keep tests focused and atomic
  • AAA Pattern - Structure tests as Arrange, Act, Assert
  • Black-box testing - Test only public methods and behavior, not implementation details
  • Test at an agreed seam - Before writing a test, identify the public interface that exposes the behavior and prefer the highest existing seam
  • Independent expectations - Expected values come from a literal, worked example, or spec; do not recompute them with the same algorithm as the implementation
  • Vertical slices - Write one meaningful test, implement the minimum, then repeat; avoid writing an entire imagined test suite before learning from the first cycle
Anti-Patterns
  • Implementation-coupled tests mock private collaborators or inspect internal state. They fail during harmless refactors and provide weak behavioral confidence.
  • Tautological tests derive the expected value with the same logic as the code under test, so both can be wrong together.
  • Horizontal slicing writes all tests first and all implementation later. Prefer tracer-bullet slices that exercise one user-visible behavior at a time.
  • Unconfirmed seams test a low-level helper only because it is easy to reach. If the behavior matters at a higher interface, test there instead or document why the lower seam is the correct one.

Before the first Red phase, discover the repository's test runner and command from its manifest, task runner, docs, or CI. Do not assume TypeScript, Vitest, npm, or pnpm. Record the exact command used for the red failure and why it failed; a syntax/import error is not a valid Red state.

Show full SKILL.md (167 more words)Show less

Process

For "start <FEATURE>":
  1. Initialize TDD session for the feature
  2. Create or identify target source file
  3. Create corresponding test file if it doesn't exist
  4. Explain the feature requirements and acceptance criteria
For "red <TEST_NAME>":
  1. Create a failing test that describes the desired behavior
  2. Ensure test fails for the right reason (not syntax errors)
  3. Run tests to confirm red state
  4. Explain what the test is validating
For "green":
  1. Implement minimal code to make failing tests pass
  2. Focus on making tests pass, not perfect code
  3. Run tests to confirm green state
  4. Write just enough code to pass the test
For "refactor":
  1. Improve code quality while maintaining green tests
  2. Remove duplication and improve design
  3. Run tests continuously during refactoring
  4. Make one refactoring change at a time

Test Template

A test template is available at $SKILL_PATH/templates/test-template.md:

typescript
import { describe, it, expect } from "vitest";
import { functionName } from "./module";

describe("functionName", () => {
	it("should return formatted output when given valid input", () => {
		// Arrange - Setup test scenario
		const input = "test input";
		const expectedOutput = "expected output";

		// Act - Execute the unit under test
		const result = functionName(input);

		// Assert - Verify expected outcome
		expect(result).toBe(expectedOutput);
	});
});

Common Commands

  • Run tests: npm test or pnpm test
  • Watch mode: npm test --watch
  • With coverage: npm test --coverage

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

Files

SKILL.md and 1 other file in skills/tdd of jellydn/my-ai-tools.

  • SKILL.md
  • templates/test-template.md

Open the folder on GitHubat commit 62c9227

Compare with similar skills

TDD 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.

TDD compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
TDD this skilljellydn/my-ai-tools123—~1.1kAutomated safety check: PassMIT
TDDpietheinstrengholt/rssmonster56430 repos~906Automated safety check: PassMIT
TDD WorkflowhellangleZ/burn-in-cceverywhere-ralph11211 repos~2.4kAutomated safety check: PassNone
TDDsanity-io/sanity6.4k20 repos~1kAutomated safety check: PassMIT
Test Driven Developmentfarm-fe/farm5.6k51 repos~2.5kAutomated safety check: PassMIT
Tapd Story PipelineTencentBlueKing/bk-bcs841—~2.6kAutomated safety check: PassCustom licence

Similar skills

  • TDD

    pietheinstrengholt/rssmonster

    Test-driven development. An agent skill from pietheinstrengholt/rssmonster.

    564 GitHub starsUsed in 30 repos~906 tokens
    Testing & QAAuto-check passed
  • TDD Workflow

    hellangleZ/burn-in-cceverywhere-ralph

    A skill your agent uses when writing new features, fixing bugs, or refactoring code.

    112 GitHub starsUsed in 11 repos~2.4k tokens
    Testing & QAAuto-check passed
  • TDD

    sanity-io/sanity

    Official

    Test-driven development with red-green-refactor loop. An agent skill from sanity-io/sanity.

    6.4k GitHub starsUsed in 20 repos~1k tokens
    Testing & QAAuto-check passed
  • A skill your agent uses when implementing any feature or bugfix, before writing implementation code

    5.6k GitHub starsUsed in 51 repos~2.5k tokens
    Testing & QAAuto-check passed
  • Tapd Story Pipeline

    TencentBlueKing/bk-bcs

    单需求实现流水线——把一个 TAPD 需求从零推进到代码提交。自动串联技术澄清、 开发计划、任务拆分、TDD 实现、架构/安全校验、代码提交六个阶段。

    841 GitHub stars~2.6k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Absolute Init

    maddhruv/absolute

    One-time setup for absolute: interview how you want it to behave (output style, autonomy, TDD strictness, spec dir, families) + detect the stack once, then write .absolute.config.json (project…

    218 GitHub starsUsed in 1 repo~3k tokens
    Testing & QAAuto-check passed

More from jellydn/my-ai-tools

All 33 skills in this repo
  • Babysit PR

    jellydn/my-ai-tools

    A skill your agent uses when monitoring an open GitHub PR for CI failures, review feedback, mergeability, and safe retries or fixes.

    123 GitHub stars~4.1k tokensUpdated today
    Auto-check passed
  • Visual PR

    jellydn/my-ai-tools

    Posts a concise visual outline as a GitHub pull request comment.

    123 GitHub stars~764 tokensUpdated today
    Auto-check passed
  • Qmd Knowledge

    jellydn/my-ai-tools

    Manage project knowledge with qmd — captures learnings, decisions, and conventions

    123 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Prd

    jellydn/my-ai-tools

    Generate Product Requirements Documents from feature ideas — plans specs and requirements

    123 GitHub starsUsed in 4 repos~1.8k tokens
    Auto-check passed
  • Capability Experiments

    jellydn/my-ai-tools

    Build an interactive report or experiment when the user asks to explore model capabilities.

    123 GitHub stars~2k tokensUpdated today
    Auto-check passed
  • PR Review

    jellydn/my-ai-tools

    Fix PR review comments by implementing requested changes. An agent skill from jellydn/my-ai-tools.

    123 GitHub stars~1.1k tokensUpdated today
    Auto-check passed

Categories

Questions about TDD

What does TDD do?

Guide through the Red-Green-Refactor cycle for test-driven development. TDD is an agent skill from jellydn/my-ai-tools.

When should I use TDD?

TDD fits situations like: tasks that involve Test-driven development.

How do I install TDD in Claude Code?

Run `npx skills add jellydn/my-ai-tools --skill tdd -a claude-code`. Or copy the skill folder (skills/tdd in jellydn/my-ai-tools) into .claude/skills/tdd in your project. Claude Code loads it when a task matches its description.

How do I install TDD in Codex?

Run `npx skills add jellydn/my-ai-tools --skill tdd -a codex`. Or copy the skill folder (skills/tdd in jellydn/my-ai-tools) into .agents/skills/tdd in your project. Codex loads it when a task matches its description.

Can I use TDD 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 jellydn/my-ai-tools --skill tdd -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tdd, .gemini/skills/tdd, .github/skills/tdd and .opencode/skills/tdd in your project.

What does TDD need to run?

Going by SKILL.md and its folder, TDD needs the command-line tools its instructions call (npm and pnpm). Compatibility (from SKILL.md): cline, claude, opencode, amp, codex, gemini, cursor, pi.

Does TDD access the network?

SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is TDD safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does TDD use?

TDD 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 TDD use?

About 1.1k tokens (SKILL.md is roughly 4.6k 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 TDD?

Skills that share tags, products or a category with TDD: TDD (pietheinstrengholt/rssmonster, 564 stars), TDD Workflow (hellangleZ/burn-in-cceverywhere-ralph, 112 stars), TDD (sanity-io/sanity, 6.4k stars) and Test Driven Development (farm-fe/farm, 5.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains TDD?

jellydn (a GitHub user) maintains it in jellydn/my-ai-tools, which has 123 GitHub stars. The repository holds 33 skills in this directory. The repository was last updated on October 9, 2026.

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