Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问clear审计通过

tdd-workflowTDD 工作流程

Agent Skill

tdd-workflow 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合在 Codex、Claude、Cursor、Gemini CLI 中希望让 Agent 持续沉淀问题、修正和最佳实践时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

372

周安装

16

GitHub Stars

127

下载量

131
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:tdd-workflow(TDD 工作流程)
来源仓库:https://github.com/anton-abyzov/specweave
仓库路径:skills/tdd-workflow
安装命令:
npx skills add https://github.com/anton-abyzov/specweave --skill tdd-workflow
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/anton-abyzov/specweave --skill tdd-workflow

简介

tdd-workflow 是一种轻量级的发现技能,它:

  • ✅ 从用户消息中检测 TDD 意图
  • ✅ 询问用户对 TDD 执行级别的偏好
  • ✅ 路由到适当的工具(引导命令与专家代理)
  • ✅ 教授 TDD 原则和最佳实践
  • ✅ 与 SpecWeave 增量工作流程集成
  • 不能替代:
  • TDD-编排器
  • 代理(深厚的专业知识)
  • /sw:tdd-*
  • 命令(工作流程执行)
  • 相反,它是帮助用户选择适合其上下文的 TDD 工具的切入点。
  • 关键词:TDD、测试驱动开发、红绿重构、测试优先、Kent Beck、TDD 周期、基于属性的测试、突变测试、重构、测试规则
  • 每周安装量
  • 16
  • 存储库
  • 安东阿比佐夫
  • GitHub 之星
  • 127
  • 第一次看到
  • 2026 年 1 月 22 日
  • 安全审计
  • Gen Agent Trust Hub 通行证

SKILL.md

TDD Workflow - Discovery & Coordination Skill

Purpose

This skill acts as a discovery hub for Test-Driven Development (TDD) in SpecWeave. It:

  • ✅ Detects when users want to implement features with TDD
  • ✅ Asks user preference for TDD workflow enforcement
  • ✅ Routes to appropriate TDD tools (commands vs agent)
  • ✅ Provides TDD education and best practices

NOT a full TDD implementation - delegates to:

  • tdd-orchestrator agent (deep TDD expertise)
  • /sw:tdd:cycle command (enforced red-green-refactor)
  • Individual phase commands (/sw:tdd:red, /sw:tdd:green, /sw:tdd:refactor)

When to Activate

Automatic activation when user mentions:

  • "implement with TDD"
  • "use test-driven development"
  • "red-green-refactor"
  • "write tests first"
  • "test-first approach"
  • "Kent Beck style"
  • "TDD discipline"

Example triggers:

User: "Implement authentication with TDD"
User: "Use test-driven development for this feature"
User: "Let's do red-green-refactor for the payment module"

Workflow

Step 1: Detect TDD Intent

When activated, confirm user's TDD intent:

"I detected you want to use Test-Driven Development (TDD).

TDD follows the red-green-refactor cycle:
🔴 RED: Write a failing test first
🟢 GREEN: Write minimal code to make it pass
🔵 REFACTOR: Improve code while keeping tests green

Would you like to:"

Step 2: Offer TDD Options

Use AskUserQuestion tool to present choices:

Question: "How would you like to implement TDD for this feature?"
Options:
  1. "Guided TDD Workflow (/sw:tdd:cycle)"
     Description: "Full red-green-refactor cycle with gates between phases.
                   Can't proceed to GREEN without RED test. Most rigorous."

  2. "Expert TDD Agent (tdd-orchestrator)"
     Description: "Deep TDD expertise with flexible workflow.
                   Best for complex scenarios, property-based testing, legacy code."

  3. "Manual TDD (I'll guide myself)"
     Description: "I'll implement TDD discipline myself.
                   You provide TDD advice when needed."

Step 3: Route Based on Choice

Option 1: Guided TDD Workflow

Invoke: /sw:tdd:cycle

This command orchestrates:
1. /sw:tdd:red    - Write failing test (blocks until red)
2. /sw:tdd:green  - Implement minimal code (blocks until green)
3. /sw:tdd:refactor - Refactor safely (tests must stay green)

Benefits:
- Enforces discipline (gates prevent skipping phases)
- Perfect for beginners or teams learning TDD
- Integrates with SpecWeave increment workflow

Option 2: Expert TDD Agent

Invoke: tdd-orchestrator agent (via Task tool)

This agent provides:
- Multi-agent TDD workflow coordination
- Property-based testing (QuickCheck, Hypothesis)
- Mutation testing for test quality
- Legacy code refactoring with safety nets
- BDD/ATDD integration
- AI-assisted test generation

Benefits:
- Flexible workflow (not rigid gates)
- Advanced techniques (property-based, mutation)
- Best for experienced TDD practitioners
- Handles complex scenarios

Option 3: Manual TDD

Provide TDD best practices:

"I'll implement your feature while following TDD principles.
I'll ensure:
- Tests written before implementation
- Minimal code to pass tests
- Refactoring with test coverage
- Clear red→green→refactor progression

I'll notify you at each phase transition."

TDD Best Practices (Reference)

Red Phase 🔴

  • Write the simplest test that fails
  • Test should compile but fail on assertion
  • Focus on WHAT, not HOW
  • One test at a time

Green Phase 🟢

  • Write minimal code to pass the test
  • Embrace "fake it till you make it"
  • Hardcoded values acceptable initially
  • Get to green FAST

Refactor Phase 🔵

  • Improve code structure
  • Extract methods, remove duplication
  • Tests must stay green
  • Commit after each refactor

TDD Anti-Patterns to Avoid

  • ❌ Writing implementation before test
  • ❌ Writing multiple tests before implementation
  • ❌ Over-engineering in GREEN phase
  • ❌ Refactoring without tests passing
  • ❌ Skipping refactor phase

Integration with SpecWeave

In Increment Workflow:

/sw:inc "Authentication feature" → spec.md created
↓
User: "Implement with TDD"
↓
tdd-workflow skill activates → offers options
↓
User chooses: Guided TDD Workflow
↓
/sw:tdd:cycle invoked
  ↓
  Phase 1: RED   - tests.md updated with failing tests
  Phase 2: GREEN - tasks.md implementation
  Phase 3: REFACTOR - code improvements
↓
Increment tasks completed with TDD discipline

With spec-driven-debugging:

Bug found → spec-driven-debugging activates
↓
Fix proposal includes: "Add regression test first (TDD RED phase)"
↓
tdd-workflow can coordinate test-first bug fixes

Commands Reference

Full Cycle

  • /sw:tdd:cycle - Complete red-green-refactor orchestration

Individual Phases

  • /sw:tdd:red - RED phase only (write failing test)
  • /sw:tdd:green - GREEN phase only (make test pass)
  • /sw:tdd:refactor - REFACTOR phase only (improve code)

When to Use Each

Use /sw:tdd:cycle when:

  • ✅ Starting new feature from scratch
  • ✅ Learning TDD or teaching team
  • ✅ Want enforced discipline (gates)
  • ✅ Working in increment-based workflow

Use individual commands when:

  • ✅ Already in middle of TDD cycle
  • ✅ Need to repeat a phase (e.g., multiple refactors)
  • ✅ Want finer control over cycle
  • ✅ Integrating with other workflows

Use tdd-orchestrator agent when:

  • ✅ Complex scenarios (property-based testing)
  • ✅ Legacy code refactoring
  • ✅ Multi-agent coordination needed
  • ✅ Advanced TDD techniques required

Example Interactions

Example 1: Beginner TDD User

User: "I want to implement user registration with TDD"

tdd-workflow:

Great! TDD (Test-Driven Development) follows red-green-refactor:
🔴 RED: Write failing test
🟢 GREEN: Make it pass
🔵 REFACTOR: Improve code

[Presents AskUserQuestion with 3 options]

User selects: "Guided TDD Workflow"

tdd-workflow:

Perfect! I'm invoking /sw:tdd:cycle to orchestrate your TDD workflow.

🔴 Starting RED phase...
Write a failing test for user registration. Let me create the test skeleton:

[Creates test file with failing test]

✅ Test written and failing. Run: npm test
❌ Expected failure confirmed.

Ready to proceed to GREEN phase? (type 'yes' or run /sw:tdd:green)

Example 2: Experienced TDD User

User: "Refactor auth module with TDD safety nets"

tdd-workflow:

I see you want to refactor with TDD discipline.

[Presents AskUserQuestion]

User selects: "Expert TDD Agent"

tdd-workflow:

Invoking tdd-orchestrator agent for advanced refactoring support...

[tdd-orchestrator agent takes over with:]
- Characterization tests for legacy code
- Golden master testing
- Seam identification
- Incremental refactoring with safety nets

Example 3: Mid-Cycle TDD

User: "I'm in GREEN phase, tests passing, ready to refactor"

tdd-workflow:

Great! Tests are passing. Time for REFACTOR phase.

You can:
1. Run /sw:tdd:refactor (guided refactoring)
2. Refactor manually (I'll verify tests stay green)

Which would you prefer?

User: "I'll refactor manually"

tdd-workflow:

Perfect! I'll monitor your refactoring:

✅ Tests passing before refactor
[User refactors code]
✅ Tests still passing after refactor
✅ TDD cycle maintained

Ready for next feature? Run /sw:tdd:cycle or continue manually.

Configuration

Optional: Customize TDD preferences in .specweave/config.yaml:

tdd:
  default_workflow: "cycle"  # Options: "cycle", "agent", "manual"
  auto_activate: true         # Auto-offer TDD on new features
  gates_enabled: true         # Enforce phase gates in cycle mode
  mutation_testing: false     # Enable mutation testing (requires setup)

Success Criteria

This skill succeeds when:

  • ✅ Users are offered TDD workflow when appropriate
  • ✅ TDD choice is explicit (not assumed)
  • ✅ Clear routing to appropriate tool (command vs agent)
  • ✅ TDD education embedded in workflow
  • ✅ Flexible enough for beginners and experts
  • ✅ Integrates seamlessly with SpecWeave increments

Related Skills & Agents

Skills:

  • spec-driven-debugging - Bug fixes can use TDD approach
  • increment-planner - Increments can specify TDD as methodology
  • e2e-playwright - E2E tests can follow TDD for acceptance tests

Agents:

  • tdd-orchestrator - Deep TDD expertise (invoked by this skill)
  • qa-lead - Test strategy overlaps with TDD principles

Commands:

  • /sw:tdd:cycle - Full red-green-refactor orchestration
  • /sw:tdd:red, /sw:tdd:green, /sw:tdd:refactor - Individual phases

Summary

tdd-workflow is a lightweight discovery skill that:

  1. Detects TDD intent from user messages
  2. Asks user preference for TDD enforcement level
  3. Routes to appropriate tool (guided commands vs expert agent)
  4. Educates on TDD principles and best practices
  5. Integrates with SpecWeave increment workflow

Not a replacement for:

  • tdd-orchestrator agent (deep expertise)
  • /sw:tdd-* commands (workflow enforcement)

Instead, it's the entry point that helps users choose the right TDD tool for their context.


Keywords: TDD, test-driven development, red-green-refactor, test-first, Kent Beck, TDD cycle, property-based testing, mutation testing, refactoring, test discipline

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.52%
按下载量换算37

Antigravity

24.43%
按下载量换算32

Cursor

19.83%
按下载量换算26

Gemini CLI

14.49%
按下载量换算19

OpenCode

7.8%
按下载量换算10

Codex

3.62%
按下载量换算5

安全审计

Gen Agent Trust Hub

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills