1
0

增加js-runner的skill

This commit is contained in:
2026-02-05 11:25:01 +08:00
parent a3169930fd
commit 9e42c2ccd9
9 changed files with 717 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
## 1. 项目设置和目录结构
- [x] 1.1 验证 `skills/js-runner/` 目录结构
- [x] 1.2 创建 `skills/js-runner/scripts/` 目录(注意是复数 scripts/
- [x] 1.3 确认现有测试文件 `skills/js-runner/test/axios.js` 的状态
- [x] 1.4 验证 Bun 运行时是否已安装(本地开发环境)
## 2. 实现临时路径生成辅助脚本
- [x] 2.1 创建 `skills/js-runner/scripts/get_temp_path.js` 文件(使用 JavaScript
- [x] 2.2 实现 `getTempPath(extension)` 函数
- [x] 2.3 确保函数生成唯一路径(包含时间戳和随机字符串)
- [x] 2.4 测试辅助脚本的输出格式正确性
- [x] 2.5 使用 `bun scripts/get_temp_path.js` 验证脚本可执行
## 3. 编写 SKILL.md 文档
- [x] 3.1 创建 `skills/js-runner/SKILL.md` 文档
- [x] 3.2 添加必要的 YAML frontmatter
- `name: js-runner`
- `description` 描述功能和场景
- 可选 `compatibility` 说明 Bun 依赖
- [x] 3.3 编写 Bun 安装说明和先决条件
- [x] 3.4 描述完整的调用流程(供大模型使用):
- 执行 `bun --version` 检查环境
- 调用 `scripts/get_temp_path.js` 生成临时文件路径
- 写入脚本内容到临时文件
- 使用 `bun <temp-file>` 执行脚本
- 输出结果到 stdout/stderr
- [x] 3.5 添加调用流程的完整示例代码
- [x] 3.6 添加依赖管理示例(通过 import 直接引入Bun 自动处理)
- [x] 3.7 添加 JavaScript 和 TypeScript 执行示例(同样流程)
- [x] 3.8 添加错误处理和故障排除指南
- [x] 3.9 添加辅助函数 API 参考
- [x] 3.10 说明不主动清理临时文件,由系统自动处理
## 4. 验证 SKILL.md 格式
- [x] 4.1 使用 `skills-ref validate ./skills/js-runner` 验证格式(如果可用)
- [x] 4.2 确认 frontmatter 符合 Agent Skills 规范
- [x] 4.3 确认 name 字段格式正确(小写、数字、连字符)
- [x] 4.4 确认 description 字段长度在 1024 字符以内
- [x] 4.5 确认文档内容清晰且易于理解
## 5. 集成和最终验证
- [x] 5.1 手动测试 `scripts/get_temp_path.js` 辅助脚本
- [x] 5.2 验证 SKILL.md 格式符合规范
- [x] 5.3 验证调用流程的可行性
- [x] 5.4 验证与 `python-runner` 模式的一致性
- [x] 5.5 提交所有更改到版本控制(如适用)