Loading...
Loading...
Compare original and translation side by side
~/.claude/skills~/.agents/skills/executable-code-skills.md~/.claude/skills~/.agents/skills/agent-skills:test-driven-developmentexecutable-code-skills.md| TDD Concept | Skill Creation |
|---|---|
| Test case | Pressure scenario with subagent |
| Production code | Skill document (SKILL.md) |
| Test fails (RED) | Agent violates rule without skill (baseline) |
| Test passes (GREEN) | Agent complies with skill present |
| Refactor | Close loopholes while maintaining compliance |
| Write test first | Run baseline scenario BEFORE writing skill |
| Watch it fail | Document exact rationalizations agent uses |
| Minimal code | Write skill addressing those specific violations |
| Watch it pass | Verify agent now complies |
| Refactor cycle | Find new rationalizations → plug → re-verify |
| TDD 概念 | Skill 创建 |
|---|---|
| 测试用例 | 使用 subagent 的压力场景 |
| 生产代码 | Skill 文档(SKILL.md) |
| 测试失败(RED) | 没有 Skill 时 Agent 违反规则(基线) |
| 测试通过(GREEN) | 存在 Skill 时 Agent 遵守规则 |
| 重构 | 在保持合规的同时堵住漏洞 |
| 先写测试 | 在编写 Skill 之前运行基线场景 |
| 观察测试失败 | 记录 Agent 使用的确切合理化辩解 |
| 最小代码 | 编写 Skill 以解决这些具体违规 |
| 观察测试通过 | 验证 Agent 现在能够遵守规则 |
| 重构循环 | 找出新的合理化辩解 → 封堵 → 重新验证 |
skills/
skill-name/
SKILL.md # Main reference (required)
supporting-file.* # Only if neededskills/
skill-name/
SKILL.md # Main reference (required)
supporting-file.* # Only if needednamedescriptionversionMajor.Minor.patchmetadata1.0.0namedescriptioncso-guide.md---
name: Skill-Name-With-Hyphens
description: Use when [specific triggering conditions and symptoms]
---namedescriptionversionMajor.Minor.patchmetadata1.0.0namedescriptioncso-guide.md---
name: Skill-Name-With-Hyphens
description: Use when [specific triggering conditions and symptoms]
---undefinedundefined@write-skillguide-decisionfind-causeskill-utilshelperscso-guide.md@write-skillguide-decisionfind-causeskill-utilshelperscso-guide.mddigraph when_flowchart {
"Need to show information?" [shape=diamond];
"Decision where I might go wrong?" [shape=diamond];
"Use markdown" [shape=box];
"Small inline flowchart" [shape=box];
"Need to show information?" -> "Decision where I might go wrong?" [label="yes"];
"Decision where I might go wrong?" -> "Small inline flowchart" [label="yes"];
"Decision where I might go wrong?" -> "Use markdown" [label="no"];
}graphviz-conventions.dotrender-graphs.js./render-graphs.js ../some-skill # Each diagram separately
./render-graphs.js ../some-skill --combine # All diagrams in one SVGdigraph when_flowchart {
"Need to show information?" [shape=diamond];
"Decision where I might go wrong?" [shape=diamond];
"Use markdown" [shape=box];
"Small inline flowchart" [shape=box];
"Need to show information?" -> "Decision where I might go wrong?" [label="yes"];
"Decision where I might go wrong?" -> "Small inline flowchart" [label="yes"];
"Decision where I might go wrong?" -> "Use markdown" [label="no"];
}graphviz-conventions.dotrender-graphs.js./render-graphs.js ../some-skill # Each diagram separately
./render-graphs.js ../some-skill --combine # All diagrams in one SVGexecutable-code-skills.mdexecutable-code-skills.mddefense-in-depth/
SKILL.md # Everything inlinedefense-in-depth/
SKILL.md # Everything inlineretry-with-backoff/
SKILL.md # Overview + patterns
example.ts # Working helpers to adaptretry-with-backoff/
SKILL.md # Overview + patterns
example.ts # Working helpers to adaptpptx/
SKILL.md # Overview + workflows
pptxgenjs.md # 600 lines API reference
ooxml.md # 500 lines XML structure
scripts/ # Executable toolspptx/
SKILL.md # Overview + workflows
pptxgenjs.md # 600 lines API reference
ooxml.md # 500 lines XML structure
scripts/ # Executable toolsNO SKILL WITHOUT A FAILING TEST FIRSTNO SKILL WITHOUT A FAILING TEST FIRSTagent-skills:test-driven-developmenttesting-skills-with-subagents.mdtesting-skills-with-subagents.mdevaluating-skills-with-subagents.mdevaluating-skills-with-subagents.md| Excuse | Reality |
|---|---|
| "Skill is obviously clear" | Clear to you ≠ clear to other agents. Test it. |
| "It's just a reference" | References can have gaps, unclear sections. Test retrieval. |
| "Testing is overkill" | Untested skills have issues. Always. 15 min testing saves hours. |
| "I'll test if problems emerge" | Problems = agents can't use skill. Test BEFORE deploying. |
| "Too tedious to test" | Testing is less tedious than debugging bad skill in production. |
| "I'm confident it's good" | Overconfidence guarantees issues. Test anyway. |
| "Academic review is enough" | Reading ≠ using. Test application scenarios. |
| "No time to test" | Deploying untested skill wastes more time fixing it later. |
| 借口 | 现实情况 |
|---|---|
| “Skill 显然很清楚” | 你觉得清楚 ≠ 其他 Agent 也清楚。测试它。 |
| “这只是一份参考资料” | 参考资料可能存在缺口或不清楚的部分。测试检索能力。 |
| “测试是过度设计” | 未经测试的 Skill 总会有问题。15 分钟的测试可以节省数小时。 |
| “等出现问题时我再测试” | 出现问题 = Agent 无法使用 Skill。部署前就测试。 |
| “测试太繁琐” | 测试远不如在生产环境中调试糟糕的 Skill 繁琐。 |
| “我有信心它没问题” | 过度自信必然带来问题。仍然要测试。 |
| “学术审查已经足够” | 阅读 ≠ 使用。测试应用场景。 |
| “没有时间测试” | 部署未测试的 Skill 只会浪费更多时间在后续修复上。 |
testing-skills-with-subagents.mdtesting-skills-with-subagents.mdstep1 [label="import fs"];
step2 [label="read file"];step1 [label="import fs"];
step2 [label="read file"];skill-utilshelpersmisc-patternsskill-utilshelpersmisc-patternsscripts\helper.pyreference\guide.mdscripts\helper.pyreference\guide.mdwrite-skillnamedescriptionversion1.0.0write-promptwrite-skillnamedescriptionversion1.0.0write-promptobra/superpowerswriting-skillsskill-creatorSOURCES.mdobra/superpowerswriting-skillsskill-creatorSOURCES.md