Files
agent/skills/image-process/AGENTS.md
T
kicer 4e1c1f36d0 refactor(skills): 本机环境说明改放技能目录的 AGENTS.md,启动器不再特判任何技能
上一版把安装说明写成 INSTALL.md 并在 SKILL.md 里加段落,两处都不对:SKILL.md 是用法说明,
不该塞安装内容;启动器为 office 单独注入 PATH 也不成立,再加技能就得逐条改 start.sh。

- 删除 4 个 INSTALL.md,改为各技能目录下的 AGENTS.md(只写命令:下载/安装/验证、
  平台资产名、字体路径),SKILL.md 恢复原样
- start.sh 去掉 office 的 PATH 注入;技能要命令入口时由 AGENTS.md 指导按次前缀
  (PATH="$SK/scripts:$PATH" office ...)。启动器只保留 AGENT_SKILLS_DEPS 这个路径变量
- 找不到依赖时的指路不放在 core 里做特征匹配,而是各自报错带自己 AGENTS.md 的绝对路径
  (office 封装层 ENOENT / x2pdf 缺包或无后端 / image-process 缺字体)
- env-local 提示词加一句:技能失败就读其目录下的 AGENTS.md

实测:无 PATH 时 office 报 command not found,按 AGENTS.md 加前缀后 --version 正常;
三条缺依赖报错均给出 AGENTS.md 绝对路径。
2026-11-11 19:12:01 +08:00

27 lines
744 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# image-process:本机环境
```sh
SK="$(dirname "$AGENT_SKILLS_DEPS")/image-process"
```
## Pillow
```sh
python3 -m pip install --target "$AGENT_SKILLS_DEPS" -r "$SK/requirements.txt"
python3 -c "import PIL"
```
## 中文水印缺字体
技能不内置字体,也不跨平台查找。报「中文水印缺少字体」时传 `font` 参数:
- macOS:`/System/Library/Fonts/Hiragino Sans GB.ttc`(简体)、`/System/Library/Fonts/PingFang.ttc`
- Linux:`/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc`
- Windows:`C:\Windows\Fonts\msyh.ttc`
```json
{"action":"watermark","input":"a.jpg","text":"机密","font":"/System/Library/Fonts/Hiragino Sans GB.ttc"}
```
英文/数字水印不需要字体;其余动作只依赖 Pillow。