review-skill
审查指定 Skill 的规范合规性,输出结构化报告。不要自动修复,只报告问题。
步骤 1 — 加载上下文
- 解析
$ARGUMENTS:- 若为目录路径 → 读取该目录下的
SKILL.md - 若为文件路径 → 直接读取该文件
- 若路径不存在或无 SKILL.md → 输出错误信息并终止
- 若为目录路径 → 读取该目录下的
- 用 Glob 列出该 Skill 目录下所有文件(含子目录)
- 读取官方规范(按优先级尝试):
- 项目根目录下
docs/references/Extend Claude with skills.md(Claude Code 官方文档) - 项目根目录下
docs/references/The-Complete-Guide-to-Building-Skill-for-Claude.md(完整构建指南) - 若两份均不存在 → 基于内置知识完成审查,并以如下告警块开头输出报告:
⚠️ 置信度:中 — 未加载官方规范文档(路径不存在),结果基于
references/checklist.md和内置知识,建议更新文档路径后重新审查。
- 项目根目录下
- 读取完整检查表:本 Skill 目录下的
references/checklist.md
步骤 2 — 逐项检查
对照 references/checklist.md 中的检查表逐项判定。每项标记 ✅ 通过、❌ 不通过、⚠️ 建议优化。
使用 Grep 辅助以下项目的判定(避免纯目测遗漏):
- A3/C1 工具声明:Grep
\bBash\b、\bRead\b、\bWrite\b、\bEdit\b、\bGlob\b、\bGrep\b、\bWebFetch\b、\bSkill\b、\bTask\b检查工具实际出现位置,与allowed-tools交叉比对 - A11 未知字段:Grep frontmatter 块(
^---之间)提取所有 key,与合法字段列表对比 - D1/D2 文件引用:Grep
\.md、.py、.sh等扩展名检查路径,与 Glob 文件列表交叉核对孤立/断链文件 - E1 非标准占位符:Grep
\{\{和<[A-Z_]+>检测{{...}}和<PLACEHOLDER>等非标准语法 - F1 硬编码路径:Grep
/Users/、/home/、/root/等绝对路径模式
检查覆盖 6 个类别共 33 项:
| 类别 | 编号范围 | 检查要点 |
|---|---|---|
| A. Frontmatter 合规性 | A1-A13 | name/description 格式与内容、字段合法性、安全限制、目录卫生 |
| B. 指令内容质量 | B1-B6 | 步骤完整性、分支覆盖、退出条件、输出格式、行数控制 |
| C. 工具使用合规性 | C1-C3 | 声明一致性、参数约束、Task 子代理 |
| D. 文件引用有效性 | D1-D3 | 正向/反向引用检查、路径格式 |
| E. 变量与动态内容 | E1-E5 | 标准语法、索引合理性、动态注入安全性、argument-hint 一致性 |
| F. 可移植性 | F1-F3 | 硬编码路径、语言/文化绑定、工具链硬绑定 |
判定原则:
- 规范文档中有明确规则的项 → 严格判定(❌ 或 ✅)
- 属于最佳实践建议的项 → 标记为 ⚠️ 而非 ❌
- 不确定是否违规时 → 标记为 ⚠️ 并说明疑点
步骤 3 — 输出报告
发现问题时
按严重程度降序排列:
| # | 检查项 | 严重程度 | 位置 | 问题 | 建议修复 |
|---|
严重程度定义:
- 高:Skill 无法触发、执行报错或产生错误结果
- 中:不阻断执行但降低可靠性或可维护性
- 低:最佳实践建议
建议修复要求:
- 高/中严重程度项:须提供可直接采用的修改内容(如修正后的 YAML 片段、修改后的文本)
- 低严重程度项:说明改进方向即可
无问题时
输出:✅ 未发现问题。已检查 A1-A13、B1-B6、C1-C3、D1-D3、E1-E5、F1-F3 共 33 项。
示例
示例 1:典型问题报告
输入:/review-skill .claude/skills/my-deploy/
输出片段:
| # | 检查项 | 严重程度 | 位置 | 问题 | 建议修复 |
|---|---|---|---|---|---|
| A2 | description |
中 | frontmatter | 仅 15 字符"部署应用",缺少触发词和使用时机 | 扩展为:description: 部署应用到生产环境。Use when asked to deploy, release, or push to production. |
| A4 | disable-model-invocation |
中 | frontmatter | 含部署操作但未设为 true | 添加 disable-model-invocation: true |
| C1 | 声明一致 | 高 | 步骤 3 | 使用了 Bash 但 allowed-tools 未声明 | 在 allowed-tools 中添加 Bash(deploy *) |
示例 2:全部通过
输入:/review-skill .claude/skills/explain-code/
输出:✅ 未发现问题。已检查 A1-A13、B1-B6、C1-C3、D1-D3、E1-E5、F1-F3 共 33 项。
判定模糊时的处理
某些检查项(如 B1 步骤链路、B5 行为影响)需要主观判断。此时标记为 ⚠️ 并在「问题」列详细说明疑点,供用户自行判断。
More from vamdawn/ai-forge
content-summarizer
Fetch, analyze, and summarize web content into structured Obsidian notes. Supports articles, GitHub repositories, and Reddit/HN/Twitter threads. Automatically detects URL type and selects the appropriate fetcher strategy and note template. Triggers include requests like 'summarize this article', 'take notes on this', 'save this repo', 'summarize this thread', or any URL-based request intended to be saved as an Obsidian note.
62git-commit
Create well-formatted atomic git commits with conventional commit messages and emoji. Use when making git commits, splitting large changesets into logical units, or crafting commit messages.
16semver-release
Automated version release workflow. Analyzes git commit history to infer semantic version, auto-detects version files across ecosystems, updates multilingual CHANGELOGs, creates git commit and tag. Use when: (1) user says "release", "publish version", "bump version", (2) user invokes /release command, (3) preparing to release a new version.
16review-doc
Structured document review and quality improvement. Use when the user asks to review, proofread, check, audit, or improve a document (Markdown, text, or any prose file). Triggers include: 'review this doc', 'check this document', 'proofread', 'audit this spec', 'review and fix', or any request to find and fix issues in written documents. Supports reviewing against referenced standards (PRD, design docs, style guides).
15plan-executor
Orchestrated multi-agent plan execution with TDD and code review. Use when you have a structured plan file to execute via SubAgents. Decomposes tasks, dispatches agents, enforces TDD and code review gates.
13session-summary
分析当前会话内容并按固定格式生成结构化摘要,输出基本信息、会话概要与逐轮明细。触发词:'总结这次会话'、'summarize this session'、'会话总结'、'session summary'、'总结一下'、'生成会话摘要'、'记录本次会话'。
9