Agent skill

Tool Specification

by kangarooking in kangarooking/system-prompt-skills

当需要为 AI 定义工具接口、设计调用规范、实现工具发现与编排机制时调用此 skill。典型场景包括:设计 AI agent 的工具集、定义 JSON Schema/XML/TypeScript 格式的工具描述、实现工具权限控制与并行调度、设计子代理委托架构。

MITAuto-check passedAI & LLM Engineering

Install Tool Specification

skills CLI
$ npx skills add kangarooking/system-prompt-skills --skill tool-specification -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install kangarooking/system-prompt-skills tool-specification --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/kangarooking/system-prompt-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/tool-specification .claude/skills/tool-specification && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tool-specification
GitHub stars
205
Used in
1 other repo
Token cost
~1.1k tokens
SKILL.md length
341 words
Files
1
Skills in repo
15
Repo updated
First seen
Licence
MIT

At a glance

当需要为 AI 定义工具接口、设计调用规范、实现工具发现与编排机制时调用此 skill。典型场景包括:设计 AI agent 的工具集、定义 JSON Schema/XML/TypeScript 格式的工具描述、实现工具权限控制与并行调度、设计子代理委托架构。

  • Works in 5 steps: 定义格式 (Definition Format): JSON… → 权限门控 (Permission Gating):… → 发现机制 (Discovery Mechanism):… → …
  • 信号:AI 需要调用外部 API 或服务、工具数量超过 10 个需要发现机制、需要区分工具权限层级、需要子代理并行执行、工具调用涉及敏感操作需要审批
  • SKILL.md covers R — 原文 (Reading), I — 方法论骨架 (Interpretation), A1 — 案例分析 (Past Application) and A2 — 触发场景 (Future Trigger) ★, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Tool Specification is an agent skill from kangarooking/system-prompt-skills. 当需要为 AI 定义工具接口、设计调用规范、实现工具发现与编排机制时调用此 skill。典型场景包括:设计 AI agent 的工具集、定义 JSON Schema/XML/TypeScript 格式的工具描述、实现工具权限控制与并行调度、设计子代理委托架构。 不适用于:定义 AI 身份(persona-design)、安全规则(safety-guardrails)、记忆存储(memory-system)。 关键 trigger 信号:AI 需要调用外部 API 或服务、工具数量超过 10 个需要发现机制、需要区分工具权限层级、需要子代理并行执行、工具调用涉及敏感操作需要审批。

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering. It works with TypeScript and OpenAI. The repository describes itself as: 从 165 个顶级 AI 产品系统提示词中蒸馏出的 15 个可执行 Agent skill. The licence is MIT.

When your agent uses it

  • 信号:AI 需要调用外部 API 或服务、工具数量超过 10 个需要发现机制、需要区分工具权限层级、需要子代理并行执行、工具调用涉及敏感操作需要审批

Example prompts

  • “/tool-specification”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. 定义格式 (Definition Format): JSON Schema(Meta AI, Claude)、XML(Grok 4 的 xai:function_call)、TypeScript 类型(Codex)——格式选择影响解析效率和可组合性。
  2. 权限门控 (Permission Gating): 三层模型——禁止层(Prohibited,绝不可执行)、显式授权层(Explicit Permission,需用户确认)、常规层(Regular,自动执行)。Claude Chrome 的三层分类是这一模式的典范。
  3. 发现机制 (Discovery Mechanism): 当工具数量庞大时(Jules 25+,Meta AI 四个命名空间),需要延迟加载(Claude Code 的 ToolSearch)或命名空间分组(Meta AI 的…
  4. 并行执行 (Parallel Execution): Claude Code 支持并行工具调用,Gemini CLI 通过子代理委托实现并行调查,ChatGPT Agent 通过三通道架构实现思考与行动的并行。
  5. 生命周期管理 (Lifecycle Management): 工具从发现到执行到结果处理的完整流程。Jules 的 plan/review/submit 三阶段生命周期和 Codex 的 Plan tool with skip rules 是这一模式的代表。

What it can do on your machine

Read from SKILL.md and the folder at commit 252cd52. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Tool Specification loads about 1.1k tokens when it runs. Until then it costs about 78 tokens; SKILL.md has 341 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~78
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from kangarooking/system-prompt-skills at commit 252cd52, republished under its MIT licence (© kangarooking). 341 words, ~1,113 tokens.

Download SKILL.mdSave it as .claude/skills/tool-specification/SKILL.md (or your agent's skills folder).
name
tool-specification
description
当需要为 AI 定义工具接口、设计调用规范、实现工具发现与编排机制时调用此 skill。典型场景包括:设计 AI agent 的工具集、定义 JSON Schema/XML/TypeScript 格式的工具描述、实现工具权限控制与并行调度、设计子代理委托架构。 不适用于:定义 AI 身份(persona-design)、安全规则(safety-guardrails)、记忆存储(memory-system)。 关键 trigger 信号:AI 需要调用外部 API 或服务、工具数量超过 10 个需要发现机制、需要区分工具权限层级、需要子代理并行执行、工具调用涉及敏感操作需要审批。
tags
tool-use, function-calling, agent-architecture, api-design
related_skills
persona-design, safety-guardrails

工具定义与集成模式 (Tool Specification)

R — 原文 (Reading)

Claude Code: ToolSearch 用于延迟加载, parallel tool calls, Agent tool 用于子代理委托 Claude Chrome: PURL 紧凑命令模式, 三层行动分类 (Prohibited/Explicit Permission/Regular) GPT-4o: Content Reference System, file_search with citation format ChatGPT Agent Mode: 三通道架构 (analysis/commentary/final), browser+computer+container tools Meta AI: 四个命名空间 (media, browser, meta_1p, container, third_party) with full JSON Schema Grok 4: Custom XML function call format (xai:function_call), code_execution with stateful REPL

I — 方法论骨架 (Interpretation)

工具定义与集成的核心设计模式包含五个正交维度:

  1. 定义格式 (Definition Format): JSON Schema(Meta AI, Claude)、XML(Grok 4 的 xai:function_call)、TypeScript 类型(Codex)——格式选择影响解析效率和可组合性。
  2. 权限门控 (Permission Gating): 三层模型——禁止层(Prohibited,绝不可执行)、显式授权层(Explicit Permission,需用户确认)、常规层(Regular,自动执行)。Claude Chrome 的三层分类是这一模式的典范。
  3. 发现机制 (Discovery Mechanism): 当工具数量庞大时(Jules 25+,Meta AI 四个命名空间),需要延迟加载(Claude Code 的 ToolSearch)或命名空间分组(Meta AI 的 media/browser/meta_1p/container/third_party)。
  4. 并行执行 (Parallel Execution): Claude Code 支持并行工具调用,Gemini CLI 通过子代理委托实现并行调查,ChatGPT Agent 通过三通道架构实现思考与行动的并行。
  5. 生命周期管理 (Lifecycle Management): 工具从发现到执行到结果处理的完整流程。Jules 的 plan/review/submit 三阶段生命周期和 Codex 的 Plan tool with skip rules 是这一模式的代表。

A1 — 案例分析 (Past Application)

案例 1: Claude Chrome 的三层权限门控
  • 问题: 浏览器操作涉及极高安全风险(支付、删除、导航到恶意站点),如何在不牺牲易用性的前提下实现安全控制?
  • 设计模式的使用: 将所有浏览器操作分为三层——Prohibited(如自动填写密码字段,绝不执行)、Explicit Permission(如点击购买按钮,必须用户确认)、Regular(如滚动页面,自动执行)。配合 critical_injection_defense 安全层,形成深度防御。
  • 结论: 三层分类比简单的"允许/禁止"二分法更灵活,既避免了过度限制又守住了安全底线。
案例 2: Meta AI 的四命名空间工具架构
  • 问题: Meta 的工具集横跨媒体生成、浏览器操作、第一方服务和第三方插件,如何管理这种复杂度?
  • 设计模式的使用: 将工具按功能域分为四个命名空间,每个命名空间内的工具共享统一的 JSON Schema 定义和权限策略。这种分组方式使得添加新工具成为局部操作,不影响其他命名空间。
  • 结论: 命名空间分组是工具数量超过 15 个时的必选策略,否则 system prompt 会变得不可维护。
案例 3: Gemini CLI 的子代理委托
  • 问题: 单一代理如何高效处理需要并行调查的复杂编程任务?
  • 设计模式的使用: 实现 codebase_investigator、cli_help、generalist、browser_agent 四种专用子代理。主代理作为编排者,将不同类型的子任务委托给专用子代理并行执行,最后汇总结果。
  • 结论: 子代理委托模式在复杂任务中显著优于单体代理,但需要精心设计子代理间的信息传递机制。

A2 — 触发场景 (Future Trigger) ★

用户会在什么情境下需要这个 skill?
  1. 设计 AI agent 的工具集,从零开始定义工具接口
  2. 工具数量增长到需要发现机制或分组策略
  3. 某些工具操作涉及安全风险,需要设计权限控制
  4. 需要实现子代理或并行执行架构
  5. 需要选择工具定义格式(JSON Schema / XML / TypeScript)
语言信号
  • "AI 需要调用外部工具/API"
  • "工具太多,模型经常用错"
  • "某些操作需要用户确认才能执行"
  • "如何设计 function calling 的 schema"
  • "需要子代理并行处理"
与相邻 skill 的区分
  • 与 safety-guardrails 的区别: tool-specification 中的权限门控是工具层面的操作控制("这个按钮能不能按"),safety-guardrails 是内容层面的行为约束("能不能讨论这个话题")。两者互补但不重叠。
  • 与 persona-design 的区别: persona-design 决定 AI "是谁",tool-specification 决定 AI "能做什么"。

E — 可执行步骤 (Execution)

  1. 步骤 1: 选择定义格式

    • 评估工具使用场景:标准 API 调用用 JSON Schema,需要与 XML 生态集成用 XML 格式,内部工具可用 TypeScript 类型
    • 为每个工具编写接口定义,包含名称、描述、参数列表和返回值格式
    • 完成标准: 格式选择有明确理由,且每个工具的定义能被模型准确理解和调用
  2. 步骤 2: 实现三层权限门控

    • 将所有工具操作分类:Prohibited(自动拒绝)、Explicit Permission(需确认)、Regular(自动执行)
    • 为 Explicit Permission 层设计用户确认流程和超时机制
    • 完成标准: 每个工具操作都有明确的权限层级分类,且分类结果经过安全评审
  3. 步骤 3: 设计发现与分组策略

    • 工具数量 <10: 全量列举在 system prompt 中
    • 工具数量 10-25: 按功能域分组,使用命名空间
    • 工具数量 >25: 实现延迟加载机制(如 ToolSearch),按需发现
    • 完成标准: 模型在任何场景下都能在 2 轮对话内找到并调用正确的工具
  4. 步骤 4: 设计并行执行与委托机制

    • 识别可并行的工具调用(如多个独立搜索、多文件读取)
    • 设计子代理委托协议:任务描述格式、结果返回格式、错误处理
    • 完成标准: 并行调用不产生竞态条件,子代理结果能被主代理正确汇总
  5. 步骤 5: 定义生命周期与错误处理

    • 设计工具调用的生命周期:发现 → 参数构造 → 权限检查 → 执行 → 结果解析 → 错误恢复
    • 为每个阶段定义失败处理策略
    • 完成标准: 任何工具调用失败都不会导致 agent 停滞,且有明确的降级策略

B — 边界 (Boundary) ★

不要在以下情况使用此 skill
  • AI 产品不需要调用任何外部工具(纯对话场景)
  • 工具集成属于后端工程问题而非 prompt 设计问题(如 API 实现)
  • 试图通过工具设计解决安全问题(安全规则应在 safety-guardrails 中定义)
  • 工具数量极少(<5 个)且无安全风险(简单列举即可,无需复杂设计)
常见失败模式
  • 工具描述歧义: 工具的自然语言描述不够精确,导致模型在边界情况下调错工具。应使用具体示例而非抽象描述。
  • 权限层级过度简化: 所有操作都设为 Regular 或都需要确认,前者导致安全风险,后者导致用户体验灾难。应严格使用三层分类。
  • 忽略工具发现成本: 大量工具全部写入 system prompt,消耗宝贵的上下文窗口。应按需加载。
  • 子代理信息孤岛: 子代理之间无法共享上下文,导致重复工作或信息矛盾。应设计明确的信息传递协议。
  • 缺少错误恢复: 工具调用失败后 agent 直接放弃或陷入重试循环。应定义降级策略和最大重试次数。

© kangarooking, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in tool-specification of kangarooking/system-prompt-skills.

Open the folder on GitHubat commit 252cd52

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in kangarooking/system-prompt-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Tool Specification next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Tool Specification compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tool Specification this skillkangarooking/system-prompt-skills2051 repos~1.1kAutomated safety check: PassMIT
Trigger.dev Agent Patternspapermark/papermark9.2k—~2kAutomated safety check: PassCustom licence
Claude APIKocoro-lab/Kocoro4148 repos~4.5kAutomated safety check: PassApache-2.0
Add Example AgentGetBindu/Bindu10k—~1.1kAutomated safety check: NotesCustom licence
Agent Squad for TypeScript2FastLabs/agent-squad7.8k—~4.3kAutomated safety check: PassApache-2.0
Duel Agents2aronS/Duel-Agents746—~228Automated safety check: PassMIT

Similar skills

  • Trigger.dev Agent Patterns

    papermark/papermark

    Patterns for building LLM agents on Trigger.dev tasks: prompt chaining, routing, parallel workers, orchestrator-workers, evaluator loops and human approval gates.

    9.2k GitHub stars~2k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • Claude API

    Kocoro-lab/Kocoro

    Build apps with the Claude API or Anthropic SDK. An agent skill from Kocoro-lab/Kocoro.

    414 GitHub starsUsed in 8 repos~4.5k tokens
    AI & LLM EngineeringAuto-check passed
  • Add Example Agent

    GetBindu/Bindu

    Add a new self-contained example agent under examples/. An agent skill from GetBindu/Bindu.

    10k GitHub stars~1.1k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check: notes
  • Agent Squad for TypeScript

    2FastLabs/agent-squad

    Guide to building Node.js and TypeScript apps on the agent-squad package: orchestrator, agent types, classifier routing, storage, retrievers and MCP tools.

    7.8k GitHub stars~4.3k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Duel Agents

    2aronS/Duel-Agents

    Use Duel Agents model routing in Cursor. An agent skill from 2aronS/Duel-Agents.

    746 GitHub stars~228 tokensUpdated 3 mo ago
    AI & LLM EngineeringAuto-check passed
  • Azure Openai To Responses

    microsoft/ai-agents-for-beginners

    Official

    Migrate Python apps from Azure OpenAI Chat Completions to the Responses API.

    77k GitHub stars~6k tokensUpdated 18 days ago
    AI & LLM EngineeringAuto-check: notes

More from kangarooking/system-prompt-skills

All 15 skills in this repo
  • Persona Design

    kangarooking/system-prompt-skills

    当需要为 AI 产品定义核心身份、角色声明和能力边界时调用此 skill。典型场景包括:设计新 AI 产品的 system prompt 首段、为不同场景创建差异化角色(如教学助手 vs 编程代理)、重新定义 AI 与用户的关系框架。

    205 GitHub starsUsed in 1 repo~956 tokens
    Auto-check passed
  • Memory System

    kangarooking/system-prompt-skills

    当需要为 AI 设计记忆存储、检索、应用和更新机制时调用此 skill。典型场景包括:设计持久化记忆架构(用户偏好、历史上下文、项目知识)、定义记忆的创建/读取/更新/删除生命周期、实现静默记忆应用(不在回复中透露记忆内容)、管理敏感记忆边界。

    205 GitHub stars~1.2k tokensUpdated 5 mo ago
    Auto-check passed
  • Personality System

    kangarooking/system-prompt-skills

    当需要在基础身份之上叠加可切换的人格风格层时调用此 skill。典型场景包括:为同一产品提供多种人格选项(如 GPT-5.1 的 friendly/professional/quirky 模式)、设计人格切换机制、防止人格泄露到用户内容中。

    205 GitHub stars~1k tokensUpdated 5 mo ago
    Auto-check passed
  • Conversation Flow

    kangarooking/system-prompt-skills

    当系统提示词需要定义 AI 如何分类用户意图、路由到不同处理流程、决定澄清策略和自主度级别时调用此 Skill。适用于多任务型 AI 助手、客服机器人、编程工具、研究助手等需要结构化对话管理的场景。不适用于:纯问答型系统(无任务执行)、单轮交互(无对话状态)、简单的 prompt 模板(无路由逻辑)。当需求仅涉及"输出什么格式"而非"如何决定输出什么"时,应该用…

    205 GitHub starsUsed in 1 repo~788 tokens
    Auto-check passed
  • Safety Guardrails

    kangarooking/system-prompt-skills

    当需要为 AI 系统设计多层安全防线、内容过滤策略和伦理边界时调用此 skill。典型场景包括:设计拒绝策略与升级机制、防御 prompt 注入攻击、实现领域特定安全规则(教育、医疗、金融等)、定义 AI 的价值观锚点。

    205 GitHub stars~1.2k tokensUpdated 5 mo ago
    Auto-check passed
  • Agent Delegation

    kangarooking/system-prompt-skills

    当系统提示词需要设计多代理协作架构、子代理专业化分工、代理间上下文隔离与传递机制、任务生命周期管理时调用此 Skill。适用于 AI Agent 平台、多工具编排系统、代码审查流水线、跨应用协作场景等。不适用于:单代理系统(无委派需求)、简单工具调用(无子代理概念)、纯 API 编排(无 AI 决策)。当需求聚焦于"单代理内的对话路由"而非"多代理间的任务分配"时,应该用…

    205 GitHub stars~897 tokensUpdated 5 mo ago
    Auto-check passed

Questions about Tool Specification

What does Tool Specification do?

当需要为 AI 定义工具接口、设计调用规范、实现工具发现与编排机制时调用此 skill。典型场景包括:设计 AI agent 的工具集、定义 JSON Schema/XML/TypeScript 格式的工具描述、实现工具权限控制与并行调度、设计子代理委托架构。. Tool Specification is an agent skill from kangarooking/system-prompt-skills.

When should I use Tool Specification?

Tool Specification fits situations like: 信号:AI 需要调用外部 API 或服务、工具数量超过 10 个需要发现机制、需要区分工具权限层级、需要子代理并行执行、工具调用涉及敏感操作需要审批.

How do I install Tool Specification in Claude Code?

Run `npx skills add kangarooking/system-prompt-skills --skill tool-specification -a claude-code`. Or copy the skill folder (tool-specification in kangarooking/system-prompt-skills) into .claude/skills/tool-specification in your project. Claude Code loads it when a task matches its description.

How do I install Tool Specification in Codex?

Run `npx skills add kangarooking/system-prompt-skills --skill tool-specification -a codex`. Or copy the skill folder (tool-specification in kangarooking/system-prompt-skills) into .agents/skills/tool-specification in your project. Codex loads it when a task matches its description.

Can I use Tool Specification in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add kangarooking/system-prompt-skills --skill tool-specification -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tool-specification, .gemini/skills/tool-specification, .github/skills/tool-specification and .opencode/skills/tool-specification in your project.

What does Tool Specification need to run?

SKILL.md names no scripts, command-line tools or credentials: Tool Specification is instructions for the agent only.

Does Tool Specification access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Tool Specification safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Tool Specification use?

Tool Specification is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Tool Specification use?

About 1.1k tokens (SKILL.md is roughly 4.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Tool Specification?

Skills that share tags, products or a category with Tool Specification: Trigger.dev Agent Patterns (papermark/papermark, 9.2k stars), Claude API (Kocoro-lab/Kocoro, 414 stars), Add Example Agent (GetBindu/Bindu, 10k stars) and Agent Squad for TypeScript (2FastLabs/agent-squad, 7.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tool Specification?

kangarooking (a GitHub user) maintains it in kangarooking/system-prompt-skills, which has 205 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on May 4, 2026.

Source: kangarooking/system-prompt-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.