Skill Linter & Advisor
Analyze SKILL.md files against Claude Code Skills best practices and provide actionable feedback.
Analysis Process
- 1. Read the SKILL.md file - Load the complete content
- Parse frontmatter - Validate YAML structure and required fields
- Check content structure - Verify best practices for the markdown body
- Compare against patterns - Match against known good Skill patterns
- Generate report - Provide structured feedback with severity levels
Validation Checklist
Frontmatter (YAML Header)
| Check | Severity | Description |
|---|
Has --- delimiters | 🔴 Critical | Must have opening and closing INLINECODE1 |
| Valid YAML syntax |
🔴 Critical | YAML must parse without errors |
| Has
name field | 🟡 Warning | Defaults to directory name, but explicit is better |
| Has
description | 🔴 Critical | Required for auto-trigger to work |
| Description quality | 🟡 Warning | Should be specific, mention when to use |
|
disable-model-invocation | 🟢 Info | Only set if you want manual-only |
|
user-invocable | 🟢 Info | Set to false to hide from / menu |
|
allowed-tools | 🟡 Warning | Specify if Skill needs specific tools |
|
model override | 🟢 Info | Only if you need specific model |
|
context: fork | 🟢 Info | Use for long-running or isolated tasks |
|
agent with context | 🟢 Info | Required when context: fork |
Content Structure
| Check | Severity | Description |
|---|
| Has clear title/heading | 🟡 Warning | First line should indicate purpose |
| Has process/steps |
🟡 Warning | Skills should have actionable steps |
| Has output format | 🟡 Warning | Define expected output structure |
| Uses specific language | 🟡 Warning | Avoid vague terms like "etc", "etc." |
| Has examples | 🟢 Info | Concrete examples improve reliability |
| Has constraints/guardrails | 🟢 Info | Define what NOT to do |
| Appropriate length | 🟡 Warning | Too short (<100 words) or too long (>2000) |
Common Issues
| Issue | Severity | Fix |
|---|
| Missing description | 🔴 Critical | Add description explaining when to trigger |
| Description too vague |
🟡 Warning | Be specific about use cases |
| No clear output format | 🟡 Warning | Add expected output structure |
| Missing tool declarations | 🟡 Warning | Add
allowed-tools if using tools |
| Too many responsibilities | 🟡 Warning | Split into multiple focused Skills |
| Hardcoded paths | 🟡 Warning | Use variables or relative paths |
| No error handling guidance | 🟢 Info | Add what to do when things go wrong |
Output Format
CODEBLOCK0 yaml
improved frontmatter
Improved content...
CODEBLOCK1
Skill Patterns Reference
Pattern 1: Checklist/Task Skill
For: Code review, testing, validation tasks
Structure:
- - Clear trigger description
- Step-by-step process
- Checklist categories
- Severity ratings
- Structured output format
Pattern 2: Generator Skill
For: Documentation, commit messages, reports
Structure:
- - Input requirements
- Analysis steps
- Template/format specification
- Examples
- Constraints
Pattern 3: Explorer/Research Skill
For: Code exploration, debugging, analysis
Structure:
- - Context gathering (!commands)
- Investigation steps
- What to look for
- How to present findings
Pattern 4: Workflow Skill
For: Multi-step processes, releases, deployments
Structure:
- - Prerequisites check
- Sequential steps
- Validation points
- Rollback guidance
Examples of Good Descriptions
✅ Good:
- - "Perform a thorough code review following the team checklist. Use when reviewing code changes, pull requests, or when the user asks for a code review."
- "Generate API documentation from source code. Use when the user asks to document an API endpoint, route handler, or controller."
- "Create a standardized git commit message following Conventional Commits format. Use when the user asks to commit or create a commit message."
❌ Bad:
- - "Does code review" (too vague)
- "Helps with documentation" (when?)
- "A skill for git" (too broad)
Examples of Good Output Formats
✅ Good:
CODEBLOCK2
❌ Bad:
CODEBLOCK3
技能检查与建议
分析SKILL.md文件是否符合Claude Code技能最佳实践,并提供可操作的反馈。
分析流程
- 1. 读取SKILL.md文件 - 加载完整内容
- 解析前置元数据 - 验证YAML结构和必填字段
- 检查内容结构 - 验证Markdown正文的最佳实践
- 对比模式 - 匹配已知的优秀技能模式
- 生成报告 - 提供带严重级别的结构化反馈
验证清单
前置元数据(YAML头部)
| 检查项 | 严重级别 | 描述 |
|---|
| 包含---分隔符 | 🔴 严重 | 必须有开头和结尾的--- |
| 有效的YAML语法 |
🔴 严重 | YAML必须能无错误解析 |
| 包含name字段 | 🟡 警告 | 默认使用目录名,但显式指定更好 |
| 包含description | 🔴 严重 | 自动触发功能必需 |
| 描述质量 | 🟡 警告 | 应具体说明,提及使用时机 |
| disable-model-invocation | 🟢 提示 | 仅当需要纯手动模式时设置 |
| user-invocable | 🟢 提示 | 设为false可从/菜单隐藏 |
| allowed-tools | 🟡 警告 | 技能需要特定工具时指定 |
| model覆盖 | 🟢 提示 | 仅当需要特定模型时使用 |
| context: fork | 🟢 提示 | 用于长时间运行或隔离任务 |
| 带上下文的agent | 🟢 提示 | 使用context: fork时必须设置 |
内容结构
| 检查项 | 严重级别 | 描述 |
|---|
| 有清晰的标题/标题行 | 🟡 警告 | 第一行应表明目的 |
| 有流程/步骤 |
🟡 警告 | 技能应有可操作的步骤 |
| 有输出格式 | 🟡 警告 | 定义预期的输出结构 |
| 使用具体语言 | 🟡 警告 | 避免模糊术语如等、等等 |
| 有示例 | 🟢 提示 | 具体示例提高可靠性 |
| 有约束/边界 | 🟢 提示 | 定义不应做的事项 |
| 适当长度 | 🟡 警告 | 过短(<100字)或过长(>2000字) |
常见问题
| 问题 | 严重级别 | 修复方法 |
|---|
| 缺少描述 | 🔴 严重 | 添加描述说明触发时机 |
| 描述过于模糊 |
🟡 警告 | 具体说明使用场景 |
| 无清晰输出格式 | 🟡 警告 | 添加预期输出结构 |
| 缺少工具声明 | 🟡 警告 | 使用工具时添加allowed-tools |
| 职责过多 | 🟡 警告 | 拆分为多个专注的技能 |
| 硬编码路径 | 🟡 警告 | 使用变量或相对路径 |
| 缺少错误处理指导 | 🟢 提示 | 添加出错时的应对措施 |
输出格式
技能分析报告
文件:{文件路径}
前置元数据分析
| 字段 | 状态 | 值 | 备注 |
|---|
| name | ✅/⚠️/❌ | {值} | {反馈} |
| description |
✅/⚠️/❌ | {值} | {反馈} |
| ... | | | |
前置元数据评分: X/10
内容分析
| 检查项 | 状态 | 备注 |
|---|
| 有清晰目的 | ✅/⚠️/❌ | {反馈} |
| 可操作步骤 |
✅/⚠️/❌ | {反馈} |
| 定义了输出格式 | ✅/⚠️/❌ | {反馈} |
| 有示例 | ✅/⚠️/❌ | {反馈} |
| 长度适当 | ✅/⚠️/❌ | {字数}字 |
内容评分: X/10
发现的问题
🔴 严重(必须修复)
- 1. {问题描述} → {修复建议}
🟡 警告(建议修复)
- 1. {问题描述} → {修复建议}
🟢 建议(锦上添花)
- 1. {问题描述} → {修复建议}
总体评估
总分: X/10
结论:
- - ✅ 优秀 - 可直接使用
- 🟡 良好 - 建议小幅改进
- ⚠️ 需要改进 - 使用前处理警告
- ❌ 严重问题 - 使用前必须修复
建议操作
- 1. {操作项}
- {操作项}
- {操作项}
改进版本(可选)
如需重大改进,提供重写的SKILL.md:
yaml
改进的前置元数据
改进的内容...
技能模式参考
模式1:清单/任务技能
适用于:代码审查、测试、验证任务
结构:
- - 清晰的触发描述
- 分步流程
- 清单分类
- 严重级别评级
- 结构化输出格式
模式2:生成器技能
适用于:文档、提交信息、报告
结构:
模式3:探索/研究技能
适用于:代码探索、调试、分析
结构:
- - 上下文收集(!命令)
- 调查步骤
- 查找目标
- 如何呈现发现
模式4:工作流技能
适用于:多步骤流程、发布、部署
结构:
优秀描述示例
✅ 优秀:
- - 按照团队清单进行彻底的代码审查。在审查代码变更、拉取请求或用户要求代码审查时使用。
- 从源代码生成API文档。在用户要求记录API端点、路由处理器或控制器时使用。
- 按照Conventional Commits格式创建标准化的git提交信息。在用户要求提交或创建提交信息时使用。
❌ 不佳:
- - 进行代码审查(过于模糊)
- 帮助处理文档(何时使用?)
- 一个用于git的技能(过于宽泛)
优秀输出格式示例
✅ 优秀:
markdown
输出格式
按以下结构组织审查:
摘要
[一段总体评估]
严重问题
[合并前必须修复]
是否批准?
[是 / 否 / 有条件批准]
❌ 不佳:
markdown
直接给我一个代码审查。