tool-protocol
Find, build, or adapt automation tools following the Tool Protocol decision tree
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Find, build, or adapt automation tools following the Tool Protocol decision tree
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Create an Architectural Decision Record (ADR) to document a significant design or technology choice
Audit VS Code extensions against the current project stack and recommend keep/add/remove actions
Diagnose and fix a failing CI pipeline or GitHub Actions workflow
Triage a GitHub issue by classifying severity, labelling waste category, proposing next action, and drafting a structured response
Create a new MCP server — clarify purpose, choose transport, scaffold, implement, test, and register
Configure and manage Model Context Protocol servers for external tool access
基于 SOC 职业分类
| name | tool-protocol |
| description | Find, build, or adapt automation tools following the Tool Protocol decision tree |
| compatibility | >=1.4 |
Skill metadata: version "1.0"; license MIT; tags [tools, automation, scripting, toolbox]; compatibility ">=1.4"; recommended tools [codebase, editFiles, runCommands, fetch].
When a task requires automation, a scripted command sequence, or a repeatable utility, follow this decision tree before writing anything ad-hoc.
Need a tool for task X
│
├─ 1. FIND — check .copilot/tools/INDEX.md
│ ├─ Exact match → USE IT directly
│ ├─ Close match → ADAPT (fork, rename, note source in comment at top of file)
│ └─ No match → ↓
│
├─ 1.5 BUILT-IN — check VS Code's native tool capabilities
│ ├─ `list_code_usages` → find all references, implementations, callers of a symbol
│ ├─ `get_errors` → get compile/lint errors for a file or the entire workspace
│ ├─ `fetch_webpage` → fetch web pages, docs, APIs (use for documentation lookups)
│ ├─ `semantic_search` → natural language search across the codebase
│ ├─ `grep_search` → fast text/regex search in workspace files
│ ├─ Sufficient → USE built-in tool
│ └─ Not sufficient → ↓
│
├─ 2. SEARCH online (try in order)
│ a. MCP server registry github.com/modelcontextprotocol/servers
│ b. GitHub search github.com/search?type=repositories&q=<task>
│ c. Awesome lists awesome-cli-apps · awesome-shell · awesome-python · awesome-rust · awesome-go
│ d. Stack registry npmjs.com / pypi.org / crates.io / pkg.go.dev
│ e. Official CLI docs git · docker · gh · jq · ripgrep · sed · awk (built-ins first)
│ ├─ Found something usable → evaluate fit, adapt as needed, note source
│ └─ Nothing applicable → ↓
│
├─ 2.5 COMPOSE — can this be assembled from 2+ existing toolbox tools via pipe or import?
│ ├─ Yes → compose; document the pipeline; save to toolbox if reusable
│ └─ No → ↓
│
└─ 3. BUILD — write the tool from scratch
- Follow §4 coding conventions and §3 LOC baselines
- Single-purpose: one tool, one job; compose via pipes or imports
- Accept arguments instead of hardcoding project-specific paths
- Required inline header at the top of every built or saved tool:
# purpose: <what this tool does — one precise sentence>
# when: <when to invoke it | when NOT to invoke it>
# inputs: <argument list with types and valid values>
# outputs: <what it returns — type and structure>
# risk: safe | destructive
# source: <url or "original" if built from scratch>
│
└─ 4. EVALUATE reusability
├─ ≥ 2 distinct tasks in this project would benefit → SAVE to toolbox
│ a. Place file in .copilot/tools/<kebab-name>.<ext>
│ b. Add a row to .copilot/tools/INDEX.md (see format below)
└─ Single-use / too project-specific → use inline only; do not save
.copilot/tools/ is created on first tool save (no setup step required). Contents:
Files: INDEX.md (catalogue) · *.sh · *.py · *.js/*.ts · *.mcp.json
INDEX.md row format:
| Tool | Lang | What it does | When to use | Output | Risk |
|---|---|---|---|---|---|
count-exports.sh | bash | Count exported symbols per file | API surface audits | symbol counts to stdout | safe |
summarise-metrics.py | python | Parse metrics baselines and print trends | Kaizen review sessions | trend table to stdout | safe |
Naming — Tool names must be a verb-noun kebab phrase describing the action (count-exports, sync-schema), not a noun or generic label (exports, utils).
Risk tier:
safe — read-only or fully idempotent; invoke without confirmationdestructive — deletes files, overwrites data, or writes to remote systems; must pause and confirm with the user before execution, regardless of session autonomy levelOther rules:
[DEPRECATED] in INDEX.md; counts as W1 (Overproduction)grep, head, jq) over raw dumps; return the minimum token payload the callsite requires.Subagents inherit this protocol fully. A subagent may build or adapt a tool independently. To save a tool to the toolbox, the subagent must first flag the proposal to the parent agent, which confirms before any write to .copilot/tools/.