template-skill-enhanced
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseEnhanced Skill Template
增强版Skill模板
A production-ready skill template demonstrating progressive disclosure, bundled resource patterns, and quality validation. Use this template when creating skills that require tiered content loading, reference file organization, or structured quality scoring.
一款具备生产就绪能力的Skill模板,展示了渐进式披露、捆绑资源模式和质量验证方法。当你需要创建支持分层内容加载、参考文件组织或结构化质量评分的Skill时,请使用此模板。
When to Use This Skill
适用场景
- Creating a new skill that needs progressive disclosure (tiered content loading)
- Building skills with bundled resources (references, examples, validation rubrics)
- Designing skills that exceed basic template complexity
- Setting up skills with quality targets and scoring rubrics
- Avoid using for simple, single-purpose skills — use instead
template-skill
- 创建需要渐进式披露(分层内容加载)的新Skill
- 构建包含捆绑资源(参考资料、示例、验证评估标准)的Skill
- 设计复杂度超出基础模板的Skill
- 搭建带有质量目标和评分标准的Skill
- 简单的单一用途Skill请勿使用此模板,请改用
template-skill
Workflow
工作流程
Step 1: Set Up Frontmatter
步骤1:设置前置元数据
Define metadata with kebab-case name, quoted description including a "Use when" clause, version, and tags:
yaml
---
name: my-new-skill
description: "Clear description of what this skill does. Use when [specific trigger condition]."
version: 1.0.0
tags: [domain, category]
---使用短横线命名法(kebab-case)定义元数据,包含带引号的描述(需包含“适用场景”条款)、版本和标签:
yaml
---
name: my-new-skill
description: "Clear description of what this skill does. Use when [specific trigger condition]."
version: 1.0.0
tags: [domain, category]
---Step 2: Write Core Principles (Tier 1 — Always Loaded)
步骤2:编写核心原则(层级1 — 始终加载)
The first section loads immediately on activation. Keep it under ~1000 tokens:
markdown
undefined第一部分在激活时立即加载,内容控制在约1000token以内:
markdown
undefinedCore Principles
核心原则
Principle 1: Foundation Concept
原则1:基础概念
Explanation with a concise code example:
```python
附带简洁代码示例的说明:
python
undefinedDemonstrate the concept clearly
Demonstrate the concept clearly
def foundation_example(input_data):
validated = validate(input_data)
return transform(validated)
```
Key Points:
- Critical aspect that must be understood
- Common misconception to avoid
undefineddef foundation_example(input_data):
validated = validate(input_data)
return transform(validated)
**核心要点:**
- 必须理解的关键内容
- 需要避免的常见误区Step 3: Add Implementation Patterns (Tier 2 — Loaded When Needed)
步骤3:添加实现模式(层级2 — 按需加载)
Detailed patterns for common scenarios (~1500 tokens):
markdown
undefined针对常见场景的详细模式(约1500token):
markdown
undefinedPattern: Descriptive Name
模式:描述性名称
Problem: What specific problem this solves
Solution: High-level approach
```python
def pattern_implementation(input_data):
validate(input_data)
result = transform(input_data)
return format_output(result)
```
Trade-offs:
| Aspect | Benefit | Cost |
|---|---|---|
| Performance | Fast execution | Higher memory |
| Maintainability | Clear structure | More boilerplate |
undefined问题:此模式解决的具体问题
解决方案:整体方法
python
def pattern_implementation(input_data):
validate(input_data)
result = transform(input_data)
return format_output(result)权衡分析:
| 维度 | 优势 | 成本 |
|---|---|---|
| 性能 | 执行速度快 | 内存占用更高 |
| 可维护性 | 结构清晰 | 冗余代码更多 |
undefinedStep 4: Add Advanced Usage (Tier 3 — Complex Scenarios)
步骤4:添加高级用法(层级3 — 复杂场景)
Reserve for sophisticated implementations (~2000+ tokens). Include edge cases:
| Scenario | Expected Behavior | Handling Strategy |
|---|---|---|
| Empty input | Graceful failure | Return default or descriptive error |
| Invalid format | Validation error | Clear error message with fix guidance |
| Resource exhaustion | Graceful degradation | Backoff and retry logic |
用于复杂实现场景(约2000+token),包含边缘案例:
| 场景 | 预期行为 | 处理策略 |
|---|---|---|
| 空输入 | 优雅失败 | 返回默认值或描述性错误 |
| 格式无效 | 验证错误 | 提供清晰错误信息及修复指引 |
| 资源耗尽 | 优雅降级 | 退避重试逻辑 |
Step 5: Organize Bundled Resources
步骤5:组织捆绑资源
Create sibling directories for heavy content:
skills/my-new-skill/
├── SKILL.md # Core skill (under token budget)
├── references/
│ ├── README.md # Guide to reference docs
│ └── detailed-patterns.md # Extended pattern documentation
├── examples/
│ └── basic.md # Annotated usage example
└── validation/
└── rubric.yaml # Quality scoring rubric为大容量内容创建同级目录:
skills/my-new-skill/
├── SKILL.md # 核心Skill(控制在token预算内)
├── references/
│ ├── README.md # 参考文档指南
│ └── detailed-patterns.md # 扩展模式文档
├── examples/
│ └── basic.md # 带注释的用法示例
└── validation/
└── rubric.yaml # 质量评分标准Step 6: Define Quality Targets
步骤6:定义质量目标
Set measurable quality criteria:
yaml
quality_targets:
clarity: ">= 4/5"
completeness: ">= 4/5"
accuracy: ">= 5/5"
usefulness: ">= 4/5"设置可衡量的质量标准:
yaml
quality_targets:
clarity: ">= 4/5"
completeness: ">= 4/5"
accuracy: ">= 5/5"
usefulness: ">= 4/5"Step 7: Validate the Skill
步骤7:验证Skill
bash
cortex skills validate my-new-skill
cortex skills info my-new-skill --show-tokensEnsure total token count stays within 500–8,000 tokens per CONTRIBUTING guidelines.
bash
cortex skills validate my-new-skill
cortex skills info my-new-skill --show-tokens确保总token数符合贡献指南要求的500–8000token范围。
Best Practices
最佳实践
- Progressive disclosure: Keep Tier 1 concise — load detail on demand
- Bundled resources: Move lengthy examples and deep-dives to or
references/examples/ - Quality rubrics: Define scoring criteria in so skill outputs can be evaluated consistently
validation/rubric.yaml - Token budget: Core SKILL.md should stay under token limits; offload heavy content to sibling files
- Real examples: Replace all placeholder content with domain-specific, working code
- Kebab-case naming: Directories and skill names use lowercase hyphen-case
- 渐进式披露:保持层级1内容简洁,按需加载详细内容
- 捆绑资源:将冗长示例和深度分析移至或
references/目录examples/ - 质量评估标准:在中定义评分标准,确保Skill输出可被一致评估
validation/rubric.yaml - Token预算:核心SKILL.md需控制在token限制内,将大容量内容转移至同级文件
- 真实示例:将所有占位符内容替换为领域特定的可运行代码
- 短横线命名法:目录和Skill名称使用小写短横线格式
Anti-Patterns
反模式
- Placeholder content in production: Shipping or
[Pattern Name]— always fill in real contentexample_code_here() - Monolithic skills: Putting everything in SKILL.md instead of using bundled resources
- Missing "Use when" clause: Description must include activation context
- Ignoring token budgets: Skills over 8,000 tokens slow activation and may be truncated
- 生产环境使用占位符内容:发布或
[Pattern Name]这类内容——务必填充真实内容example_code_here() - 单体Skill:将所有内容放入SKILL.md,而非使用捆绑资源
- 缺失“适用场景”条款:描述中必须包含激活场景
- 忽略Token预算:超过8000token的Skill会减慢激活速度,可能被截断