docs(skills): AGENTS.md 改成「现象 → 命令」排错清单

删掉服务器背景、agent-executor-init、SKILL.md 说明之类的旁白。只保留:
报什么错 → 敲什么命令。四份都在 20 行内。
This commit is contained in:
2026-11-11 19:13:34 +08:00
parent 4e1c1f36d0
commit 5959b4a674
5 changed files with 32 additions and 72 deletions
+2 -2
View File
@@ -282,8 +282,8 @@ health 只作为「端口上有服务但不是本启动器拉起的」兜底提
`install.sh` / `requirements.txt` 是服务器工件(镜像构建与 `agent-executor-init` 读它们),本机不跑、
不改。启动器也不认识任何具体技能:不注入 PATH、不预装、不做特判。新增技能不需要动 `local/`。
本机缺东西时只有一条入口:技能自己目录下的 `AGENTS.md`(下载/安装/验证命令、平台资产名、字体路径)。
起点是 `env-local` 提示词的一句话:技能失败就读
本机缺东西时只有一条入口:技能自己目录下的 `AGENTS.md`。它是**排错清单**,只写「现象 → 命令」
(报什么错、敲什么),不写背景、不提服务器。起点是 `env-local` 提示词的一句话:技能失败就读
`"$(dirname "$AGENT_SKILLS_DEPS")/<技能>/AGENTS.md"`。装完不需要重启,旧进程不影响。
代价明写:`office` 的命令入口在本地不在 PATH 上,按次 `PATH="$SK/scripts:$PATH" office ...` 即可
+5 -12
View File
@@ -1,16 +1,9 @@
# document-photo-to-pdf:本机环境
# document-photo-to-pdf
`ModuleNotFoundError`(`numpy` / `PIL` / `fitz`)
```sh
SK="$(dirname "$AGENT_SKILLS_DEPS")/document-photo-to-pdf"
python3 -m pip install --target "$AGENT_SKILLS_DEPS" -r "$(dirname "$AGENT_SKILLS_DEPS")/document-photo-to-pdf/requirements.txt"
```
缺依赖时(`ModuleNotFoundError`,最先撞到的是 `numpy`):
```sh
python3 -m pip install --target "$AGENT_SKILLS_DEPS" -r "$SK/requirements.txt"
python3 -c "import numpy, PIL, fitz"
```
- `fitz` 是 `pymupdf` 的 import 名
- `pypdfium2` 不必装:只在 `pymupdf` 也缺失时才用得上
- 自检渲染优先系统 `pdftoppm`(poppler,可选)
`fitz` 是 `pymupdf` 的 import 名。`pypdfium2` 不用装。
+6 -17
View File
@@ -1,26 +1,15 @@
# image-process:本机环境
# image-process
`ModuleNotFoundError: No module named 'PIL'`
```sh
SK="$(dirname "$AGENT_SKILLS_DEPS")/image-process"
python3 -m pip install --target "$AGENT_SKILLS_DEPS" -r "$(dirname "$AGENT_SKILLS_DEPS")/image-process/requirements.txt"
```
## 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`
`中文水印缺少字体`:传 `font` 参数
```json
{"action":"watermark","input":"a.jpg","text":"机密","font":"/System/Library/Fonts/Hiragino Sans GB.ttc"}
```
英文/数字水印不需要字体;其余动作只依赖 Pillow。
字体:macOS `/System/Library/Fonts/Hiragino Sans GB.ttc`;Linux `/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc`;Windows `C:\Windows\Fonts\msyh.ttc`。
+10 -19
View File
@@ -1,27 +1,18 @@
# office:本机环境
# office
服务器由镜像与 `agent-executor-init` 准备(跑同目录 `install.sh`)。本机不要跑它,按下面装,装完不需要重启。
`office: command not found`
```sh
PATH="$(dirname "$AGENT_SKILLS_DEPS")/office/scripts:$PATH" office help
```
`office.core binary missing`
```sh
SK="$(dirname "$AGENT_SKILLS_DEPS")/office"
```
## 缺二进制(报 `office.core binary missing`)
```sh
mkdir -p "$SK/bin"
curl -fL --progress-bar -o "$SK/bin/officecli" \
https://github.com/iOfficeAI/OfficeCLI/releases/latest/download/officecli-mac-x64
chmod +x "$SK/bin/officecli" && "$SK/bin/officecli" --version
chmod +x "$SK/bin/officecli"
```
资产名:mac Intel `officecli-mac-x64`、Apple Silicon `officecli-mac-arm64`、Linux `officecli-linux-x64` / `officecli-linux-arm64`。
GitHub 慢时加 `https://gh-proxy.com/` 前缀。用 `latest` 即可,不必对齐服务器的 pin。
## `office` 命令不在 PATH
本机启动器不注入 PATH。按次指定目录:
```sh
PATH="$SK/scripts:$PATH" office help
```
资产按 `uname -sm` 选:`officecli-mac-x64` / `officecli-mac-arm64` / `officecli-linux-x64` / `officecli-linux-arm64`。下载慢就在地址前加 `https://gh-proxy.com/`。
+9 -22
View File
@@ -1,30 +1,17 @@
# x2pdf:本机环境
# x2pdf
`ModuleNotFoundError`(文本类报 `markdown`,或提示 WeasyPrint 不可用)
```sh
SK="$(dirname "$AGENT_SKILLS_DEPS")/x2pdf"
python3 -m pip install --target "$AGENT_SKILLS_DEPS" -r "$(dirname "$AGENT_SKILLS_DEPS")/x2pdf/requirements.txt"
```
## 文本类 md / txt / html
WeasyPrint 还要系统库:macOS `brew install pango`。
Office 类(docx/xlsx/pptx)报「未找到 LibreOffice」
```sh
python3 -m pip install --target "$AGENT_SKILLS_DEPS" -r "$SK/requirements.txt"
brew install pango # macOS;Linux 的系统库见 install.sh
brew install --cask libreoffice
```
不装 pango 也能用:技能在 WeasyPrint 不可用时回落 LibreOffice,代价是 `page` 的边距/页码与部分 CSS 不生效。
## Office 类 docx / xlsx / pptx / odt / ods / odp
必须有 LibreOffice(文本类也可用它渲染):
```sh
brew install --cask libreoffice # macOS:soffice 在 app bundle 内,技能会自己找到
apt-get install libreoffice-writer libreoffice-calc libreoffice-impress # Linux(镜像已预装)
```
## 验证
```sh
python3 -c "import weasyprint, markdown"
/Applications/LibreOffice.app/Contents/MacOS/soffice --version
```
装了 LibreOffice 后文本类也能用(自动回落,`page` 的边距/页码与部分 CSS 不生效),此时不必装 pango。