Improve Tool Families Skill
The "Tool Output Token Analysis" tab in the VS Code extension groups tool
calls into families (File Reading, File Writing, Search & Discovery,
Shell / Terminal, Code Intelligence, Web & Research, ...) so a "built-in"
tool's token efficiency can be compared against "alternative" tools that do
the same job. That grouping comes from DEFAULT_TOOL_FAMILIES in
vscode-extension/src/toolFamilies.ts, merged with any user overrides in the
aiEngineeringFluency.toolFamilies VS Code setting.
The matching is an exact string match against the raw tool name recorded
per editor (see src/adapters/*.ts and usageAnalysis.ts writing into
toolCalls.byTool/outputTokensByTool) — there is no cross-editor
normalization step first. That means every spelling a different editor/agent
uses for "read a file", "run a shell command", "search text", etc. must be
listed explicitly, or it silently falls into the generic "Other Tools"
bucket instead of being compared.
What the script does
analyze-tool-families.js:
- Loads the canonical set of known tool names from
src/toolNames.json
(the cross-editor tool-name → friendly-name map used elsewhere in the
repo) and/or an ad-hoc list passed via --tools.
- Parses
DEFAULT_TOOL_FAMILIES out of vscode-extension/src/toolFamilies.ts
(no build step needed).
- Reports which candidate tool names are not yet covered by any
family's
builtIn/alternatives arrays.
- Suggests a likely family for each uncovered name using keyword
heuristics (e.g. names containing
read/view → reading,
grep/glob/search → search, run/terminal/bash → shell,
web/fetch → web, etc.).
It does not edit toolFamilies.ts automatically — deciding whether a
tool is a plain "builtIn" (baseline) tool or a more token-efficient
"alternative" is a judgment call that needs a human/agent to review the
tool's actual behavior, not just its name.
Usage
# Compare against every name in src/toolNames.json
node .github/skills/improve-tool-families/analyze-tool-families.js
# Also check specific tool names (e.g. the current agent session's own tool list)
node .github/skills/improve-tool-families/analyze-tool-families.js --tools view,edit,grep,glob,powershell,web_fetch,ask_user
# Machine-readable JSON (for further processing)
node .github/skills/improve-tool-families/analyze-tool-families.js --json
Options
| Flag |
Meaning |
--tools=a,b,c |
Additional comma-separated tool names to check for coverage (e.g. this session's own live tool list) |
--json |
Emit JSON only |
--help |
Print this file |
Exit codes
0 — ran successfully (report may still list uncovered tools)
2 — configuration / environment error (source files not found or unparsable)
Workflow: applying the suggestions
- Run the script (optionally with
--tools set to your current tool list —
in an agent session this is just the list of tools you have available).
- For each suggested family, look at the listed tool names and decide:
- Is it just another editor's spelling of an existing baseline tool
(e.g.
Read, read_file vs. read/view) → add to builtIn.
- Is it a genuinely more targeted/efficient tool for the same job
(e.g.
apply_patch, replace_string_in_file, multi_edit vs. a full
file rewrite) → add to alternatives.
- Is it not actually comparable (e.g. issue/PR/notebook management
tools, orchestration tools like
task/write_agent) → leave it out;
not every tool needs a family.
- Edit
vscode-extension/src/toolFamilies.ts (DEFAULT_TOOL_FAMILIES).
- Verify with
cd vscode-extension && npm run validate (tsc + eslint +
esbuild).
- Re-run this script to confirm the previously-uncovered names are now
covered.
Related files
vscode-extension/src/toolFamilies.ts — DEFAULT_TOOL_FAMILIES,
mergeToolFamilies, getToolFamilies (source of truth for family data)
vscode-extension/package.json — JSON schema for the
aiEngineeringFluency.toolFamilies override setting
vscode-extension/src/webview/diagnostics/main.ts —
renderToolAnalysisTab/renderToolFamilySection (exact-match rendering
logic; anything not claimed by a family lands in "Other Tools")
src/toolNames.json — canonical cross-editor tool-name → friendly-name
map, the best available source of real-world tool name spellings
src/adapters/*.ts, src/usageAnalysis.ts — where raw tool names are
recorded into toolCalls.byTool / outputTokensByTool per editor
1---2name: improve-tool-families3description: Analyze coverage of the vscode-extension's tool-family definitions (DEFAULT_TOOL_FAMILIES in vscode-extension/src/toolFamilies.ts) against the canonical tool-name list in src/toolNames.json and/or a live agent tool list, and suggest which family missing tool names likely belong to. Use when the Tool Output Token Analysis tab shows too many tools bucketed under "Other Tools", after adding a new editor adapter, after a new agent/CLI's tool list grows, or when asked to improve/expand the preconfigured tool families.4---56# Improve Tool Families Skill78The "Tool Output Token Analysis" tab in the VS Code extension groups tool9calls into **families** (File Reading, File Writing, Search & Discovery,10Shell / Terminal, Code Intelligence, Web & Research, ...) so a "built-in"11tool's token efficiency can be compared against "alternative" tools that do12the same job. That grouping comes from `DEFAULT_TOOL_FAMILIES` in13`vscode-extension/src/toolFamilies.ts`, merged with any user overrides in the14`aiEngineeringFluency.toolFamilies` VS Code setting.1516**The matching is an exact string match** against the raw tool name recorded17per editor (see `src/adapters/*.ts` and `usageAnalysis.ts` writing into18`toolCalls.byTool`/`outputTokensByTool`) — there is no cross-editor19normalization step first. That means every spelling a different editor/agent20uses for "read a file", "run a shell command", "search text", etc. must be21listed explicitly, or it silently falls into the generic "Other Tools"22bucket instead of being compared.2324## What the script does2526`analyze-tool-families.js`:271. Loads the canonical set of known tool names from `src/toolNames.json`28 (the cross-editor tool-name → friendly-name map used elsewhere in the29 repo) and/or an ad-hoc list passed via `--tools`.302. Parses `DEFAULT_TOOL_FAMILIES` out of `vscode-extension/src/toolFamilies.ts`31 (no build step needed).323. Reports which candidate tool names are **not yet covered** by any33 family's `builtIn`/`alternatives` arrays.344. Suggests a likely family for each uncovered name using keyword35 heuristics (e.g. names containing `read`/`view` → `reading`,36 `grep`/`glob`/`search` → `search`, `run`/`terminal`/`bash` → `shell`,37 `web`/`fetch` → `web`, etc.).3839It does **not** edit `toolFamilies.ts` automatically — deciding whether a40tool is a plain "builtIn" (baseline) tool or a more token-efficient41"alternative" is a judgment call that needs a human/agent to review the42tool's actual behavior, not just its name.4344## Usage4546```bash47# Compare against every name in src/toolNames.json48node .github/skills/improve-tool-families/analyze-tool-families.js4950# Also check specific tool names (e.g. the current agent session's own tool list)51node .github/skills/improve-tool-families/analyze-tool-families.js --tools view,edit,grep,glob,powershell,web_fetch,ask_user5253# Machine-readable JSON (for further processing)54node .github/skills/improve-tool-families/analyze-tool-families.js --json55```5657### Options5859| Flag | Meaning |60|------|---------|61| `--tools=a,b,c` | Additional comma-separated tool names to check for coverage (e.g. this session's own live tool list) |62| `--json` | Emit JSON only |63| `--help` | Print this file |6465### Exit codes6667- `0` — ran successfully (report may still list uncovered tools)68- `2` — configuration / environment error (source files not found or unparsable)6970## Workflow: applying the suggestions71721. Run the script (optionally with `--tools` set to your current tool list —73 in an agent session this is just the list of tools you have available).742. For each suggested family, look at the listed tool names and decide:75 - Is it just **another editor's spelling of an existing baseline tool**76 (e.g. `Read`, `read_file` vs. `read`/`view`) → add to `builtIn`.77 - Is it a **genuinely more targeted/efficient tool** for the same job78 (e.g. `apply_patch`, `replace_string_in_file`, `multi_edit` vs. a full79 file rewrite) → add to `alternatives`.80 - Is it **not actually comparable** (e.g. issue/PR/notebook management81 tools, orchestration tools like `task`/`write_agent`) → leave it out;82 not every tool needs a family.833. Edit `vscode-extension/src/toolFamilies.ts` (`DEFAULT_TOOL_FAMILIES`).844. Verify with `cd vscode-extension && npm run validate` (tsc + eslint +85 esbuild).865. Re-run this script to confirm the previously-uncovered names are now87 covered.8889## Related files9091- `vscode-extension/src/toolFamilies.ts` — `DEFAULT_TOOL_FAMILIES`,92 `mergeToolFamilies`, `getToolFamilies` (source of truth for family data)93- `vscode-extension/package.json` — JSON schema for the94 `aiEngineeringFluency.toolFamilies` override setting95- `vscode-extension/src/webview/diagnostics/main.ts` —96 `renderToolAnalysisTab`/`renderToolFamilySection` (exact-match rendering97 logic; anything not claimed by a family lands in "Other Tools")98- `src/toolNames.json` — canonical cross-editor tool-name → friendly-name99 map, the best available source of real-world tool name spellings100- `src/adapters/*.ts`, `src/usageAnalysis.ts` — where raw tool names are101 recorded into `toolCalls.byTool` / `outputTokensByTool` per editor