Skill Quality Analyzer:Claude Skills 的综合质量评估工具
深入探讨 skill-quality-analyzer 这一元技能,它从五个关键维度对 Claude Skills 进行加权评分、等级评定,并提供三种输出模式。了解该工具如何分析结构、安全性、用户体验、代码质量和集成能力,以确保高质量的技能开发并提供可操作的改进建议。
📚 Source Information
ℹ️ This article was automatically imported and translated using Claude AI. Imported on 11/20/2025.
Skill Quality Analyzer:Claude Skills 的综合质量评估工具
skill-quality-analyzer 是一个开创性的元技能,为 Claude Skills 提供全面的质量分析。这个复杂的工具从五个关键维度评估技能,分配加权分数和字母等级,并提供三种不同的输出模式,以服务于不同的用例——从详细的改进路线图到二元认证决策。
该元技能是 Anthropic skills 仓库中 PR #83 的一部分,由 eovidiu 于 2025 年 11 月 6 日引入。它代表了自动化技能质量评估的重大进步。
概述
质量分析的必要性
随着 Claude Skills 生态系统的发展,确保一致的质量变得越来越重要。人工代码审查既耗时又主观。skill-quality-analyzer 通过提供以下功能来解决这个问题:
- 自动评估 跨多个质量维度
- 客观评分 使用透明的评分标准
- 可操作的建议 用于改进
- 灵活的输出模式 适用于不同的工作流程
- 安全集成 通过 skill-security-analyzer
独特之处
多维度分析
评估 5 个不同的质量维度,具有加权重要性:安全性(30%)、结构(20%)、用户体验(20%)、代码质量(15%)、集成(15%)
三种输出模式
用于改进的综合报告、用于学习的交互式审查、用于部署决策的通过/失败认证
多源支持
分析来自 GitHub URL、marketplace 链接、ZIP 文件或本地目录的技能
安全优先方法
与 skill-security-analyzer 集成,实现自动漏洞检测,赋予安全性最高权重(30%)
下载与安装
GitHub 仓库: skill-quality-analyzer 可在 Anthropic Skills 仓库的 PR #83 中获取。
安装选项
选项 1:从 PR 分支克隆
# 克隆特定的 PR 分支
git clone -b skill-analysis https://github.com/eovidiu/skills.git
cd skills/skill-quality-analyzer
# 复制到您的 Claude skills 目录
cp -r ../skill-quality-analyzer ~/.claude/skills/选项 2:直接下载(合并后)
# PR #83 合并到主分支后
git clone https://github.com/anthropics/skills.git
cd skills/skill-quality-analyzer
cp -r . ~/.claude/skills/skill-quality-analyzer/选项 3:手动下载
直接访问 PR 并下载文件:
- PR 链接: https://github.com/anthropics/skills/pull/83
- 文件更改: 导航到"Files changed"标签
- 下载: skill-quality-analyzer/ 目录(812 行 SKILL.md + 引用文件)
注意: 此技能目前在 PR #83 中(截至 2025 年 11 月仍处于开放状态)。安装前请检查 PR 状态。合并后,它将在主分支中可用。
架构
目录结构
核心组件
1. SKILL.md(812 行)
主要实现文件包含:
- 完整的 8 步分析工作流程
- 每个维度的详细评分标准
- 评分算法和权重分配
- 所有三种模式的输出生成逻辑
- 与 skill-security-analyzer 的集成说明
2. 参考文档
quality-checklist.md(377 行)
- 全面的评估标准
- 特定维度的检查清单
- 分数分配明细
- 常见问题和解决方案
best-practices-patterns.md(666 行)
- 来自高质量技能的经过验证的模式数据库
- 优秀的 SKILL.md 结构示例
- 有效的工作流程设计
- 文档完善的脚本示例
anti-patterns.md(797 行)
- 常见错误和危险信号
- 要避免的安全漏洞
- 用户体验反模式
- 代码质量问题
五个评估维度
1. 结构与文档(20% 权重)
评估使技能可发现、可理解和可用的基础元素。
检查内容:
YAML 前置元数据(20 分)
- 必需字段:
name、description - 有效的 YAML 语法
- 无禁止字段
描述质量(20 分)
- 具体的动作词
- 清晰的上下文和用例
- 包含 3-5 个触发短语
- 长度:100-300 字符
章节组织(20 分)
- 存在概述部分
- "何时使用"指导
- 清晰的工作流程/流程部分
- 资源文档
示例与模板(20 分)
- 实用的使用示例
- 适当的代码示例
- 需要时的模板文件
- 清晰的预期结果
引用目录(20 分)
- 组织良好的参考文档
- 正确记录的脚本
- 资产组织
- 复杂结构的 README
评分标准:
| 分数范围 | 等级 | 描述 |
|---|---|---|
| 90-100 | A+/A | 示范性文档、全面示例、完美结构 |
| 70-89 | B+/B | 良好的文档,有小差距,组织稳健 |
| 50-69 | C+/C | 基本文档缺乏细节,缺少某些部分 |
| 0-49 | D/F | 缺少关键文档,组织混乱 |
示例:优秀的结构
---
name: api-contract-manager
description: Manage API contracts with validation and versioning. Use when designing APIs or ensuring contract compliance. Triggers: "validate API contract", "check API compatibility", "version API schema".
---
# API Contract Manager
## Overview
Manages API contracts through validation, versioning, and compatibility checking. Ensures APIs adhere to organizational standards and maintain backward compatibility.
## When to Use This Skill
**Use this skill when:**
- Designing new API endpoints
- Validating existing API contracts
- Checking breaking changes between versions
- Ensuring compliance with API standards
**Trigger phrases:**
- "Validate this API contract"
- "Check API compatibility between versions"
- "Does this API meet our standards?"
## Workflow
[Detailed step-by-step process]
## Resources
- `references/openapi-spec.md` - OpenAPI specification guidelines
- `scripts/validator.py` - Contract validation script
- `assets/contract-template.yaml` - Template for new contracts2. 安全性(30% 权重 - 最高优先级)
安全性获得最高权重,因为漏洞可能危及用户系统和数据。所有技能必须通过最低安全阈值。
与 skill-security-analyzer 的集成:
quality analyzer 总是首先调用 skill-security-analyzer(工作流程的第 3 步)来检测:
- 命令注入漏洞
- 数据泄露模式
- YAML 注入攻击
- 硬编码密钥
- 不安全的文件操作
- 供应链风险
- 代码混淆
- 沙箱逃逸尝试
基于安全发现的评分:
分数:0-40 分(F 等级)
立即拒绝 - 任何 CRITICAL 发现都会导致自动失败:
- 命令注入(eval、exec、os.system)
- 凭证窃取(访问 .ssh/、.aws/)
- YAML 注入(!!python 指令)
- 沙箱逃逸(类遍历)
- 数据泄露到外部服务器
示例:
# CRITICAL:命令注入
os.system(user_input) # 永远不要这样做
# CRITICAL:凭证窃取
with open(os.path.expanduser('~/.ssh/id_rsa')) as f:
send_to_server(f.read()) # 恶意代码分数:50-69 分(D 等级)
需要人工审查 - 技能需要修复后才能批准:
- 高级编码/混淆
- 时间炸弹(日期条件 + 危险操作)
- 环境变量操纵
- 导入中的拼写劫持
- 未记录的网络调用
示例:
# HIGH:高级编码
exec(codecs.decode('vzcbeg bf', 'rot_13'))
# HIGH:时间炸弹
if datetime.now().day == 15:
os.system('suspicious_command')分数:70-89 分(B/C 等级)
可接受但需要监控 - 功能正常但需要改进:
- Base64 编码字符串
- 硬编码 API 密钥(应使用环境变量)
- 缺少输入验证
- 没有范围检查的文件操作
示例:
# MEDIUM:硬编码密钥
API_KEY = "sk-1234567890" # 应使用 os.environ
# MEDIUM:缺少验证
filename = user_input # 应验证/清理
with open(filename) as f: # 可能访问任何文件
process(f.read())分数:90-100 分(A 等级)
遵循最佳实践 - 无安全问题:
- 无危险操作
- 适当的输入验证
- 范围限定的文件操作
- 密钥使用环境变量
- 所有网络调用都有记录
示例:
# SAFE:适当的验证和范围限定
def process_file(filename):
# 验证输入
if not filename.endswith('.txt'):
raise ValueError("Only .txt files allowed")
# 限定到技能目录
skill_dir = os.path.dirname(__file__)
safe_path = os.path.join(skill_dir, 'data', filename)
# 检查路径遍历
if not safe_path.startswith(skill_dir):
raise ValueError("Path traversal detected")
with open(safe_path) as f:
return f.read()认证要求: 安全分数必须 ≥80/100 才能通过认证。
3. 用户体验(20% 权重)
用户体验决定了用户发现、理解和有效使用技能的容易程度。
评估标准:
明确目的(30 分)
- 技能功能的一句话描述
- 定义的具体用例
- 明确的范围界限(何时不使用)
- 适当的技能名称
工作流程指导(30 分)
- 逐步流程文档
- 明确标记的决策点
- 记录的预期输入/输出
- 解释的错误处理
示例质量(20 分)
- 现实的用例
- 完整的示例(输入 → 输出)
- 涵盖的常见场景
- 处理的边缘情况
组织(20 分)
- 逻辑章节流程
- 适当使用 references/
- 清晰的导航
- 一致的格式
评分示例:
90-100:优秀的用户体验
- 5+ 清晰的触发短语
- 带决策树的全面工作流程
- 3+ 现实示例
- 完美的组织
- 包含"何时不使用"部分
70-89:良好的用户体验
- 3-4 个触发短语
- 清晰的工作流程
- 2 个示例
- 良好的组织
- 轻微的清晰度问题
50-69:可接受的用户体验
- 1-2 个触发短语
- 基本工作流程
- 1 个示例或不完整的示例
- 令人困惑的部分
- 缺少范围定义
0-49:差劲的用户体验
- 无触发短语
- 不清楚的工作流程
- 无示例
- 组织混乱
- 用户无法理解如何使用
示例:优秀的触发短语
## Trigger Phrases
Natural ways to invoke this skill:
- "Analyze code quality for this repository"
- "Run quality check on my skill"
- "Review this skill's structure"
- "Is this skill well-built?"
- "Evaluate skill from [GitHub URL]"4. 代码质量(15% 权重)
评估技能中包含的任何脚本或代码的可维护性、清晰度和健壮性。
评估领域:
目录结构(30 分)
- 逻辑组织
- 适当使用子目录
- 无不必要的文件
- 清晰的命名约定
脚本质量(25 分)
- 文档完善的函数
- 存在错误处理
- 无硬编码值
- 模块化设计
代码清晰度(25 分)
- 可读的变量名
- 适当的注释
- 无复杂的单行代码
- 一致的风格
格式化(20 分)
- 一致的缩进
- 标准格式(Python 的 PEP 8)
- 适当的空格
- 干净的导入
示例:高质量脚本
"""
Validation script for API contracts.
This script validates API contracts against OpenAPI 3.0 specification
and checks for breaking changes between versions.
"""
import json
import sys
from typing import Dict, List, Optional
from pathlib import Path
class ContractValidator:
"""Validates API contracts and detects breaking changes."""
def __init__(self, contract_path: Path):
"""
Initialize validator with contract file.
Args:
contract_path: Path to OpenAPI contract file
Raises:
FileNotFoundError: If contract file doesn't exist
ValueError: If contract is invalid JSON
"""
if not contract_path.exists():
raise FileNotFoundError(f"Contract not found: {contract_path}")
with open(contract_path) as f:
self.contract = json.load(f)
def validate_structure(self) -> List[str]:
"""
Validate contract structure against OpenAPI spec.
Returns:
List of validation errors, empty if valid
"""
errors = []
# Check required top-level fields
required_fields = ['openapi', 'info', 'paths']
for field in required_fields:
if field not in self.contract:
errors.append(f"Missing required field: {field}")
# Validate OpenAPI version
if 'openapi' in self.contract:
version = self.contract['openapi']
if not version.startswith('3.'):
errors.append(f"Unsupported OpenAPI version: {version}")
return errors
def main():
"""Main entry point for contract validation."""
if len(sys.argv) != 2:
print("Usage: python validator.py <contract.json>")
sys.exit(1)
contract_path = Path(sys.argv[1])
try:
validator = ContractValidator(contract_path)
errors = validator.validate_structure()
if errors:
print("Validation failed:")
for error in errors:
print(f" - {error}")
sys.exit(1)
else:
print("✅ Contract is valid")
sys.exit(0)
except Exception as e:
print(f"Error: {e}")
sys.exit(1)
if __name__ == '__main__':
main()5. 集成与工具(15% 权重)
评估技能与 Claude 生态系统的集成程度,包括工具使用、MCP 服务器和资源效率。
评估标准:
工具使用(40 分)
- 适当的工具调用
- 不过度使用工具(过多调用)
- 不使用不足的工具(有工具可用时手动操作)
- 工具失败的适当错误处理
MCP 集成(30 分)
- 如果适用,正确使用 MCP 服务器
- 高效的服务器通信
- 适当的连接管理
- 记录的 MCP 依赖项
资源效率(30 分)
- 最小的令牌消耗
- 大型资源的延迟加载
- 适当使用 references/ 目录
- 无冗余内容
评分示例:
优秀的集成(90-100):
## Tools Used
This skill uses the following tools:
- `read_file` - To load contract files
- `grep` - To search for specific patterns
- `bash` - To run validation scripts
MCP Integration:
- Uses `openapi-mcp` server for spec validation
- Connection managed automatically
- Fallback to local validation if MCP unavailable
Resource Strategy:
- Main SKILL.md kept under 5KB
- Detailed specs in references/
- Examples loaded on-demand差劲的集成(0-49):
- 简单任务进行 20+ 次工具调用
- 将整个参考文档加载到 SKILL.md
- 在有益时不使用 MCP
- 在多个地方重复说明
三种输出模式
skill-quality-analyzer 提供三种不同的输出模式以服务不同的工作流程:
模式 1:综合报告
何时使用: 当您需要详细的改进指导和具体建议时。
格式: 详细的 markdown 文档,包含:
结构:
# Skill Quality Analysis Report
## Executive Summary
- Overall Score: 78/100 (C+)
- Letter Grade: C+
- Certification Status: FAILED (Security < 80)
- Top Priority: Fix security vulnerabilities
## Dimension Scores
### 1. Structure & Documentation: 85/100 (B)
**Strengths:**
- ✅ Valid YAML frontmatter
- ✅ Clear description with trigger phrases
- ✅ Well-organized sections
**Weaknesses:**
- ❌ Missing examples for advanced use cases
- ❌ References/ directory lacks README
**Recommendations:**
1. Add 2-3 more realistic examples
2. Create references/README.md explaining structure
3. Include template files in assets/
### 2. Security: 65/100 (D)
**CRITICAL ISSUES (Must Fix):**
- ❌ Hardcoded API key in scripts/fetcher.py:15
- ❌ User input passed to subprocess without validation (scripts/runner.py:42)
**HIGH PRIORITY:**
- ⚠️ Base64 encoded string in SKILL.md (line 234) - unclear purpose
- ⚠️ Network call to undocumented endpoint (scripts/sync.py:67)
**Recommendations:**
1. IMMEDIATE: Remove hardcoded API key, use environment variable
2. IMMEDIATE: Add input validation and sanitization in runner.py
3. Document purpose of base64 string or remove if unnecessary
4. Document network endpoint in SKILL.md or remove if not needed
[Continues for all dimensions...]
## Action Plan
### Immediate Actions (Required for Certification)
1. Fix security issues (scripts/fetcher.py, scripts/runner.py)
2. Add input validation
3. Remove hardcoded secrets
### Short-term Improvements (2-4 hours)
1. Add missing examples
2. Improve script documentation
3. Create references/README.md
### Long-term Enhancements (Optional)
1. Add MCP integration for external APIs
2. Create interactive tutorials
3. Build test suite优点:
- 所有维度的全面分析
- 问题的具体行号
- 优先级行动计划
- 学习机会
模式 2:交互式审查
何时使用: 当您希望在通过引导式交互改进技能的同时学习最佳实践时。
格式: 与 Claude 的逐步对话,每次专注于一个维度。
示例流程:
Claude: Let's review your skill quality together! I'll guide you through each dimension.
--- DIMENSION 1: Structure & Documentation (20%) ---
Current Score: 75/100 (C)
I found these issues:
1. Your description is good but could be more specific:
Current: "Manages API contracts"
Better: "Validate API contracts with OpenAPI 3.0 and detect breaking changes.
Use when designing APIs or ensuring backward compatibility."
Would you like me to suggest an improved description? (y/n)
User: y
Claude: Here's my suggestion:
[Provides improved description]
Would you like to update it now? I can help you edit SKILL.md. (y/n)
User: y
[Claude helps edit the file]
Claude: Great! Description improved. Now let's check your trigger phrases...
[Continues through all issues in this dimension]
Claude: --- SUMMARY: Structure & Documentation ---
Before: 75/100
After: 90/100 (+15 points!)
Ready to move to the next dimension: Security? (y/n)优点:
- 交互式学习最佳实践
- 实时进行改进
- 理解建议背后的"为什么"
- 为未来开发建立技能
模式 3:通过/失败认证
何时使用: 当您需要用于部署或 marketplace 提交的二元决策时。
格式: 简洁的通过/失败裁决,仅包含阻塞问题。
认证阈值:
- 总分:≥70/100
- 安全性:≥80/100(关键)
- 结构:≥70/100
- 用户体验:≥70/100
- 代码质量:≥60/100
- 集成:≥60/100
- 无 CRITICAL 安全发现
示例输出:
# Skill Certification Result
## ❌ CERTIFICATION FAILED
**Overall Score:** 68/100 (D+)
**Decision:** DO NOT DEPLOY
## Blocking Issues (Must Fix)
### CRITICAL: Security Threshold Not Met
- Current: 65/100
- Required: ≥80/100
- Gap: -15 points
**Blocking security issues:**
1. Hardcoded API key (scripts/fetcher.py:15) - CRITICAL
2. Unvalidated user input to subprocess (scripts/runner.py:42) - CRITICAL
3. Undocumented network call (scripts/sync.py:67) - HIGH
### FAILED: Overall Score Below 70
- Current: 68/100
- Required: ≥70/100
- Gap: -2 points
## Quick Fix Checklist
To pass certification, complete these steps:
- [ ] Remove hardcoded API key, use os.environ['API_KEY']
- [ ] Add input validation in runner.py before subprocess call
- [ ] Document network endpoint in SKILL.md or remove
- [ ] Add 1-2 examples to improve UX score (+5 points estimated)
**Estimated time to fix:** 1-2 hours
**Re-run certification after fixes:** `analyze skill quality --mode certification`优点:
- 清晰的是/否决策
- 仅关注阻塞问题
- 快速的部署评估
- 合规验证
八步分析工作流程
skill-quality-analyzer 遵循系统化的 8 步流程:
理解源和模式
- 询问用户技能源(GitHub URL、marketplace 链接、ZIP、本地路径)
- 确认分析模式(综合/交互式/认证)
- 通过适当方法获取技能(git clone、下载、解压、本地读取)
# 示例:GitHub 源
git clone https://github.com/user/my-skill.git /tmp/analysis
cd /tmp/analysis理解技能的目的
- 阅读 SKILL.md 以了解目标和能力
- 识别技能类别和预期用例
- 注意任何特殊要求或依赖项
运行安全分析(关键)
- 总是首先调用 skill-security-analyzer
- 按严重性解析安全发现
- 转换为分数:CRITICAL(0-40)、HIGH(50-69)、MEDIUM(70-89)、LOW/SAFE(90-100)
# 安全分析是强制性的
python3 skill-security-analyzer/scripts/security_scanner.py ./my-skill评估结构与文档
- 检查 YAML 前置元数据有效性(20 分)
- 评估描述质量(20 分)
- 审查章节组织(20 分)
- 评估示例和模板(20 分)
- 检查 references/ 目录(20 分)
总计:0-100 分 → 权重:20%
评估用户体验
- 评估目的清晰度(30 分)
- 审查工作流程文档(30 分)
- 评估示例质量(20 分)
- 检查组织(20 分)
总计:0-100 分 → 权重:20%
评估代码质量
- 审查目录结构(30 分)
- 评估脚本质量(25 分)
- 检查代码清晰度(25 分)
- 验证格式一致性(20 分)
总计:0-100 分 → 权重:15%
评估集成与工具
- 评估工具使用的适当性(40 分)
- 检查 MCP 集成(30 分)
- 评估资源效率(30 分)
总计:0-100 分 → 权重:15%
基于模式生成输出
- 计算加权总分
- 分配字母等级(A+ 到 F)
- 检查认证阈值
- 以请求的格式生成输出(综合/交互式/认证)
加权评分系统
分析器使用复杂的加权评分系统:
公式:
Overall Score = (Structure × 0.20) + (Security × 0.30) + (UX × 0.20) +
(Code Quality × 0.15) + (Integration × 0.15)示例计算:
| 维度 | 原始分数 | 权重 | 贡献 |
|---|---|---|---|
| 结构 | 85/100 | 20% | 17.0 |
| 安全性 | 70/100 | 30% | 21.0 |
| 用户体验 | 80/100 | 20% | 16.0 |
| 代码质量 | 75/100 | 15% | 11.25 |
| 集成 | 65/100 | 15% | 9.75 |
| 总体 | 75/100 | 100% | 75.0 (C) |
字母等级映射:
| 分数范围 | 字母等级 | 含义 |
|---|---|---|
| 97-100 | A+ | 卓越 |
| 93-96 | A | 优秀 |
| 90-92 | A- | 非常好 |
| 87-89 | B+ | 好 |
| 83-86 | B | 高于平均 |
| 80-82 | B- | 稳健 |
| 77-79 | C+ | 可接受 |
| 73-76 | C | 令人满意 |
| 70-72 | C- | 最低可接受 |
| 67-69 | D+ | 低于标准 |
| 63-66 | D | 差 |
| 60-62 | D- | 很差 |
| 0-59 | F | 失败 |
使用示例
示例 1:分析 GitHub 技能
User: "Analyze skill quality for https://github.com/anthropics/skills/tree/main/mcp-builder"
Claude (using skill-quality-analyzer):
Step 1: Fetching skill from GitHub...
✅ Cloned successfully
Step 2: Understanding skill purpose...
This skill guides developers through creating MCP servers.
Step 3: Running security analysis...
✅ Security scan complete: SAFE (95/100)
- No critical or high findings
- 1 medium finding: Large reference files (acceptable)
Step 4-7: Evaluating all dimensions...
Step 8: Generating comprehensive report...
# Quality Analysis: mcp-builder
## Overall Assessment
- **Score:** 94/100 (A)
- **Grade:** A (Excellent)
- **Certification:** ✅ PASS
## Dimension Scores
### Structure & Documentation: 98/100 (A+)
**Exemplary**
- Perfect YAML frontmatter
- Excellent description with clear triggers
- Comprehensive workflow documentation
- Multiple reference documents
- Well-organized scripts
### Security: 95/100 (A)
**Excellent**
- No critical issues
- No high-priority issues
- 1 medium: Large reference files (16KB+) - acceptable for this use case
- All scripts use safe patterns
### User Experience: 92/100 (A)
**Excellent**
- Clear 4-phase workflow
- Extensive examples
- Well-documented edge cases
- Minor: Could add more beginner-friendly examples
### Code Quality: 90/100 (A-)
**Very Good**
- Clean Python scripts (connections.py, evaluation.py)
- Good documentation
- Consistent style
- Minor: Some functions could be broken down further
### Integration: 95/100 (A)
**Excellent**
- Sophisticated tool usage
- Efficient resource loading
- Good separation of concerns
## Recommendations
### Short-term (Optional Enhancements)
1. Add 1-2 beginner-friendly examples
2. Consider breaking down longer functions in evaluation.py
This skill exemplifies best practices and serves as an excellent template for others.示例 2:交互式审查以学习
User: "Review this skill interactively: ./my-api-skill"
Claude: Let's improve your skill together! I'll guide you through each area.
🔍 Quick scan complete. I found some opportunities for improvement.
--- SECURITY CHECK (30% of score) ---
⚠️ I found 2 security concerns:
1. MEDIUM: Hardcoded API endpoint in SKILL.md line 45
Current: `API_URL = "https://api.example.com"`
Risk: If endpoint changes, skill breaks; not configurable
Fix: Use environment variable or config file
2. LOW: Missing input validation in scripts/fetch.py line 23
Current: `response = requests.get(user_url)`
Risk: Could access unintended URLs
Fix: Validate URL domain before request
Want me to show you how to fix these? (y/n)
User: y
Claude: Great! Let's fix the hardcoded endpoint first.
Here's the improved approach:
```python
# scripts/fetch.py
import os
# Use environment variable with fallback
API_URL = os.environ.get('API_URL', 'https://api.example.com')
# Validate URL before use
def fetch_data(endpoint):
full_url = f"{API_URL}/{endpoint}"
# Validate domain
parsed = urllib.parse.urlparse(full_url)
if parsed.netloc not in ['api.example.com', 'api-staging.example.com']:
raise ValueError(f"Invalid domain: {parsed.netloc}")
return requests.get(full_url)Should I update scripts/fetch.py with this fix? (y/n)
[Continues through all issues interactively...]
### 示例 3:通过/失败认证
```markdown
User: "Certify skill quality for ./marketplace-submission --mode certification"
Claude (using skill-quality-analyzer):
🔍 Running certification analysis...
# Skill Certification: marketplace-submission
## ✅ CERTIFICATION PASSED
**Overall Score:** 82/100 (B)
**Decision:** APPROVED FOR DEPLOYMENT
## Dimension Results
✅ Overall Score: 82/100 (Required: ≥70)
✅ Security: 88/100 (Required: ≥80)
✅ Structure: 85/100 (Required: ≥70)
✅ UX: 78/100 (Required: ≥70)
✅ Code Quality: 75/100 (Required: ≥60)
✅ Integration: 70/100 (Required: ≥60)
✅ No CRITICAL security findings
## Quality Summary
Your skill meets all certification requirements:
- High security standards
- Good documentation
- Clear user experience
- Solid code quality
- Appropriate tool integration
**Recommendation:** APPROVED for marketplace submission
## Optional Enhancements (Not Required)
To reach "Excellent" (A grade), consider:
- Add 2 more examples (+3 UX points)
- Improve script documentation (+5 Code Quality points)
- Optimize tool usage (+5 Integration points)
Estimated time: 2-3 hours
Potential score: 82 → 90 (A-)最佳实践
对于技能开发者
安全优先
在质量分析之前运行 skill-security-analyzer。在继续之前修复所有 CRITICAL 和 HIGH 发现。
迭代反馈
首先使用综合模式了解所有问题,然后使用交互式模式系统地修复它们。
瞄准认证
针对认证阈值:总分 70、安全性 80、结构/用户体验 70、代码/集成 60。
从示例中学习
研究高分技能(mcp-builder、skill-creator)以理解最佳实践。
对于代码审查员
预审查筛选
首先运行认证模式以识别需要在人工审查前进行工作的技能。
集中人工审查
使用综合报告专注于分析器可能遗漏的领域(领域特定逻辑、业务需求)。
一致标准
使用评分标准在审查员之间保持一致性。
提供上下文
与开发人员分享分析器报告,以客观地解释审查决策。
对于 Marketplace 策展
最低标准: 要求认证通过(总分 70、安全性 80)以提交到 marketplace。
推荐等级:
- 精选(A/A+):90-100 总分
- 推荐(B+/A-):87-92 总分
- 批准(B/C+):70-86 总分
- 需要改进(低于 70):在改进前不列出
常见陷阱
陷阱 1:忽略安全警告
症状: "我的技能运行良好,但由于安全原因认证失败。"
问题: 安全性权重为 30% 并要求 ≥80/100。即使功能正常的技能如果不安全也会失败。
解决方案:
- 独立运行 skill-security-analyzer
- 修复所有 CRITICAL 和 HIGH 发现
- 记录所有网络调用和文件操作
- 对密钥使用环境变量
陷阱 2:模糊的描述
症状: 尽管有所有部分,结构分数仍然很低。
问题: 像"帮助任务的有用技能"这样的通用描述无助于发现。
解决方案:
❌ 差:" Helps with API work"
✅ 好:"Validate API contracts with OpenAPI 3.0 and detect breaking changes. Use when designing APIs or ensuring backward compatibility. Triggers: 'validate API contract', 'check API compatibility'."陷阱 3:缺少示例
症状: 即使有清晰的文档,用户体验分数仍然很低。
问题: 没有具体示例,用户无法可视化如何使用技能。
解决方案:
- 包含 3+ 个现实示例
- 为每个示例显示输入 → 流程 → 输出
- 涵盖常见场景和边缘情况
陷阱 4:过度工程
症状: 尽管实现复杂,代码质量或集成分数仍然很低。
问题: 没有明确好处的复杂性会损害可维护性。
解决方案:
- 保持脚本简单且专注
- 当简单逻辑足够时不要使用工具
- 避免过早优化
- 记录为什么复杂性是必要的
与其他技能的集成
skill-quality-analyzer 无缝配合:
skill-security-analyzer(必需)
- 工作流程的第 3 步自动调用安全分析
- 安全分数直接输入到总体质量分数中
- 结合起来提供深度防御评估
skill-creator(互补)
- 使用 skill-creator 构建新技能
- 使用 skill-quality-analyzer 在部署前验证它们
- 在创建和质量分析之间迭代
mcp-builder(验证)
- 使用 mcp-builder 构建 MCP 服务器
- 使用 quality analyzer 分析生成的技能
- 确保 MCP 集成符合质量标准
故障排除
问题:尽管没有明显问题,安全分数仍然很低
诊断: 检查细微问题,如:
- Base64 编码字符串(即使是良性的)
- 未记录的网络调用
- 没有明确范围限定的文件操作
解决方案:
# 使用详细输出运行安全分析器
python3 skill-security-analyzer/scripts/security_scanner.py ./my-skill --verbose
# 详细审查每个发现
# 在 SKILL.md 中记录合法用例问题:认证失败,分数为 69/100
诊断: 仅低于阈值 1 分。
解决方案: 快速获得 2-5 分的方法:
- 在描述中添加触发短语(+2-3 分)
- 再包含一个示例(+2-3 分)
- 添加 references/README.md(+1-2 分)
- 修复格式不一致(+1-2 分)
问题:交互式模式没有帮助
诊断: 您需要具体的逐行指导,而不是对话。
解决方案: 切换到综合模式以获取包含具体文件位置和行号的详细报告。
未来增强
skill-quality-analyzer 正在积极开发中。未来版本可能包括:
计划功能:
- 🔄 历史趋势跟踪(随时间推移的分数改进)
- 🔄 比较分析(与类似技能比较)
- 🔄 自定义权重配置(调整维度重要性)
- 🔄 CI/CD 集成(自动化质量门)
- 🔄 Marketplace API 集成(自动更新)
- 🔄 性能基准测试(令牌效率指标)
结论
skill-quality-analyzer 代表了 Claude Skills 自动化质量评估的重大进步。通过结合:
✅ 多维度分析 跨 5 个关键领域 ✅ 加权评分 强调安全性(30% 权重) ✅ 灵活的输出模式 用于不同的工作流程 ✅ 安全集成 通过 skill-security-analyzer ✅ 可操作的建议 具有具体修复方案 ✅ 客观标准 通过透明的标准
这个元技能使开发人员能够构建高质量的技能,审查员能够保持一致的标准,marketplace 策展人能够确保生态系统质量。
关键要点
安全是第一优先级: 权重为 30% 和 80 分认证阈值,安全性不能被忽视。
使用正确的模式: 综合用于改进,交互式用于学习,认证用于部署决策。
系统地迭代: 首先修复阻塞问题(安全性、结构),然后增强其他维度。
向最好的学习: 研究 A 级技能(如 mcp-builder)以理解示范性模式。
何时使用此技能
使用 skill-quality-analyzer 当:
- 构建新技能(在分享前验证)
- 审查代码提交(一致评估)
- 策展 marketplace(执行质量标准)
- 学习最佳实践(交互式模式)
- 调试质量问题(综合诊断)
下载并开始
准备确保您的技能符合质量标准了吗?
安装:
# 从 PR #83(当前)
git clone -b skill-analysis https://github.com/eovidiu/skills.git
cp -r skills/skill-quality-analyzer ~/.claude/skills/
# 合并后(未来)
git clone https://github.com/anthropics/skills.git
cp -r skills/skill-quality-analyzer ~/.claude/skills/使用:
# 综合分析
"Analyze skill quality for https://github.com/user/my-skill"
# 交互式改进
"Review this skill interactively: ./my-skill"
# 认证检查
"Certify skill quality for ./marketplace-submission --mode certification"相关资源
- GitHub PR #83: https://github.com/anthropics/skills/pull/83
- skill-security-analyzer: 配套安全扫描工具(同一 PR)
- Anthropic Skills Repository: github.com/anthropics/skills
- MCP Builder Skill: Analyzing mcp-builder
总结
本综合分析涵盖:
- ✅ skill-quality-analyzer 的概述和目的
- ✅ 从 PR #83 下载和安装说明
- ✅ 五个评估维度的详细评分标准
- ✅ 三种输出模式:综合、交互式、认证
- ✅ 八步分析工作流程
- ✅ 加权评分系统和字母等级映射
- ✅ 每种模式的实际使用示例
- ✅ 开发人员、审查员和策展人的最佳实践
- ✅ 常见陷阱和故障排除指南
- ✅ 与 skill-security-analyzer 的集成
- ✅ 未来增强路线图
ℹ️ 源信息
原始贡献: GitHub PR #83
- 作者: eovidiu
- 提交日期: 2025 年 11 月 6 日
- 状态: 开放(截至 2025 年 11 月 20 日)
- 文件: 812 行 SKILL.md + 3 个参考文档
- 相关: skill-security-analyzer(同一 PR)
- 仓库: github.com/anthropics/skills
本文分析了来自 PR #83 的 skill-quality-analyzer,为开发人员提供了使用这个强大的元技能进行质量评估的全面指导。
准备提升您的技能质量了吗? 从 PR #83 下载 skill-quality-analyzer 并开始构建符合最高标准的技能!
SessionStart Hook 技能:自动化 Claude Code Web 环境设置
掌握 Claude Code web 版的 SessionStart hook 技能 - 自动安装依赖、配置环境,确保测试和代码检查器在每个会话中正常工作
Skill Security Analyzer v2.0:检测 Claude Skills 中的 40+ 恶意模式
全面分析 skill-security-analyzer v2.0 这一元技能,通过 6 阶段分析对恶意代码模式实现 100% 检测率。了解该工具如何检测命令注入、YAML 注入、拼写劫持、时间炸弹、沙箱逃逸和高级编码技术,并提供基于风险的建议。