创建工具

创建工具 is a skill for Claude Code, Codex from jianchen08/Agent-os-open. It costs 46 tokens per session (876 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.

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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 876 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.00046 $0.00876
Opus 5 $0.00023 $0.00438
Sonnet 5 $0.00009 $0.00175
Haiku 4.5 $0.00005 $0.00088

Measured yesterday against content hash 9f4a32f3c24f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 yesterday.

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 · 92 lines

What it actually says

创建工具

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

工具创建流程(TDD 模式)

1. 需求分析

  • 明确工具的名称、描述、核心能力、分类(ToolCategory)
  • 明确输入输出接口和使用场景

2. 编写测试(Red 阶段)

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

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

  • 代码写到 src/tools/builtin/{tool_id}.py
  • 写最少的代码让测试通过,不做过度设计
  • 运行测试确认通过(Green)

4. 重构优化(Refactor 阶段)

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

5. 验证提交

  • 运行全部测试通过
  • yaml_validate 验证配置格式(如有配置)

命名规范

对象 规范 示例
工具 ID snake_case web_search
文件名 snake_case.py web_search.py
类名 PascalCase WebSearchTool

工具类规范

  • 所有工具继承 BuiltinTool 基类
  • 实现 get_tool_definition() 静态方法
  • 实现 execute() 异步方法
  • 中文注释,类型注解,遵循项目现有风格

ToolCategory 枚举(必须使用大写)

枚举值 说明
FILE 文件操作
SEARCH 搜索
WEB Web 操作
MEMORY 记忆检索
TASK 任务管理
SYSTEM 系统工具
EXECUTION 命令执行
ANALYSIS 分析
EVALUATION 评估
AGENT Agent 调用
MONITORING 监控

路径规范

资源 路径
工具代码 src/tools/builtin/{tool_id}.py
工具测试 src/tools/builtin/test_{tool_id}.py
工具配置(可选) config/tools/
隔离策略(可选) config/isolation/isolation_policy.yaml

注意事项

  • 创建工具只需创建 {tool_id}.py无需修改 __init__.py,系统自动发现
  • 隔离策略由 config/isolation/isolation_policy.yaml 统一管理,代码中不设置隔离属性
  • 如需特殊隔离,在该配置文件中添加工具配置
  • 为工具设置准确的 category 标签(对应 ToolCategory 枚举)
  • 工具名称要能反映功能(名称用于配置匹配)

验证清单

创建工具后逐项核对:

  • 工具代码文件 src/tools/builtin/{tool_id}.py 存在
  • 测试文件 src/tools/builtin/test_{tool_id}.py 存在且通过
  • 继承 BuiltinTool,实现 get_tool_definition() 和 execute()
  • ToolCategory 设置正确
  • 命名规范一致(tool_id snake_case / 类名 PascalCase)
  • 无需改 init.py
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. yesterday Changed · +2 lines 9f4a32f3c24f
  2. 6d 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 (5 stars, last pushed 2d ago), licensed Apache-2.0. It adds 46 tokens to every session and 876 once invoked, about $0.0002 per session on Opus 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.