tdd

GitHub

遵循TDD模式,分步实现功能:先写失败测试(Red),再写最小代码使通过(Green),最后重构优化。循环执行直至完成并展示差异供审查。

solutions/i-1/dot-claude/skills/tdd/SKILL.md wesammustafa/Claude-Code-Quest

Trigger Scenarios

用户要求新功能或函数 提到测试优先或TDD

Install

npx skills add wesammustafa/Claude-Code-Quest --skill tdd -g -y
More Options

Non-standard path

npx skills add https://github.com/wesammustafa/Claude-Code-Quest/tree/main/solutions/i-1/dot-claude/skills/tdd -g -y

Use without installing

npx skills use wesammustafa/Claude-Code-Quest@tdd

指定 Agent (Claude Code)

npx skills add wesammustafa/Claude-Code-Quest --skill tdd -a claude-code -g -y

安装 repo 全部 skill

npx skills add wesammustafa/Claude-Code-Quest --all -g -y

预览 repo 内 skill

npx skills add wesammustafa/Claude-Code-Quest --list

SKILL.md

Frontmatter
{
    "name": "tdd",
    "description": "Builds a requested feature test-first, one behavior at a time, and stops at a diff for review. Use when the user asks for a new function or feature, or says test-first or TDD."
}

Build this test-first, one behavior at a time: $ARGUMENTS

  1. Red: write one failing test for the next behavior. Run the tests and confirm that it fails, and fails for the reason you expect. Don't change code outside the tests in this step.
  2. Green: write the least code that makes the new test pass, then run the whole test suite and confirm that every test passes. Don't change the tests in this step.
  3. Refactor: improve the names and structure of the code you just wrote without changing what it does, and run the tests again. They must still pass.

Repeat until the feature is done, then run the whole test suite and show the diff. Don't commit: the user reviews the diff and commits.

Version History

  • d6d24d6 Current 2026-11-02 19:33

Same Skill Collection

.claude/skills/claude-md-review/SKILL.md
solutions/a-capstone/dot-claude/skills/team-review/SKILL.md
solutions/i-1/dot-claude/skills/five-whys/SKILL.md
solutions/i-3/dot-claude/skills/changelog/SKILL.md
solutions/i-capstone/dot-claude/skills/check-links/SKILL.md

Metadata

Files
0
Version
7bb7ec3
Hash
cd74dfb9
Indexed
2026-11-02 19:33

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-10 03:07
浙ICP备14020137号-1