AGENT SKILL

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
所属仓库
xhd2015/agent-pro
最近更新
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

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:

  1. 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.

  2. Design the Go API — Derive package name from the feature slug. Design exported functions, types, and constants the tests will call.

  3. 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.

  4. Generate Test File — Create a Go test file. Translate SETUP.md into test setup code and ASSERT.md into Go assertions using standard testing patterns. Map Exit Code expectations to exec.ExitError checks.

  5. Initialize Module and Run — go mod init, go mod tidy, then go test ./... -v. Verify all tests are in RED state (all fail).

  6. 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

xhd2015
xhd2015/agent-pro

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.

★ 1
xhd2015
xhd2015/agent-pro

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>

★ 1
xhd2015
xhd2015/agent-pro

test-case-tree-design-expert

Use when the user wants a decision-tree style test case design with inherited setup and per-leaf assertions.

★ 1
xhd2015
xhd2015/agent-pro

test-case-design-expert

Use when the user wants comprehensive user-facing end-to-end test scenarios for a feature description.

★ 1
xhd2015
xhd2015/agent-pro

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".

★ 1
xhd2015
xhd2015/agent-pro

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.

★ 1