@yottameta/yotta-vetter 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,14 @@
1
+ # 更新日志
2
+
3
+ ## v0.1.0 (2026-08-26)
4
+
5
+ YottaMeta 自有实现首版(重写自第三方技术包 skill-vetter v2.0.0,已完全重写,无上游代码):
6
+
7
+ - check:四阶段初审(来源/代码/权限/风险)+ 危险模式规则扫描 + SKILL VETTING REPORT 报告。
8
+ - 危险模式规则与 yotta-security-audit(元安)共用(vetter_rules.py 为 audit_rules.py 的同步副本)。
9
+ - 联动元安(V3):初审发现 high 及以上,输出深度扫描引导命令。
10
+ - source(V4):GitHub 仓库来源半自动化检查(stars/更新时间/许可证),本地缓存,无网络自动降级。
11
+ - 输出:文本 / --json / --report report.md(SKILL VETTING REPORT 模板,含结论/决策记录/时间戳/审查者)。
12
+ - 零依赖(Python 3.8+ 标准库),Windows + Linux 通用,UTF-8 加固(GBK 控制台不崩)。
13
+ - exit code 语义与元安一致:0=干净/仅 low,1=medium,2=high,3=critical,4=错误。
14
+ - 版权:YottaMeta 纯自有 MIT + NOTICE 品牌声明;README 一行上游致谢。
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 YottaMeta
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,11 @@
1
+ # NOTICE — YottaMeta 品牌声明
2
+
3
+ 「YottaMeta」「元忆」「yotta-memory」「元审」「yotta-vetter」「元安」「元阁」以及本家族各技能名称(yotta-* 前缀)是 YottaMeta 的品牌与标识。
4
+
5
+ 本软件以 MIT 许可证开源,任何人均可自由使用、修改与分发。若你在其基础上制作派生作品:
6
+
7
+ 1. 不得继续使用 YottaMeta 或本家族名称(yotta-*、元忆、元审 等)作为派生作品的名称;
8
+ 2. 不得暗示派生作品由 YottaMeta 官方维护、认可或与之存在关联;
9
+ 3. 建议在派生作品中明确声明「与 YottaMeta 官方无关联」。
10
+
11
+ 上游来源致谢:本技能为 YottaMeta 全新实现,审查协议参考开源社区的 skill-vetter 类技能思路,无上游代码。
package/README.md ADDED
@@ -0,0 +1,64 @@
1
+ <p align="center">
2
+ <img src="assets/banner.png" alt="yotta-vetter banner" width="100%" />
3
+ </p>
4
+
5
+ # yotta-vetter(元审)
6
+
7
+ 安装任何技能前的「安全审查协议」:四阶段 checklist(来源→代码→权限→风险)+ 轻量 checker,与元安(yotta-security-audit)联动深度扫描。
8
+
9
+ - **check**:四阶段初审 + SKILL VETTING REPORT(含结论/决策记录/时间戳/审查者)。
10
+ - **source**:GitHub 仓库来源半自动化检查,本地缓存,无网络自动降级。
11
+ - **规则共用**:危险模式规则与元安同源(vetter_rules.py 为 audit_rules.py 的同步副本)。
12
+ - **零依赖**:Python 3.8+ 标准库,Windows + Linux 通用。
13
+
14
+ ## 安装
15
+
16
+ 本技能为「技能包」:先装到你的智能体技能目录,再由智能体按需调用其中的脚本。
17
+
18
+ ### 方式一:npm(推荐,Windows / Linux / macOS)
19
+
20
+ ```bash
21
+ npx -y @yottameta/yotta-vetter --agent codex # 装到 Codex
22
+ npx -y @yottameta/yotta-vetter --agent claude # 装到 Claude Code
23
+ npx -y @yottameta/yotta-vetter --agent cursor # 装到 Cursor
24
+ npx -y @yottameta/yotta-vetter -g # 装到全部已知智能体
25
+ npx -y @yottameta/yotta-vetter --list # 查看智能体 → 默认目录
26
+ ```
27
+
28
+ ### 方式二:install.sh(Linux / macOS)
29
+
30
+ ```bash
31
+ git clone https://github.com/YottaMeta/yotta-vetter.git
32
+ cd yotta-vetter
33
+ bash install.sh --agent codex # 或 --agent claude / --dir <路径> / -g
34
+ ```
35
+
36
+ ### 方式三:手动复制
37
+
38
+ 把本仓库内容复制到你的智能体技能目录(Claude Code ~/.claude/skills/、Cursor ~/.cursor/skills/、Codex ~/.codex/skills/ 或 $CODEX_HOME/skills、通用 ~/.agents/skills/)。
39
+
40
+ ## 快速使用
41
+
42
+ ```bash
43
+ python3 scripts/yotta_vetter.py check ./some-skill
44
+ python3 scripts/yotta_vetter.py check ./some-skill --json --report report.md
45
+ python3 scripts/yotta_vetter.py source github:YottaMeta/yotta-memory
46
+ ```
47
+
48
+ ## 与元安的关系
49
+
50
+ - 元审负责「安装前初审 + 来源检查 + 结构化报告」;
51
+ - 元安负责「技能深度扫描(13 类检测器)+ 系统安全基线」;
52
+ - 元审发现 high 及以上会输出命令引导跑元安。
53
+
54
+ ## 测试
55
+
56
+ ```bash
57
+ python3 scripts/test_yotta_vetter.py
58
+ ```
59
+
60
+ ## 许可证与品牌
61
+
62
+ - MIT License(Copyright © 2026 YottaMeta),详见 LICENSE。
63
+ - 品牌声明见 NOTICE:YottaMeta / 元忆 / 元审 / yotta-* 为 YottaMeta 品牌,派生作品须改名并声明无关联。
64
+ - 上游来源致谢:审查协议参考开源社区 skill-vetter 类技能思路,实现为 YottaMeta 自有。
package/SKILL.md ADDED
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: yotta-vetter
3
+ version: 0.1.0
4
+ description: 元审 —— 安装任何技能前的安全审查协议:四阶段 checklist(来源→代码→权限→风险)+ 轻量 checker,与元安联动深度扫描。触发:安装/评估任何技能前、从市场或 GitHub 获取技能、审查他人分享的技能、任何「要装未知代码」的场景;或用户说 审查/审查技能/vetting/技能安全审查/检查技能 等。边界:checker 只做初审与报告,结论需人工确认;绝不代替最终决策。
5
+ license: MIT
6
+ ---
7
+
8
+ # 元审(yotta-vetter)
9
+
10
+ 安装任何技能前的「安全审查协议」——四阶段 checklist + 轻量检查脚本,与元安(yotta-security-audit)联动:
11
+
12
+ - **check**:对技能目录做四阶段初审(来源/代码/权限/风险),输出 SKILL VETTING REPORT。
13
+ - **source**:GitHub 仓库来源半自动化检查(stars/更新时间/许可证),本地缓存,无网络自动降级。
14
+ - **联动元安**:初审发现 high 及以上风险时,输出一条命令引导跑 yotta-security-audit 深度扫描。
15
+
16
+ 零依赖(Python 3.8+ 标准库),Windows + Linux 通用。危险模式规则与元安共用(scripts/vetter_rules.py 为同步副本,勿手改)。
17
+
18
+ ## 何时使用
19
+
20
+ - 从技能市场、GitHub 或任何来源获取技能后、安装前;
21
+ - 评估他人分享的技能是否安全;
22
+ - 需要给「要不要装这个技能」一个结构化决策依据时。
23
+
24
+ **Do NOT trigger**:本工具只做审查与报告,不执行安装、修复或删除;最终结论必须由人类确认。
25
+
26
+ ## 四阶段审查协议
27
+
28
+ | 阶段 | 检查点 | 对应命令/参考 |
29
+ |---|---|---|
30
+ | 1. 来源 | 来源平台、作者信誉、stars/更新时间、许可证 | source github:owner/repo;references/checklist.md |
31
+ | 2. 代码 | SKILL.md 完整性、脚本清单、危险模式规则扫描 | check <path> |
32
+ | 3. 权限 | 可执行位、全局可写、符号链接、需读取/写入/联网的范围 | check <path> |
33
+ | 4. 风险 | 风险等级判定 + 结论 + 决策记录 | 报告中的 结论/决策记录 段 |
34
+
35
+ ## 快速使用
36
+
37
+ ```bash
38
+ # 初审一个技能目录
39
+ python3 scripts/yotta_vetter.py check ./some-skill
40
+
41
+ # 输出 JSON + 生成报告文件
42
+ python3 scripts/yotta_vetter.py check ./some-skill --json --report report.md
43
+
44
+ # 只报告 high 及以上
45
+ python3 scripts/yotta_vetter.py check ./some-skill --severity high
46
+
47
+ # 来源半自动化检查(本地缓存,无网络自动降级)
48
+ python3 scripts/yotta_vetter.py source github:YottaMeta/yotta-memory
49
+ ```
50
+
51
+ ## 结论判定
52
+
53
+ | 风险等级 | 结论 | 动作 |
54
+ |---|---|---|
55
+ | critical | DO NOT INSTALL | 拒绝安装并人工复核 |
56
+ | high | INSTALL WITH CAUTION | 人工复核后决定 |
57
+ | medium | REVIEW REQUIRED | 复核后安装 |
58
+ | low/info | SAFE TO INSTALL | 仍建议按协议完整审查 |
59
+
60
+ exit code 与元安一致:0 = 干净/仅 low;1 = medium;2 = high;3 = critical;4 = 错误。
61
+
62
+ ## 与元安的分工
63
+
64
+ - 元审 = 初审:快、轻,四阶段 checklist + 规则扫描 + 来源检查。
65
+ - 元安 = 深度扫描:13 类检测器 + 系统安全基线。
66
+ - 元审发现 high 及以上 → 输出命令引导跑元安深度扫描。
67
+
68
+ ## 自扫说明
69
+
70
+ 元审自身含来源检查功能(source 命令使用标准库 urllib 访问 GitHub API)。
71
+ 用元审或元安自扫时会命中 urllib 网络调用提示(medium),属预期行为,非风险。
72
+
73
+ ## 参考文档
74
+
75
+ - references/checklist.md — 四阶段详细清单
76
+ - references/vetting-report-template.md — SKILL VETTING REPORT 模板
package/bin/install.js ADDED
@@ -0,0 +1,163 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * yotta-vetter(元审)跨平台安装器(YottaSkills)
4
+ * 用法:
5
+ * npx -y @yottameta/yotta-security-audit --agent <name> # 按智能体默认用户级目录安装(推荐)
6
+ * npx -y @yottameta/yotta-security-audit --dir PATH # 装到指定目录(用户改了目录的智能体)
7
+ * npx -y @yottameta/yotta-security-audit -g # 安装到全部已知智能体用户级目录
8
+ * npx -y @yottameta/yotta-security-audit # 安装到检测到的项目级目录
9
+ * npx -y @yottameta/yotta-security-audit --list # 列出智能体 -> 默认目录
10
+ */
11
+ 'use strict';
12
+ const fs = require('fs');
13
+ const path = require('path');
14
+ const os = require('os');
15
+
16
+ const SKILL_NAME = 'yotta-vetter';
17
+ const PKG_ROOT = path.join(__dirname, '..');
18
+
19
+ // 智能体 -> 用户级默认技能目录(dirs 按优先级排列;--agent 装到第一个)
20
+ // 依据官方文档:.agents/skills 并非通用目录,被 OpenCode / Cursor / Cline / Amp /
21
+ // Kimi / Gemini CLI / GitHub Copilot 等读取;Claude Code 与 Codex 默认不读 .agents。
22
+ const AGENT_DIRS = {
23
+ claude: { label: 'Claude Code', dirs: ['.claude/skills'] },
24
+ cursor: { label: 'Cursor', dirs: ['.cursor/skills', '.agents/skills'] },
25
+ codex: { label: 'Codex', dirs: ['.codex/skills'] }, // 特判:$CODEX_HOME/skills
26
+ gemini: { label: 'Gemini CLI', dirs: ['.gemini/skills', '.agents/skills'] },
27
+ goose: { label: 'Goose', dirs: ['.config/goose/skills', '.agents/skills'] },
28
+ amp: { label: 'Amp', dirs: ['.config/agents/skills', '.agents/skills'] },
29
+ opencode: { label: 'OpenCode', dirs: ['.config/opencode/skills'] }, // 特判:$XDG_CONFIG_HOME
30
+ windsurf: { label: 'Windsurf', dirs: ['.codeium/windsurf/skills'] },
31
+ workbuddy: { label: 'WorkBuddy', dirs: ['.workbuddy/skills'] },
32
+ kiro: { label: 'Kiro', dirs: ['.kiro/skills'] },
33
+ trae: { label: 'Trae Code CLI', dirs: ['.traecli/skills'] },
34
+ 'trae-cn': { label: 'Trae IDE(国内)', dirs: ['.trae-cn/skills'] },
35
+ qwen: { label: 'Qwen Code', dirs: ['.qwen/skills'] },
36
+ comate: { label: 'Comate 文心快码', dirs: ['.comate/skills'] },
37
+ codebuddy: { label: 'CodeBuddy Code', dirs: ['.codebuddy/skills'] },
38
+ kimi: { label: 'Kimi Code CLI', dirs: ['.kimi/skills'] },
39
+ agents: { label: '通用 AGENTS.md', dirs: ['.agents/skills'] },
40
+ };
41
+
42
+ // Codex 用户级目录特判:优先 $CODEX_HOME/skills,否则 ~/.codex/skills
43
+ function codexUserDir() {
44
+ const base = process.env.CODEX_HOME || path.join(os.homedir(), '.codex');
45
+ return path.join(base, 'skills');
46
+ }
47
+
48
+ // OpenCode 用户级目录特判:优先 $XDG_CONFIG_HOME/opencode/skills,否则 ~/.config/opencode/skills
49
+ function opencodeUserDir() {
50
+ const base = process.env.XDG_CONFIG_HOME || path.join(os.homedir(), '.config');
51
+ return path.join(base, 'opencode', 'skills');
52
+ }
53
+
54
+ function resolveUserDir(rel) {
55
+ if (rel === '.codex/skills') return codexUserDir();
56
+ if (rel === '.config/opencode/skills') return opencodeUserDir();
57
+ return path.join(os.homedir(), rel);
58
+ }
59
+
60
+ function installTo(dest) {
61
+ const target = path.join(dest, SKILL_NAME);
62
+ fs.mkdirSync(target, { recursive: true });
63
+ copyDir(PKG_ROOT, target, new Set(['package.json', 'bin', 'node_modules', '.git']));
64
+ console.log('installed -> ' + target);
65
+ }
66
+
67
+ function copyDir(src, dst, skip) {
68
+ for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
69
+ if (skip.has(entry.name)) continue;
70
+ const s = path.join(src, entry.name);
71
+ const d = path.join(dst, entry.name);
72
+ if (entry.isDirectory()) {
73
+ fs.mkdirSync(d, { recursive: true });
74
+ copyDir(s, d, skip);
75
+ } else if (entry.isFile()) {
76
+ fs.copyFileSync(s, d);
77
+ }
78
+ }
79
+ }
80
+
81
+ function displayDir(rel) {
82
+ if (process.platform === 'win32') return '%USERPROFILE%\\' + rel.replace(/\//g, '\\');
83
+ return '~/' + rel;
84
+ }
85
+
86
+ function main() {
87
+ const args = process.argv.slice(2);
88
+ const isGlobal = args.includes('-g') || args.includes('--global');
89
+ const list = args.includes('--list') || args.includes('-l');
90
+ let explicitDir = null;
91
+ const di = args.indexOf('--dir');
92
+ if (di !== -1 && args[di + 1]) explicitDir = args[di + 1];
93
+ let agent = null;
94
+ const ai = args.indexOf('--agent');
95
+ if (ai !== -1 && args[ai + 1]) agent = String(args[ai + 1]).toLowerCase();
96
+
97
+ if (list) {
98
+ console.log('智能体 -> 默认技能目录(--agent <name> 装到第一个,用户级):');
99
+ for (const [key, v] of Object.entries(AGENT_DIRS)) {
100
+ const resolved = v.dirs.map(displayDir);
101
+ console.log(' ' + key.padEnd(10) + v.label.padEnd(18) + resolved.join('、'));
102
+ }
103
+ console.log('\n说明:Windows 用 %USERPROFILE%,Linux/macOS 用 ~;仅收录有官方默认目录的智能体。');
104
+ console.log('改了目录的请用 --dir <路径>,不要依赖默认位置;若设置了 CODEX_HOME / XDG_CONFIG_HOME,安装自动以该变量为准。');
105
+ return;
106
+ }
107
+
108
+ if (explicitDir) { installTo(explicitDir); return; }
109
+
110
+ if (agent) {
111
+ const info = AGENT_DIRS[agent];
112
+ if (!info) {
113
+ console.log('未收录智能体: ' + agent + '。请用 --dir <路径> 指定技能目录。');
114
+ console.log('可用: ' + Object.keys(AGENT_DIRS).join(', '));
115
+ return;
116
+ }
117
+ installTo(resolveUserDir(info.dirs[0]));
118
+ console.log('完成。');
119
+ return;
120
+ }
121
+
122
+ if (isGlobal) {
123
+ const seen = new Set();
124
+ for (const v of Object.values(AGENT_DIRS)) {
125
+ for (const d of v.dirs) {
126
+ if (seen.has(d)) continue;
127
+ seen.add(d);
128
+ installTo(resolveUserDir(d));
129
+ }
130
+ }
131
+ console.log('完成。');
132
+ return;
133
+ }
134
+
135
+ const PROJECT_DIRS = [
136
+ '.claude/skills',
137
+ '.cursor/skills',
138
+ '.codex/skills',
139
+ '.config/goose/skills',
140
+ '.config/agents/skills',
141
+ '.opencode/skills',
142
+ '.codeium/windsurf/skills',
143
+ '.workbuddy/skills',
144
+ '.kiro/skills',
145
+ '.traecli/skills',
146
+ '.gemini/skills',
147
+ '.trae-cn/skills',
148
+ '.qwen/skills',
149
+ '.comate/skills',
150
+ '.codebuddy/skills',
151
+ '.kimi/skills',
152
+ '.agents/skills',
153
+ ];
154
+ let installedAny = false;
155
+ for (const d of PROJECT_DIRS) {
156
+ if (fs.existsSync(d)) { installTo(d); installedAny = true; }
157
+ }
158
+ if (!installedAny) {
159
+ console.log('未检测到项目级智能体目录。可手动复制,或用 --agent <name> / -g 装到用户级。');
160
+ }
161
+ }
162
+
163
+ main();
package/install.sh ADDED
@@ -0,0 +1,132 @@
1
+ #!/usr/bin/env bash
2
+ # yotta-vetter(元审)多智能体安装脚本(YottaSkills)
3
+ # 用法:
4
+ # bash install.sh --agent <name> # 按智能体默认用户级目录安装
5
+ # bash install.sh --dir <path> # 装到指定目录(用户改过目录的智能体)
6
+ # bash install.sh -g # 装到全部已知智能体用户级目录
7
+ # bash install.sh # 检测并安装到已存在的项目级目录
8
+ # bash install.sh --list # 列出智能体 -> 默认目录
9
+ set -euo pipefail
10
+
11
+ SKILL_NAME="yotta-vetter"
12
+ SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
13
+ case "$(uname -s)" in
14
+ MINGW*|MSYS*)
15
+ SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -W)"
16
+ ;;
17
+ esac
18
+
19
+ # 智能体 -> 用户级默认目录(--agent 装到第一个)
20
+ # .agents/skills 并非通用目录:OpenCode / Cursor / Cline / Amp / Kimi / Gemini CLI / GitHub Copilot 读取。
21
+ # 判断当前环境:Windows Git Bash 用 %USERPROFILE%,Unix 用 ~
22
+ _IS_WINDOWS=0
23
+ case "$(uname -s)" in
24
+ MINGW*|MSYS*|CYGWIN*) _IS_WINDOWS=1 ;;
25
+ esac
26
+ dirs_for() {
27
+ case "$1" in
28
+ claude) echo ".claude/skills" ;;
29
+ cursor) echo ".cursor/skills .agents/skills" ;;
30
+ codex) echo "__CODEX__" ;;
31
+ gemini) echo ".gemini/skills .agents/skills" ;;
32
+ goose) echo ".config/goose/skills .agents/skills" ;;
33
+ amp) echo ".config/agents/skills .agents/skills" ;;
34
+ opencode) echo "__OPENCODE__" ;;
35
+ windsurf) echo ".codeium/windsurf/skills" ;;
36
+ workbuddy) echo ".workbuddy/skills" ;;
37
+ kiro) echo ".kiro/skills" ;;
38
+ trae) echo ".traecli/skills" ;;
39
+ trae-cn) echo ".trae-cn/skills" ;;
40
+ qwen) echo ".qwen/skills" ;;
41
+ comate) echo ".comate/skills" ;;
42
+ codebuddy) echo ".codebuddy/skills" ;;
43
+ kimi) echo ".kimi/skills" ;;
44
+ agents) echo ".agents/skills" ;;
45
+ *) return 1 ;;
46
+ esac
47
+ }
48
+
49
+ codex_dir() {
50
+ if [ -n "${CODEX_HOME:-}" ]; then printf '%s' "$CODEX_HOME/skills"; else printf '%s' "$HOME/.codex/skills"; fi
51
+ }
52
+ opencode_dir() {
53
+ if [ -n "${XDG_CONFIG_HOME:-}" ]; then printf '%s' "$XDG_CONFIG_HOME/opencode/skills"; else printf '%s' "$HOME/.config/opencode/skills"; fi
54
+ }
55
+ resolve_user() {
56
+ case "$1" in
57
+ __CODEX__) codex_dir ;;
58
+ __OPENCODE__) opencode_dir ;;
59
+ *) printf '%s' "$HOME/$1" ;;
60
+ esac
61
+ }
62
+
63
+ install_to() {
64
+ mkdir -p "$1/$SKILL_NAME"
65
+ cp -r "$SOURCE_DIR/." "$1/$SKILL_NAME/"
66
+ rm -rf "$1/$SKILL_NAME/.git"
67
+ echo "installed -> $1/$SKILL_NAME"
68
+ }
69
+
70
+ list() {
71
+ echo "智能体 -> 默认技能目录(--agent <name> 装到第一个,用户级):"
72
+ for a in claude cursor codex gemini goose amp opencode windsurf workbuddy kiro trae trae-cn qwen comate codebuddy kimi agents; do
73
+ local dirs first
74
+ dirs="$(dirs_for "$a")"
75
+ first="${dirs%% *}"
76
+ case "$first" in
77
+ __CODEX__) first=".codex/skills" ;;
78
+ __OPENCODE__) first=".config/opencode/skills" ;;
79
+ esac
80
+ if [ "$_IS_WINDOWS" = "1" ]; then
81
+ first="%USERPROFILE%\\${first//\//\\}"
82
+ else
83
+ first="~/$first"
84
+ fi
85
+ printf ' %-10s %s\n' "$a" "$first"
86
+ done
87
+ echo '说明:Windows 用 %USERPROFILE%,Linux/macOS 用 ~;仅收录有官方默认目录的智能体。'
88
+ echo '改了目录的请用 --dir <路径>,不要依赖默认位置;若设置了 CODEX_HOME / XDG_CONFIG_HOME,安装自动以该变量为准。'
89
+ }
90
+
91
+ main() {
92
+ local agent="" dir="" global=0 show_list=0
93
+ while [ $# -gt 0 ]; do
94
+ case "$1" in
95
+ --agent) shift; agent="${1:-}" ;;
96
+ --dir) shift; dir="${1:-}" ;;
97
+ -g|--global) global=1 ;;
98
+ --list|-l) show_list=1 ;;
99
+ *) echo "未知参数: $1" >&2; exit 2 ;;
100
+ esac
101
+ shift
102
+ done
103
+
104
+ if [ "$show_list" = "1" ]; then list; return; fi
105
+ if [ -n "$dir" ]; then install_to "$dir"; echo "完成。"; return; fi
106
+ if [ -n "$agent" ]; then
107
+ local dirs first
108
+ if ! dirs="$(dirs_for "$agent")"; then
109
+ echo "未收录智能体: $agent。请用 --dir <路径> 指定技能目录。" >&2; exit 2
110
+ fi
111
+ first="${dirs%% *}"
112
+ install_to "$(resolve_user "$first")"; echo "完成。"; return
113
+ fi
114
+ if [ "$global" = "1" ]; then
115
+ echo "安装到全部已知智能体用户级目录..."
116
+ local dirs rel
117
+ for a in claude cursor codex gemini goose amp opencode windsurf workbuddy kiro trae trae-cn qwen comate codebuddy kimi agents; do
118
+ dirs="$(dirs_for "$a")"
119
+ for rel in $dirs; do install_to "$(resolve_user "$rel")"; done
120
+ done
121
+ echo "完成。"; return
122
+ fi
123
+ local installed=0 d
124
+ for d in .claude/skills .cursor/skills .codex/skills .config/goose/skills .config/agents/skills .opencode/skills .codeium/windsurf/skills .workbuddy/skills .kiro/skills .traecli/skills .gemini/skills .trae-cn/skills .qwen/skills .comate/skills .codebuddy/skills .kimi/skills .agents/skills; do
125
+ if [ -d "$d" ]; then install_to "$d"; installed=1; fi
126
+ done
127
+ if [ "$installed" = "0" ]; then
128
+ echo "未检测到项目级智能体目录。可用 --agent <name> / -g 装到用户级,或 --dir 指定。"
129
+ fi
130
+ }
131
+
132
+ main "$@"
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@yottameta/yotta-vetter",
3
+ "version": "0.1.0",
4
+ "description": "元审 —— 安装任何技能前的安全审查协议:四阶段 checklist + 轻量 checker,与元安联动深度扫描。",
5
+ "license": "MIT",
6
+ "keywords": [
7
+ "agent-skills",
8
+ "yotta-vetter",
9
+ "skill-vetting",
10
+ "security",
11
+ "supply-chain",
12
+ "yottaskills"
13
+ ],
14
+ "files": [
15
+ "SKILL.md",
16
+ "LICENSE",
17
+ "NOTICE",
18
+ "README.md",
19
+ "CHANGELOG.md",
20
+ "install.sh",
21
+ "references",
22
+ "scripts",
23
+ "bin"
24
+ ],
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/YottaMeta/yotta-vetter.git"
28
+ },
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "bin": {
33
+ "yotta-vetter": "bin/install.js"
34
+ }
35
+ }
@@ -0,0 +1,43 @@
1
+ # 技能审查清单(四阶段)
2
+
3
+ ## 第一阶段:来源检查
4
+
5
+ - [ ] 来源平台:技能市场 / GitHub / 其他
6
+ - [ ] 作者信誉:已知作者 / 新作者 / 匿名
7
+ - [ ] 下载量 / stars:高(>1000) / 中(100-1000) / 低(<100)
8
+ - [ ] 最后更新:最近(30 天内) / 较近(90 天内) / 很久以前
9
+ - [ ] 许可证:MIT / Apache / GPL / 其他 / 无
10
+ - [ ] 是否已归档(不再维护)
11
+
12
+ ## 第二阶段:代码审查
13
+
14
+ - [ ] SKILL.md 存在,frontmatter name 与目录名一致
15
+ - [ ] 描述清晰、版本号有、目录结构合理
16
+ - [ ] 危险模式扫描:下载后执行 / 动态求值 / 数据外传 / 凭据访问 / 持久化 / 提权 / 混淆
17
+ - [ ] 安装钩子:npm 生命周期脚本、安装自定义命令类
18
+ - [ ] 隐藏字符:零宽字符、双向覆盖字符
19
+ - [ ] 依赖声明与必要性
20
+
21
+ ## 第三阶段:权限评估
22
+
23
+ - [ ] 需要读取哪些文件(最小化?)
24
+ - [ ] 需要写入哪些文件(最小化?)
25
+ - [ ] 需要联网吗?目标地址可信吗?
26
+ - [ ] 需要执行哪些命令?需要提权吗?
27
+ - [ ] 可执行位 / 全局可写 / 符号链接是否异常
28
+
29
+ ## 第四阶段:风险判定与决策
30
+
31
+ - [ ] 风险等级:低 / 中 / 高 / 极高
32
+ - [ ] 结论:SAFE TO INSTALL / REVIEW REQUIRED / INSTALL WITH CAUTION / DO NOT INSTALL
33
+ - [ ] 决策理由已记录
34
+ - [ ] 时间戳与审查者已记录
35
+ - [ ] 报告已保存(供后续追溯)
36
+
37
+ ## 注意事项
38
+
39
+ 1. 零信任:默认不信任,先验证再安装。
40
+ 2. 最小权限:只授予功能所需的权限。
41
+ 3. 持续监控:安装后仍关注行为与更新。
42
+ 4. 及时更新:关注安全通告。
43
+ 5. 备份恢复:重要系统做好备份。
@@ -0,0 +1,41 @@
1
+ # SKILL VETTING REPORT 模板
2
+
3
+ check --report 生成的报告遵循本结构;人工审查也可直接套用。
4
+
5
+ ```markdown
6
+ # SKILL VETTING REPORT
7
+
8
+ - 技能: <名称>
9
+ - 路径: <目录>
10
+ - 来源: <平台 / github:owner/repo>
11
+ - 审查时间: <ISO 8601>
12
+ - 审查者: <人名/角色>
13
+ - 文件数: <N>
14
+
15
+ ## 结论
16
+
17
+ - 风险等级: <LOW / MEDIUM / HIGH / CRITICAL>
18
+ - 结论: <SAFE TO INSTALL / REVIEW REQUIRED / INSTALL WITH CAUTION / DO NOT INSTALL>
19
+ - 决策记录: <一句决策理由>
20
+
21
+ ## 汇总
22
+
23
+ | 级别 | 数量 |
24
+ |---|---|
25
+ | CRITICAL | N |
26
+ | HIGH | N |
27
+ | MEDIUM | N |
28
+ | LOW | N |
29
+ | INFO | N |
30
+
31
+ ## 发现
32
+
33
+ 逐条:级别 · 规则 · 位置 · 描述
34
+
35
+ ## 决策记录
36
+
37
+ - [ ] 已人工复核发现项
38
+ - [ ] 已确认来源可信度
39
+ - [ ] 已确认权限范围最小化
40
+ - [ ] 审查结论与理由已记录(时间戳/审查者)
41
+ ```