/ 目录 / 演练场 / agent-skill-tdd
● 社区 Shelpuk-AI-Technology-Consulting ⚡ 即开即用

agent-skill-tdd

作者 Shelpuk-AI-Technology-Consulting · Shelpuk-AI-Technology-Consulting/agent-skill-tdd

Six-step workflow that forces AI coding agents into requirements-first, test-first discipline — Serena + requirements docs + Lad MCP design review + TDD + peer review.

A discipline skill for coding agents. Activates Serena for semantic code navigation, forces investigation before changes, demands explicit requirements confirmation, writes timestamped .requirements/ docs with As-Is/To-Be/Acceptance, validates architecture via Lad MCP Server, then runs strict TDD with per-change peer review. Claims 15–20% quality uplift. Works with Claude Code, Codex, Cursor, Windsurf, Antigravity.

为什么要用

核心特性

实时演示

实际使用效果

agent-skill-tdd-skill.replay ▶ 就绪
0/0

安装

作者仓库 · Claude Skills 官方文档

使用场景

实战用法: agent-skill-tdd

Implement a new feature with full TDD discipline

👤 Teams where AI coders jump to implementation and miss requirements ⏱ ~120 min intermediate

何时使用: Non-trivial feature where 'just write it' has burned you before.

步骤
  1. Kick off with the skill
    Use agent-skill-tdd. I want to add a 'saved searches' feature. Start from step 1 — activate Serena and investigate.✓ 已复制
    → Claude reads code, summarizes current state
  2. Clarify requirements
    Confirm what I just said maps to these acceptance criteria — don't code yet.✓ 已复制
    → Back-and-forth until confirmed; .requirements/ file saved
  3. Design review via Lad
    Run design review — architecture fit, hotspots.✓ 已复制
    → Design critique, not just approval
  4. TDD loop
    Now begin TDD — write a failing test, minimum code to pass, refactor. Peer review each step.✓ 已复制
    → Red-green-refactor cycles, each reviewed

结果: Feature shipped with tests, requirements history, and design rationale preserved.

注意事项
  • Skipping clarify to 'save time' — That's where most AI coding value is lost — hold the line
搭配使用: filesystem · github

Fix a bug after writing down what correct behavior should be

👤 Devs tired of AI 'fixes' that break other paths ⏱ ~60 min intermediate

何时使用: A subtle bug where the reproduction is half the battle.

步骤
  1. Investigate + document
    Use agent-skill-tdd bug mode. Symptom: <description>. Write the reproduction + expected behavior to .requirements/ first.✓ 已复制
    → Timestamped doc with As-Is and To-Be
  2. Write failing test
    Test that expresses the expected behavior — currently failing.✓ 已复制
    → Red test
  3. Fix + peer review
    Minimum fix to go green. Peer review.✓ 已复制
    → Green + review notes

结果: A bug fix with a test preventing regression.

Stop before implementing — validate you understand the spec

👤 Teams where spec-misreading causes rework ⏱ ~30 min beginner

何时使用: The ticket is ambiguous and you suspect you're about to build the wrong thing.

步骤
  1. Only run steps 1–4
    Use agent-skill-tdd — investigate + clarify + document + design review. Stop before coding.✓ 已复制
    → Requirements doc + design review without touching code

结果: You either discover you misread the ticket or greenlight with confidence.

组合

与其他 MCP 搭配,撬动十倍杠杆

agent-skill-tdd-skill + filesystem

Keep .requirements/ in the repo for future agents to read

Commit .requirements/ to git so the next session has context.✓ 已复制
agent-skill-tdd-skill + github

Link requirements doc in the PR description

When opening the PR, paste the .requirements/ file path in the description.✓ 已复制

工具

此 MCP 暴露的能力

工具输入参数何时调用成本
activate_serena repo path Step 1 0 — local
investigate task description Step 2 0
clarify task, user answers Step 3 0
document_requirements confirmed requirements Step 4 0
design_review requirements + repo Step 5 0
tdd_cycle requirements Step 6 0

成本与限制

运行它的成本

API 配额
None from the skill; Serena and Lad have their own footprints
每次调用 Token 数
Moderate — each step is a round trip
费用
Free
提示
Full 6-step is overkill for trivial tasks — run steps 1–4 only on small work

安全

权限、密钥、影响范围

凭据存储: None
数据出站: Only via Serena/Lad if configured

故障排查

常见错误与修复

Requirements doc not created

Ensure filesystem write access to .requirements/

验证: ls .requirements/
Design review step feels rubber-stamp

Force an adversarial framing: 'what's the strongest objection to this design?'

替代方案

agent-skill-tdd 对比其他方案

替代方案何时用它替代权衡
claude-gpt-workflowYou want cross-model review instead of self-TDD disciplineHigher API cost
planning-with-files-skillYou want persistence across sessions but less TDD rigorNo test-first enforcement

更多

资源

📖 阅读 GitHub 上的官方 README

🐙 查看未解决的 issue

🔍 浏览全部 400+ MCP 服务器和 Skills