界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
开发与工程 · SKILL.md

tdd-cycle

tdd-cycle

【开发与工程】Red-Green-Refactor test-driven development cycle

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: tdd-cycle description: Red-Green-Refactor test-driven development cycle version: 1.0.0 author: Agentic OS tags: [testing, tdd, quality, development]

TDD Cycle

Description

Enforces the Red-Green-Refactor TDD cycle: write a failing test, make it pass, then refactor. No code is written before a test exists.

When to Use

  • When implementing any new feature
  • When fixing a bug
  • When refactoring existing code

Process

  1. RED: Write a failing test for the desired behavior
  2. Verify test fails (confirm test is valid)
  3. GREEN: Write minimal code to make the test pass
  4. Verify test passes
  5. REFACTOR: Clean up code while keeping tests green
  6. Commit with message format: RED|GREEN|REFACTOR: description

Rules

  • Production code is only written to make a failing test pass
  • Delete any code written before tests
  • Never skip the RED phase

Agent Assignment

  • Primary: opencode
我的收藏