测试与安全

test-driven-development

sickn33/agentic…e-skills

Use a failing behavioral test to guide a feature or bug fix, then implement and refactor with relevant regression checks.

  • 1419 次安装
  • 4.9万 星标
  • 收录于

安装命令

npx skills add https://github.com/sickn33/agentic-awesome-skills --skill test-driven-development

SKILL.md

Test-Driven Development (TDD)

Overview

Write the test first. Watch it fail. Write minimal code to pass.

Core principle: If you didn't watch the test fail, you don't know if it tests the right thing.

Violating the letter of the rules is violating the spirit of the rules.

When to Use

Use for behavior changes where a repeatable test can demonstrate the requirement or reproduce the bug. Inspect the repository’s test runner and existing coverage first. For copy, generated outputs or low-impact configuration, use the appropriate focused validation rather than manufacturing a unit test.

Preserve existing work

Write the failing regression before the repair when feasible, and verify that it fails for the expected reason. If implementation already exists, preserve it and add characterization/regression tests. Do not delete user work, reset a branch or rewrite working code to reconstruct an ideal test-first history. State honestly whether the test preceded the fix.

Red-Green-Refactor