feat(local): 技能通用规则进提示词,移除 skills/AGENTS.md 中转

- env-local 加两条:长任务后台写日志+10 秒轮询;国内 pip/npm/GitHub/brew 换源
- 4 个技能 AGENTS.md 删掉指向根文档的指针行;pip 命令补 --upgrade
- document-photo-to-pdf:自检未能执行时单独给摘要,不再伪装成「建议确认」
- SKILL.md 示例去掉真实域名,改成 <站点地址>
- 删除 skills/AGENTS.md(根级中转文档,靠出错时翻文件拉不动)
This commit is contained in:
2026-11-11 20:15:52 +08:00
parent 24d7f023ba
commit 0234bc85e5
10 changed files with 20 additions and 28 deletions
-9
View File
@@ -1,9 +0,0 @@
# 国内网络
pip / npm / GitHub / brew 超时或装不上时换源:
- pip:加 `-i https://pypi.tuna.tsinghua.edu.cn/simple`
- npm:加 `--registry=https://registry.npmmirror.com`
- GitHub 下载:地址前加 `https://gh-proxy.com/`(备用 `https://ghfast.top/`)
- brew:换清华/中科大镜像,或让用户自己装
- 缺运行时/系统包用本机包管理器(`apt` / `dnf` / `pacman` / `brew` / `winget`);需要密码时先问用户
-1
View File
@@ -20,7 +20,6 @@
```
skills/
├── AGENTS.md # 技能排错与国内网络换源(可选参考;core 不读)
└── <skill-name>/
├── SKILL.md # 技能描述文件(必须)
├── run.py # 技能主入口(Python 脚本,推荐)或 run.sh
+1 -3
View File
@@ -3,9 +3,7 @@
`ModuleNotFoundError`(`numpy` / `PIL` / `fitz`):把依赖装进 `$AGENT_SKILLS_DEPS`
```sh
python3 -m pip install --target "$AGENT_SKILLS_DEPS" -r "$(dirname "$AGENT_SKILLS_DEPS")/document-photo-to-pdf/requirements.txt"
python3 -m pip install --upgrade --target "$AGENT_SKILLS_DEPS" -r "$(dirname "$AGENT_SKILLS_DEPS")/document-photo-to-pdf/requirements.txt"
```
`fitz` 是 `pymupdf` 的 import 名,`pypdfium2` 不用装。没有 `python3` 先装运行时(Windows 上解释器常是 `python` / `py`)。
网络慢或装不上(pip / GitHub 等):见技能根目录的 `AGENTS.md`。
+1 -1
View File
@@ -39,7 +39,7 @@ input_schema:
```json
{"ok":true,"summary":"3 页已生成;1 页建议在审核页确认;原始页图见 out/","pdf":"合同_校正.pdf","images":["out/合同_校正-01.png","out/合同_校正-02.png","out/合同_校正-03.png"]}
访问地址:https://agent.ai.foresh.com/app/task-20261023-001/doc-review/
访问地址:<站点地址>/app/task-20261023-001/doc-review/
```
审核页可拖角、旋转、删页/排序、改纸张与清晰度;改动后点「重新生成 PDF」覆盖同名文件。
+5 -1
View File
@@ -864,7 +864,11 @@ def process(args, t0):
if not state_ok:
warnings.append("state 文件写入失败:%s" % state_path)
if checks.get("ok") is False:
if checks.get("ok") is None:
# 自检根本没跑(无 PDF 渲染后端等):不能让它伪装成「建议确认」——
# 那种情况下页面压根没过边缘/短边检验,模型和用户都得知道判据缺失。
summary = "%d 页已生成;PDF 自检未能执行,请在审核页人工确认" % len(ordered_pages)
elif checks.get("ok") is False:
summary = "%d 页已生成;自检有未通过项" % len(ordered_pages)
elif needs:
summary = "%d 页已生成;%d 页建议在审核页确认" % (
+1 -3
View File
@@ -3,7 +3,7 @@
`ModuleNotFoundError: No module named 'PIL'`:把依赖装进 `$AGENT_SKILLS_DEPS`
```sh
python3 -m pip install --target "$AGENT_SKILLS_DEPS" -r "$(dirname "$AGENT_SKILLS_DEPS")/image-process/requirements.txt"
python3 -m pip install --upgrade --target "$AGENT_SKILLS_DEPS" -r "$(dirname "$AGENT_SKILLS_DEPS")/image-process/requirements.txt"
```
`中文水印缺少字体`:传 `font` 参数,指向本机任意中文字体文件(ttf/ttc)
@@ -13,5 +13,3 @@ python3 -m pip install --target "$AGENT_SKILLS_DEPS" -r "$(dirname "$AGENT_SKILL
```
找字体:Linux `fc-list :lang=zh`;macOS `ls /System/Library/Fonts`;Windows `C:\Windows\Fonts\msyh*`。
网络慢或装不上(pip / GitHub 等):见技能根目录的 `AGENTS.md`。
-2
View File
@@ -17,5 +17,3 @@ chmod +x "$SK/bin/officecli"
资产名是 `{mac,linux,win}-{x64,arm64}`,如 `officecli-mac-arm64`、`officecli-linux-x64`、`officecli-win-x64.exe`;
musl 系统(Alpine)用 `officecli-linux-alpine-{x64,arm64}`。`uname -sm` 可判断平台与架构。
网络慢或装不上(GitHub 下载 / brew 等):见技能根目录的 `AGENTS.md`。
+1 -3
View File
@@ -3,7 +3,7 @@
`ModuleNotFoundError`(`markdown`)或提示 WeasyPrint 不可用:把依赖装进 `$AGENT_SKILLS_DEPS`
```sh
python3 -m pip install --target "$AGENT_SKILLS_DEPS" -r "$(dirname "$AGENT_SKILLS_DEPS")/x2pdf/requirements.txt"
python3 -m pip install --upgrade --target "$AGENT_SKILLS_DEPS" -r "$(dirname "$AGENT_SKILLS_DEPS")/x2pdf/requirements.txt"
```
WeasyPrint 还要系统库 pango/cairo:Linux `apt install libpango-1.0-0 libpangocairo-1.0-0 libcairo2`;
@@ -14,5 +14,3 @@ Office 类(docx/xlsx/pptx)报「未找到 LibreOffice」:装一个 LibreOf
Windows `winget install TheDocumentFoundation.LibreOffice`)。
装了 LibreOffice 后文本类也能用(回落路径,`page` 的边距/页码与部分 CSS 不生效),此时不必装 pango。
网络慢或装不上(pip / brew / winget 等):见技能根目录的 `AGENTS.md`。