fix(skills): 添加脚本路径强制规则,修复 docx/pptx/xlsx 脚本找不到的问题

Agent 执行技能内置脚本时 cwd 不在技能目录,导致 python scripts/... 相对路径失败。
在 L2 规范中增加 Script Path Rule,要求使用 <skill-dir> 拼接完整路径。
This commit is contained in:
2026-05-13 20:01:56 +08:00
parent 3c48bdd96b
commit 9eb03e2f24
6 changed files with 89 additions and 9 deletions

View File

@@ -21,6 +21,20 @@ xlsx 是一个**流程型技能Procedural Skill**,提供 Excel 电子表
## L2详细规范
### 脚本路径规则(强制)
本技能自带的 Python 脚本位于技能安装目录内。执行时**必须使用完整路径**,不能使用相对路径。
技能目录由上下文中的 `<skill-dir>` 标签提供。所有 `scripts/` 开头的命令都应拼接为:
```bash
python "<skill-dir>/scripts/office/unpack.py" spreadsheet.xlsx unpacked/
python "<skill-dir>/scripts/office/pack.py" unpacked/ output.xlsx
python "<skill-dir>/scripts/recalc.py" output.xlsx
```
**禁止**直接执行 `python scripts/office/unpack.py`——该相对路径在用户工作目录下不存在。
## Prerequisites
### Python 3必需