agent-skill-linter
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAgent Skill Linter
Agent Skill Linter
Checks agent skills for spec compliance and publishing readiness.
检查Agent Skill是否符合规范以及是否具备发布条件。
Expected Layout
预期目录结构
A well-structured skill repo separates agent-facing files (installed by ) from repo artifacts:
npx skills addmy-skill/
├── skill/ ← only this dir is installed by npx
│ ├── SKILL.md
│ ├── references/
│ │ └── fix-templates.md
│ └── scripts/ ← skill-invoked scripts (optional)
│ └── main.py
├── src/ ← linter/library source (not installed)
├── tests/
├── README.md
├── LICENSE
├── pyproject.toml
└── .github/
└── workflows/The lint target is the subdirectory (or repo root for older repos with no dir).
skill/skill/结构清晰的Skill仓库会将Agent所需文件(通过安装)与仓库其他产物分开:
npx skills addmy-skill/
├── skill/ ← 仅该目录会通过npx安装
│ ├── SKILL.md
│ ├── references/
│ │ └── fix-templates.md
│ └── scripts/ ← Skill调用的脚本(可选)
│ └── main.py
├── src/ ← 检查工具/库源码(不安装)
├── tests/
├── README.md
├── LICENSE
├── pyproject.toml
└── .github/
└── workflows/检查目标是子目录(对于没有目录的旧仓库,则为仓库根目录)。
skill/skill/Triage Workflow
检查流程
Target: the skill directory to lint — current directory () or a path provided by the user.
.目标: 要检查的Skill目录——当前目录()或用户提供的路径。
.Step 1 — Get the full picture
步骤1 — 查看完整检查结果
bash
./scripts/skill-lint.py check <target>Review the output for errors and warnings; confirm the full picture before proceeding to Step 2.
bash
./scripts/skill-lint.py check <target>查看输出中的错误和警告;在进入步骤2前确认整体情况。
Step 2 — Fix Errors first
步骤2 — 优先修复错误
Rule 1 (SKILL.md spec compliance) blocks publishing. Fix before anything else.
规则1(SKILL.md规范符合性)会阻止发布。需优先修复。
Step 3 — Auto-fix Warnings
步骤3 — 自动修复警告
bash
./scripts/skill-lint.py check <target> --fixFor fixable rules without CLI, use the templates in .
references/fix-templates.mdConfirm no auto-fixable warnings remain before continuing to Step 4.
bash
./scripts/skill-lint.py check <target> --fix对于无法通过CLI自动修复的规则,使用中的模板进行修复。
references/fix-templates.md确认没有可自动修复的警告后,再进入步骤4。
Step 4 — Resolve remaining Warnings manually
步骤4 — 手动解决剩余警告
CSO description prefix (Rule 11), Python invocations (Rule 13), README-tier sections in SKILL.md (Rule 19) — see the rule table below.
CSO描述前缀(规则11)、Python调用方式(规则13)、SKILL.md中的README级章节(规则19)——请查看下方规则表格。
Step 5 — Semantic review: CSO signal
步骤5 — 语义评审:CSO信号
Rule 11 catches structural patterns but not meaning. Read the and frontmatter and ask: do they function purely as routing signals?
descriptionnameSee— Rules 12 and 18 for examples.references/semantic-rules.md
Flag the description if it:
- Enumerates what the skill checks, handles, or supports
- Reads as a feature summary or workflow overview
- Contains elaboration labels (,
Triggers on:,Use cases:) or multiple sentencesChecks: - Could be trimmed to one clause without losing routing precision
Flag the name if it reads as a noun phrase rather than an action — prefer gerunds (, ) over noun forms (, ). Short well-known names (, ) are fine.
creating-skillsprocessing-pdfsskill-creatorpdf-processorpdfcommitA good description names the trigger condition only. Everything else belongs in the skill body.
Confirm the description and name function as pure routing signals before moving to Step 6.
规则11仅检查结构模式,不检查语义。阅读和前置元数据,并思考:它们是否仅作为路由信号发挥作用?
descriptionname参考中的规则12和18示例。references/semantic-rules.md
若描述存在以下情况,则标记出来:
- 列举了该Skill检查、处理或支持的内容
- 读起来像功能总结或流程概述
- 包含说明标签(如、
Triggers on:、Use cases:)或多个句子Checks: - 可精简为一个分句而不丢失路由精度
若名称是名词短语而非动作形式,则标记出来——优先使用动名词形式(如、)而非名词形式(如、)。简短且广为人知的名称(如、)除外。
creating-skillsprocessing-pdfsskill-creatorpdf-processorpdfcommit优质的描述应仅说明触发条件。其他所有内容应放在Skill主体中。
确认描述和名称仅作为纯路由信号后,再进入步骤6。
Step 6 — Semantic review: starter prompts
步骤6 — 语义评审:启动提示
Rule 7 detects whether prompts exist, not whether they're useful. Read the Usage section starter prompts and ask: do they reflect genuine, distinct trigger scenarios?
Flag them if they:
- Are vague or generic (e.g. ,
Use this skill)Run the linter - All describe the same scenario with minor wording variation
- Don't reflect the range of contexts a real user would encounter
Confirm starter prompts cover genuinely distinct use cases before proceeding to Step 7.
规则7仅检测提示是否存在,不检查其实用性。阅读Usage章节中的启动提示,并思考:它们是否反映了真实、不同的触发场景?
若提示存在以下情况,则标记出来:
- 模糊或通用(例如、
Use this skill)Run the linter - 所有描述都是同一场景的轻微措辞变体
- 未覆盖真实用户会遇到的各类场景
确认启动提示覆盖了真正不同的使用场景后,再进入步骤7。
Step 7 — Semantic review: content overlap
步骤7 — 语义评审:内容重复
The linter does not check this. Ask: is the same information conveyed in different words across SKILL.md and README?
See— Rule 8 for examples.references/semantic-rules.md
Flag paraphrased repetition. SKILL.md should be agent-focused (triage workflow, rules); README should be human-focused (installation, usage examples).
Confirm no paraphrased repetition remains before moving to Step 8.
检查工具不会检查此项。思考:SKILL.md和README中是否存在用不同语言表达相同信息的情况?
参考中的规则8示例。references/semantic-rules.md
标记这类改写后的重复内容。SKILL.md应聚焦Agent(检查流程、规则);README应聚焦人类用户(安装说明、使用示例)。
确认没有改写后的重复内容后,再进入步骤8。
Step 8 — Semantic review: progressive disclosure
步骤8 — 语义评审:渐进式披露
Rule 15 flags known reference-tier keywords, but not all reactive content has a recognizable heading. Ask: would an agent look up this section reactively rather than read it upfront?
See— Rule 16 for examples.references/semantic-rules.md
Flag sections for if they:
references/- Are reference material regardless of their heading name (e.g. "Background", "How It Works")
- Are dense or conditional — even if short and not caught by Rule 15
- Are step-specific detail blocks that bulk up the main workflow without being needed upfront
Confirm all reactive content has been moved to before proceeding to Step 9.
references/规则15会标记已知的参考级关键词,但并非所有响应式内容都有可识别的标题。思考:Agent是否会在需要时才查阅该章节,而非提前阅读?
参考中的规则16示例。references/semantic-rules.md
若章节存在以下情况,则将其移至目录并标记:
references/- 无论标题名称如何,都属于参考资料(例如"Background"、"How It Works")
- 内容密集或有条件限制——即使篇幅短且未被规则15捕获
- 是步骤特定的详细块,会增加主流程的冗余内容且无需提前阅读
确认所有响应式内容已移至后,再进入步骤9。
references/Step 9 — Semantic review: multi-step workflow quality
步骤9 — 语义评审:多步骤流程质量
Only apply this step when the skill has a multi-step workflow (3+ headings).
### Step NRead each step body and ask: does every substantive step state how the agent knows it is done?
See— Rule 22 for examples.references/semantic-rules.md
Flag a step if its body describes only what to do with no exit condition, no gate phrase, no "proceed only when" signal. Trivially short steps (a single line) need no explicit gate.
Also ask: does the workflow include at least one step that checks actual tool output, not just verbal claims?
See— Rule 23 for examples.references/semantic-rules.md
Flag the workflow if every step prescribes actions but none tells the agent to read what the tool actually returned.
Confirm both questions are satisfied before proceeding to Step 10.
仅当Skill包含多步骤流程(3个及以上标题)时,才执行此步骤。
### Step N阅读每个步骤的内容,并思考:每个实质性步骤是否说明了Agent如何判断该步骤已完成?
参考中的规则22示例。references/semantic-rules.md
若步骤仅描述要做什么,而未说明退出条件、 gate phrase或"仅当…时才继续"的信号,则标记该步骤。极短的步骤(仅一行)无需明确的完成信号。
同时思考:流程中是否至少有一个步骤是检查工具的实际输出,而非仅口头说明?
参考中的规则23示例。references/semantic-rules.md
若每个步骤仅规定操作,却未告知Agent读取工具的实际返回结果,则标记该流程。
确认上述两个问题都得到满足后,再进入步骤10。
Step 10 — Address Info items as polish
步骤10 — 处理信息类项以优化细节
Body length (Rule 9), non-standard dirs (Rule 10), skill isolation (Rule 17).
内容长度(规则9)、非标准目录(规则10)、Skill隔离性(规则17)。
What It Checks
检查内容
| # | Rule | Severity | Auto-fix |
|---|---|---|---|
| 1 | SKILL.md spec compliance (via skills-ref) | Error | — |
| 2 | LICENSE exists, Apache-2.0 or MIT, current year | Warning | Partial |
| 3 | | Warning | Yes |
| 4 | README badges (CI, license, Agent Skills) | Warning | Yes |
| 5 | | Warning | Yes |
| 6 | README has Installation section | Warning | Yes |
| 7 | README has Usage section with starter prompts + CLI subsection | Warning | Partial + Step 6 |
| 9 | SKILL.md body < 500 lines | Info | — |
| 10 | Non-standard directories flagged | Info | — |
| 11 | CSO: description starts with "Use when..." | Warning | Step 5 |
| 13 | Python invocation consistency ( | Warning | — |
| 14 | Progressive disclosure: embedded templates (4-backtick fences) → | Warning | Yes |
| 15 | Progressive disclosure: reference-tier headings (Troubleshooting, FAQ, Advanced…) → | Warning | Yes + Step 8 |
| 17 | Skill isolation: SKILL.md at repo root alongside non-skill artifacts | Info | — |
| 19 | Division of labor: README-tier sections (Installation, Features, Getting Started…) in SKILL.md | Warning | — |
| 20 | Triage workflow has 3+ steps but no semantic review step (e.g. "Ask: does it…") | Info | Step 5–9 |
| 21 | Python entry-point scripts in | Warning | — |
| 编号 | 规则 | 严重程度 | 自动修复 |
|---|---|---|---|
| 1 | SKILL.md规范符合性(通过skills-ref检查) | 错误 | — |
| 2 | LICENSE文件存在,且为Apache-2.0或MIT协议,年份为当前年份 | 警告 | 部分支持 |
| 3 | SKILL.md前置元数据中包含 | 警告 | 是 |
| 4 | README包含徽章(CI、许可证、Agent Skills) | 警告 | 是 |
| 5 | | 警告 | 是 |
| 6 | README包含Installation章节 | 警告 | 是 |
| 7 | README包含Usage章节,其中包含启动提示和CLI子章节 | 警告 | 部分支持 + 步骤6 |
| 9 | SKILL.md主体内容少于500行 | 信息 | — |
| 10 | 标记非标准目录 | 信息 | — |
| 11 | CSO:描述以"Use when..."开头 | 警告 | 步骤5 |
| 13 | Python调用一致性(uv项目中使用 | 警告 | — |
| 14 | 渐进式披露:嵌入式模板(4反引号围栏)→ 移至 | 警告 | 是 |
| 15 | 渐进式披露:参考级标题(Troubleshooting、FAQ、Advanced…)→ 移至 | 警告 | 是 + 步骤8 |
| 17 | Skill隔离性:SKILL.md位于仓库根目录,与非Skill产物共存 | 信息 | — |
| 19 | 分工合理性:SKILL.md中包含README级章节(Installation、Features、Getting Started…) | 警告 | — |
| 20 | 检查流程包含3个及以上步骤,但无语义评审步骤(例如"Ask: does it…") | 信息 | 步骤5–9 |
| 21 | | 警告 | — |
CLI Reference
CLI参考
bash
./scripts/skill-lint.py check . # Lint repo-root skill
./scripts/skill-lint.py check ./my-skill --fix # Auto-fix fixable issues
./scripts/skill-lint.py check ./my-skill --format json # JSON output for CIExit code 1 on errors, 0 otherwise.
bash
./scripts/skill-lint.py check . # 检查仓库根目录下的Skill
./scripts/skill-lint.py check ./my-skill --fix # 自动修复可修复的问题
./scripts/skill-lint.py check ./my-skill --format json # 输出JSON格式结果用于CI存在错误时退出码为1,否则为0。