@yottameta/yotta-humanize 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,13 @@
1
+ # 更新日志
2
+
3
+ ## v0.1.0 (2026-08-26)
4
+
5
+ YottaMeta 自有实现首版(去 AI 味方向参考开源社区 humanizer / ai-humanizer 类技能思路,已完全重写为中文语料实现,零依赖、无上游代码):
6
+
7
+ - **检测器引擎**(scripts/yotta_humanize.py + humanize_rules.py,Python 3.8+ 标准库):24 类中文 AI 腔规则(内容 / 语言 / 句式 / 沟通 / 废话五组)+ 词表 + 句式正则 + 统计突发性(句长均匀度 CV / 突发性 / 双字词汇多样性 TTR / 逗号密度)。
8
+ - **确定性改写**:词表替换(赋能→支持、抓手→切入点、闭环→流程…)、套话 / 聊天残渣 / 奉承 / 免责删除、破折号 / 感叹号限流;输出修复清单与前后评分。
9
+ - **CLI**:score(--gate 可做 CI 拦截)/ analyze / report(Markdown)/ suggest / rewrite / version;--json 机器可读;stdin 编码自适应(UTF-8 优先,回退本机编码)。
10
+ - **退出码**:与元安 / 元审 / 元盾家族一致(0 = 成功;1 = --gate 达到阈值;4 = 用法错误)。
11
+ - **测试**:scripts/test_yotta_humanize.py 155 项全绿(24 类规则命中 / 干净文本低分 / 统计量 / 确定性改写 / CLI 子命令 / 退出码 / JSON / GBK 控制台)。
12
+ - **文档**:SKILL.md / README.md / references(patterns / scoring / rewriting)/ assets/banner.png。
13
+ - 版权: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-humanize」「元阁」以及本家族各技能名称(yotta-* 前缀)是 YottaMeta 的品牌与标识。
4
+
5
+ 本软件以 MIT 许可证开源,任何人均可自由使用、修改与分发。若你在其基础上制作派生作品:
6
+
7
+ 1. 不得继续使用 YottaMeta 或本家族名称(yotta-*、元忆、元真 等)作为派生作品的名称;
8
+ 2. 不得暗示派生作品由 YottaMeta 官方维护、认可或与之存在关联;
9
+ 3. 建议在派生作品中明确声明「与 YottaMeta 官方无关联」。
10
+
11
+ 上游来源致谢:本技能由 YottaMeta 全新实现,去 AI 味方向参考开源社区的 humanizer / ai-humanizer 类技能思路,词表与句式均为中文自研整理,无上游代码。
package/README.md ADDED
@@ -0,0 +1,157 @@
1
+
2
+ <p align="center">
3
+ <img src="assets/banner.png" alt="yotta-humanize banner" width="100%" />
4
+ </p>
5
+
6
+ <h1 align="center">yotta-humanize · 元真</h1>
7
+
8
+ <p align="center">YottaMeta 自有的去 AI 味中文写作编辑技能:<b>检测器引擎(24 类规则 + 词表 + 统计突发性)</b>识别 AI 腔文本,并给出确定性改写,让中文写作更自然、更像人写的。适用于编辑 / 润色文本、给 AI 生成的中文稿件做检测与改写。</p>
9
+ <p align="center">检测到空泛升华、套话、AI 黑话(赋能 / 闭环 / 抓手)、同义堆叠、排比三连、聊天残渣(希望对你有所帮助)等 AI 腔特征时自动激活——<b>不靠提示词兜底,按规则确定性判定</b>。</p>
10
+ <p align="center">纯 Python 3.8+ 标准库实现,零外部依赖;Windows + Linux + macOS 通用;检测 + 改写全流程,改写不依赖模型。</p>
11
+
12
+ <p align="center">
13
+ <a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-blue" /></a>
14
+ <a href="https://agentskills.io/"><img alt="Standard: agentskills.io" src="https://img.shields.io/badge/standard-agentskills.io-orange" /></a>
15
+ <a href="https://www.npmjs.com/package/@yottameta/yotta-humanize"><img alt="npm package" src="https://img.shields.io/npm/v/@yottameta/yotta-humanize" /></a>
16
+ <a href="https://github.com/YottaMeta/yotta-humanize"><img alt="GitHub stars" src="https://img.shields.io/github/stars/YottaMeta/yotta-humanize" /></a>
17
+ <a href="https://github.com/YottaMeta/yotta-humanize/commits/main"><img alt="last commit" src="https://img.shields.io/github/last-commit/YottaMeta/yotta-humanize" /></a>
18
+ <a href="https://github.com/YottaMeta/yotta-humanize"><img alt="PRs welcome" src="https://img.shields.io/badge/PRs-welcome-brightgreen" /></a>
19
+ </p>
20
+
21
+ ## 这是什么
22
+
23
+ AI 生成的中文文本有一眼可辨的「AI 腔」:空泛升华(标志着 / 彰显了)、套话(众所周知 / 综上所述 / 未来可期)、黑话(赋能 / 闭环 / 抓手 / 颗粒度)、机械列举(首先 / 其次 / 再次)、聊天残渣(希望对你有所帮助)……元真把这些特征做成**确定性检测器引擎**:24 类规则(词表 + 句式正则)+ 中文统计突发性(句长均匀度 / 词汇多样性),输出 0-100 的 AI 腔评分,并给出**确定性改写**(词表替换、套话删除、聊天残渣清理、标点限流)。
24
+
25
+ 它不是某个平台的专属功能,而是一份与智能体无关的工具包:装进任何支持 Agent Skills 的智能体即可按需调用。全程零依赖、不调模型;需要判断的改写以建议形式给出,不强行自动改。
26
+
27
+ ## 核心价值
28
+
29
+ - **24 类检测规则**:内容(空泛升华 / 套话开头结尾 / 模糊归因 / 绝对化)/ 语言(AI 黑话 / 同义堆叠 / 名词化堆砌 / 「我们」滥用)/ 句式(排比三连 / 机械列举 / 反问堆叠 / 标点滥用)/ 沟通(聊天残渣 / 奉承讨好 / 免责回避)/ 废话(填充 / 转折 / 重复声明)。
30
+ - **统计突发性**:句长均匀度(CV)、突发性、双字词汇多样性(TTR)、逗号密度——补规则检测不到的节奏问题。
31
+ - **确定性改写**:无歧义机械变换直接改(赋能→支持、抓手→切入点、众所周知 / 综上所述 删除、希望对你有所帮助 清理、破折号 / 感叹号限流),输出修复清单与前后评分。
32
+ - **机器可读**:--json 输出纯净 JSON;score --gate 接入 CI / 发布前检查。
33
+ - **中文优先**:词表、句式、改写映射全部针对中文语料自研整理,与英文 humanizer 类技能无共享代码。
34
+
35
+ ## 核心优势
36
+
37
+ | 优势 | 说明 |
38
+ |---|---|
39
+ | **零依赖** | Python 3.8+ 标准库,无模型、无数据库、无外部服务;Windows + Linux + macOS 通用 |
40
+ | **确定性** | 规则判定可复现、可解释;改写是确定性变换,不依赖模型概率 |
41
+ | **中文优先** | 针对中文 AI 腔(黑话 / 套话 / 排比 / 聊天残渣)自研词表与句式,非英文规则直译 |
42
+ | **检测 + 改写一体** | score / analyze / report / suggest / rewrite 全流程,一条命令从检测到改写 |
43
+ | **可复核** | 改写输出修复清单与前后评分,人工可逐条核对 |
44
+ | **生态分发** | GitHub + npm + ClawHub 三源同步发布;npx / install.sh / 手动复制三种安装方式 |
45
+
46
+ ## 功能体系
47
+
48
+ | 能力 | 说明 |
49
+ |---|---|
50
+ | score | 输出 AI 腔评分(0-100),--gate 可做 CI 拦截(退出码 1) |
51
+ | analyze | 详细检测报告(文本 / --json),含命中规则、上下文片段、建议 |
52
+ | report | Markdown 检测报告(统计表 + 命中规则) |
53
+ | suggest | 按优先级分组的改写建议 |
54
+ | rewrite | 确定性改写:替换 / 删除 AI 腔,输出修复清单 + 改写后文本 + 前后评分 |
55
+ | version | 打印版本 |
56
+
57
+ ## 快速使用
58
+
59
+ Windows 用 python,Linux/macOS 用 python3。
60
+
61
+ ```bash
62
+ # 评分(0-100,越高越像 AI 写的)
63
+ python3 scripts/yotta_humanize.py score -f article.md
64
+
65
+ # 详细检测报告
66
+ python3 scripts/yotta_humanize.py analyze -f article.md
67
+
68
+ # Markdown 报告
69
+ python3 scripts/yotta_humanize.py report -f article.md > report.md
70
+
71
+ # 按优先级分组的改写建议
72
+ python3 scripts/yotta_humanize.py suggest -f article.md
73
+
74
+ # 确定性改写(输出改写后文本 + 修复清单)
75
+ python3 scripts/yotta_humanize.py rewrite -f article.md
76
+
77
+ # 管道输入
78
+ cat article.md | python3 scripts/yotta_humanize.py score --stdin
79
+
80
+ # CI 拦截:评分 >= 阈值时退出码 1
81
+ python3 scripts/yotta_humanize.py score -f article.md --gate --threshold 45
82
+ ```
83
+
84
+ 退出码语义(与元安 / 元审 / 元盾家族一致):0 = 成功;1 = score --gate 且评分达到阈值;4 = 用法错误 / 致命异常。
85
+
86
+ ## 安装
87
+
88
+ 三种方式任选其一,技能文件统一从 **npm** 获取(GitHub 无代理时较慢,npm 可配国内镜像加速)。
89
+
90
+ ### 方式一:npm(推荐,一行安装)
91
+ ```bash
92
+ # 国内加速(可选):npm config set registry https://registry.npmmirror.com
93
+ npx -y @yottameta/yotta-humanize -g
94
+ npx -y @yottameta/yotta-humanize --dir <你的技能目录> # 任意智能体:指定目录安装
95
+ ```
96
+ > 智能体不在预置列表里?用 --dir 指定它的 skills 目录,或手动复制(方式三)。--list 可查看各智能体对应的默认目录。想手动拿文件也可 npm pack @yottameta/yotta-humanize 解包后按方式二/三安装。
97
+
98
+ ### 方式二:install.sh 一键安装
99
+ 获取技能文件夹后(npm pack 解包或 git clone),进入技能文件夹:
100
+ ```bash
101
+ bash install.sh -g # 用户级;bash install.sh --list 查看全部目录
102
+ bash install.sh --agent codex # 指定智能体(--list 可查看可用项)
103
+ bash install.sh # 项目级:自动检测已存在的 .claude/.cursor/.codex 等 skills 目录
104
+ bash install.sh --dir /path/to/skills
105
+ ```
106
+ > 覆盖 17 类智能体,含国内 Trae / Qwen / Comate / CodeBuddy / Kimi。Windows 用户:装有 Git Bash 即可用;否则用方式三手动复制。
107
+
108
+ ### 方式三:手动复制
109
+ 把整个 yotta-humanize 文件夹复制到目标智能体的 skills 目录。常见位置(用户级;Windows 用 %USERPROFILE%,Linux/macOS 用 ~):
110
+
111
+ | 智能体 | 用户级目录 | 项目级目录 |
112
+ |---|---|---|
113
+ | Codex | %USERPROFILE%\.codex\skills\yotta-humanize\ | .codex\skills\ |
114
+ | Claude Code | %USERPROFILE%\.claude\skills\yotta-humanize\ | .claude\skills\ |
115
+ | Cursor | %USERPROFILE%\.cursor\skills\yotta-humanize\ | .cursor\skills\ |
116
+ | Windsurf | %USERPROFILE%\.codeium\windsurf\skills\yotta-humanize\ | .windsurf\skills\ |
117
+ | opencode | %USERPROFILE%\.config\opencode\skills\yotta-humanize\ | .opencode\skills\ |
118
+ | Gemini | %USERPROFILE%\.gemini\skills\yotta-humanize\ | .gemini\skills\ |
119
+ | Goose | %USERPROFILE%\.config\goose\skills\yotta-humanize\ | .goose\skills\ |
120
+ | Amp | %USERPROFILE%\.config\agents\skills\yotta-humanize\ | .agents\skills\ |
121
+ | Kiro | %USERPROFILE%\.kiro\skills\yotta-humanize\ | .kiro\skills\ |
122
+ | WorkBuddy | %USERPROFILE%\.workbuddy\skills\yotta-humanize\ | .workbuddy\skills\ |
123
+ | Trae Code CLI | %USERPROFILE%\.traecli\skills\yotta-humanize\ | .traecli\skills\ |
124
+ | Trae IDE(国内) | %USERPROFILE%\.trae-cn\skills\yotta-humanize\ | .trae\skills\ |
125
+ | Qwen Code | %USERPROFILE%\.qwen\skills\yotta-humanize\ | .qwen\skills\ |
126
+ | Comate | %USERPROFILE%\.comate\skills\yotta-humanize\ | .comate\skills\ |
127
+ | CodeBuddy | %USERPROFILE%\.codebuddy\skills\yotta-humanize\ | .codebuddy\skills\ |
128
+ | Kimi | %USERPROFILE%\.kimi\skills\yotta-humanize\ | .kimi\skills\ |
129
+ | 通用 AGENTS.md | %USERPROFILE%\.agents\skills\yotta-humanize\ | .agents\skills\ |
130
+
131
+ > Codex 默认目录若设置了环境变量 CODEX_HOME,以该变量为准;opencode 若设置 XDG_CONFIG_HOME 同理。.agents\skills 并非通用目录,仅 OpenCode / Cursor / Cline / Amp / Kimi / Gemini CLI / GitHub Copilot 等会读取,Claude Code 与 Codex 默认不读。不确定时用 --dir 指定,或让该智能体自行安装。
132
+
133
+ ## 使用示例(AI 智能体)
134
+
135
+ 1. 将本仓库的 SKILL.md 接入任意 AI 智能体的技能/规则系统(见上方安装)。
136
+ 2. 收到一段 AI 味很重的文稿时,先跑一次检测:
137
+ ```bash
138
+ python3 scripts/yotta_humanize.py analyze -f draft.md
139
+ ```
140
+ 看评分与命中规则(空泛升华 / 黑话 / 套话 / 聊天残渣等)。
141
+ 3. 无歧义的部分直接机械改写:
142
+ ```bash
143
+ python3 scripts/yotta_humanize.py rewrite -f draft.md
144
+ ```
145
+ 对照修复清单确认,把改写后文本落回稿件。
146
+ 4. 需要判断的部分(排比拆句、模糊归因补来源、绝对化软化)按 suggest 的建议手工润色。
147
+ 5. 改写完再 score 一次,确认评分下降、原意未破坏。
148
+
149
+ ## 开发与校验
150
+
151
+ - 测试:python scripts/test_yotta_humanize.py(155 项)
152
+ - 基础校验:python tools/validate-skill.py yotta-humanize(在仓库根目录运行)
153
+ - 规则目录:references/patterns.md;评分公式:references/scoring.md;改写规则:references/rewriting.md
154
+
155
+ ## 许可证
156
+
157
+ MIT © YottaMeta —— 详见 [LICENSE](./LICENSE)。
package/SKILL.md ADDED
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: yotta-humanize
3
+ version: 0.1.0
4
+ description: 元真 —— 去 AI 味的中文写作编辑技能:检测器引擎(24 类规则 + 词表 + 统计突发性)识别并改写 AI 腔文本,让中文写作更自然、更像人写的。触发:编辑 / 润色文本、去 AI 味、让文章 / 文案 / 回复更像人写、发现文本充斥着 AI 常用词与句式(赋能 / 闭环 / 值得注意的是 / 综上所述 / 希望对你有所帮助 等)、给 AI 生成的中文稿件做检测与改写。边界:只处理文本,不生成新内容;不改写事实 / 数据 / 专有名词;不破坏作者原意;改写为确定性规则,不依赖模型。
5
+ license: MIT
6
+ ---
7
+
8
+ # 元真(yotta-humanize)
9
+
10
+ 去 AI 味的中文写作编辑技能:**检测器引擎(24 类规则 + 词表 + 统计突发性)**识别 AI 腔文本并给出**确定性改写**,让中文写作更自然。
11
+
12
+ 零依赖(Python 3.8+ 标准库),Windows + Linux + macOS 通用;Claude Code / Cursor / Codex / 通用 Agent 均可调用。
13
+
14
+ ## 何时使用
15
+
16
+ - 编辑 / 润色文本,去掉 AI 味,让文章、文案、回复更像人写的;
17
+ - 给 AI 生成的中文稿件做检测(评分 0-100)与改写;
18
+ - 发现文本充斥着 AI 常用词与句式:赋能、闭环、抓手、综上所述、未来可期、值得注意的是、希望对你有所帮助 等。
19
+
20
+ **Do NOT trigger**:
21
+
22
+ - 只处理文本,不生成新内容、不补写缺失信息;
23
+ - 不改写事实 / 数据 / 专有名词 / 引文;
24
+ - 不破坏作者原意与个人语气(正式 / 随意 / 技术向由作者定);
25
+ - 改写是确定性规则(替换 + 删除),需要判断的改写以建议形式给出,不强行自动改。
26
+
27
+ ## 快速使用
28
+
29
+ Windows 用 python,Linux/macOS 用 python3。
30
+
31
+ ```bash
32
+ # 评分(0-100,越高越像 AI 写的)
33
+ python3 scripts/yotta_humanize.py score -f article.md
34
+
35
+ # 详细检测报告
36
+ python3 scripts/yotta_humanize.py analyze -f article.md
37
+
38
+ # Markdown 报告
39
+ python3 scripts/yotta_humanize.py report -f article.md > report.md
40
+
41
+ # 按优先级分组的改写建议
42
+ python3 scripts/yotta_humanize.py suggest -f article.md
43
+
44
+ # 确定性改写(替换/删除 AI 腔,输出改写后文本 + 修复清单)
45
+ python3 scripts/yotta_humanize.py rewrite -f article.md
46
+
47
+ # 管道输入
48
+ cat article.md | python3 scripts/yotta_humanize.py score --stdin
49
+
50
+ # CI 拦截:评分 >= 阈值时退出码 1
51
+ python3 scripts/yotta_humanize.py score -f article.md --gate --threshold 45
52
+ ```
53
+
54
+ 退出码(与元安 / 元审 / 元盾家族一致):0 = 成功;1 = score --gate 且评分达到阈值;4 = 用法错误 / 致命异常。
55
+
56
+ ## 工作流程(AI 智能体编辑文本时)
57
+
58
+ 1. **先检测**:把待编辑文本交给元真 score 或 analyze,看评分与命中规则;
59
+ 2. **看命中**:analyze / report 给出命中规则与上下文片段;suggest 按优先级给改写建议;
60
+ 3. **机械改写**:无歧义的 AI 腔(套话、黑话、聊天残渣、同义堆叠等)用 rewrite 直接改;
61
+ 4. **人工润色**:需要判断的(排比拆句、模糊归因补来源、绝对化软化)按建议手工处理;
62
+ 5. **复核**:改写后再次 score 对比评分,确认不破坏原意。
63
+
64
+ ## 能力
65
+
66
+ - **24 类检测规则**:空泛升华 / 套话开头结尾 / 模糊归因 / AI 黑话 / 同义堆叠 / 「我们」滥用 / 排比三连 / 机械列举 / 破折号与感叹号滥用 / 聊天残渣 / 奉承讨好 / 免责回避 / 废话填充 / 重复声明 等(五组:内容 / 语言 / 句式 / 沟通 / 废话),详见 references/patterns.md;
67
+ - **统计突发性**:句长均匀度(CV)、突发性、词汇多样性(双字 TTR)、逗号密度,补充规则检测不到的节奏问题,详见 references/scoring.md;
68
+ - **确定性改写**:词表替换(赋能→支持、抓手→切入点、闭环→流程…)、套话删除、聊天残渣清理、标点限流,改写后输出修复清单与前后评分,详见 references/rewriting.md;
69
+ - **机器可读**:--json 输出纯净 JSON;score --gate 适合接入 CI / 发布前检查。
70
+
71
+ ## 参考文档
72
+
73
+ - references/patterns.md — 24 类规则目录与命中示例
74
+ - references/scoring.md — 评分公式与统计量说明
75
+ - references/rewriting.md — 确定性改写规则与 CLI 协议
76
+
77
+ ## 责任声明
78
+
79
+ 本技能只做文本层面的风格编辑,不改写事实与数据;改写结果请作者复核。检测评分仅供参考,不构成对文本来源的绝对判定。
Binary file
package/bin/install.js ADDED
@@ -0,0 +1,163 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * yotta-humanize 跨平台安装器(YottaSkills)
4
+ * 用法:
5
+ * npx -y @yottameta/yotta-humanize --agent <name> # 按智能体默认用户级目录安装(推荐)
6
+ * npx -y @yottameta/yotta-humanize --dir PATH # 装到指定目录(用户改了目录的智能体)
7
+ * npx -y @yottameta/yotta-humanize -g # 安装到全部已知智能体用户级目录
8
+ * npx -y @yottameta/yotta-humanize # 安装到检测到的项目级目录
9
+ * npx -y @yottameta/yotta-humanize --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-humanize';
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-humanize 多智能体安装脚本(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-humanize"
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,32 @@
1
+ {
2
+ "name": "@yottameta/yotta-humanize",
3
+ "version": "0.1.0",
4
+ "description": "元真 —— 去 AI 味的中文写作编辑技能:检测器引擎(24 类 + 词表 + 统计突发性)识别并改写 AI 腔文本,让中文写作更自然。触发:编辑/润色文本、去掉 AI 味、让文案更像人写时。边界:只处理文本,不生成新内容。",
5
+ "license": "MIT",
6
+ "keywords": [
7
+ "agent-skills",
8
+ "yotta-humanize"
9
+ ],
10
+ "files": [
11
+ "SKILL.md",
12
+ "LICENSE",
13
+ "README.md",
14
+ "install.sh",
15
+ "references",
16
+ "scripts",
17
+ "assets",
18
+ "bin",
19
+ "NOTICE",
20
+ "CHANGELOG.md"
21
+ ],
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/YottaMeta/yotta-humanize.git"
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "bin": {
30
+ "yotta-humanize": "bin/install.js"
31
+ }
32
+ }