$npx skillfedfor your agent

tdd

tdd guides you through strict test-driven development using the red-green-refactor cycle: write a failing test, implement minimal code to pass it, then refactor. The skill enforces the discipline of writing tests before production code and provides framework-specific commands for multiple languages.

tdd enforces test-driven development by guiding you through the red-green-refactor cycle to write failing tests first.

AI-generated summary based on this skill's SKILL.md

1,847 330 MITupdated by zereight

Decision gist · record as of 2026-07-27

tdd enforces test-driven development by guiding you through the red-green-refactor cycle to write failing tests first. tdd guides you through strict test-driven development using the red-green-refactor cycle: write a failing test, implement minimal code to pass it, then refactor. The skill enforces the discipline of writing tests before production code and provides framework-specific commands for multiple languages.

manual: git clone https://github.com/zereight/gitlab-mcp → cp -r gitlab-mcp/.github/skills/tdd ~/.claude/skills/tdd
.github/skills/tdd/SKILL.md · version b04a681f

Use it when

  • tdd guides you to write failing tests before implementing production code.
  • tdd teaches TDD best practices by helping you avoid common pitfalls: writing tests after code, skipping the refactor phase.

Verify before relying

Read SKILL.md below before installing (1 file). Open directory: indexed for reading, not audited.

Same gist for agents: .md · .json

Install

zereight/gitlab-mcp/tdd · repository language: TypeScript

Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

What is the red green refactor cycle that tdd enforces?

tdd enforces the red-green-refactor cycle as the core TDD workflow. Red means writing a failing test first. Green means implementing minimal code to make that test pass. Refactor means improving the code while keeping tests passing. This cycle repeats for each feature, ensuring tests drive design and maintain coverage throughout development.

How do I write tests first with tdd?

tdd guides you to write failing tests before implementing production code. Start by defining what your code should do as a test case. Run it—it fails (red phase). Then write the minimal implementation to pass it (green phase). Finally, improve the code without breaking tests (refactor phase). This test-first discipline ensures your code is testable and requirements are clear from the start.

What TDD best practices does tdd help me avoid?

tdd teaches TDD best practices by helping you avoid common pitfalls: writing tests after code, skipping the refactor phase, writing overly complex tests, or testing implementation details instead of behavior. The skill enforces atomic test cases as executable specifications, keeping each test focused on one behavior. This prevents brittle tests and ensures your test suite remains maintainable.

Can tdd help me refactor code safely?

Yes. tdd supports safe refactoring by maintaining test coverage throughout the process. Since you've written tests before implementation, your test suite acts as a safety net. You can confidently refactor code knowing that if tests still pass, behavior is preserved. This coverage-first approach eliminates the fear of breaking functionality during improvements.

What framework-specific commands does tdd provide?

tdd provides framework-specific commands for multiple languages to support your TDD workflow. These commands help you run tests, watch for changes, and execute the red-green-refactor cycle efficiently across different tech stacks. The skill adapts to your language and testing framework, making TDD discipline accessible whether you use Jest, pytest, RSpec, or other popular test runners.

How does tdd structure atomic test cases?

tdd structures atomic test cases as executable specifications—each test focuses on a single behavior or requirement. This approach keeps tests small, readable, and maintainable. Atomic tests are easier to debug when they fail, provide clear documentation of expected behavior, and prevent cascading failures. tdd guides you to write these focused specifications so your test suite remains a reliable design tool.

SKILL.md

Rendered from the published skill. Quoted content, verbatim.

TDD — Test-Driven Development

THE IRON LAW: Write the failing test FIRST. Always.

The Red-Green-Refactor Cycle

RED   → Write a failing test for the NEXT behavior
GREEN → Write ONLY enough code to make it pass (no extras)
REFACTOR → Clean up code quality (tests must stay green after every change)
REPEAT

Step-by-Step Protocol

1. RED Phase
  1. Identify the smallest next behavior to implement
  2. Write a test that describes that behavior as a named it() / test() / def test_
  3. Run the test — it MUST FAIL. If it passes, the test is wrong.
  4. Confirm the failure message is the RIGHT failure (not a syntax error)
// Example: RED — test fails because function doesn't exist yet
it('returns an empty array for an empty input', () => {
  const result = parseItems([]);
  expect(result).toEqual([]);  // FAILS: parseItems is not defined
});
2. GREEN Phase
  1. Write the MINIMUM code to make

(truncated - see the full file via the links below)

File tree — 1 file
.github/skills/tdd/SKILL.md

Let your AI agent find skills like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.

wish › “Enforce test-driven development workflow with red-green-refactor cycle”

Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →

Related skills

testing-strategy
by cacr92 · cacr92/WeReply

Testing Strategy provides comprehensive testing patterns for Tauri applications spanning Rust backend and React frontend. It covers unit and integration tests, test fixtures, command mocking, and test coverage strategies to support quality assurance and TDD workflows.

MITfor claude-code, codex, cursorupdated Jan 2026
★ 4repo stars
tdd-mastery
by xenitV1 · xenitV1/claude-code-maestro

TDD Mastery enforces the iron law of test-first development: write a failing test, verify it fails, implement minimal code to pass, then refactor. The skill drills the red-green-refactor cycle with no exceptions, rejecting any production code written before its corresponding test exists and has been observed failing.

MITupdated Jan 2026
★ 230repo stars
Tdd
by glebis · glebis/claude-skills

This skill guides you through test-driven development using separate subagents for test writing and implementation, ensuring each phase stays focused on its role. It supports Jest, Vitest, pytest, Go test, cargo test, PHPUnit, and RSpec, with modes for interactive approval, autonomous execution, and dry-run validation. Vertical slicing and context isolation keep your TDD workflow disciplined and your tests honest.

no license declared → metadata onlyupdated Jul 2026
★ 334repo stars
ultraqa
by zereight · zereight/gitlab-mcp

UltraQA automates the test-fix loop by running quality checks, analyzing what broke, and applying corrections across up to 5 cycles. Choose your goal—tests, build, lint, or type checking—and let it work toward success. It tracks progress, detects repeated failures, and exits when the goal is met or max cycles reached.

MITupdated Jul 2026
★ 1,847repo stars
tdd
by frankify-app · frankify-app/skills

tdd guides you through writing tests before implementation using the red-green-refactor workflow. Each cycle commits a failing test marked red, then minimal passing code marked green, with refactoring only after all tests pass. The skill enforces behavioral testing over implementation details and includes commit hygiene checks to keep your tree lint-clean at every step.

MITupdated Jul 2026
★ 0repo stars
rtk-tdd
by rtk-ai · rtk-ai/rtk

rtk-tdd enforces the red-green-refactor cycle for Rust development, automatically guiding you through failing tests, minimal implementations, and refactoring phases. It provides Rust-idiomatic testing patterns using anyhow/thiserror, cfg(test) modules, and Arrange-Act-Assert workflows, with pre-commit gates ensuring code quality.

Apache-2.0for claude-codeupdated Jul 2026
★ 73,568repo stars

More skills verify (MIT) · Test-Driven Development (TDD) (MIT) · trace (MIT) · openspec-plus-tdd (MIT) · doc-tdd (MIT) · status (MIT)

Tags
quality-assurancedevelopment-methodologytesting-firstcode-disciplinebehavior-specificationincremental-developmenttest-automationrefactoring-workflow