SponsoredSkillry: Agent Skills with taste. Designed and tested in-house, so one prompt gives you polished slides, web pages and launch videos.Skillry: Agent Skills with taste Try free Skills
Agent Skills
  • Skills
  • Picks
  • ShopSoon
  • Solutions
  • Specification
  • Submit
Agent Skills
Agent Skills

Discover and share powerful Agent Skills for AI assistants

GitHubX (Twitter)
Skills
  • View All
  • Install Guide
  • Documentation
  • Solutions
  • Product Launch Video
  • Submit
Tools
  • Claude Code
  • Cursor
  • OpenCode
  • Codex CLI
  • Gemini CLI
Resources
  • anthropics/skills
  • awesome-claude-skills
  • vercel-labs/agent-skills
  • kepano/obsidian-skills
Company
  • About
  • Changelog
  • Privacy Policy
  • Terms of Service

Sponsored by Vectrust @ OpenDev Org & NextRouter Alliance

Ā© 2026 EvergreenAI. Built with JimmyLv
tdd-workflow - Agent Skill - Agent Skills
Home/Skills/tdd-workflow

tdd-workflow

1,630

Test-Driven Development workflow principles. RED-GREEN-REFACTOR cycle.

Download Folder
View on GitHub

CLI Install

Recommended

Use the skills CLI to install this skill with one command. Auto-detects all installed AI assistants.

Method 1 - skills CLI

npx skills i sickn33/antigravity-awesome-skills/skills/tdd-workflow

Method 2 - openskills (supports sync & update)

npx openskills install sickn33/antigravity-awesome-skills

Auto-detects Claude Code, Cursor, Codex CLI, Gemini CLI, and more. One install, works everywhere.

Installation Path

Download and extract to one of the following locations:

~/.claude/skills/tdd-workflow/
SKILL.md

Skill Instructions

Back

Run with Cloud Agent

No setup needed. Let our cloud agents run this skill for you.

Select Provider

Select Model

ClaudeClaude Sonnet 5.5
$0.20/task

Best for coding tasks

Join Cloud Agent Waitlist

No setup required

Before you install

Read from this skill's files on GitHub on 2026-11-09. These are facts about the files, not a review of how well the skill works.

Files
1 file, 0 scripts, SKILL.md is 566 words
Needs on your machine
Nothing beyond the agent: no scripts or install commands found
Web addresses in its scripts
No URLs in its scripts
Worth a look before running
No sudo, rm -rf, curl | sh or shell=True in its scripts
Agent Skills spec
name and description present, name matches the folder
Last upstream change
2026-07-29

We ran this skill ourselves. Here is what went in and what came out.

Field noteRan on 2026-11-04

Input

A scratch function skillSlug(name), tested with node:test. First test: skillSlug("React Performance") equals "react-performance". The test file was written before slug.mjs existed.

Output

RED: node --test exited 1 with ERR_MODULE_NOT_FOUND for slug.mjs. After a one-line implementation (lower-case, split on a single space, join with hyphens) that test passed. Second test, added while the first stayed: skillSlug("React   Performance") should equal "react-performance". RED assertion: actual "react---performance", expected "react-performance". GREEN after splitting on /\s+/ and trimming. node --test then reported 2 pass, 0 fail, exit 0.

What happened

The cycle works on a tiny pure function, and the second failure was a real assertion, which is what the skill asks for. The first failure was only a missing module, so it did not prove the behavior. I did not make a git commit per refactor. This was a scratch directory, and the skill's 'commit after each refactor' rule was not followed.

Use it when

Logic with a clear input and output, or a bug you can pin with one assertion.

Skip it when

Layout, exploratory spikes, or any change where you cannot stand to watch a test fail before you write the code. The skill says those outright.

Where this skill sits

  • Review the diff, then commit

    When the change is logic or a bugfix. Skip it for a layout tweak. The skill itself says UI layout is a poor fit, and exploratory work should be a spike first.

TDD Workflow

Write tests first, code second.


1. The TDD Cycle
šŸ”“ RED → Write failing test
    ↓
🟢 GREEN → Write minimal code to pass
    ↓
šŸ”µ REFACTOR → Improve code quality
    ↓
   Repeat...

2. The Three Laws of TDD
  1. Write production code only to make a failing test pass
  2. Write only enough test to demonstrate failure
  3. Write only enough code to make the test pass

3. RED Phase Principles
What to Write
FocusExample
Behavior"should add two numbers"
Edge cases"should handle empty input"
Error states"should throw for invalid data"
RED Phase Rules
  • Test must fail first
  • Test name describes expected behavior
  • One assertion per test (ideally)

4. GREEN Phase Principles
Minimum Code
PrincipleMeaning
YAGNIYou Aren't Gonna Need It
Simplest thingWrite the minimum to pass
No optimizationJust make it work
GREEN Phase Rules
  • Don't write unneeded code
  • Don't optimize yet
  • Pass the test, nothing more

5. REFACTOR Phase Principles
What to Improve
AreaAction
DuplicationExtract common code
NamingMake intent clear
StructureImprove organization
ComplexitySimplify logic
REFACTOR Rules
  • All tests must stay green
  • Small incremental changes
  • Commit after each refactor

6. AAA Pattern

Every test follows:

StepPurpose
ArrangeSet up test data
ActExecute code under test
AssertVerify expected outcome

7. When to Use TDD
ScenarioTDD Value
New featureHigh
Bug fixHigh (write test first)
Complex logicHigh
ExploratoryLow (spike, then TDD)
UI layoutLow

8. Test Prioritization
PriorityTest Type
1Happy path
2Error cases
3Edge cases
4Performance

9. Anti-Patterns
āŒ Don'tāœ… Do
Skip the RED phaseWatch test fail first
Write tests afterWrite tests before
Over-engineer initialKeep it simple
Multiple assertsOne behavior per test
Test implementationTest behavior

10. AI-Augmented TDD
Multi-Agent Pattern
AgentRole
Agent AWrite failing tests (RED)
Agent BImplement to pass (GREEN)
Agent COptimize (REFACTOR)

Remember: The test is the specification. If you can't write a test, you don't understand the requirement.

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

Limitations
  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.