一键导入
assistant-tdd
Apply Red-Green-Refactor. Use when tests-first/TDD is requested or required by project conventions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Apply Red-Green-Refactor. Use when tests-first/TDD is requested or required by project conventions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Clarify ambiguous or multi-intent requests. Use when the user asks to untangle, structure, or restate what they mean.
Manage durable memory safely. Use for explicit remember, recall, forget, or memory-health requests and stable corrections or preferences.
Review code and re-review fixes until clean. Use for explicit code review or the workflow Review phase; QA runs only when required.
Create or update V1 skills and contracts. Use for skill scaffolding, contract design, or contract-compliance validation.
Run proportional development phases. Use to plan, build, implement, fix, migrate, or refactor project artifacts.
Generate and rank options. Use light mode for quick improvement scans and deep mode for explicit brainstorming or broad exploration.
| name | assistant-tdd |
| description | Apply Red-Green-Refactor. Use when tests-first/TDD is requested or required by project conventions. |
| effort | high |
| triggers | [{"pattern":"tdd|tests? first|test.driven|red green refactor|write the test first","priority":85,"reminder":"This request matches assistant-tdd. You MUST invoke the Skill tool with skill='assistant-tdd' BEFORE writing any production code."}] |
Protect each behavior change with verified RED, minimal GREEN, and behavior-neutral REFACTOR evidence before production code is trusted.
Canonical tier files are contracts/input.yaml, contracts/output.yaml,
contracts/phase-gates.yaml, and contracts/handoffs.yaml.
Read contracts/index.yaml first and load only the active enforcement boundary:
entry for activation, behaviors, debugging evidence, framework, and exceptions;current_phase for RED, GREEN, or REFACTOR; andcompletion for the returned cycle artifact.The handoffs contract remains canonical but empty because assistant-workflow
owns cross-role dispatch. Missing or invalid selectors fall back to the full
named canonical contract; do not load every contract at entry.
assistant-tdd owns RED-GREEN-REFACTOR correctness. Generic workflow coordinates task packets and role dispatch, but specialist gates are authoritative.
When workflow delegates:
Required RED evidence before production implementation:
If TDD is active and RED evidence is missing, Code Writer must return NEEDS_CONTEXT and make no production changes.
For unknown-cause bugs, use assistant-debugging first. Start TDD only after
reproduction/root-cause evidence can define a meaningful regression test.
Allowed exceptions require recorded approval/reason when TDD is active: throwaway spikes, generated code, docs-only work, behavior-free config, and layout-only styling. Do not claim TDD completion for an exception.
Return status, cycle log with commands/outcomes, test and production files, targeted/regression verification, approved exceptions, and blockers.