一键导入
test-driven-development
Use when implementing a feature or bugfix that involves writing meaningful application logic
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when implementing a feature or bugfix that involves writing meaningful application logic
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when creating a Jira ticket to plan upcoming work. Guides ticket drafting with clear structure, self-contained context, and testable acceptance criteria, then creates the ticket via the available Jira/Atlassian broker tool.
Use when reviewing a pull request, branch, commit range, working tree diff, plan, document, or other coherent unit of work across correctness, security, codebase alignment, code quality, test quality, performance, and simplicity.
Use when the user asks to create or polish a standalone HTML artifact such as an HTML report, interactive explainer, visual plan, dashboard, slide deck, diagram, prototype, or throwaway HTML tool.
Use when debugging bugs, failures, exceptions, flaky behavior, regressions, or performance problems where the cause is not already proven.
Use when the user asks to build web components, pages, or applications that need distinctive, production-grade frontend interfaces with high design quality
Reference skill for browser automation: web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
| name | test-driven-development |
| description | Use when implementing a feature or bugfix that involves writing meaningful application logic |
Write the test first, observe the expected failure, implement the smallest behavior that passes, then refactor while green.
For each behavior change:
Do not write or retain task-specific production changes before the failing test. If implementation began prematurely, revert only that task's untested changes; never delete pre-existing or user-owned work to enforce the workflow.
Use for:
Ask before skipping test-first development for throwaway prototypes, generated code, configuration-only changes, or work with no meaningful executable behavior.
Write the smallest test that demonstrates one requirement through the public or most stable practical seam.
A good test:
Run the focused test immediately. Do not proceed until the failure is expected and specific. A passing test may describe existing behavior; an error may indicate broken setup. Correct the test or harness until it fails for the intended reason.
For a bug, reproduce the reported failure before changing production code. Prefer converting the minimized reproduction into the regression test.
Implement only what the failing test requires. Avoid unrelated refactors, speculative options, generalized helpers, and additional behavior.
Run:
Fix production code when the test correctly describes required behavior. Change the test only when evidence shows its expectation or setup is wrong.
After green:
Rerun the relevant tests after each meaningful refactor.
Require coverage proportionate to the change, not one test per function. Cover meaningful boundaries, error paths, state transitions, and regression conditions exposed by the requirement. Prefer tests that survive implementation refactors.
When adding mocks, fixtures, or test utilities, read testing-anti-patterns.md. Understand real dependency behavior before mocking it, and never assert only that a mock behaves as configured.
Before reporting completion, verify:
If a correct automated seam does not exist, state that explicitly. Keep the best deterministic reproduction available and explain the verification gap instead of adding a shallow test that cannot detect the real failure.