agentleFS
yearzen1yearzen1/LocalSkillManager/.agents/skills/tdd/SKILL.md

tdd

Skill2 starsChanged 14 days agoMITView on GitHub

Use for all Agent-generated code changes to enforce strict test-driven development: Red → Green → Refactor, minimal implementation, full test verification, and atomic commits.

194 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use capture-learning-tools, design-frontend-dev and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • The-Vibe-CompanySkill

    capture-learning-tools

    Turn technical conversations, bugs, CI failures, review comments,

    Also in 5 projects that use this

  • The-Vibe-CompanySkill

    design-frontend-dev

    Clean Impeccable frontend design skill. Use when the user wants to

    Also in 5 projects that use this

  • tristanphvnSkill

    ketchup-video

    Catch the user up like /keel:ketchup, with a short silent video of slides for what happened and the waiting calls as text under it. Use for /keel:ketchup-video.

    Also in 14 projects that use this

  • jaydubya818Skill

    figure-it-out

    Use when novel or multi-phase work needs an auditable workflow and no narrower playbook fits.

    Also in 54 projects that use this

  • jaydubya818Skill

    principle-laziness-protocol

    Apply when a refactor is adding wrappers or abstractions instead of simplifying.

    Also in 45 projects that use this

  • +2 more from The-Vibe-Company
  • +5 more from jaydubya818

The file

Files
SKILL.md

TDD

1. 核心原则

本仓库遵循测试驱动开发(TDD)。所有由 Agent 生成的代码变更,必须严格遵循 TDD 循环:

Red → Green → Refactor
  • Red(红):先写一个失败的测试,明确期望的行为。
  • Green(绿):用最少的代码让测试通过。
  • Refactor(重构):在测试保护下清理代码,不改变行为。

禁止先写实现再补测试。没有对应失败测试的实现代码,视为违规。

2. 工作流程(Agent 必须遵守)

步骤 0:理解需求

  • 阅读任务描述,列出所有可验证的行为点。
  • 将每个行为点映射为一个测试用例。
  • 若需求模糊,先提问或写出假设,不要直接猜测实现。

步骤 1:Red — 写失败测试

  • 在测试文件中新增测试,命名清晰描述行为,如 should_return_zero_for_empty_cart。
  • 运行测试,确认它因预期原因失败,而不是语法错误或导入错误。
  • 记录失败信息。

步骤 2:Green — 最小实现

  • 只写让当前失败测试通过的最少代码。
  • 不提前实现未被测试覆盖的功能(YAGNI)。
  • 运行全部测试,确保新测试通过且旧测试不回归。

步骤 3:Refactor — 重构

  • 在测试全绿的前提下,消除重复、改善命名、抽取函数。
  • 每次重构后立即运行测试。
  • 若重构引入新行为,回到步骤 1。

步骤 4:提交

  • 每个 TDD 循环对应一个原子提交。
  • 提交信息格式:test: ...、feat: ...、refactor: ...。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.