{"slug":"writing-skills-2","title":"writing-skills","summary":"当创建新技能、编辑现有技能或在部署前验证技能是否有效时使用","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-09-07T18:38:27.682796Z","repo":{"url":"https://github.com/jnMetaCode/superpowers-zh","stars":8205,"forks":767,"license":"MIT","updatedAt":"2026-09-17T09:11:21Z"},"bodyHtml":"<hr>\n<h2>name: writing-skills\ndescription: 当创建新技能、编辑现有技能或在部署前验证技能是否有效时使用\nversion: \"1.0.0\"\nlicense: MIT\nmetadata:\nhermes:\ntags: [skills, documentation]</h2>\n<h1>编写技能</h1>\n<h2>概述</h2>\n<p><strong>编写技能就是将测试驱动开发应用于流程文档。</strong></p>\n<p><strong>个人技能存放在智能体特定的目录中（Claude Code 用 <code>~/.claude/skills</code>，Codex 用 <code>~/.agents/skills/</code>）</strong></p>\n<p>你编写测试用例（带子智能体的压力场景），观察它们失败（基线行为），编写技能（文档），观察测试通过（智能体遵守规则），然后重构（堵住漏洞）。</p>\n<p><strong>核心原则：</strong> 如果你没有观察到智能体在没有该技能时失败，你就不知道这个技能是否教了正确的东西。</p>\n<p><strong>必需背景：</strong> 在使用此技能前，你必须理解 test-driven-development。该技能定义了基本的红-绿-重构循环。本技能将 TDD 适配到文档编写中。</p>\n<p><strong>官方指南：</strong> Anthropic 官方的技能编写最佳实践请参见 anthropic-best-practices.md。该文档提供了补充本技能 TDD 导向方法的额外模式和指南。</p>\n<h2>什么是技能？</h2>\n<p><strong>技能</strong>是经过验证的技术、模式或工具的参考指南。技能帮助未来的 Claude 实例找到并应用有效的方法。</p>\n<p><strong>技能是：</strong> 可复用的技术、模式、工具、参考指南</p>\n<p><strong>技能不是：</strong> 关于你某次如何解决问题的叙事</p>\n<h2>TDD 映射到技能</h2>\n<table>\n<thead>\n<tr>\n<th>TDD 概念</th>\n<th>技能创建</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>测试用例</strong></td>\n<td>带子智能体的压力场景</td>\n</tr>\n<tr>\n<td><strong>生产代码</strong></td>\n<td>技能文档（SKILL.md）</td>\n</tr>\n<tr>\n<td><strong>测试失败（红）</strong></td>\n<td>智能体在没有技能时违反规则（基线）</td>\n</tr>\n<tr>\n<td><strong>测试通过（绿）</strong></td>\n<td>智能体在有技能时遵守规则</td>\n</tr>\n<tr>\n<td><strong>重构</strong></td>\n<td>在保持合规的同时堵住漏洞</td>\n</tr>\n<tr>\n<td><strong>先写测试</strong></td>\n<td>在编写技能之前先运行基线场景</td>\n</tr>\n<tr>\n<td><strong>观察失败</strong></td>\n<td>记录智能体使用的确切合理化借口</td>\n</tr>\n<tr>\n<td><strong>最小代码</strong></td>\n<td>编写针对那些具体违规行为的技能</td>\n</tr>\n<tr>\n<td><strong>观察通过</strong></td>\n<td>验证智能体现在遵守规则</td>\n</tr>\n<tr>\n<td><strong>重构循环</strong></td>\n<td>发现新的合理化借口 → 堵住 → 重新验证</td>\n</tr>\n</tbody>\n</table>\n<p>整个技能创建过程遵循红-绿-重构。</p>\n<h2>何时创建技能</h2>\n<p><strong>创建条件：</strong></p>\n<ul>\n<li>技术对你来说不是直觉上显而易见的</li>\n<li>你会在不同项目中反复引用</li>\n<li>模式具有广泛适用性（非项目特定）</li>\n<li>其他人也会受益</li>\n</ul>\n<p><strong>不要创建：</strong></p>\n<ul>\n<li>一次性解决方案</li>\n<li>其他地方有充分文档的标准实践</li>\n<li>项目特定的约定（放在 CLAUDE.md 中）</li>\n<li>机械性约束（如果可以用正则/验证强制执行，就自动化——文档留给需要判断的场景）</li>\n</ul>\n<h2>技能类型</h2>\n<h3>技术类</h3>\n<p>有具体步骤的方法（condition-based-waiting、root-cause-tracing）</p>\n<h3>模式类</h3>\n<p>思考问题的方式（flatten-with-flags、test-invariants）</p>\n<h3>参考类</h3>\n<p>API 文档、语法指南、工具文档（office docs）</p>\n<h2>目录结构</h2>\n<pre><code>skills/\n  skill-name/\n    SKILL.md              # 主参考文档（必需）\n    supporting-file.*     # 仅在需要时\n</code></pre>\n<p><strong>扁平命名空间</strong> - 所有技能在一个可搜索的命名空间中</p>\n<p><strong>分离文件的情况：</strong></p>\n<ol>\n<li><strong>大量参考内容</strong>（100+ 行）- API 文档、全面的语法说明</li>\n<li><strong>可复用工具</strong> - 脚本、实用程序、模板</li>\n</ol>\n<p><strong>保持内联：</strong></p>\n<ul>\n<li>原则和概念</li>\n<li>代码模式（&lt; 50 行）</li>\n<li>其他所有内容</li>\n</ul>\n<h2>SKILL.md 结构</h2>\n<p><strong>Frontmatter（YAML）：</strong></p>\n<ul>\n<li>两个必需字段：<code>name</code> 和 <code>description</code>（完整支持字段参见 <a href=\"https://agentskills.io/specification\">agentskills.io/specification</a>）</li>\n<li>总计最多 1024 字符</li>\n<li><code>name</code>：只使用字母、数字和连字符（不要用括号、特殊字符）</li>\n<li><code>description</code>：第三人称，仅描述何时使用（不是做什么）\n<ul>\n<li>以\"Use when...\"开头，聚焦于触发条件</li>\n<li>包含具体的症状、场景和上下文</li>\n<li><strong>绝不总结技能的流程或工作流</strong>（参见 SDO 章节了解原因）</li>\n<li>尽量控制在 500 字符以内</li>\n</ul>\n</li>\n</ul>\n<pre><code>---\nname: Skill-Name-With-Hyphens\ndescription: Use when [具体的触发条件和症状]\n---\n\n# 技能名称\n\n## 概述\n这是什么？用 1-2 句话说明核心原则。\n\n## 何时使用\n[如果决策不明显，使用小型内联流程图]\n\n症状和用例的要点列表\n不适用的场景\n\n## 核心模式（技术/模式类）\n前后代码对比\n\n## 快速参考\n用于快速浏览常见操作的表格或要点\n\n## 实现\n简单模式内联代码\n大量参考或可复用工具链接到文件\n\n## 常见错误\n常见问题 + 修复方法\n\n## 实际效果（可选）\n具体结果\n</code></pre>\n<h2>技能发现优化（SDO）</h2>\n<p><strong>发现至关重要：</strong> 未来的 Claude 需要找到你的技能</p>\n<h3>1. 丰富的描述字段</h3>\n<p><strong>目的：</strong> Claude 读取描述来决定为当前任务加载哪些技能。让它能回答：\"我现在应该读这个技能吗？\"</p>\n<p><strong>格式：</strong> 以\"Use when...\"开头，聚焦于触发条件</p>\n<p><strong>关键：描述 = 何时使用，不是技能做什么</strong></p>\n<p>描述应该只描述触发条件。不要在描述中总结技能的流程或工作流。</p>\n<p><strong>为什么这很重要：</strong> 测试表明，当描述总结了技能的工作流时，Claude 可能会跟随描述而非阅读完整的技能内容。一个写着\"任务间进行代码审查\"的描述导致 Claude 只做了一次审查，尽管技能的流程图清楚地展示了两次审查（先规格合规再代码质量）。</p>\n<p>当描述改为仅\"在当前会话中执行包含独立任务的实现计划时使用\"（无工作流摘要）时，Claude 正确地阅读了流程图并遵循了两阶段审查流程。</p>\n<p><strong>陷阱：</strong> 总结工作流的描述创建了 Claude 会走的捷径。技能正文变成了 Claude 跳过的文档。</p>\n<pre><code># 错误：总结了工作流 - Claude 可能会跟随描述而非阅读技能\ndescription: Use when executing plans - dispatches subagent per task with code review between tasks\n\n# 错误：流程细节太多\ndescription: Use for TDD - write test first, watch it fail, write minimal code, refactor\n\n# 正确：只有触发条件，无工作流摘要\ndescription: Use when executing implementation plans with independent tasks in the current session\n\n# 正确：仅触发条件\ndescription: Use when implementing any feature or bugfix, before writing implementation code\n</code></pre>\n<p><strong>内容：</strong></p>\n<ul>\n<li>使用具体的触发条件、症状和场景来表明此技能适用</li>\n<li>描述问题（竞态条件、行为不一致）而非语言特定的症状（setTimeout、sleep）</li>\n<li>保持触发条件技术无关，除非技能本身是技术特定的</li>\n<li>如果技能是技术特定的，在触发条件中明确说明</li>\n<li>用第三人称写（注入到系统提示中）</li>\n<li><strong>绝不总结技能的流程或工作流</strong></li>\n</ul>\n<pre><code># 错误：太抽象、模糊，未包含何时使用\ndescription: For async testing\n\n# 错误：第一人称\ndescription: I can help you with async tests when they're flaky\n\n# 错误：提到了技术但技能并非该技术特定的\ndescription: Use when tests use setTimeout/sleep and are flaky\n\n# 正确：以\"Use when\"开头，描述问题，无工作流\ndescription: Use when tests have race conditions, timing dependencies, or pass/fail inconsistently\n\n# 正确：技术特定的技能带有明确的触发条件\ndescription: Use when using React Router and handling authentication redirects\n</code></pre>\n<h3>2. 关键词覆盖</h3>\n<p>使用 Claude 会搜索的词语：</p>\n<ul>\n<li>错误信息：\"Hook timed out\"、\"ENOTEMPTY\"、\"race condition\"</li>\n<li>症状：\"flaky\"、\"hanging\"、\"zombie\"、\"pollution\"</li>\n<li>同义词：\"timeout/hang/freeze\"、\"cleanup/teardown/afterEach\"</li>\n<li>工具：实际命令、库名称、文件类型</li>\n</ul>\n<h3>3. 描述性命名</h3>\n<p><strong>使用主动语态，动词优先：</strong></p>\n<ul>\n<li>✅ <code>creating-skills</code> 而非 <code>skill-creation</code></li>\n<li>✅ <code>condition-based-waiting</code> 而非 <code>async-test-helpers</code></li>\n</ul>\n<h3>4. Token 效率（关键）</h3>\n<p><strong>问题：</strong> getting-started 和频繁引用的技能会加载到每个对话中。每个 token 都很重要。</p>\n<p><strong>目标字数：</strong></p>\n<ul>\n<li>getting-started 工作流：每个 &lt;150 词</li>\n<li>频繁加载的技能：总计 &lt;200 词</li>\n<li>其他技能：&lt;500 词（仍要简洁）</li>\n</ul>\n<p><strong>技巧：</strong></p>\n<p><strong>将细节移到工具帮助中：</strong></p>\n<pre><code># 错误：在 SKILL.md 中列出所有参数\nsearch-conversations supports --text, --both, --after DATE, --before DATE, --limit N\n\n# 正确：引用 --help\nsearch-conversations 支持多种模式和过滤器。运行 --help 查看详情。\n</code></pre>\n<p><strong>使用交叉引用：</strong></p>\n<pre><code># 错误：重复工作流细节\n搜索时，用模板分派子智能体……\n[20 行重复的说明]\n\n# 正确：引用其他技能\n始终使用子智能体（节省 50-100 倍上下文）。必需：使用 [other-skill-name] 工作流。\n</code></pre>\n<p><strong>压缩示例：</strong></p>\n<pre><code># 错误：冗长的示例（42 词）\n你的搭档：\"我们之前是怎么处理 React Router 中的认证错误的？\"\n你：我来搜索过去对话中的 React Router 认证模式。\n[用搜索查询分派子智能体：\"React Router authentication error handling 401\"]\n\n# 正确：精简的示例（20 词）\n搭档：\"我们之前是怎么处理 React Router 中的认证错误的？\"\n你：正在搜索……\n[分派子智能体 → 整合]\n</code></pre>\n<p><strong>消除冗余：</strong></p>\n<ul>\n<li>不要重复交叉引用的技能中已有的内容</li>\n<li>不要解释从命令中就能看出的东西</li>\n<li>不要为同一模式提供多个示例</li>\n</ul>\n<p><strong>验证：</strong></p>\n<pre><code>wc -w skills/path/SKILL.md\n# getting-started 工作流：目标 &lt;150 每个\n# 其他频繁加载的：目标总计 &lt;200\n</code></pre>\n<p><strong>用你做的事或核心洞察来命名：</strong></p>\n<ul>\n<li>✅ <code>condition-based-waiting</code> &gt; <code>async-test-helpers</code></li>\n<li>✅ <code>using-skills</code> 而非 <code>skill-usage</code></li>\n<li>✅ <code>flatten-with-flags</code> &gt; <code>data-structure-refactoring</code></li>\n<li>✅ <code>root-cause-tracing</code> &gt; <code>debugging-techniques</code></li>\n</ul>\n<p><strong>动名词（-ing）适合描述流程：</strong></p>\n<ul>\n<li><code>creating-skills</code>、<code>testing-skills</code>、<code>debugging-with-logs</code></li>\n<li>主动的，描述你正在进行的操作</li>\n</ul>\n<h3>5. 交叉引用其他技能</h3>\n<p><strong>编写引用其他技能的文档时：</strong></p>\n<p>仅使用技能名称，带有明确的必需标记：</p>\n<ul>\n<li>✅ 好的：<code>**必需子技能：** 使用 test-driven-development</code></li>\n<li>✅ 好的：<code>**必需背景：** 你必须理解 systematic-debugging</code></li>\n<li>❌ 差的：<code>参见 skills/testing/test-driven-development</code>（不清楚是否必需）</li>\n<li>❌ 差的：<code>@skills/testing/test-driven-development/SKILL.md</code>（强制加载，浪费上下文）</li>\n</ul>\n<p><strong>为什么不用 @ 链接：</strong> <code>@</code> 语法会立即强制加载文件，在你需要之前就消耗 200k+ 的上下文。</p>\n<h2>流程图使用</h2>\n<pre><code>digraph when_flowchart {\n    \"需要展示信息?\" [shape=diamond];\n    \"我可能在决策中犯错?\" [shape=diamond];\n    \"使用 markdown\" [shape=box];\n    \"小型内联流程图\" [shape=box];\n\n    \"需要展示信息?\" -&gt; \"我可能在决策中犯错?\" [label=\"是\"];\n    \"我可能在决策中犯错?\" -&gt; \"小型内联流程图\" [label=\"是\"];\n    \"我可能在决策中犯错?\" -&gt; \"使用 markdown\" [label=\"否\"];\n}\n</code></pre>\n<p><strong>仅在以下情况使用流程图：</strong></p>\n<ul>\n<li>非显而易见的决策点</li>\n<li>你可能过早停止的流程循环</li>\n<li>\"何时使用 A vs B\"的决策</li>\n</ul>\n<p><strong>绝不使用流程图用于：</strong></p>\n<ul>\n<li>参考资料 → 表格、列表</li>\n<li>代码示例 → Markdown 代码块</li>\n<li>线性指令 → 编号列表</li>\n<li>无语义意义的标签（step1、helper2）</li>\n</ul>\n<p>参见 @graphviz-conventions.dot 了解 graphviz 样式规则。</p>\n<p><strong>为你的搭档可视化：</strong> 使用此目录中的 <code>render-graphs.js</code> 将技能的流程图渲染为 SVG：</p>\n<pre><code>./render-graphs.js ../some-skill           # 每个图表分别渲染\n./render-graphs.js ../some-skill --combine # 所有图表合并为一个 SVG\n</code></pre>\n<h2>代码示例</h2>\n<p><strong>一个优秀的示例胜过多个平庸的</strong></p>\n<p>选择最相关的语言：</p>\n<ul>\n<li>测试技术 → TypeScript/JavaScript</li>\n<li>系统调试 → Shell/Python</li>\n<li>数据处理 → Python</li>\n</ul>\n<p><strong>好的示例：</strong></p>\n<ul>\n<li>完整可运行</li>\n<li>注释良好，解释为什么</li>\n<li>来自真实场景</li>\n<li>清晰展示模式</li>\n<li>可以直接适配（不是通用模板）</li>\n</ul>\n<p><strong>不要：</strong></p>\n<ul>\n<li>用 5 种以上语言实现</li>\n<li>创建填空模板</li>\n<li>写人为构造的示例</li>\n</ul>\n<p>你擅长语言移植——一个优秀的示例就够了。</p>\n<h2>文件组织</h2>\n<h3>自包含技能</h3>\n<pre><code>defense-in-depth/\n  SKILL.md    # 所有内容内联\n</code></pre>\n<p>适用场景：所有内容都能放下，无需大量参考</p>\n<h3>带可复用工具的技能</h3>\n<pre><code>condition-based-waiting/\n  SKILL.md    # 概述 + 模式\n  example.ts  # 可适配的工作代码\n</code></pre>\n<p>适用场景：工具是可复用的代码，不只是叙述</p>\n<h3>带大量参考的技能</h3>\n<pre><code>pptx/\n  SKILL.md       # 概述 + 工作流\n  pptxgenjs.md   # 600 行 API 参考\n  ooxml.md       # 500 行 XML 结构\n  scripts/       # 可执行工具\n</code></pre>\n<p>适用场景：参考资料太多无法内联</p>\n<h2>铁律（与 TDD 相同）</h2>\n<pre><code>没有失败的测试就不写技能\n</code></pre>\n<p>这适用于新技能和对现有技能的编辑。</p>\n<p>先写技能再测试？删掉它。重新开始。\n编辑技能不测试？同样违规。</p>\n<p><strong>无例外：</strong></p>\n<ul>\n<li>不适用于\"简单的添加\"</li>\n<li>不适用于\"只是加一个章节\"</li>\n<li>不适用于\"文档更新\"</li>\n<li>不要保留未测试的更改作为\"参考\"</li>\n<li>不要在运行测试时\"调整\"</li>\n<li>删除就是删除</li>\n</ul>\n<p><strong>必需背景：</strong> test-driven-development 技能解释了为什么这很重要。相同的原则适用于文档。</p>\n<h2>测试所有技能类型</h2>\n<p>不同类型的技能需要不同的测试方法：</p>\n<h3>纪律执行类技能（规则/要求）</h3>\n<p><strong>例如：</strong> TDD、完成前验证、编码前设计</p>\n<p><strong>测试方式：</strong></p>\n<ul>\n<li>学术性问题：它们理解规则吗？</li>\n<li>压力场景：它们在压力下遵守吗？</li>\n<li>多重压力组合：时间 + 沉没成本 + 疲惫</li>\n<li>识别合理化借口并添加明确的反驳</li>\n</ul>\n<p><strong>成功标准：</strong> 智能体在最大压力下遵循规则</p>\n<h3>技术类技能（操作指南）</h3>\n<p><strong>例如：</strong> condition-based-waiting、root-cause-tracing、defensive-programming</p>\n<p><strong>测试方式：</strong></p>\n<ul>\n<li>应用场景：它们能正确应用技术吗？</li>\n<li>变体场景：它们能处理边界情况吗？</li>\n<li>缺失信息测试：说明是否有遗漏？</li>\n</ul>\n<p><strong>成功标准：</strong> 智能体成功将技术应用于新场景</p>\n<h3>模式类技能（心智模型）</h3>\n<p><strong>例如：</strong> reducing-complexity、information-hiding 概念</p>\n<p><strong>测试方式：</strong></p>\n<ul>\n<li>识别场景：它们能识别模式何时适用吗？</li>\n<li>应用场景：它们能使用心智模型吗？</li>\n<li>反例：它们知道何时不应用吗？</li>\n</ul>\n<p><strong>成功标准：</strong> 智能体正确识别何时/如何应用模式</p>\n<h3>参考类技能（文档/API）</h3>\n<p><strong>例如：</strong> API 文档、命令参考、库指南</p>\n<p><strong>测试方式：</strong></p>\n<ul>\n<li>检索场景：它们能找到正确的信息吗？</li>\n<li>应用场景：它们能正确使用找到的内容吗？</li>\n<li>覆盖测试：常见用例是否都涵盖了？</li>\n</ul>\n<p><strong>成功标准：</strong> 智能体找到并正确应用参考信息</p>\n<h2>跳过测试的常见合理化借口</h2>\n<table>\n<thead>\n<tr>\n<th>借口</th>\n<th>现实</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>\"技能显然很清晰\"</td>\n<td>对你清晰 ≠ 对其他智能体清晰。测试它。</td>\n</tr>\n<tr>\n<td>\"这只是参考资料\"</td>\n<td>参考资料可能有遗漏、不清楚的地方。测试检索。</td>\n</tr>\n<tr>\n<td>\"测试太过了\"</td>\n<td>未测试的技能总有问题。15 分钟测试省下数小时。</td>\n</tr>\n<tr>\n<td>\"有问题再测试\"</td>\n<td>问题 = 智能体无法使用技能。在部署前测试。</td>\n</tr>\n<tr>\n<td>\"测试太繁琐\"</td>\n<td>测试比在生产中调试坏技能少繁琐得多。</td>\n</tr>\n<tr>\n<td>\"我有信心它很好\"</td>\n<td>过度自信保证出问题。无论如何都要测试。</td>\n</tr>\n<tr>\n<td>\"学术审查就够了\"</td>\n<td>阅读 ≠ 使用。测试应用场景。</td>\n</tr>\n<tr>\n<td>\"没时间测试\"</td>\n<td>部署未测试的技能比后面修复浪费更多时间。</td>\n</tr>\n</tbody>\n</table>\n<p><strong>以上所有都意味着：部署前测试。无例外。</strong></p>\n<h2>让形式匹配失败类型</h2>\n<p>在写指导内容之前，先给基线失败<strong>归类</strong>。能让某一类失败变得无懈可击的形式，用在另一类上会<strong>可测量地反噬</strong>。</p>\n<table>\n<thead>\n<tr>\n<th>基线失败</th>\n<th>正确的形式</th>\n<th>错误的形式</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>压力之下跳过/违反规则（明知故犯）</td>\n<td>禁令 + 合理化借口表 + 红线（见下方\"让技能经受住合理化的考验\"）</td>\n<td>软性建议（\"优先……\"、\"考虑……\"）</td>\n</tr>\n<tr>\n<td>遵守了，但产出的<strong>形状</strong>不对（提示词臃肿、结论被埋、复述规格）</td>\n<td>正面配方或契约：直接说明产出<strong>是什么</strong> —— 它由哪些部分组成、按什么顺序</td>\n<td>禁令清单（\"不要复述\"、\"绝不旁白\"）</td>\n</tr>\n<tr>\n<td>在他们<strong>本来就会产出</strong>的东西里漏掉了必需元素</td>\n<td>结构性手段：在他们要填的模板里放一个 REQUIRED 字段或占位槽</td>\n<td>在模板附近写散文式提醒</td>\n</tr>\n<tr>\n<td>行为<strong>应当取决于某个条件</strong></td>\n<td>挂在可观察谓词上的条件句（\"如果简报存在，就引用它\"）</td>\n<td>无条件规则 + 一堆例外条款</td>\n</tr>\n</tbody>\n</table>\n<p><strong>为什么禁令在\"塑形\"类问题上会反噬：</strong> 在存在竞争性激励时（比如\"让提示词自包含\"），智能体会<strong>跟\"不要 X\"讨价还价</strong>。在针对分派提示词指导做的同题措辞对照测试里，禁令组产出的不想要的内容明显<strong>多于</strong>配方组（两组分布完全分离），甚至比\"完全不给指导\"的对照组还差 —— 请对你自己的场景做微型测试，别想当然，但<strong>永远不要把禁令当默认选择</strong>。配方留不下可讨价还价的空间：产出要么符合所说的形状，要么不符合。</p>\n<p><strong>无论你选哪种形式，都适用的规则：</strong></p>\n<ul>\n<li><strong>不要加\"视情况\"从句。</strong> \"不要 X，除非它很重要\"会重新打开谈判 —— 在同一批措辞测试里，给一个胜出的配方追加<strong>一条</strong>\"视情况\"从句，就把它从稳定退化成了飘忽。真正的例外要表达成<strong>它自己的</strong>条件句，挂在可观察的谓词上。</li>\n<li><strong>豁免条款不会限定作用域。</strong> \"这条长度限制不适用于代码块\"，照样会压制代码块。如果产出里有一部分必须豁免，就<strong>重构结构让规则碰不到它</strong>，而不是写豁免。</li>\n</ul>\n<h2>让技能经受住合理化的考验</h2>\n<p>执行纪律的技能（如 TDD）需要抵抗合理化。智能体很聪明，在压力下会找到漏洞。</p>\n<p><strong>心理学说明：</strong> 理解说服技巧为什么有效有助于你系统性地应用它们。参见 persuasion-principles.md 了解研究基础（Cialdini, 2021; Meincke et al., 2025），涵盖权威、承诺、稀缺、社会认同和归属原则。</p>\n<h3>明确堵住每个漏洞</h3>\n<p>不要只是陈述规则——禁止具体的变通方法：</p>\n\n","files":[{"path":"anthropic-best-practices.md","sizeBytes":42446,"isText":true},{"path":"examples/CLAUDE_MD_TESTING.md","sizeBytes":5423,"isText":true},{"path":"graphviz-conventions.dot","sizeBytes":5970,"isText":false},{"path":"persuasion-principles.md","sizeBytes":5387,"isText":true},{"path":"render-graphs.js","sizeBytes":5633,"isText":true},{"path":"SKILL.md","sizeBytes":25011,"isText":true},{"path":"testing-skills-with-subagents.md","sizeBytes":12389,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-09-07T18:39:02.900406Z","sha256":"08F9CC9D732DC337BC2034B0F79F34C6B056F18231E6FFF6A0A0E9306F9ABB4D","sizeBytes":42920},"review":null,"source":{"repositoryUrl":"https://github.com/jnMetaCode/superpowers-zh","path":"skills/writing-skills","license":"MIT","commit":"78cb4f68d691d516eb7216897053ea574212cdf6","subtreeSha":"A5E866DA3FAFF6B23D85CCA910D9702EFE4E6B54A967DBF8312A59BC669CE8AE","lastSyncedAt":"2026-09-25T06:49:13.086723Z"},"reviewedAt":"2026-09-07T18:40:03.153977Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/jnMetaCode/superpowers-zh/tree/main/skills/writing-skills"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install jnmetacode-superpowers-zh@llmmart"},{"target":"git","command":"git clone https://github.com/jnMetaCode/superpowers-zh.git"}]}