@yottameta/yotta-resume 0.0.0 → 0.1.2

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.
@@ -0,0 +1,135 @@
1
+ {
2
+ "schema_version": "1.0",
3
+ "contract_version": "1.0",
4
+ "generated_at": "2026-11-21",
5
+ "sources": [
6
+ {
7
+ "source_id": "nist-nice-2-2-0",
8
+ "layer": "A",
9
+ "title": "NIST NICE Framework 2.2.0",
10
+ "publisher": "NIST",
11
+ "url": "https://www.nist.gov/itl/applied-cybersecurity/nice/nice-framework-resource-center/nice-framework-current-versions",
12
+ "published_at": "2025-04-28",
13
+ "retrieved_at": "2026-11-21",
14
+ "last_verified_at": "2026-11-21",
15
+ "refresh_interval_days": 30,
16
+ "stale_after_days": 90,
17
+ "usage_policy": "facts_only",
18
+ "license_review_status": "review_required",
19
+ "status": "active",
20
+ "notes": "用于岗位族与工作角色映射;不复制大段原文。"
21
+ },
22
+ {
23
+ "source_id": "nist-csf-2-0",
24
+ "layer": "A",
25
+ "title": "NIST Cybersecurity Framework 2.0",
26
+ "publisher": "NIST",
27
+ "url": "https://www.nist.gov/cyberframework",
28
+ "published_at": "2024-02-26",
29
+ "retrieved_at": "2026-11-21",
30
+ "last_verified_at": "2026-11-21",
31
+ "refresh_interval_days": 30,
32
+ "stale_after_days": 90,
33
+ "usage_policy": "facts_only",
34
+ "license_review_status": "review_required",
35
+ "status": "active",
36
+ "notes": "用于治理、风险和防御控制维度的自主改写。"
37
+ },
38
+ {
39
+ "source_id": "owasp-top10-2025",
40
+ "layer": "A",
41
+ "title": "OWASP Top 10:2025",
42
+ "publisher": "OWASP Foundation",
43
+ "url": "https://owasp.org/Top10/",
44
+ "published_at": null,
45
+ "retrieved_at": "2026-11-21",
46
+ "last_verified_at": "2026-11-21",
47
+ "refresh_interval_days": 30,
48
+ "stale_after_days": 90,
49
+ "usage_policy": "facts_only",
50
+ "license_review_status": "review_required",
51
+ "status": "active",
52
+ "notes": "页面为持续更新资源;具体发布日期未在本地 registry 固化。"
53
+ },
54
+ {
55
+ "source_id": "owasp-wstg",
56
+ "layer": "A",
57
+ "title": "OWASP Web Security Testing Guide",
58
+ "publisher": "OWASP Foundation",
59
+ "url": "https://owasp.org/www-project-web-security-testing-guide/",
60
+ "published_at": null,
61
+ "retrieved_at": "2026-11-21",
62
+ "last_verified_at": "2026-11-21",
63
+ "refresh_interval_days": 30,
64
+ "stale_after_days": 90,
65
+ "usage_policy": "facts_only",
66
+ "license_review_status": "review_required",
67
+ "status": "active",
68
+ "notes": "用于测试方法维度;题目须自主改写并标明来源。"
69
+ },
70
+ {
71
+ "source_id": "mitre-attack-v18",
72
+ "layer": "A",
73
+ "title": "MITRE ATT&CK v18",
74
+ "publisher": "MITRE",
75
+ "url": "https://attack.mitre.org/",
76
+ "published_at": null,
77
+ "retrieved_at": "2026-11-21",
78
+ "last_verified_at": "2026-11-21",
79
+ "refresh_interval_days": 30,
80
+ "stale_after_days": 90,
81
+ "usage_policy": "facts_only",
82
+ "license_review_status": "review_required",
83
+ "status": "active",
84
+ "notes": "版本号依据本地研发资料登记;题目使用时须再次核对当前版本。"
85
+ },
86
+ {
87
+ "source_id": "cwe-top25-2025",
88
+ "layer": "A",
89
+ "title": "CWE Top 25 2025",
90
+ "publisher": "MITRE",
91
+ "url": "https://cwe.mitre.org/top25/",
92
+ "published_at": null,
93
+ "retrieved_at": "2026-11-21",
94
+ "last_verified_at": "2026-11-21",
95
+ "refresh_interval_days": 30,
96
+ "stale_after_days": 90,
97
+ "usage_policy": "facts_only",
98
+ "license_review_status": "review_required",
99
+ "status": "active",
100
+ "notes": "用于应用安全和风险分类;不复制 CWE 全文。"
101
+ },
102
+ {
103
+ "source_id": "cisa-kev",
104
+ "layer": "A",
105
+ "title": "CISA Known Exploited Vulnerabilities Catalog",
106
+ "publisher": "CISA",
107
+ "url": "https://www.cisa.gov/known-exploited-vulnerabilities-catalog",
108
+ "published_at": null,
109
+ "retrieved_at": "2026-11-21",
110
+ "last_verified_at": "2026-11-21",
111
+ "refresh_interval_days": 7,
112
+ "stale_after_days": 14,
113
+ "usage_policy": "facts_only",
114
+ "license_review_status": "review_required",
115
+ "status": "active",
116
+ "notes": "高风险漏洞题按短周期复核;不得把历史条目冒充最新。"
117
+ },
118
+ {
119
+ "source_id": "cnvd",
120
+ "layer": "A",
121
+ "title": "国家信息安全漏洞共享平台",
122
+ "publisher": "CNVD",
123
+ "url": "https://www.cnvd.org.cn/",
124
+ "published_at": null,
125
+ "retrieved_at": "2026-11-21",
126
+ "last_verified_at": "2026-11-21",
127
+ "refresh_interval_days": 7,
128
+ "stale_after_days": 14,
129
+ "usage_policy": "link_only",
130
+ "license_review_status": "review_required",
131
+ "status": "active",
132
+ "notes": "站点存在验证码保护;只做人工可访问来源登记,不绕过。"
133
+ }
134
+ ]
135
+ }
@@ -0,0 +1,122 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/YottaMeta/yotta-resume/data/source-registry.schema.json",
4
+ "title": "yotta-resume source registry",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema_version",
9
+ "contract_version",
10
+ "generated_at",
11
+ "sources"
12
+ ],
13
+ "properties": {
14
+ "schema_version": {
15
+ "const": "1.0"
16
+ },
17
+ "contract_version": {
18
+ "const": "1.0"
19
+ },
20
+ "generated_at": {
21
+ "type": "string",
22
+ "format": "date"
23
+ },
24
+ "sources": {
25
+ "type": "array",
26
+ "minItems": 1,
27
+ "items": {
28
+ "type": "object",
29
+ "additionalProperties": false,
30
+ "required": [
31
+ "source_id",
32
+ "layer",
33
+ "title",
34
+ "publisher",
35
+ "url",
36
+ "published_at",
37
+ "retrieved_at",
38
+ "last_verified_at",
39
+ "refresh_interval_days",
40
+ "stale_after_days",
41
+ "usage_policy",
42
+ "license_review_status",
43
+ "status"
44
+ ],
45
+ "properties": {
46
+ "source_id": {
47
+ "type": "string",
48
+ "pattern": "^[a-z0-9][a-z0-9-]{2,63}$"
49
+ },
50
+ "layer": {
51
+ "enum": [
52
+ "A",
53
+ "B",
54
+ "C",
55
+ "D"
56
+ ]
57
+ },
58
+ "title": {
59
+ "type": "string",
60
+ "minLength": 1
61
+ },
62
+ "publisher": {
63
+ "type": "string",
64
+ "minLength": 1
65
+ },
66
+ "url": {
67
+ "type": "string",
68
+ "pattern": "^https://"
69
+ },
70
+ "published_at": {
71
+ "type": [
72
+ "string",
73
+ "null"
74
+ ],
75
+ "format": "date"
76
+ },
77
+ "retrieved_at": {
78
+ "type": "string",
79
+ "format": "date"
80
+ },
81
+ "last_verified_at": {
82
+ "type": "string",
83
+ "format": "date"
84
+ },
85
+ "refresh_interval_days": {
86
+ "type": "integer",
87
+ "minimum": 1
88
+ },
89
+ "stale_after_days": {
90
+ "type": "integer",
91
+ "minimum": 1
92
+ },
93
+ "usage_policy": {
94
+ "enum": [
95
+ "facts_only",
96
+ "link_only",
97
+ "permission_required"
98
+ ]
99
+ },
100
+ "license_review_status": {
101
+ "enum": [
102
+ "unknown",
103
+ "review_required",
104
+ "cleared",
105
+ "restricted"
106
+ ]
107
+ },
108
+ "status": {
109
+ "enum": [
110
+ "active",
111
+ "draft",
112
+ "retired"
113
+ ]
114
+ },
115
+ "notes": {
116
+ "type": "string"
117
+ }
118
+ }
119
+ }
120
+ }
121
+ }
122
+ }
package/install.sh ADDED
@@ -0,0 +1,367 @@
1
+ #!/usr/bin/env bash
2
+ # yotta-resume 多智能体安装脚本(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
+ # bash install.sh --dry-run # 只显示将写入的目标,不写文件
10
+ # bash install.sh --version # 显示版本
11
+ # bash install.sh --help # 显示帮助
12
+ # 退出码: 0 成功 / 1 安装失败 / 2 用法错误 / 4 目标错误
13
+ set -euo pipefail
14
+
15
+ SKILL_NAME="yotta-resume"
16
+ SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
17
+ _IS_WINDOWS=0
18
+ case "$(uname -s)" in
19
+ MINGW*|MSYS*)
20
+ SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -W)"
21
+ _IS_WINDOWS=1
22
+ ;;
23
+ CYGWIN*) _IS_WINDOWS=1 ;;
24
+ esac
25
+
26
+ # 智能体 -> 用户级默认目录(--agent 装到第一个)
27
+ # .agents/skills 并非通用目录:OpenCode / Cursor / Cline / Amp / Kimi / Gemini CLI / GitHub Copilot 读取。
28
+ dirs_for() {
29
+ case "$1" in
30
+ claude) echo ".claude/skills" ;;
31
+ cursor) echo ".cursor/skills .agents/skills" ;;
32
+ codex) echo "__CODEX__" ;;
33
+ gemini) echo ".gemini/skills .agents/skills" ;;
34
+ goose) echo ".config/goose/skills .agents/skills" ;;
35
+ amp) echo ".config/agents/skills .agents/skills" ;;
36
+ opencode) echo "__OPENCODE__" ;;
37
+ windsurf) echo ".codeium/windsurf/skills" ;;
38
+ workbuddy) echo ".workbuddy/skills" ;;
39
+ kiro) echo ".kiro/skills" ;;
40
+ trae) echo ".traecli/skills" ;;
41
+ trae-cn) echo ".trae-cn/skills" ;;
42
+ qwen) echo ".qwen/skills" ;;
43
+ comate) echo ".comate/skills" ;;
44
+ codebuddy) echo ".codebuddy/skills" ;;
45
+ kimi) echo ".kimi/skills" ;;
46
+ agents) echo ".agents/skills" ;;
47
+ *) return 1 ;;
48
+ esac
49
+ }
50
+
51
+ codex_dir() {
52
+ if [ -n "${CODEX_HOME:-}" ]; then printf '%s' "$CODEX_HOME/skills"; else printf '%s' "$HOME/.codex/skills"; fi
53
+ }
54
+ opencode_dir() {
55
+ if [ -n "${XDG_CONFIG_HOME:-}" ]; then printf '%s' "$XDG_CONFIG_HOME/opencode/skills"; else printf '%s' "$HOME/.config/opencode/skills"; fi
56
+ }
57
+ resolve_user() {
58
+ case "$1" in
59
+ __CODEX__) codex_dir ;;
60
+ __OPENCODE__) opencode_dir ;;
61
+ *) printf '%s' "$HOME/$1" ;;
62
+ esac
63
+ }
64
+
65
+ skill_version() {
66
+ local pkg="$SOURCE_DIR/package.json" v=""
67
+ [ -f "$pkg" ] || return 0
68
+ if command -v awk >/dev/null 2>&1; then
69
+ v="$(awk -F'"' '{for (i=1;i<=NF;i++) if ($i=="version") {print $(i+2); exit}}' "$pkg" 2>/dev/null || true)"
70
+ fi
71
+ if [ -z "$v" ]; then
72
+ v="$(sed -n 's/.*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' "$pkg" 2>/dev/null | head -n 1 || true)"
73
+ fi
74
+ printf '%s' "$v"
75
+ }
76
+
77
+ usage() {
78
+ echo "$SKILL_NAME 安装脚本(YottaSkills)"
79
+ echo ""
80
+ echo "用法:"
81
+ echo " bash install.sh --agent <name> 按智能体默认用户级目录安装(推荐)"
82
+ echo " bash install.sh --dir <path> 装到指定目录(用户改了目录的智能体)"
83
+ echo " bash install.sh -g 安装到全部已知智能体用户级目录"
84
+ echo " bash install.sh 安装到检测到的项目级目录"
85
+ echo ""
86
+ echo "参数:"
87
+ echo " --agent <name> 智能体键名,见 --list"
88
+ echo " --dir <path> 自定义技能目录"
89
+ echo " -g, --global 安装到全部已知用户级目录"
90
+ echo " --list, -l 列出支持的智能体目录"
91
+ echo " --dry-run 只显示将写入的目标,不写文件"
92
+ echo " --version, -v 显示版本"
93
+ echo " --help, -h 显示帮助"
94
+ echo " --yes, -y 兼容参数(-g 不再强制要求)"
95
+ echo ""
96
+ echo "退出码: 0 成功 / 1 安装失败 / 2 用法错误 / 4 目标错误"
97
+ }
98
+
99
+ resolve_path() {
100
+ # 与 SOURCE_DIR 同一风格(Windows Git Bash 用 pwd -W),供路径包含判断使用
101
+ local p="$1"
102
+ if [ "$_IS_WINDOWS" = "1" ]; then
103
+ (cd "$p" 2>/dev/null && pwd -W)
104
+ else
105
+ (cd "$p" 2>/dev/null && pwd -P)
106
+ fi
107
+ }
108
+
109
+ assert_safe_target() {
110
+ local dest="$1" src_real dest_real parent
111
+ src_real="$(resolve_path "$SOURCE_DIR")" || return 0
112
+ if [ -d "$dest" ]; then
113
+ dest_real="$(resolve_path "$dest")" || return 0
114
+ else
115
+ parent="$(dirname "$dest")"
116
+ dest_real="$(resolve_path "$parent")" || return 0
117
+ dest_real="$dest_real/$(basename "$dest")"
118
+ fi
119
+ case "$dest_real" in
120
+ "$src_real"|"$src_real"/*)
121
+ echo "安装失败:目标目录不能在技能源目录内(防止自装自毁)" >&2
122
+ return 1
123
+ ;;
124
+ esac
125
+ return 0
126
+ }
127
+
128
+ is_managed_hub_link() {
129
+ local p="$1" real parent
130
+ [ -L "$p" ] || return 1
131
+ real="$(resolve_path "$p")" || return 1
132
+ [ "$(basename "$real")" = "$SKILL_NAME" ] || return 1
133
+ parent="$(dirname "$real")"
134
+ [ -f "$parent/.yotta-hub.json" ] || [ -f "$parent/.yotta-links.json" ]
135
+ }
136
+
137
+ assert_no_nested_links() {
138
+ local dest="$1"
139
+ [ -d "$dest" ] || return 0
140
+ if find "$dest" -mindepth 1 -type l -print -quit 2>/dev/null | grep -q .; then
141
+ echo "安装失败:目标目录包含符号链接,拒绝写入:$dest" >&2
142
+ return 1
143
+ fi
144
+ return 0
145
+ }
146
+
147
+ # 清理旧版安装残留(fail-closed 白名单):仅在目标目录已存在且含 SKILL.md 时触发;
148
+ # 只删顶层开发项 + 任意层级缓存;不整目录删除、不跟随符号链接。
149
+ DEV_SKIP="package.json package-lock.json bin lib test .github .git .gitignore .npmignore .gitattributes .yotta .tmp install.sh node_modules"
150
+ clean_residue() {
151
+ local dest="$1" name p
152
+ [ -d "$dest" ] || return 0
153
+ [ -f "$dest/SKILL.md" ] || return 0
154
+ for name in $DEV_SKIP; do
155
+ p="$dest/$name"
156
+ [ -L "$p" ] && continue
157
+ if [ -e "$p" ]; then
158
+ rm -rf -- "$p"
159
+ echo "已清理残留: $name"
160
+ fi
161
+ done
162
+ find "$dest" -type d \( -name '__pycache__' -o -name '.pytest_cache' -o -name '.mypy_cache' \) -prune -exec rm -rf -- {} + 2>/dev/null || true
163
+ find "$dest" -type f \( -name '*.pyc' -o -name '*.pyo' \) -delete 2>/dev/null || true
164
+ }
165
+
166
+ # 复制技能本体:顶层跳过开发件与运行时不相关目录(嵌套同名保留);
167
+ # 任意层级跳过缓存(__pycache__ / .pytest_cache / .mypy_cache / *.pyc / *.pyo)。
168
+ copy_tree() {
169
+ local src="$1" dst="$2" top="$3" entry base
170
+ if [ "$top" != "1" ] && [ -L "$dst" ]; then
171
+ echo "安装失败:目标目录包含符号链接,拒绝写入:$dst" >&2
172
+ return 1
173
+ fi
174
+ mkdir -p "$dst" || return 1
175
+ if [ "$top" != "1" ] && [ -L "$dst" ]; then
176
+ echo "安装失败:目标目录包含符号链接,拒绝写入:$dst" >&2
177
+ return 1
178
+ fi
179
+ for entry in "$src"/* "$src"/.[!.]* "$src"/..?*; do
180
+ [ -e "$entry" ] || [ -L "$entry" ] || continue
181
+ base="$(basename "$entry")"
182
+ case "$base" in
183
+ __pycache__|.pytest_cache|.mypy_cache) continue ;;
184
+ esac
185
+ if [ "$top" = "1" ]; then
186
+ case " $DEV_SKIP " in
187
+ *" $base "*) continue ;;
188
+ esac
189
+ fi
190
+ if [ -d "$entry" ] && [ ! -L "$entry" ]; then
191
+ if [ -L "$dst/$base" ]; then
192
+ echo "安装失败:目标目录包含符号链接,拒绝写入:$dst/$base" >&2
193
+ return 1
194
+ fi
195
+ copy_tree "$entry" "$dst/$base" 0 || return 1
196
+ else
197
+ case "$base" in
198
+ *.pyc|*.pyo) continue ;;
199
+ esac
200
+ if [ -L "$dst/$base" ]; then
201
+ echo "安装失败:目标文件是符号链接,拒绝写入:$dst/$base" >&2
202
+ return 1
203
+ fi
204
+ cp -RP "$entry" "$dst/$base" || return 1
205
+ fi
206
+ done
207
+ }
208
+
209
+ install_to() {
210
+ local base="$1" dry="$2" dest
211
+ dest="$base/$SKILL_NAME"
212
+ if [ -L "$base" ]; then
213
+ echo "安装失败:目标目录是符号链接,拒绝跟随:$base" >&2
214
+ return 1
215
+ fi
216
+ if [ -e "$base" ] && [ ! -d "$base" ]; then
217
+ echo "安装失败:目标路径已存在且不是目录:$base" >&2
218
+ return 1
219
+ fi
220
+ if [ -L "$dest" ] && ! is_managed_hub_link "$dest"; then
221
+ echo "安装失败:技能目录是符号链接,拒绝跟随:$dest" >&2
222
+ return 1
223
+ fi
224
+ if [ -e "$dest" ] && [ ! -d "$dest" ]; then
225
+ echo "安装失败:技能路径已存在且不是目录:$dest" >&2
226
+ return 1
227
+ fi
228
+ assert_safe_target "$dest" || return 1
229
+ assert_no_nested_links "$dest" || return 1
230
+ if [ "$dry" = "1" ]; then
231
+ echo "[dry-run] 将安装到 -> $dest"
232
+ return 0
233
+ fi
234
+ clean_residue "$dest"
235
+ mkdir -p "$dest" || return 1
236
+ if [ -L "$dest" ] && ! is_managed_hub_link "$dest"; then
237
+ echo "安装失败:技能目录在安装期间变成了链接,拒绝写入:$dest" >&2
238
+ return 1
239
+ fi
240
+ copy_tree "$SOURCE_DIR" "$dest" 1 || return 1
241
+ if [ ! -f "$dest/SKILL.md" ]; then
242
+ echo "安装失败:结果缺少 SKILL.md" >&2
243
+ return 1
244
+ fi
245
+ echo "installed -> $dest"
246
+ }
247
+
248
+ list() {
249
+ echo "智能体 -> 默认技能目录(--agent <name> 装到第一个,用户级):"
250
+ local a dirs first
251
+ for a in claude cursor codex gemini goose amp opencode windsurf workbuddy kiro trae trae-cn qwen comate codebuddy kimi agents; do
252
+ dirs="$(dirs_for "$a")"
253
+ first="${dirs%% *}"
254
+ case "$first" in
255
+ __CODEX__) first=".codex/skills" ;;
256
+ __OPENCODE__) first=".config/opencode/skills" ;;
257
+ esac
258
+ if [ "$_IS_WINDOWS" = "1" ]; then
259
+ first="%USERPROFILE%\\${first//\//\\}"
260
+ else
261
+ first="~/$first"
262
+ fi
263
+ printf ' %-10s %s\n' "$a" "$first"
264
+ done
265
+ echo '说明:Windows 用 %USERPROFILE%,Linux/macOS 用 ~;仅收录有官方默认目录的智能体。'
266
+ echo '改了目录的请用 --dir <路径>,不要依赖默认位置;若设置了 CODEX_HOME / XDG_CONFIG_HOME,安装自动以该变量为准。'
267
+ }
268
+
269
+ main() {
270
+ local agent="" dir="" global=0 show_list=0 show_help=0 show_version=0 dry=0
271
+ while [ $# -gt 0 ]; do
272
+ case "$1" in
273
+ --help|-h) show_help=1 ;;
274
+ --version|-v) show_version=1 ;;
275
+ --list|-l) show_list=1 ;;
276
+ -g|--global) global=1 ;;
277
+ --dry-run) dry=1 ;;
278
+ --yes|-y) : ;;
279
+ --agent)
280
+ shift
281
+ if [ $# -eq 0 ] || [ -z "${1:-}" ]; then
282
+ echo "用法错误: --agent 需要一个非空名称" >&2
283
+ exit 2
284
+ fi
285
+ agent="$1"
286
+ ;;
287
+ --dir)
288
+ shift
289
+ if [ $# -eq 0 ] || [ -z "${1:-}" ]; then
290
+ echo "用法错误: --dir 需要一个非空路径" >&2
291
+ exit 2
292
+ fi
293
+ dir="$1"
294
+ ;;
295
+ *) echo "未知参数: $1" >&2; exit 2 ;;
296
+ esac
297
+ shift
298
+ done
299
+
300
+ if [ "$show_help" = "1" ]; then usage; return 0; fi
301
+ if [ "$show_version" = "1" ]; then
302
+ local v
303
+ v="$(skill_version)"
304
+ if [ -z "$v" ]; then
305
+ echo "$SKILL_NAME 版本未知(未找到 package.json)" >&2
306
+ exit 1
307
+ fi
308
+ echo "$SKILL_NAME v$v"
309
+ return 0
310
+ fi
311
+ if [ "$show_list" = "1" ]; then list; return 0; fi
312
+
313
+ local selected=0
314
+ [ -n "$dir" ] && selected=$((selected + 1))
315
+ [ -n "$agent" ] && selected=$((selected + 1))
316
+ [ "$global" = "1" ] && selected=$((selected + 1))
317
+ if [ "$selected" -gt 1 ]; then
318
+ echo "用法错误: --dir / --agent / -g 只能选一个" >&2
319
+ exit 2
320
+ fi
321
+
322
+ if [ -n "$dir" ]; then
323
+ install_to "$dir" "$dry" || exit 1
324
+ [ "$dry" = "1" ] || echo "完成。"
325
+ return 0
326
+ fi
327
+ if [ -n "$agent" ]; then
328
+ local dirs first
329
+ if ! dirs="$(dirs_for "$agent")"; then
330
+ echo "未收录智能体: $agent。可用 --list 查看,或 --dir <路径> 指定。" >&2
331
+ exit 2
332
+ fi
333
+ first="${dirs%% *}"
334
+ install_to "$(resolve_user "$first")" "$dry" || exit 1
335
+ [ "$dry" = "1" ] || echo "完成。"
336
+ return 0
337
+ fi
338
+ if [ "$global" = "1" ]; then
339
+ local a dirs rel seen=" "
340
+ for a in claude cursor codex gemini goose amp opencode windsurf workbuddy kiro trae trae-cn qwen comate codebuddy kimi agents; do
341
+ dirs="$(dirs_for "$a")" || continue
342
+ for rel in $dirs; do
343
+ case "$seen" in
344
+ *" $rel "*) continue ;;
345
+ esac
346
+ seen="$seen$rel "
347
+ install_to "$(resolve_user "$rel")" "$dry" || exit 1
348
+ done
349
+ done
350
+ [ "$dry" = "1" ] || echo "完成。"
351
+ return 0
352
+ fi
353
+ local installed=0 d
354
+ 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
355
+ if [ -d "$d" ]; then
356
+ install_to "$d" "$dry" || exit 1
357
+ installed=1
358
+ fi
359
+ done
360
+ if [ "$installed" = "0" ]; then
361
+ echo "目标错误: 未检测到项目级智能体目录。可用 --agent <name> 装到用户级,或用 --dir <路径> 指定目录。" >&2
362
+ exit 4
363
+ fi
364
+ [ "$dry" = "1" ] || echo "完成。"
365
+ }
366
+
367
+ main "$@"
package/package.json CHANGED
@@ -1,23 +1,54 @@
1
1
  {
2
2
  "name": "@yottameta/yotta-resume",
3
- "version": "0.0.0",
4
- "description": "Placeholder package for the YottaMeta yotta-resume skill.",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "keywords": [],
10
- "type": "commonjs",
3
+ "version": "0.1.2",
4
+ "description": "元简 — 本地求职者简历分析与成品导出技能:分析简历结构、证据、岗位匹配和风险,向用户追问缺失事实,给出逐条合理化修改建议,并把确认后的内容导出为 DOCX/PDF。触发:简历诊断、改简历、简历追问、JD匹配、导出Word/PDF。边界:不编造经历,不承诺ATS/面试/Offer结果;不自动投递;不处理复杂设计作品集排版;默认本地处理且不联网。",
11
5
  "license": "MIT",
6
+ "keywords": [
7
+ "agent-skills",
8
+ "yotta-resume",
9
+ "yottaskills",
10
+ "简历诊断",
11
+ "简历分析",
12
+ "简历优化",
13
+ "改简历",
14
+ "求职简历",
15
+ "JD匹配",
16
+ "简历导出",
17
+ "Word简历",
18
+ "PDF简历",
19
+ "resume review",
20
+ "resume analyzer",
21
+ "resume export",
22
+ "job description matching"
23
+ ],
24
+ "files": [
25
+ "SKILL.md",
26
+ "LICENSE",
27
+ "NOTICE",
28
+ "README.md",
29
+ "README.zh-CN.md",
30
+ "CHANGELOG.md",
31
+ "assets",
32
+ "data",
33
+ "install.sh",
34
+ "references",
35
+ "scripts",
36
+ "bin",
37
+ "!scripts/test_*.py",
38
+ "!**/__pycache__",
39
+ "!**/*.pyc"
40
+ ],
12
41
  "repository": {
13
42
  "type": "git",
14
43
  "url": "git+https://github.com/YottaMeta/yotta-resume.git"
15
44
  },
45
+ "scripts": {
46
+ "test": "python -m unittest discover -s scripts -p \"test_*.py\""
47
+ },
16
48
  "publishConfig": {
17
49
  "access": "public"
18
50
  },
19
- "bugs": {
20
- "url": "https://github.com/YottaMeta/yotta-resume/issues"
21
- },
22
- "homepage": "https://github.com/YottaMeta/yotta-resume#readme"
51
+ "bin": {
52
+ "yotta-resume": "bin/install.js"
53
+ }
23
54
  }