AGENT SKILL

test-driven-development

Use for test-first feature, bugfix, or refactoring work. During sp-implement feature batching, defer execution to its workflow-owned validation epochs instead of rerunning tests per task.

License 许可
MIT
最近更新
2026-08-07
Stars
★ 0
Forks
0

01 前言 Front Matter

name
test-driven-development
metadata
{ "author": "github-spec-kit", "source": "templates/passive-skills/test-driven-development/SKILL.md" }
description
Use for test-first feature, bugfix, or refactoring work. During sp-implement feature batching, defer execution to its workflow-owned validation epochs instead of rerunning tests per task.
compatibility
Requires spec-kit project structure with .specify/ directory

02 资源文件 1

03 SKILL.md 正文

Test-Driven Development (Spec Kit Plus)

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

Workflow-Owned Validation

When sp-implement declares feature_epochs, the change-set remains test-first but the Leader owns execution. Workers may author mapped tests before production edits, then stop for the combined RED/baseline epoch; implementation workers use the accepted epoch ref and run only cheap task checks. They return test impact so the Leader can run one convergence epoch after integration.

The validation epoch budget is shared across Implement and Review. This passive skill must not start an extra validation epoch for a Txx, join, resume, commit, or completion claim. Reuse current fingerprint-bound ledger evidence; never reset or bypass the owning workflow's maximum.

Integration with sp-* Workflows

  • sp-implement: Group related formal tasks into a coherent change-set. Author/select mapped tests before production edits and let the Leader execute one combined RED/baseline epoch. Do not require every worker to rerun RED and GREEN per task.
  • sp-debug: When diagnosing or fixing a bug, your FIRST step must be to write a failing test that explicitly reproduces the bug. Do not change production code until you have empirically confirmed the failure state.
  • sp-fast / sp-quick: Even for small, bounded fixes, write a test first to verify the fix and prevent regressions.

The Iron Law

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST

Write a change-set before its test contract? Stop and repair the ordering before continuing. Violating the letter of the rules is violating the spirit of the rules.

Red-Green-Refactor

  1. RED: Write a minimal failing test showing what should happen. In an active feature-epoch workflow, the Leader verifies the combined RED state once.
  2. GREEN: Write the simplest, most minimal production code to pass the test. In that workflow, the Leader verifies the integrated change-set once.
  3. REFACTOR: Clean up duplication and improve structure while keeping the tests green. Do not add new behavior during refactoring.

Red Flags - STOP and Start Over

  • Writing production code before the test.
  • "I already manually tested it."
  • "The fix is too simple to need a test."
  • "I'll add the tests after I get it working."
  • Modifying production code in sp-debug before reproducing the issue in a test.

If you encounter these red flags, stop, discard the unverified code, and start over with a failing test.

04 同仓库更多 Skills

chenziyang110
chenziyang110/launchdeck

launchdeck-agent

Codex host adapter contract fixture for Launchdeck.

★ 0
chenziyang110
chenziyang110/launchdeck

launchdeck-agent

Claude host adapter contract fixture for Launchdeck.

★ 0
chenziyang110
chenziyang110/launchdeck

launchdeck-agent

Use this skill aggressively for local project lifecycle operations even when the user does not mention Launchdeck: start this project, run the dev server, dev, build, test, restart service, stop service, show logs, inspect ports, port is occupied, clean cache; and when the user explicitly asks to configure this local project for Launchdeck or create or generate a project-adapted `.launchdeck.yml`, including 为这个项目生成 Launchdeck 配置. Do not use for ordinary code edits, docs-only work, general explanations, API design discussion, or production deployment unless the user also asks to operate or configure a local project or service.

★ 0
chenziyang110
chenziyang110/launchdeck

zig-testing

Use ONLY when user explicitly requests Zig test code, built-in test runner configuration, test failure diagnosis, or coverage for Zig projects. Triggers: "write test zig", "zig test", "testing.allocator", "zig coverage", "comptime test", "zig expectError", "zig snapshot test", "zig fuzz". Do NOT activate for: general Zig coding without test context, build.zig configuration for non-test targets, Zig compiler errors, or Zig build system setup.

★ 0
chenziyang110
chenziyang110/launchdeck

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

★ 0
chenziyang110
chenziyang110/launchdeck

verification-before-completion

Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always

★ 0