Loading...
Loading...
Compare original and translation side by side
Constraints {
require {
Verify before committing — run frontmatter check, structure check, word count
Define clear output format in every skill
Test discipline-enforcing skills with pressure scenarios (3+ combined pressures)
Use imperative steps, not declarative statements
}
never {
Create a skill without checking for existing duplicates first — if >50% overlap, update existing skill
Commit a skill without verification (frontmatter check, structure check, test)
Write declarative-only skills — workflow steps must be imperative
Summarize workflow in the description — description is for triggers only, not execution
Skip testing with "I can see the fix is correct" or "it's just a small change" — analysis != verification
Create skills over 500 lines — extract to reference.md
}
}Constraints {
require {
提交前必须验证——运行前置元数据检查、结构检查、字数统计
在每个技能中定义清晰的输出格式
使用压力场景测试规则约束类技能(需包含3种及以上复合压力)
使用命令式步骤,而非声明式语句
}
never {
未检查现有重复技能就创建新技能——如果功能重叠度超过50%,请更新现有技能
未经过验证(前置元数据检查、结构检查、测试)就提交技能
仅编写声明式技能——工作流步骤必须为命令式
在描述中总结工作流——描述仅用于说明触发场景,而非执行流程
以“我能看出修复是正确的”或“这只是小改动”为借口跳过测试——分析不等于验证
创建超过500行的技能——将冗余内容提取至reference.md
}
}| Field | Type | Source | Description |
|---|---|---|---|
| target | string | $ARGUMENTS | Skill name, path, or description of skill to create |
| mode | enum: CREATE, AUDIT | Derived | Determined from context — create new or audit existing |
| 字段 | 类型 | 来源 | 描述 |
|---|---|---|---|
| target | 字符串 | $ARGUMENTS | 要创建的技能名称、路径或描述 |
| mode | 枚举值:CREATE, AUDIT | 推导得出 | 根据上下文确定——创建新技能或审核现有技能 |
| Field | Type | Required | Description |
|---|---|---|---|
| path | string | Yes | Full path to SKILL.md |
| name | string | Yes | Skill name (kebab-case) |
| type | enum: TECHNIQUE, PATTERN, REFERENCE, COORDINATION | Yes | Skill classification |
| size | number | Yes | Word count |
| verification | VerificationChecklist | Yes | Verification results |
| ready | boolean | Yes | Ready for deployment |
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
| path | 字符串 | 是 | SKILL.md的完整路径 |
| name | 字符串 | 是 | 技能名称(短横线命名法) |
| type | 枚举值:TECHNIQUE, PATTERN, REFERENCE, COORDINATION | 是 | 技能分类 |
| size | 数字 | 是 | 字数统计 |
| verification | VerificationChecklist | 是 | 验证结果 |
| ready | 布尔值 | 是 | 是否准备好部署 |
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Skill name |
| path | string | Yes | Full path |
| issueCount | number | Yes | Total issues found |
| issues | AuditIssue[] | Yes | Issue details |
| rootCause | string | Yes | Why agents don't follow this skill |
| actions | string[] | Yes | Recommended fixes |
| verified | boolean | Yes | Whether fix was tested (not just analyzed) |
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
| name | 字符串 | 是 | 技能名称 |
| path | 字符串 | 是 | 完整路径 |
| issueCount | 数字 | 是 | 发现的问题总数 |
| issues | AuditIssue[] | 是 | 问题详情 |
| rootCause | 字符串 | 是 | 智能体不遵循该技能的原因 |
| actions | 字符串[] | 是 | 推荐修复方案 |
| verified | 布尔值 | 是 | 修复方案是否经过测试(而非仅分析) |
| Field | Type | Required | Description |
|---|---|---|---|
| issue | string | Yes | Description of the problem |
| category | enum: EXECUTION_GAP, DISCOVERY_PROBLEM, AMBIGUITY, CSO_PROBLEM, BLOAT | Yes | Issue classification |
| severity | enum: HIGH, MEDIUM, LOW | Yes | Impact level |
| recommendation | string | Yes | Specific fix |
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
| issue | 字符串 | 是 | 问题描述 |
| category | 枚举值:EXECUTION_GAP, DISCOVERY_PROBLEM, AMBIGUITY, CSO_PROBLEM, BLOAT | 是 | 问题分类 |
| severity | 枚举值:HIGH, MEDIUM, LOW | 是 | 影响级别 |
| recommendation | 字符串 | 是 | 具体修复建议 |
| IF request context | THEN mode | Next step |
|---|---|---|
| User asks to create, write, or build a new skill | CREATE | Phase 1: Creation |
| User asks to audit, review, fix, or debug a skill | AUDIT | Phase 2: Audit |
| User says "skill doesn't work" or reports inconsistency | AUDIT | Phase 2: Audit |
| Ambiguous | Ask user via AskUserQuestion | Route based on answer |
| 如果请求上下文 | 则模式为 | 下一步 |
|---|---|---|
| 用户要求创建、编写或构建新技能 | CREATE | 阶段1:创建 |
| 用户要求审核、评审、修复或调试技能 | AUDIT | 阶段2:审核 |
| 用户反馈“技能无法正常工作”或报告不一致问题 | AUDIT | 阶段2:审核 |
| 上下文模糊 | 通过AskUserQuestion询问用户 | 根据回答路由 |
| File | When to Load |
|---|---|
| reference/testing-with-subagents.md | Testing discipline-enforcing skills with pressure scenarios |
| reference/persuasion-principles.md | Understanding why certain language patterns work in skills |
| 文件 | 加载时机 |
|---|---|
| reference/testing-with-subagents.md | 使用压力场景测试规则约束类技能时 |
| reference/persuasion-principles.md | 理解技能中某些语言模式为何有效时 |
undefinedundefined
**If similar skill exists:**
- Propose updating existing skill instead
- Or explain why new skill is justified
**Rationalization trap:** "Mine is different enough" — if functionality overlaps >50%, update the existing skill.
**如果存在相似技能:**
- 建议更新现有技能
- 或解释为何需要创建新技能
**理性化陷阱**:“我的技能足够不同”——如果功能重叠度超过50%,请更新现有技能。| IF skill purpose is | THEN type is | Structure |
|---|---|---|
| How-to guide with steps | TECHNIQUE | Workflow + examples |
| Mental model or approach | PATTERN | Principles + when to apply |
| API/syntax documentation | REFERENCE | Tables + code samples |
| Orchestrate multiple agents | COORDINATION | Agent prompts + synthesis |
| 如果技能用途是 | 则类型为 | 结构 |
|---|---|---|
| 带步骤的操作指南 | TECHNIQUE | 工作流 + 示例 |
| 思维模型或方法 | PATTERN | 原则 + 适用场景 |
| API/语法文档 | REFERENCE | 表格 + 代码示例 |
| 协调多个智能体 | COORDINATION | 智能体提示词 + 综合处理 |
---
name: kebab-case-name # Lowercase, numbers, hyphens (max 64 chars)
description: What it does and when to use it # Max 1024 chars
allowed-tools: Tool1, Tool2 # Tools without permission prompts (optional)
disable-model-invocation: false # true = only user can invoke (optional)
user-invocable: true # false = hides from / menu (optional)
context: fork # Run in subagent (optional)
agent: Explore # Subagent type when context: fork (optional)
---undefined---
name: kebab-case-name # 小写、数字、短横线(最多64字符)
description: What it does and when to use it # 最多1024字符
allowed-tools: Tool1, Tool2 # 无需权限提示的工具(可选)
disable-model-invocation: false # true = 仅用户可调用(可选)
user-invocable: true # false = 在/菜单中隐藏(可选)
context: fork # 在子智能体中运行(可选)
agent: Explore # 当context为fork时的子智能体类型(可选)
---undefined
**Body structure:**
```markdown
**主体结构:**
```markdown
**Size targets:**
- Keep SKILL.md under 500 lines
- Move heavy reference to separate files
- Use progressive disclosure
**String substitutions (for dynamic content):**
```yaml
$ARGUMENTS # All arguments passed when invoking
$ARGUMENTS[0] # First argument (or use $0 shorthand)
${CLAUDE_SESSION_ID} # Current session ID
!`shell command` # Execute command, insert output (preprocessing)
**大小目标:**
- 保持SKILL.md在500行以内
- 将大量参考内容移至单独文件
- 使用渐进式披露
**字符串替换(用于动态内容):**
```yaml
$ARGUMENTS # 调用时传递的所有参数
$ARGUMENTS[0] # 第一个参数(或使用$0简写)
${CLAUDE_SESSION_ID} # 当前会话ID
!`shell command` # 执行命令,插入输出(预处理)undefinedundefined
**For discipline-enforcing skills:** Run a pressure scenario with subagent to verify agents comply. See **testing-with-subagents.md** for full methodology (RED-GREEN-REFACTOR for skills).
---
**对于规则约束类技能:** 使用子智能体运行压力场景,验证智能体是否遵守规则。查看**testing-with-subagents.md**获取完整方法(技能的RED-GREEN-REFACTOR)。
---undefinedundefinedundefinedundefined| Check | Question | Pass/Fail |
|---|---|---|
| Frontmatter | Valid YAML? name + description present? | |
| Description | Explains what + when to use? Includes keywords? | |
| Activation | Clear triggers listed in body? | |
| Execution | Imperative steps (not just declarative)? | |
| Tools | Tool usage explained if tools listed? | |
| Output | Clear output format defined? | |
| Size | Under 500 lines? (or has supporting files) |
| 检查项 | 问题 | 通过/失败 |
|---|---|---|
| 前置元数据 | YAML格式是否有效?是否包含name和description? | |
| 描述 | 是否说明功能和适用场景?是否包含关键词? | |
| 激活时机 | 主体中是否列出清晰的触发场景? | |
| 执行流程 | 是否使用命令式步骤(而非仅声明式)? | |
| 工具 | 若列出工具,是否说明工具使用方法? | |
| 输出 | 是否定义清晰的输出格式? | |
| 大小 | 是否在500行以内?(或有支持文件) |
| Symptom | Category | Fix Approach |
|---|---|---|
| "Agent doesn't follow it" | EXECUTION_GAP | Add imperative workflow steps |
| "Agent skips sections" | DISCOVERY_PROBLEM | Restructure for progressive disclosure |
| "Agent does wrong thing" | AMBIGUITY | Add explicit EXCLUDE or constraints |
| "Agent can't find skill" | CSO_PROBLEM | Improve description keywords |
| "Skill is too long" | BLOAT | Extract to reference.md |
| 症状 | 类别 | 修复方法 |
|---|---|---|
| “智能体不遵循该技能” | EXECUTION_GAP | 添加命令式工作流步骤 |
| “智能体跳过部分内容” | DISCOVERY_PROBLEM | 重构为渐进式披露结构 |
| “智能体执行错误操作” | AMBIGUITY | 添加明确的排除项或约束条件 |
| “智能体无法找到技能” | CSO_PROBLEM | 优化描述中的关键词 |
| “技能过于冗长” | BLOAT | 将内容提取至reference.md |
The security review should check for SQL injection vulnerabilities.undefinedThe security review should check for SQL injection vulnerabilities.undefinedgrep -r "query\|sql" src/undefinedgrep -r "query\|sql" src/undefinedallowed-tools: Task, Bash, Read
---
[skill body never mentions how to use tools]allowed-tools: Task, Bash, Read
---allowed-tools: Task, Bash, Read
---
[skill body never mentions how to use tools]allowed-tools: Task, Bash, Read
---git diff --cachedgit diff --cachedundefinedundefineddescription: Coordinates code review by launching four specialized subagents then synthesizing findingsdescription: Use when reviewing code changes, PRs, or staged files. Handles security, performance, quality, and test analysis.description: Coordinates code review by launching four specialized subagents then synthesizing findingsdescription: Use when reviewing code changes, PRs, or staged files. Handles security, performance, quality, and test analysis.| Excuse | Reality |
|--------|---------|
| "Just this once" | Exceptions become habits. No exceptions. |
| "It's obvious" | Obvious to you ≠ clear to agents. Test it. |undefined| Excuse | Reality |
|--------|---------|
| "Just this once" | Exceptions become habits. No exceptions. |
| "It's obvious" | Obvious to you ≠ clear to agents. Test it. |undefined
**Test with pressure scenarios:**
Use 3+ combined pressures (time + sunk cost + exhaustion). See **testing-with-subagents.md**.
---
**使用压力场景测试:**
使用3种及以上复合压力(时间 + 沉没成本 + 疲劳)。查看**testing-with-subagents.md**。
---