Skills.MD
# Creating Agent Skills
Skills extend agent capabilities with domain-specific knowledge. Use skills for procedural knowledge the agent lacks—not for concepts it already understands.
If guidance is project-specific or one-off, use INSTRUCTIONS.md or inline context instead.
## Structure
### Required Frontmatter
Every SKILL.md must start with YAML frontmatter on line 1:
```yaml
---
name: my-skill-name
description: What this skill does and when to use it. Third-person.
---
```
**Field requirements:**
- `name`: lowercase, hyphens only, max 64 chars, no reserved words ("anthropic", "claude")
- `description`: max 1024 chars, specific triggers + capabilities
### File Organization
```
skill-name/
├── SKILL.md # Required. Under 200 lines.
└── references/ # Optional. For detailed content.
├── api.md
└── examples.md
```
Use `references/` when SKILL.md exceeds 200 lines. Keep references one level deep—avoid nested file references.
## Writing Descriptions
The description determines when the skill activates. Include both **what it does** and **when to use it**.
**Always use third-person** (the description is injected into the system prompt):
| Quality | Example |
|---------|---------|
| Good | `Manages GitLab MRs and pipelines via glab CLI. Load before running glab commands.` |
| Good | `Analyzes web performance with Chrome DevTools MCP. Use when auditing page load or Lighthouse scores.` |
| Bad | `I help you with GitLab operations.` |
| Bad | `Useful for various tasks.` |
Include key terms users might mention: tool names, file extensions, specific operations.
## Content Guidelines
### Match Specificity to Task Fragility
**High freedom** (multiple valid approaches):
```markdown
Review code for potential bugs, readability, and adherence to project conventions.
```
**Medium freedom** (preferred pattern with variation):
```markdown
Use pdfplumber for text extraction. For scanned PDFs requiring OCR, use pdf2image instead.
```
**Low freedom** (fragile operations):
```markdown
Run exactly: `python scripts/migrate.py --verify --backup`
Do not modify flags.
```
### Writing Style
- **Imperative form**: "Use X" not "You should use X"
- **Assume competence**: Skip explanations of concepts the agent knows
- **One term, consistent**: Pick "endpoint" or "route", not both
- **No time-sensitive content**: Avoid "as of 2025" or "after next release"
### Quick Reference Tables
For CLIs and APIs, provide lookup tables:
```markdown
| Task | Command |
|------|---------|
| Check status | `glab ci status` |
| View logs | `glab ci trace <job>` |
| Retry job | `glab ci retry <job>` |
```
## Common Patterns
### Prerequisite Verification
Check requirements before proceeding:
```markdown
## FIRST: Verify Installation
Run this before any commands. If it fails, STOP—this skill doesn't apply.
\`\`\`bash
glab --version
\`\`\`
```
### Workflow Checklists
For multi-step tasks, provide a copyable checklist:
```markdown
## Workflow
Copy this checklist to track progress:
\`\`\`
- [ ] Step 1: Analyze input
- [ ] Step 2: Validate mapping
- [ ] Step 3: Apply changes
- [ ] Step 4: Verify output
\`\`\`
```
### Concrete Examples
Show input/output pairs instead of abstract descriptions:
```markdown
**Input**: Added user authentication with JWT tokens
**Output**:
\`\`\`
feat(auth): implement JWT-based authentication
\`\`\`
```
## Anti-patterns
- **Verbose explanations**: Don't explain what PDFs are or how libraries work
- **Multiple options without defaults**: Recommend one approach, mention alternatives briefly
- **Vague descriptions**: "Helps with documents" won't activate correctly
- **Deeply nested references**: SKILL.md → file.md → another.md breaks navigation
- **Magic constants**: Document why values were chosen, or let the agent decide
## Checklist
Before finalizing a skill:
- [ ] Frontmatter starts on line 1 with `---`
- [ ] `name` is lowercase with hyphens only
- [ ] `description` includes triggers AND capabilities (third-person)
- [ ] SKILL.md is under 200 lines (use `references/` if larger)
- [ ] References are one level deep from SKILL.md
- [ ] Imperative form throughout ("Use X" not "You should")
- [ ] Quick reference table for any CLI/API commands
- [ ] Prerequisite verification if skill depends on tools/config
- [ ] No time-sensitive information
- [ ] Tested with representative tasks
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「add-skill」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次