tdd — community humansintheloop-dev-workflow-and-tools, community, ide skills, Claude Code, Cursor, Windsurf

v1.0.0

关于此技能

Perfect for Coding Agents 需要严格的 Test-Driven Development 工作流程强制执行和防作弊机制。 a workflow for practicing Test-Driven Development (TDD)

humansintheloop-dev humansintheloop-dev
[0]
[0]
更新于: 3/9/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reference-Only Page Review Score: 7/11

This page remains useful for operators, but Killer-Skills treats it as reference material instead of a primary organic landing page.

Original recommendation layer Concrete use-case guidance Explicit limitations and caution
Review Score
7/11
Quality Score
29
Canonical Locale
en
Detected Body Locale
en

Perfect for Coding Agents 需要严格的 Test-Driven Development 工作流程强制执行和防作弊机制。 a workflow for practicing Test-Driven Development (TDD)

核心价值

赋予代理确保准确的测试结果的能力,通过强制执行诚实和防止作弊的严格但轻量级的 TDD 工作流程,仅关注测试,并利用包括永远不会声称测试通过或失败,除非它们刚刚运行并显示确切输出的核心防作弊合同。

适用 Agent 类型

Perfect for Coding Agents 需要严格的 Test-Driven Development 工作流程强制执行和防作弊机制。

赋予的主要能力 · tdd

强制执行编码任务的严格 TDD 工作流程
通过仅关注测试来防止作弊
通过核心防作弊合同生成准确的测试结果

! 使用限制与门槛

  • 需要遵守核心防作弊合同
  • 必须运行测试以声明通过或失败的结果
  • 如果无法运行测试,则进入 'BLOCKED' 状态

Why this page is reference-only

  • - Current locale does not satisfy the locale-governance contract.
  • - The underlying skill quality score is below the review floor.

Source Boundary

The section below is supporting source material from the upstream repository. Use the Killer-Skills review above as the primary decision layer.

实验室 Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

常见问题与安装步骤

以下问题与步骤与页面结构化数据保持一致,便于搜索引擎理解页面内容。

? FAQ

tdd 是什么?

Perfect for Coding Agents 需要严格的 Test-Driven Development 工作流程强制执行和防作弊机制。 a workflow for practicing Test-Driven Development (TDD)

如何安装 tdd?

运行命令:npx killer-skills add humansintheloop-dev/humansintheloop-dev-workflow-and-tools/tdd。支持 Cursor、Windsurf、VS Code、Claude Code 等 19+ IDE/Agent。

tdd 适用于哪些场景?

典型场景包括:强制执行编码任务的严格 TDD 工作流程、通过仅关注测试来防止作弊、通过核心防作弊合同生成准确的测试结果。

tdd 支持哪些 IDE 或 Agent?

该技能兼容 Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer。可使用 Killer-Skills CLI 一条命令通用安装。

tdd 有哪些限制?

需要遵守核心防作弊合同;必须运行测试以声明通过或失败的结果;如果无法运行测试,则进入 'BLOCKED' 状态。

安装步骤

  1. 1. 打开终端

    在你的项目目录中打开终端或命令行。

  2. 2. 执行安装命令

    运行:npx killer-skills add humansintheloop-dev/humansintheloop-dev-workflow-and-tools/tdd。CLI 会自动识别 IDE 或 AI Agent 并完成配置。

  3. 3. 开始使用技能

    tdd 已启用,可立即在当前项目中调用。

! 参考页模式

此页面仍可作为安装与查阅参考,但 Killer-Skills 不再把它视为主要可索引落地页。请优先阅读上方评审结论,再决定是否继续查看上游仓库说明。

Imported Repository Instructions

The section below is supporting source material from the upstream repository. Use the Killer-Skills review above as the primary decision layer.

Supporting Evidence

tdd

安装 tdd,这是一款面向AI agent workflows and automation的 AI Agent Skill。支持 Claude Code、Cursor、Windsurf,一键安装。

SKILL.md
Readonly
Imported Repository Instructions
The section below is supporting source material from the upstream repository. Use the Killer-Skills review above as the primary decision layer.
Supporting Evidence

TDD Skill (Test-Only, Anti-Cheat, Minimal Version)

This skill defines a strict but lightweight TDD workflow designed for coding agents. It enforces honesty, prevents cheating, and minimizes token usage by focusing solely on tests.


Core Anti-Cheat Contract

(Always enforced in every state)

  1. Never claim tests passed or failed unless you have just run them and shown the exact output.

  2. If you cannot run tests, enter BLOCKED immediately. Do not guess or infer results.

  3. Never modify test assertions just to make a failing test pass.

  4. Only transition between TDD states when the required test evidence has been shown.

  5. In RED, implement only the minimum code necessary to make the currently failing test pass.

  6. Every message must begin with a TDD state prefix, and the prefix must match the actual test evidence.

  7. Promote the Dependency Rule If making a failing test for the current SUT pass requires changing a dependency, you must stop and promote that dependency to be the SUT. Write a failing test for the dependency, make it pass, then return to the original SUT.

    Clarification:

    • Modifying a dependency counts as production code.
    • Production code may only be written to satisfy the currently failing test.
    • Therefore, any dependency change must be justified by its own failing test.

TDD Layer Discipline

When testing layer A that mocks layer B:

  • Layer B only needs a method signature (stub returning null or throwing UnsupportedOperationException)
  • Do NOT implement Layer B's logic until you write Layer B's tests
  • Ask: "Is the service/dependency mocked in this test?" If yes, only a stub is needed.

Example:

  • Controller test mocks CustomerService → CustomerService.createLocationForCustomer() should be throw new UnsupportedOperationException("implement me")
  • CustomerService test (separate task) will drive the actual implementation

Outside-In Development

Use outside-in development: start from the external interface and work inward.

Why: Every piece of code should be immediately callable and tested from an external perspective. Avoid creating "infrastructure only" code to be connected later.

Correct order for implementing a feature:

  1. Write test for the external interface (command handler, REST endpoint)
  2. Implement the handler/controller, which calls the service method
  3. Implement the service method, which uses infrastructure (events, repositories)
  4. Create infrastructure as needed to satisfy the test

Anti-pattern: Creating event publishing code or domain methods without a caller (no REST endpoint or command handler to invoke them). Every method should have an entry point that exercises it.


Evidence Format (Required)

Whenever tests are mentioned:

Evidence:

  • tests: pass | fail | not-run
  • last_output: <exact test output snippet>

Rules:

  • pass or fail may only be used if tests were just executed.
  • not-run must be used if tests cannot be executed.
  • Never infer test status from code.

TDD States

⚪ TDD: PLANNING

Goal:
Write a meaningful failing test that expresses the desired behavior.

Allowed actions:

  • Ask clarification questions
  • Write or update a test
  • Run tests to show failure

Pre-conditions to enter RED:

  • A test exists
  • The test was just run
  • A failing test is shown
  • The failure reflects missing/incorrect behavior

Transition:

  • If pre-conditions satisfied → RED
  • Otherwise remain in PLANNING

🔴 TDD: RED

Goal:
Make the failing test pass using the minimum implementation.

Allowed actions:

  • Analyze the failing test
  • Implement the smallest possible change
  • Run tests again
  • Justify why the implementation is minimal

Pre-conditions to enter GREEN:

  • The previously failing test now passes
  • All tests pass
  • Test output is shown

Transition:

  • If all tests pass → GREEN
  • If tests still fail → remain in RED
  • If tests cannot run → BLOCKED

🟢 TDD: GREEN

Goal: The behavior is now correct; evaluate and prepare safe refactoring.

Allowed actions:

  • Re-read the actual code changes made in this cycle
  • Identify safe refactorings
  • Explain improvement intent
  • Run tests as needed

Required Evaluation (before any transition):

  1. Re-read the actual code changes made in this cycle (use git diff HEAD, not memory)
  2. List at least one observation about potential refactoring (even if "no duplication found")
  3. If duplication exists, either refactor it OR note it as intentional with justification

Skipping directly from GREEN to VERIFY without this explicit evaluation is a TDD violation.

Pre-conditions to enter REFACTOR:

  • All tests currently pass
  • Recent test output shown
  • A refactoring goal identified

Transition:

  • If refactoring is needed → REFACTOR
  • If no refactoring needed → VERIFY

🛠️ TDD: REFACTOR

Goal:
Improve internal code structure without changing behavior.

Allowed actions:

  • Perform small safe refactorings
  • Run tests immediately after each change

Pre-conditions to exit REFACTOR:

  • Tests were run after the last change
  • All tests pass
  • Test output is shown

Transition:

  • If tests pass → VERIFY
  • If tests fail → return to RED
  • If tests cannot run → BLOCKED

✅ TDD: VERIFY

Goal:
Confirm the entire TDD cycle is complete.

Allowed actions:

  • Run the full test suite
  • Show test results
  • Summarize completed behavior

Pre-conditions to enter COMPLETE:

  • All tests pass
  • Test output is shown

Transition:

  • If all tests pass → COMPLETE
  • If any test fails → RED
  • If tests cannot run → BLOCKED

🏁 TDD: COMPLETE

Goal:
The TDD cycle for this behavior is finished.

Allowed actions:

  • Provide a concise summary
  • Stop unless the user starts a new cycle

⚠️ TDD: BLOCKED

Goal:
Tests cannot be run; you cannot proceed honestly.

Actions:

  • State explicitly why tests cannot run
  • Show the exact command the user should run
  • Ask for the output

Transition:

  • When test results are provided → return to prior state
  • Do not infer test status

🚨 TDD: VIOLATION

Goal:
The agent has broken the TDD rules.

Actions:

  1. State what rule was violated
  2. Explain the correct behavior
  3. Undo or repair the incorrect action
  4. Return to the correct state

End of Skill

相关技能

寻找 tdd 的替代方案 (Alternative) 或可搭配使用的同类 community Skill?探索以下相关开源技能。

查看全部

openclaw-release-maintainer

Logo of openclaw
openclaw

Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

333.8k
0
AI

widget-generator

Logo of f
f

为prompts.chat的信息反馈系统生成可定制的插件小部件

149.6k
0
AI

flags

Logo of vercel
vercel

React 框架

138.4k
0
浏览器

pr-review

Logo of pytorch
pytorch

Python中具有强大GPU加速的张量和动态神经网络

98.6k
0
开发者工具