From 5959b4a674ef9593b2c9cd50ef5d86d8716fcd86 Mon Sep 17 00:00:00 2001 From: kicer Date: Wed, 11 Nov 2026 19:13:34 +0800 Subject: [PATCH] =?UTF-8?q?docs(skills):=20AGENTS.md=20=E6=94=B9=E6=88=90?= =?UTF-8?q?=E3=80=8C=E7=8E=B0=E8=B1=A1=20=E2=86=92=20=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E3=80=8D=E6=8E=92=E9=94=99=E6=B8=85=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 删掉服务器背景、agent-executor-init、SKILL.md 说明之类的旁白。只保留: 报什么错 → 敲什么命令。四份都在 20 行内。 --- docs/local-mode.md | 4 ++-- skills/document-photo-to-pdf/AGENTS.md | 17 +++++--------- skills/image-process/AGENTS.md | 23 +++++-------------- skills/office/AGENTS.md | 29 +++++++++--------------- skills/x2pdf/AGENTS.md | 31 ++++++++------------------ 5 files changed, 32 insertions(+), 72 deletions(-) diff --git a/docs/local-mode.md b/docs/local-mode.md index 570a94d..8f17ec3 100644 --- a/docs/local-mode.md +++ b/docs/local-mode.md @@ -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 ...` 即可 diff --git a/skills/document-photo-to-pdf/AGENTS.md b/skills/document-photo-to-pdf/AGENTS.md index cb42850..941431e 100644 --- a/skills/document-photo-to-pdf/AGENTS.md +++ b/skills/document-photo-to-pdf/AGENTS.md @@ -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` 不用装。 diff --git a/skills/image-process/AGENTS.md b/skills/image-process/AGENTS.md index f506063..0bebea1 100644 --- a/skills/image-process/AGENTS.md +++ b/skills/image-process/AGENTS.md @@ -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`。 diff --git a/skills/office/AGENTS.md b/skills/office/AGENTS.md index 08c0a4d..f4a381f 100644 --- a/skills/office/AGENTS.md +++ b/skills/office/AGENTS.md @@ -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/`。 diff --git a/skills/x2pdf/AGENTS.md b/skills/x2pdf/AGENTS.md index 351932b..ed8dcaa 100644 --- a/skills/x2pdf/AGENTS.md +++ b/skills/x2pdf/AGENTS.md @@ -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。