feat: 为 skill-generator 添加脚本执行能力

- 默认创建 scripts/ 目录用于存放确定性脚本
- 新增 specs/scripting-integration.md 脚本集成规范
- 新增 templates/script-python.md 和 script-bash.md 脚本模板
- 模板中添加 ## Scripts 声明和 ExecuteScript 调用示例
- 支持命名即ID、扩展名即运行时的约定
- 参数自动转换: snake_case → kebab-case
- Bash 模板使用 jq 构建 JSON 输出

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
catlog22
2026-01-11 23:14:00 +08:00
parent 37614a3362
commit cefb934a2c
6 changed files with 808 additions and 10 deletions

View File

@@ -17,11 +17,22 @@
{{preconditions_list}}
## Scripts
\`\`\`yaml
# 声明本动作使用的脚本(可选)
# - script-id # 对应 scripts/script-id.py 或 .sh
\`\`\`
## Execution
\`\`\`javascript
async function execute(state) {
{{execution_code}}
// 调用脚本示例
// const result = await ExecuteScript('script-id', { input: state.context.data });
// if (!result.success) throw new Error(result.stderr);
}
\`\`\`