一键导入
x-tdd
Enforce strict test-driven development discipline - write failing test first, verify failure, write minimal code, verify pass, refactor
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Enforce strict test-driven development discipline - write failing test first, verify failure, write minimal code, verify pass, refactor
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create a new Jira ticket with user-approved summary and description
Assess the current state of a Jira ticket and produce a summary for development work
Load full context for modifying Claude Code configuration, settings, hooks, MCP servers, skills, or the wrapper script on this machine
Convert an existing instruction file (scenario, agent, command) into a proper Claude Code skill
Claim a Jira ticket and set up tracking (administrative only - NO technical work)
Audit project-local Claude Code permissions and migrate appropriate ones to user scope
| name | x-tdd |
| description | Enforce strict test-driven development discipline - write failing test first, verify failure, write minimal code, verify pass, refactor |
| model | opus |
You are now operating under strict TDD discipline for the duration of this task.
Core principle: If you didn't watch the test fail, you don't know if it tests the right thing.
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
Wrote code before the test? Delete it. Start over. Don't keep it as "reference," don't adapt it, don't look at it. Implement fresh from the test.
Every unit of work follows this exact sequence. No shortcuts, no reordering.
Mandatory. Never skip.
Confirm:
If the test passes immediately, you're testing existing behavior. Fix the test. If the test errors, fix the error and re-run until it fails correctly.
Write the simplest code that makes the test pass. Nothing more.
Mandatory.
Confirm:
If the test fails, fix the code — not the test. If other tests broke, fix them now before continuing.
Only after green:
Keep all tests green throughout. Don't add new behavior during refactoring.
Next failing test for the next behavior.
If any of these occur, acknowledge the violation, delete the offending code, and restart with a failing test:
| Quality | Guideline |
|---|---|
| Minimal | One behavior per test. "and" in the name? Split it. |
| Clear | Name describes the expected behavior |
| Intent-revealing | Test demonstrates desired API usage |
| Real | Tests real code, not mocks |
| Problem | Action |
|---|---|
| Don't know how to test it | Write the assertion first. Design the API you wish existed. Ask the user. |
| Test is too complicated | The design is too complicated. Simplify the interface. |
| Must mock everything | Code is too coupled. Use dependency injection. |
| Test setup is huge | Extract helpers. Still complex? Simplify the design. |
Every bug fix starts with a failing test that reproduces the bug. The test proves the fix works and prevents regression. Never fix bugs without a test first.
Before declaring work complete, verify:
If you can't check all boxes, you skipped TDD. Acknowledge it and correct course.