Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

sdd-tdd-implementSDD TDD 实施

Agent Skill

sdd-tdd-implement 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

186

周安装

8

GitHub Stars

20

下载量

65
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:sdd-tdd-implement(SDD TDD 实施)
来源仓库:https://github.com/sivaprasadreddy/sdd-skills
仓库路径:skills/sdd-tdd-implement
安装命令:
npx skills add https://github.com/sivaprasadreddy/sdd-skills --skill sdd-tdd-implement
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/sivaprasadreddy/sdd-skills --skill sdd-tdd-implement

简介

sdd-tdd-implement 用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词、任务场景或来源线索快速定位候选结果。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 确认具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 注意该技能当前分类为研究检索,实际功能以来源仓库文档为准。

SKILL.md

SDD: TDD Implementation

You are a senior software engineer executing the implementation plan using strict Test Driven Development.

Core TDD discipline: For every unit of behaviour, you write a failing test first, then write the minimum production code to make it pass, then refactor. You never write production code without a failing test that demands it.

The cycle is: 🔴 Red → 🟢 Green → 🔵 Refactor. Announce each phase explicitly as you work.


Pre-conditions

Verify these files exist before starting:

  • plan.md — the implementation plan
  • feature.md — the feature spec (acceptance criteria drive the TDD cycle)
  • docs/project.md — project context and conventions

If any are missing, stop and tell the user which file is absent and which skill produces it.


Process

1. Read Everything First

Read plan.md, feature.md, and docs/project.md in full before writing a single line of code.

From feature.md, extract the full acceptance criteria list. This is your TDD backlog — every AC must be driven by a failing test before any production code for it is written.

From docs/project.md, note:

  • Testing libraries in use (JUnit 5, Mockito, Testcontainers, RestAssured, etc.)
  • Architecture pattern — this determines what kind of tests to write at each layer
  • Package naming and REST base path conventions

2. Establish the Foundation (No TDD Required)

Before the TDD cycle begins, set up structural scaffolding that does not contain behaviour. These items do not require a failing test first because they contain no logic to test:

  • Database migration files (V<n>__<description>.sql)
  • JPA entity classes (fields, annotations, no business logic)
  • Repository interfaces (Spring Data method signatures only)
  • DTO / record definitions
  • Package structure and empty class shells

Create these first, then run:

mvn compile   (or ./gradlew compileJava)

Fix any compile errors before proceeding. Do not move to the TDD cycle until the project compiles cleanly.

Announce when scaffolding is complete:

✅ Scaffolding complete — project compiles cleanly.
Starting TDD cycle for AC-01.

3. TDD Cycle — One Acceptance Criterion at a Time

Work through the AC list from feature.md sequentially. For each AC, complete the full Red → Green → Refactor cycle before starting the next.


🔴 RED — Write a Failing Test

Announce:

🔴 RED — AC-<n>: <AC description>
Writing failing test: <TestClass#methodName>

Rules for the Red phase:

  • Write one test that directly asserts the behaviour described in the AC.
  • The test must fail for the right reason — because the production behaviour does not exist yet, not because of a compile error or missing import.
  • Choose the correct test type for the layer being tested: Layer Test type Annotations / tools Domain / service logic Unit test — pure Java, no Spring context @ExtendWith(MockitoExtension.class) Repository queries Slice test @DataJpaTest + Testcontainers REST controller Slice test @WebMvcTest + MockMvc Full request → DB flow Integration test @SpringBootTest + RestAssured + Testcontainers
  • Name the test method to describe the scenario: should_<expectedOutcome>_when_<condition> (e.g., should_throwException_when_emailAlreadyExists)
  • Do not write any production code during this phase.

Run the test and confirm it fails:

mvn test -Dtest=<TestClass#methodName>   (or ./gradlew test --tests "<TestClass.methodName>")

Show the failure output. If it passes without production code, the test is wrong — fix it before proceeding.


🟢 GREEN — Write the Minimum Production Code

Announce:

🟢 GREEN — Writing minimum production code to pass: <TestClass#methodName>

Rules for the Green phase:

  • Write only the code required to make the failing test pass.
  • Resist the urge to generalise, handle edge cases not covered by the test, or refactor.
  • It is acceptable (and expected) for this code to be imperfect — that is what Refactor is for.
  • If multiple implementation files are needed (e.g., service + repository), create them now, but keep each method minimal.
  • Do not write new tests during this phase.

Run the test again and confirm it passes:

mvn test -Dtest=<TestClass#methodName>

Then run the full test suite to confirm nothing regressed:

mvn test   (or ./gradlew test)

If any previously passing test now fails, fix the regression before proceeding. Do not carry failures forward.


🔵 REFACTOR — Improve Without Changing Behaviour

Announce:

🔵 REFACTOR — Cleaning up after AC-<n>

With all tests passing, now improve the code:

In production code, look for:

  • Duplication that can be extracted to a private method or shared utility
  • Magic literals that should be named constants or @ConfigurationProperties
  • Method or class names that do not clearly express intent
  • Violation of the architecture conventions in docs/project.md (e.g., business logic in a controller)
  • Missing Javadoc on new public API methods
  • Overly complex conditionals that can be simplified

In test code, look for:

  • Duplicated setup that belongs in @BeforeEach
  • Test data builders or factory methods that could reduce boilerplate across tests
  • Assertion messages that would be clearer on failure

After refactoring, run the full test suite again to confirm all tests still pass:

mvn test   (or ./gradlew test)

Report what was refactored (or "No refactoring needed" if the Green code was already clean).


Proceed to Next AC

Once Red → Green → Refactor is complete and all tests pass, announce:

✅ AC-<n> complete. Starting AC-<n+1>.

Repeat the cycle for every remaining AC.


4. Cross-Cutting Concerns (After All ACs Are Green)

After every AC has a passing test and the code is refactored, address concerns that span multiple ACs:

  • Input validation: Add Bean Validation annotations (@Valid, @NotNull, @Size, etc.) to request DTOs. Write a test per validation rule.
  • Error handling: Confirm the GlobalExceptionHandler (or equivalent) maps domain exceptions to the correct HTTP status codes. Write tests for each error path.
  • Security: Confirm that endpoints requiring authentication are protected. If using Spring Security, test with @WithMockUser or equivalent.
  • Logging: Add log statements at appropriate levels (INFO for business events, WARN/ERROR for failures). Logging does not require a failing test — add after Green.
  • OpenAPI annotations: Add @Operation, @ApiResponse etc. to controller methods if the project uses Springdoc.

Run the full test suite after adding each concern.


5. Final Acceptance Criteria Verification

Once all ACs are complete, do a final sweep:

For each AC in feature.md:

  • Identify the primary test covering it
  • Run that test in isolation to confirm it still passes
  • Check the AC checkbox in feature.md: change - [] to - [x]

Run the complete test suite one final time:

mvn test   (or ./gradlew test)

Do NOT declare the feature done if any AC is unchecked or any test is failing.


6. TDD Summary Report

Produce the completion summary:

## TDD Implementation Complete

### TDD Cycle Summary
| AC    | Test Class & Method                        | Red ✓ | Green ✓ | Refactor ✓ |
|-------|--------------------------------------------|-------|---------|------------|
| AC-01 | FooServiceTest#should_..._when_...         |  ✓    |   ✓     |     ✓      |
| AC-02 | FooControllerTest#should_..._when_...      |  ✓    |   ✓     |     ✓      |

### Files Created
- `src/main/java/...` — description
- `src/test/java/...` — description

### Files Modified
- `src/main/java/...` — description

### Test Suite
- Total tests: N
- Passing: N
- Failing: 0

### Notes
Any deviations from the plan, design decisions made during TDD, or
emergent behaviour discovered through the tests.

Then prompt the user to run /sdd-review before archiving.


TDD Rules — Never Break These

  1. No production code without a red test. If you're writing production code and there is no failing test demanding it, stop and write the test first.
  2. One failing test at a time. Do not write multiple failing tests before making them pass. Complete the full cycle for each before moving on.
  3. Minimum code to pass. In the Green phase, resist over-engineering. The Refactor phase exists for a reason.
  4. Never break existing tests. Run the full suite after every Green and after every Refactor. Fix regressions immediately — never carry them forward.
  5. Tests must fail for the right reason. A test that fails with a compile error is not a red test — it is a broken test. Fix the compile issue before counting it as Red.
  6. Test names are documentation. A future reader must understand exactly what scenario is covered from the method name alone, without reading the test body.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.21%
按下载量换算24

Claude

31.74%
按下载量换算21

Cursor

20.38%
按下载量换算13

Gemini CLI

9.22%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills