SuperAPI AI 工具集

audit-plugin

通用与其它

查看项目

更新于 10-16 08:00

技能介绍

用途:对 Claude Code 插件进行结构与规范审计。当用户要求“审计插件”“验证插件结构”“检查插件是否正确”时使用。

主要能力:定位插件根目录(以 .claude-plugin/plugin.json 为标志);运行组件验证脚本(validate_agent.py、validate_hook_schema.py、hook_linter.py、test_hook.py);自动修复导致 Claude Code 无法加载插件的问题(fix_plugin_load_errors.py),如 plugin.json 误含 components 字段、hooks.json 为空对象或数组、扁平格式、JSON 中出现字面 \n、SKILL.md 前置注释等;调用 bulk_symlink_fixer.py 检测并修复文本式 stand-in 与失效软链接;检查自演化策略合规、evals.json 应使用 should_trigger 布尔 schema、SKILL.md 行数、过期技能引用、ADR-003 目录软链接禁止;审计 marketplace.json 源路径;手动检查目录结构、JSON、硬编码凭证、绝对路径与命名规范。

使用方式:需 Python 3.8+ 与标准库,无外部依赖。示例:pip-compile ./requirements.in;pip install -r ./requirements.txt。常用命令:python ${CLAUDE_PLUGIN_ROOT}/scripts/validate_agent.py agents/my-agent.md;python ${CLAUDE_PLUGIN_ROOT}/scripts/validate_hook_schema.py hooks/hooks.json;python ${CLAUDE_PLUGIN_ROOT}/scripts/hook_linter.py hooks/;python ${CLAUDE_PLUGIN_ROOT}/scripts/fix_plugin_load_errors.py <plugin_root>;python3 ${CLAUDE_PLUGIN_ROOT}/scripts/audit_marketplace_sources.py <repo_root>。修复后重新验证直至 0 个 Critical。

报告含摘要、Critical、Warnings、组件统计、正面发现与总体评估。限制:软链接修复器有静默失败模式(symlink_manager.py 恒返回 0),需手动用 find 核验;stand-in 需区分目标存在与否;确定若干探索类插件的缺失源文件 stand-in 应保持原样。修复源文件并重装(uvx plugin-add)是唯一可靠修复方式,因缓存会扫描 ~/.claude/plugins/cache/ 下所有版本。其他功能与收费信息暂未提供。