tdd-expert
Use when the user has a test-case-tree output and wants runnable Go tests plus stub implementation following Test-Driven Development.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- tdd-expert
- description
- Use when the user has a test-case-tree output and wants runnable Go tests plus stub implementation following Test-Driven Development.
02 资源文件 23
- 脚本main_test.go5.8 KB
- 脚本main.go1.6 KB
- 参考文档PROMPT.md6.5 KB
- 其他test/integrations/.gitignore59 B
- 脚本test/integrations/main.go1.7 KB
- 脚本test/integrations/runner.go767 B
- 脚本test/integrations/tests.go6.6 KB
- 参考文档test/integrations/write-a-cli/write-cli-test-cases/basic-write/ASSERT.md131 B
- 参考文档test/integrations/write-a-cli/write-cli-test-cases/basic-write/SETUP.md115 B
- 参考文档test/integrations/write-a-cli/write-cli-test-cases/no-args/ASSERT.md174 B
- 参考文档test/integrations/write-a-cli/write-cli-test-cases/no-args/SETUP.md66 B
- 参考文档test/integrations/write-a-cli/write-cli-test-cases/README.md763 B
- 参考文档test/integrations/write-a-cli/write-cli-test-cases/SETUP.md145 B
- 参考文档test/integrations/write-a-cli/write-cli-test-cases/with-flag/ASSERT.md159 B
- 参考文档test/integrations/write-a-cli/write-cli-test-cases/with-flag/SETUP.md112 B
- 参考文档test/integrations/write-a-library/math-lib-test-cases/arithmetic/add/ASSERT.md91 B
- 参考文档test/integrations/write-a-library/math-lib-test-cases/arithmetic/add/SETUP.md58 B
- 参考文档test/integrations/write-a-library/math-lib-test-cases/arithmetic/multiply/ASSERT.md97 B
- 参考文档test/integrations/write-a-library/math-lib-test-cases/arithmetic/multiply/SETUP.md68 B
- 参考文档test/integrations/write-a-library/math-lib-test-cases/edge-cases/ASSERT.md64 B
- 参考文档test/integrations/write-a-library/math-lib-test-cases/edge-cases/SETUP.md75 B
- 参考文档test/integrations/write-a-library/math-lib-test-cases/README.md787 B
- 参考文档test/integrations/write-a-library/math-lib-test-cases/SETUP.md191 B
03 SKILL.md 正文
Convert a test case tree into runnable Go tests following TDD (RED phase only).
Input: A path to a test case tree directory (output of
test-case-tree-design-expert) containing README.md, SETUP.md (with
inheritance), and ASSERT.md per leaf.
Follow these steps:
-
Parse the Test Case Tree — Read README.md for the overview and index, then walk the tree to collect every runnable leaf (directories containing ASSERT.md). Collect each leaf's SETUP.md and ASSERT.md plus all ancestor SETUP.md files.
-
Design the Go API — Derive package name from the feature slug. Design exported functions, types, and constants the tests will call.
-
Generate Stub Implementation (RED) — Create a Go source file where every exported function returns
"not implemented: <FuncName>"error. The stub must compile, contain no real business logic, and return zero values for non-error returns. -
Generate Test File — Create a Go test file. Translate SETUP.md into test setup code and ASSERT.md into Go assertions using standard
testingpatterns. Map Exit Code expectations toexec.ExitErrorchecks. -
Initialize Module and Run —
go mod init,go mod tidy, thengo test ./... -v. Verify all tests are in RED state (all fail). -
Report — Report how many tests were generated, compilation status, and confirm RED state. If any test passes unexpectedly, adjust the stub.
Rules: Never write real implementation. Every stub returns an error. The generated code must compile. All files go into a single Go module directory.
04 同仓库更多 Skills
verify-with-prototype
Prototype-before-production workflow for risky host integrations (sudo, privileges, system config). Use when a feature touches the real OS, when behavior must be proven with a small script before full implementation, or when the user mentions prototype verification, POC script, or verify-with-prototype. Run after investigate/followup and before doctest-TDD integration.
verify-on-behalf-of-user
Run human-style scenario verification after an agent claims work is done: git status, build into ~/.sandbox/bin (default sandbox mode) or opt-in host mode (outside sandbox: wrk --reinstall-local / change-scoped install), real integration/E2E scenarios (start servers, browser-agent for UI), always-labeled depth, markdown transcript written and inlined for review. Use for "verify on my behalf", before commit. Complements doctests; does not replace them. Load a sub-topic with: agent-pro skill --show verify-on-behalf-of-user/<topic>
test-case-tree-design-expert
Use when the user wants a decision-tree style test case design with inherited setup and per-leaf assertions.
test-case-design-expert
Use when the user wants comprehensive user-facing end-to-end test scenarios for a feature description.
summarize-a-skill
Meta-skill: distill durable high-signal guidance (worked vs failed, wrong → correct, and anything else that quickens future similar tasks) into a brief reusable skill document with YAML frontmatter. When the user does not explicitly ask for a new skill/file, prefer updating an existing skill over creating one. Writes skills/<name>/SKILL.md (or docs|doc/skills/…). Use for /summarize-a-skill, "summarize what worked", "lessons learned into a skill", or "write a skill from this session".
split-phases
Break a large implementation plan into dependency-ordered phases that are independently implementable and verifiable. Use when the user runs /split-phases, or says "split into phases", "phase this plan", "break into units of work", "dependency-ordered milestones", or wants a giant plan split for phase-by-phase work.