tool-creator
把用户的可复用需求封装成标准化的 Agent-CLI 工具,并用 `myagents tool add` 注册进 MyAgents 工具注册表——注册后所有未来会话(builtin / Claude Code / Codex / Gemini 全 runtime)的 AI 都会在 system prompt 里自动发现它。触发场景:(1) 用户说「把 XX 封装成工具」「做成一个工具」「注册个工具」「写个 CLI」「以后能直接用」;(2) 用户描述一个会反复出现的自动化需求——文档/文件批量处理、调用某个云 API、用某个多模态大模型做图像/视频理解等,即使没说"工具"两个字;(3) 你发现自己第二次为同类需求写几乎一样的脚本——这时要主动提议把它升格为注册工具,不要等用户开口。反向边界:一次性任务就地解决、不铸工具;接入现成的 MCP server 用 `myagents mcp`,不归这里。
npx skills add hAcKlyc/MyAgents --skill tool-creator --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Tool Creator — 创建并注册 Agent-CLI 工具 你正在 MyAgents 里运行。MyAgents 有一个**工具注册表**(`~/.myagents/tools/`):注册进去的 CLI 工具会被投放到 PATH(`~/.myagents/bin/`),它的 description 会自动注入所有未来会话的 system prompt——**未来的 AI(包括别的 runtime 上的)会自己想起它、查它的用法、调用它**。用户也能在设置页「工具箱」里看到并管理它。 这个 skill 教你两件事:**写出一个对 Agent 友好的合格 CLI 工具**,以及**把它注册进去**。 ## 第 0 步:判断要不要铸工具 铸一个工具是在为未来的几百次调用做投资,但注册表里的每个工具都占一行 system prompt。判断标准: - **铸**:需求会重复出现(用户明说"以后还要用",或你已经第二次写同类脚本);有清晰的输入→输出边界;参数可枚举。 - **不铸**:一次性任务(就地写脚本跑完即弃);纯交互探索类需求;已有注册工具能覆盖(先 `myagents tool list` 查一遍)。 - 模型管理器里已配置的模型、单发单收的调用——未来由 `myagents model call` 覆盖(若该命令存在,优先用它,不铸工具)。 灰色地带主动问用户:"这个要不要我注册成工具,以后直接用?" ## 第 1 步:选原型 | 原型 | 特征 | 范例(动手前先读对应那个) | |------|------|--------------------------| | **A · 纯本地处理** | 文件进文件出,零网络、零密钥 | `references/example-local-tool.md` | | **B · API 包装** | 调外部 API,有密钥,可能多步工作流(上传→轮询→取结果) | `references/example-api-tool.md` | 两个范例都是完整可跑的代码,**照着改,不要从零发明结构**。 ## 第 2 步:写工具——形态契约 ### 目录布局 ``` ~/.myagents/tools/<tool-name>/ ├── tool.json # manifest(注册时被读取校验) └── run.mjs # 入口,Node 单文件 ``` ### tool.json ```json { "name": "md-merge", "version": "1.0.0", "description": "<≤800 字符,见第 3 步的撰写模板>", "entry": "run.mjs", "runtime": "node", "envKeys": [], "deps": [] } ``` - `n
- 第 0 步:判断要不要铸工具
- 第 1 步:选原型
- 第 2 步:写工具——形态契约
- 目录布局
- tool.json
- 技术栈
- 八条生死线
- 三条进阶约定(让工具经得起时间)
- 第 3 步:写三面文档
- description(≤800 字符,超长注册时被打回)
- --help
- readme 子命令
- 第 4 步:自测三连
- 第 5 步:注册 + 告知
node run.mjs --help # 用法契约行 + 示例齐全? node run.mjs readme # 六个固定章节齐全? node run.mjs <真实参数> # 一次真实调用:stdout 干净?exit code 对?--json 可解析? myagents tool add ~/.myagents/tools/<tool-name> # 校验 manifest、投 shim、进注册表 myagents tool env <tool-name> set API_KEY=<value> # 原型 B:设密钥(让用户提供,绝不编造) myagents tool list # 确认出现在清单里
What does the tool-creator skill do?
把用户的可复用需求封装成标准化的 Agent-CLI 工具,并用 `myagents tool add` 注册进 MyAgents 工具注册表——注册后所有未来会话(builtin / Claude Code / Codex / Gemini 全 runtime)的 AI 都会在 system prompt 里自动发现它。触发场景:(1) 用户说「把 XX 封装成工具」「做成一个工具」「注册个工具」「写个 CLI」「以后能直接用」;(2) 用户描述一个会反复出现的自动化需求——文档/文件批量处理、调用某个云 API、用某个多模态大模型做图像/视频理解等,即使没说"工具"两个字;(3) 你发现自己第二次为同类需求写几乎一样的脚本——这时要主动提议把它升格为注册工具,不要等用户开口。反向边界:一次性任务就地解决、不铸工具;接入现成的 MCP server 用 `myagents mcp`,不归这里。
How do I install it?
Run `npx skills add hAcKlyc/MyAgents --skill tool-creator --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From hAcKlyc/MyAgents, a repository with 795 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
