创建工具

创建工具 is a skill for Claude Code, Codex from jianchen08/Agent-os-open. It costs 54 tokens per session (975 once invoked), scanned A, original, Apache-2.0.

A development guide for creating or changing built-in tools. It explains test-driven development (TDD), where tests are written before the code, along with naming, file paths, and required class methods.

In plain words
What is it for?
Planning, testing, implementing, and checking Python built-in tools in the project.
Why use it?
It reduces guesswork about how tools should be structured, tested, named, and validated.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md.

Good fit Planning, testing, implementing, and checking Python built-in tools in the project.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jianchen08/agent-os-open/resource-tool-create
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add jianchen08/Agent-os-open --skill resource-tool-create
Clone the repo
git clone --depth 1 https://github.com/jianchen08/Agent-os-open

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for 创建工具

README.md
[![agentmods](https://agentmods.dev/badge/skills/jianchen08/agent-os-open/resource-tool-create/github.svg)](https://agentmods.dev/skills/jianchen08/agent-os-open/resource-tool-create)
Your own site
<a href="https://agentmods.dev/skills/jianchen08/agent-os-open/resource-tool-create"><img src="https://agentmods.dev/badge/skills/jianchen08/agent-os-open/resource-tool-create/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for 创建工具

Your own site · 80×15
<a href="https://agentmods.dev/skills/jianchen08/agent-os-open/resource-tool-create"><img src="https://agentmods.dev/badge/skills/jianchen08/agent-os-open/resource-tool-create.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 975 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00054 $0.00975
Opus 5.5 $0.00022 $0.00390
Sonnet 5.5 $0.00011 $0.00195
Haiku 4.5 $0.00005 $0.00097

Measured 1mo ago against content hash 205b901812c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

创建工具 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/resource-tool-create/SKILL.md · 74 lines

What it actually says

创建工具

本技能是流程指引,不是逐条打勾清单:按场景判断使用,遇不适用情况保持裁量,不机械执行。

工具创建流程(TDD 模式)

1. 需求分析

  • 明确工具的名称(tool_id,snake_case)、描述、输入输出接口、使用场景
  • 先查 plugins/shared/tools/ 现有工具:能复用/扩展现有工具时禁止新建

2. 编写测试(Red 阶段)

  • 测试写到 plugins/shared/tools/{tool_id}/test_{tool_id}.py(与实现同层)
  • 覆盖:核心功能、边界情况、错误处理
  • 测试中引用尚未实现的工具实现,运行确认失败(Red)

3. 生成工具代码(Green 阶段)

  • 实现写到 plugins/shared/tools/{tool_id}/,写最少的代码让测试通过
  • 运行测试确认通过(Green):pytest plugins/shared/tools/{tool_id}/

4. 重构优化(Refactor 阶段)

  • 测试通过前提下优化代码,运行测试确认无回归

5. 声明与登记(0.2 必做)

  • plugin.json 的 capabilities.tools[] 声明即注册(无需类型豁免,无需改 __init__.py)
  • 把 tool_id 加入目标 agent 的 tool_ids 白名单(如 config/agents/main/agentos.yaml)——不登记则 LLM 工具面不可见

plugin.json 工具声明(0.2 契约)

目录布局(参照现有插件 plugins/shared/tools/bash/、download/):

plugins/shared/tools/{tool_id}/
├── plugin.json      # 清单:声明即注册
├── server.py        # 入口(entry: "python server.py")
├── tool.py          # 工具实现
├── test_{tool_id}.py
└── pyproject.toml / uv.lock   # 有第三方依赖时

capabilities.tools[] 每个工具声明(tool_core 校验 fail-closed):

字段 必填 说明
name ✅ 工具调用名(snake_case)
description ✅ 给 LLM 看的能力描述(何时用、参数含义)
category ✅ 参照同类工具取值(如 system)
input_schema ✅ JSON Schema(type/properties/required)
output_schema ✅ JSON Schema——工具契约,缺失过不了 tool_core 校验
render ✅ 前端渲染意图(如 {"card": "terminal"}),前端按 render 路由

清单其他关键字段:plugin_type: "tool"、host_type(sidecar 进程内)、entry、 permissions(filesystem/network/env_vars,最小授权)。

热发现行为

  • 新建插件目录、修改 plugin.json、修改插件代码均由 watcher 自动处理 (发现→G2 校验→注册/重注册),无需重启
  • 前端 schema 需刷新页面才更新
  • G2 校验失败的插件不入面——先修声明再查代码

验证清单

创建工具后逐项核对:

  • plugins/shared/tools/{tool_id}/plugin.json 存在,capabilities.tools 声明含 output_schema + render
  • pytest plugins/shared/tools/{tool_id}/ 通过(含 Red 阶段写下的用例)
  • tool_id 已加入目标 agent 的 tool_ids 白名单
  • 权限 permissions 最小授权(不写 "*" 除非确有必要)
  • 触碰即清:新代码带测试,不动 mypy/覆盖率基线(见 AGENTS.md 治理债条款)
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · -18 lines · +8 tokens per session 205b901812c2
  2. 1mo ago Changed · +2 lines 9f4a32f3c24f
  3. 1mo ago First seen · 90 lines · 46 tokens per session scan A 2e8a33472662

Subscribe to this mod's changes

创建工具 is a skill published in the GitHub repository jianchen08/Agent-os-open (7 stars, last pushed 15d ago), licensed Apache-2.0. It adds 54 tokens to every session and 975 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.