一键导入
tdd
Use when implementing any feature or bugfix, before writing implementation code, combined with AgentMemory validation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when implementing any feature or bugfix, before writing implementation code, combined with AgentMemory validation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation, combined with GitNexus and AgentMemory.
Trace call graphs, dependencies, and execution flow of target code using GitNexus.
Convert binary and formatted documents (PDF, DOCX, XLSX, PPTX, HTML, ZIP, etc.) to Markdown using MarkItDown and extract requirements.
Safe, structured refactoring of target code using GitNexus graph mapping, AgentMemory checks, and TDD workflows.
Run targeted unit/integration tests on changed components, run full regression suites, and log outcomes in memory.
Verify codebase modifications, execute test runners, detect file change scope using GitNexus, and persist session memory.
| name | tdd |
| description | Use when implementing any feature or bugfix, before writing implementation code, combined with AgentMemory validation. |
This skill implements the strict Superpowers Test-Driven Development (TDD) workflow in the workspace, combined with AgentMemory to track successful test outcomes.
Write the test first. Watch it fail. Write minimal code to pass.
If you didn't watch the test fail, you don't know if it tests the right thing. Violating the letter of the rules is violating the spirit of the rules.NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
Write code before the test? Delete it. Start over. No exceptions:
digraph tdd_cycle {
rankdir=LR;
red [label="RED\nWrite failing test", shape=box, style=filled, fillcolor="#ffcccc"];
verify_red [label="Verify fails\ncorrectly", shape=diamond];
green [label="GREEN\nMinimal code", shape=box, style=filled, fillcolor="#ccffcc"];
verify_green [label="Verify passes\nAll green", shape=diamond];
refactor [label="REFACTOR\nClean up", shape=box, style=filled, fillcolor="#ccccff"];
next [label="Next", shape=ellipse];
red -> verify_red;
verify_red -> green [label="yes"];
verify_red -> red [label="wrong\nfailure"];
green -> verify_green;
verify_green -> refactor [label="yes"];
verify_green -> green [label="no"];
refactor -> verify_green [label="stay\ngreen"];
verify_green -> next;
next -> red;
}
Write one minimal test showing what should happen.
Run the test suite using the workspace runner.
Write the simplest code to make the tests pass.
Run the test suite.
agentmemory to save the successful test outcomes and implementation footprint.| Excuse | Reality |
|---|---|
| "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
| "I'll test after" | Tests passing immediately prove nothing. |
| "Already manually tested" | Ad-hoc ≠ systematic. No record, can't re-run. |
| "Deleting X hours is wasteful" | Sunk cost fallacy. Keeping unverified code is technical debt. |
| "Keep as reference, write tests first" | You'll adapt it. That's testing after. Delete means delete. |
Before marking work complete:
To ensure robust and maintainable code, always follow these four core principles inspired by Andrej Karpathy:
Don't assume. Don't hide confusion. Surface tradeoffs.
Minimum code that solves the problem. Nothing speculative.
Touch only what you must. Clean up only your own mess.
Define success criteria. Loop until verified.