Loading...
Loading...
Compare original and translation side by side
| # | Test Type | Purpose | Example |
|---|---|---|---|
| 1 | Obvious trigger | Should clearly match | "Create a new React component with tests" |
| 2 | Subtle trigger | Should also match | "I need a reusable button" |
| 3 | Near-miss | Should NOT match | "Review this component code" |
| 4 | Edge case | Define expected behavior | "Create a component and write its docs" |
| 5 | Ambiguous | Define which skill wins | "Set up the frontend" |
Test prompt: "Create a new React component with tests"
Expected: Should trigger component-creation skill
Should NOT trigger: testing-strategy, code-review, writing-skills| # | 测试类型 | 目的 | 示例 |
|---|---|---|---|
| 1 | 明显触发 | 应当明确匹配 | "Create a new React component with tests" |
| 2 | 隐晦触发 | 应当也能匹配 | "我需要一个可复用的按钮" |
| 3 | 近似触发 | 应当不匹配 | "Review this component code" |
| 4 | 边界场景 | 定义预期行为 | "创建一个组件并编写其文档" |
| 5 | 模糊场景 | 定义优先触发的技能 | "搭建前端项目" |
测试提示词:"Create a new React component with tests"
预期:应当触发组件创建技能
不应触发:testing-strategy, code-review, writing-skills| Element | Required | Purpose |
|---|---|---|
Frontmatter ( | Yes | Identification and trigger matching |
| CSO-optimized description | Yes | Starts with "Use when...", lists trigger conditions |
| Overview (2-3 sentences) | Yes | Purpose and value |
| Multi-phase process with STOP markers | Yes | Numbered phases with clear actions |
| Decision tables | Yes | Tables for choosing between approaches |
| Anti-patterns / Common mistakes table | Yes | "What NOT to do" section |
| Anti-rationalization guards | Yes | HARD-GATE or "Do NOT skip" markers |
| Integration points table | Yes | How skill connects to other skills |
| Concrete examples | Yes | Code/command examples where non-obvious |
| Skill type declaration | Yes | RIGID or FLEXIBLE at the end |
| 元素 | 是否必填 | 目的 |
|---|---|---|
头部元数据 ( | 是 | 识别和触发匹配 |
| CSO优化的描述 | 是 | 以"Use when..."开头,列出触发条件 |
| 概述(2-3句话) | 是 | 说明用途和价值 |
| 带STOP标记的多阶段流程 | 是 | 带明确操作的编号阶段 |
| 决策表 | 是 | 用于不同方案选择的表格 |
| 反模式/常见错误表 | 是 | "禁止操作"部分 |
| 防逻辑自洽守卫 | 是 | HARD-GATE或"请勿跳过"标记 |
| 集成点表 | 是 | 说明该技能与其他技能的关联方式 |
| 具体示例 | 是 | 不直观的场景下提供代码/命令示例 |
| 技能类型声明 | 是 | 末尾标注RIGID或FLEXIBLE |
---
name: skill-name # lowercase with hyphens, unique identifier
description: "Use when [trigger conditions]" # Max 1024 chars
---description---
name: skill-name # 小写连字符格式,唯一标识符
description: "Use when [trigger conditions]" # 最长1024字符
---descriptiondescription| Rule | Explanation |
|---|---|
| Start with "Use when..." | Trigger condition format |
| List specific conditions, not capabilities | What activates the skill, not what it teaches |
| Maximum 1024 characters | Be concise |
| Use action verbs | "creating", "debugging", "designing", "reviewing" |
description: "Use when creating database migrations, designing table schemas, adding indexes, or optimizing SQL queries"description: "A comprehensive guide to database design covering normalization, indexing, query optimization, and migration strategies"description| 规则 | 说明 |
|---|---|
| 以"Use when..."开头 | 触发条件格式要求 |
| 列出具体条件而非能力 | 说明什么场景触发技能,而非技能能做什么 |
| 最多1024字符 | 保持简洁 |
| 使用动作动词 | "creating", "debugging", "designing", "reviewing" |
description: "Use when creating database migrations, designing table schemas, adding indexes, or optimizing SQL queries"description: "A comprehensive guide to database design covering normalization, indexing, query optimization, and migration strategies"| Pattern | Format | Example |
|---|---|---|
| Action-based | "Use when creating..., updating..., deleting..." | CRUD operations |
| Problem-based | "Use when debugging..., fixing..., resolving..." | Bug fixes |
| Artifact-based | "Use when working with Docker files, CI configs..." | File types |
| Phase-based | "Use when starting a project, finishing a feature..." | Workflow stage |
| 模式 | 格式 | 示例 |
|---|---|---|
| 基于动作 | "Use when creating..., updating..., deleting..." | CRUD操作 |
| 基于问题 | "Use when debugging..., fixing..., resolving..." | Bug修复 |
| 基于产物 | "Use when working with Docker files, CI configs..." | 文件类型 |
| 基于阶段 | "Use when starting a project, finishing a feature..." | 工作流阶段 |
| Check | Question | Fix If Failing |
|---|---|---|
| Over-triggering | Does it match prompts it should NOT? | Narrow the description |
| Under-triggering | Does it miss valid prompts? | Add missing trigger conditions |
| Rationalization | Would an agent find a way to skip steps? | Add "Do NOT skip" constraints |
| Ambiguity | Are instructions interpretable multiple ways? | Make them concrete with examples |
| Token bloat | Is it over 500 lines? | Move reference material to separate files |
| Missing gates | Are there checkpoints between phases? | Add STOP markers |
| 检查项 | 问题 | 不通过时的修复方案 |
|---|---|---|
| 过度触发 | 是否匹配了不该匹配的提示词? | 收窄描述范围 |
| 触发不足 | 是否漏掉了合法的触发提示词? | 补充缺失的触发条件 |
| 逻辑自洽漏洞 | Agent会不会找到跳过步骤的方法? | 添加"请勿跳过"约束 |
| 表述模糊 | 指令是否存在多种解读方式? | 用示例让指令更具体 |
| Token冗余 | 内容是否超过500行? | 将参考材料移到独立文件 |
| 缺少检查点 | 阶段之间是否没有检查点? | 添加STOP标记 |
| Skill Type | Target Lines | Strategy |
|---|---|---|
| Getting-started workflows | < 100 lines | Minimal steps |
| Frequently-loaded skills | < 200 lines | Tables over prose |
| Comprehensive reference skills | < 400 lines | Split into phases |
| Maximum allowed | 500 lines | Move extras to separate files |
| 技能类型 | 目标行数 | 优化策略 |
|---|---|---|
| 入门工作流 | < 100行 | 步骤最少化 |
| 高频加载技能 | < 200行 | 用表格替代大段文字 |
| 综合参考技能 | < 400行 | 拆分到多个阶段 |
| 最大允许行数 | 500行 | 额外内容移到独立文件 |
| # | Check | Status |
|---|---|---|
| 1 | Frontmatter has | [ ] |
| 2 | Description starts with "Use when" | [ ] |
| 3 | Overview is 2-3 sentences | [ ] |
| 4 | Phases are numbered with STOP markers | [ ] |
| 5 | Decision tables present (not prose) | [ ] |
| 6 | Anti-patterns table present | [ ] |
| 7 | Anti-rationalization guards present | [ ] |
| 8 | Integration points table present | [ ] |
| 9 | Concrete examples present | [ ] |
| 10 | Skill type declared (RIGID/FLEXIBLE) | [ ] |
| 11 | Under 500 lines total | [ ] |
| # | 检查项 | 状态 |
|---|---|---|
| 1 | 头部元数据包含 | [ ] |
| 2 | 描述以"Use when"开头 | [ ] |
| 3 | 概述为2-3句话 | [ ] |
| 4 | 阶段带编号且有STOP标记 | [ ] |
| 5 | 包含决策表(而非大段文字) | [ ] |
| 6 | 包含反模式表 | [ ] |
| 7 | 包含防逻辑自洽守卫 | [ ] |
| 8 | 包含集成点表 | [ ] |
| 9 | 包含具体示例 | [ ] |
| 10 | 已声明技能类型(RIGID/FLEXIBLE) | [ ] |
| 11 | 总行数少于500行 | [ ] |
| Skill Type | Test Method | What to Verify |
|---|---|---|
| Technique (TDD, debugging) | Apply to problem X and unusual problem Y | Produces right steps; adapts correctly |
| Pattern (design patterns) | Show code X (matches) and code Y (near-miss) | Identifies correctly; rejects correctly |
| Reference (API docs, checklists) | Ask "what is the rule for X?" and "what about edge case Z?" | Finds right answer; handles gaps |
| Discipline (security review) | Review correct code, then review under time pressure | Passes clean code; enforces all rules even under pressure |
| 技能类型 | 测试方法 | 验证内容 |
|---|---|---|
| 技术方法(TDD、调试) | 应用到问题X和特殊问题Y | 输出正确步骤,适配性正常 |
| 模式类(设计模式) | 展示匹配的代码X和近似的代码Y | 识别正确,拒绝正确 |
| 参考类(API文档、检查清单) | 询问"X的规则是什么?"和"边界场景Z怎么处理?" | 能找到正确答案,处理空白场景 |
| 规范类(安全审查) | 先审查正确代码,再在时间压力下审查 | 正常代码通过审核,压力下也能执行所有规则 |
| Mistake | Why It Is Wrong | What To Do Instead |
|---|---|---|
| Description describes content, not triggers | Skill never gets selected | Start with "Use when..." and list trigger conditions |
| Too broad — triggers on everything | Useful for nothing | Narrow to specific actions and artifacts |
| Too long — 1000+ lines | Wastes context tokens every invocation | Stay under 500 lines; split reference material |
| Missing constraints | Agents rationalize skipping steps | Add "Do NOT" rules and HARD-GATE markers |
| Untested against real prompts | Will misfire in production | Write test prompts BEFORE writing the skill |
| External file dependencies | Fragile — files may not exist | Self-contained or check file existence first |
| Prose where tables work | Harder to scan, more tokens | Use tables for structured comparisons |
| No STOP markers between phases | Agent blasts through without checkpoints | Add STOP after each phase |
| 错误 | 错误原因 | 替代方案 |
|---|---|---|
| 描述说明的是内容而非触发条件 | 技能永远不会被选中 | 以"Use when..."开头,列出触发条件 |
| 范围太宽,什么场景都触发 | 没有实际用途 | 收窄到具体动作和产物 |
| 内容太长,超过1000行 | 每次调用都浪费上下文Token | 保持在500行以内,拆分参考材料 |
| 缺少约束 | Agent会找理由跳过步骤 | 添加"请勿"规则和HARD-GATE标记 |
| 未用真实提示词测试 | 生产环境会误触发 | 编写技能前先写测试提示词 |
| 依赖外部文件 | 脆弱,文件可能不存在 | 内容自包含,或先检查文件是否存在 |
| 能用表格的地方用大段文字 | 难扫描,占用更多Token | 结构化对比用表格 |
| 阶段之间没有STOP标记 | Agent会跳过检查点直接走完流程 | 每个阶段结束后添加STOP |
| Skill | Relationship |
|---|---|
| Skills are discovered and loaded via the skill system |
| Tracks skill effectiveness and suggests improvements |
| Skills can be specified using JTBD methodology |
| Skills should be reviewed for quality before deployment |
| Test prompts follow testing methodology |
| 技能 | 关联关系 |
|---|---|
| 技能通过技能系统被发现和加载 |
| 跟踪技能有效性并提出改进建议 |
| 可使用JTBD方法论定义技能需求 |
| 技能上线前需要做质量审查 |
| 测试提示词遵循测试方法论 |
---
name: docker-setup
description: "Use when creating Dockerfiles, docker-compose configurations, or containerizing an application for development or production"
------
name: docker-setup
description: "Use when creating Dockerfiles, docker-compose configurations, or containerizing an application for development or production"
---| Mistake | Fix |
|---|---|
| Running as root | Use non-root USER |
| No .dockerignore | Always create one |
| Mistake | Fix |
|---|---|
| Running as root | Use non-root USER |
| No .dockerignore | Always create one |
undefinedundefined