跳到正文
cccskills
免费在 GitHub 公开

tdd

Use test-driven development for behavior-changing feature or fix work, and whenever the user mentions TDD, test-first, red-green-refactor, tracer bullets, integration tests, or public-interface behavior tests. Skip for docs-only, path-only rename, formatting-only, or purely mechanical chores unless explicitly requested.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(6)

  • SKILL.md3.0 KB
  • references/deep-modules.md619 B
  • references/interface-design.md991 B
  • references/mocking.md1.2 KB
  • references/refactoring.md545 B
  • references/tests.md1.6 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Test-Driven Development

Core Rule

Work in vertical red-green-refactor slices:

  1. RED: write one test for one observable behavior.
  2. GREEN: implement the smallest production change that makes that test pass.
  3. REFACTOR: clean up only while tests are green.

Do not write a batch of imagined tests before implementation. Each new test should respond to what the last cycle taught you about the actual behavior and interface.

Plaited Defaults

  • Use bun test for targeted tests and bun --bun tsc --noEmit for the type gate.
  • Use test, not it, and organize with describe.
  • Prefer real dependencies and real runtime boundaries over mocks.
  • Mock only external boundaries such as remote APIs, time, randomness, or rare filesystem cases.
  • Avoid conditional assertions: assert the branch first, then assert branch-specific values.
  • Test both branches for conditionals, fallbacks, and error paths.
  • Exercise public interfaces and runtime contracts rather than private helpers.
  • Follow applicable repo skills and AGENTS.md rules for the touched area.

When Starting Work

Explore the codebase first. If the public interface, expected behavior, or risk boundary is discoverable from code, tests, or docs, use that evidence instead of asking the user.

Ask one concise question only when the decision cannot be discovered and a reasonable assumption would be risky. Include your recommended answer.

Before writing production code, identify:

  • the public interface or runtime boundary under test
  • the first observable behavior to prove
  • the targeted test command for the cycle
  • the broader validation needed before handoff

Cycle Discipline

For each behavior:

  1. Add or update exactly one focused test.
  2. Run the targeted test and confirm it fails for the intended reason.
  3. Implement only enough code to pass.
  4. Run the same targeted test and confirm it passes.
  5. Refactor if useful, then rerun the affected tests.

If the test passes before production code changes, it is not a valid RED signal. Tighten the test, choose a different behavior, or explain why existing coverage already proves the behavior.

Reference Files

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Analyze graded `trial_result` JSONL outputs from the eval pipeline, including reliability and custom slicing.

中文简介正在准备中。当前显示原文说明。

behavioral-sh/agent-eval-harness72026年6月18日 更新

grill-me

免费

Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".

中文简介正在准备中。当前显示原文说明。

behavioral-sh/agent-eval-harness72026年6月18日 更新

Build command-only adapters for `eval` run mode using strict stdin/stdout JSON contracts.

中文简介正在准备中。当前显示原文说明。

behavioral-sh/agent-eval-harness72026年6月18日 更新

End-to-end eval-suite orchestration with the `eval` command: run -> grade -> compare -> calibrate, using strict JSON contracts and schema discovery.

中文简介正在准备中。当前显示原文说明。

behavioral-sh/agent-eval-harness72026年6月18日 更新

查看 behavioral-sh 的全部技能

报告此技能的问题