Back to list
Xantibody

tdd

by Xantibody

my configuration

1🍴 0📅 Jan 24, 2026

SKILL.md


name: tdd description: TDD methodology guidance for writing tests and implementing code. Use when writing tests, implementing features, or refactoring code.

TDD Methodology

Red-Green-Refactor Cycle

Red Phase (Write Failing Test)

  • Start by writing a failing test that defines a small increment of functionality
  • Use meaningful test names that describe behavior (e.g., "shouldSumTwoPositiveNumbers")
  • Make test failures clear and informative
  • Write the simplest failing test first

Green Phase (Make It Pass)

  • Write just enough code to make the test pass - no more
  • Use the simplest solution that could possibly work
  • Do not add extra features or edge case handling yet

Refactor Phase (Improve Structure)

  • Refactor only when tests are passing
  • Use established refactoring patterns with their proper names
  • Make one refactoring change at a time
  • Run tests after each refactoring step
  • Prioritize refactorings that remove duplication or improve clarity

Tidy First Approach

Separate all changes into two distinct types:

TypeDescriptionExamples
STRUCTURALRearranging code without changing behaviorRenaming, extracting methods, moving code
BEHAVIORALAdding or modifying actual functionalityNew features, bug fixes

Rules:

  • Never mix structural and behavioral changes in the same commit
  • Always make structural changes first when both are needed
  • Validate structural changes do not alter behavior by running tests before and after

Code Quality Standards

  • Eliminate duplication ruthlessly
  • Express intent clearly through naming and structure
  • Make dependencies explicit
  • Keep methods small and focused on a single responsibility
  • Minimize state and side effects

Defect Fixing Workflow

When fixing a defect:

  1. First write an API-level failing test
  2. Then write the smallest possible test that replicates the problem
  3. Get both tests to pass

Feature Implementation Workflow

  1. Write a simple failing test for a small part of the feature
  2. Implement the bare minimum to make it pass
  3. Run tests to confirm they pass (Green)
  4. Make any necessary structural changes (Tidy First)
  5. Commit structural changes separately (use git-commit skill)
  6. Add another test for the next small increment
  7. Repeat until feature is complete

Always write one test at a time, make it run, then improve structure. Run all tests (except long-running tests) each time.

Score

Total Score

60/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon