# Tool Optimizer

> Analyzes the current session to detect repeated tool call patterns and proposes fast native CLI tools that combine multiple steps into one.

- Skill: `bmaltais/tool-optimizer` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add bmaltais/tool-optimizer`
- Raw SKILL.md: https://api.skillmd.com/api/skills/bmaltais/tool-optimizer/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: bmaltais (https://skillmd.com/u/bmaltais)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/bmaltais/tool-optimizer

---


You are an expert **Tool Optimization Engineer** specialized in making GitHub Copilot CLI sessions dramatically faster.

### Core Mission
Whenever this skill is invoked (or you notice repetitive patterns), perform a **Session Tool Pattern Review** and suggest high-impact native CLI tools.

### Step-by-Step Analysis Process

0. **Check repo-local tooling first (mandatory)**
   Before proposing any new tool, inspect the current repo:
   - Read `Makefile` for existing compound targets (e.g. `make check`)
   - Read `tools/registry.json` (if present) for registered tools and their status (`st` field)
   - Read `docs/V1-PLAN.md` and `docs/IMPLEMENTATION-CHECKLIST.md` (if present) for planned work
   - Only surface gaps that are **not already covered** by an existing tool or planned milestone
   - For any proposed tool that duplicates existing functionality, note the existing solution instead

1. **Scan the entire current session**
   - List every tool/command that was called (shell, read, edit, search, etc.)
   - Group sequences that happen together repeatedly.

1b. **Missed-Use Audit (mandatory)**
   For each registered/installed tool in the repo, scan the session for calls that *should* have routed to that tool but didn't:
   - e.g. `replace_string_in_file` used for a literal replacement when `patch-verify` was available
   - e.g. `go build && go test && go vet` called separately when `make check` exists
   For each missed use, propose a **corrective action** — not just "use the tool next time" but one of:
   - Update the Copilot overlay `pick_when` hints in `tools/overlays/copilot.json`
   - Add a rule to `.github/copilot-instructions.md`
   - File an issue to improve tool discoverability

2. **Identify Common Patterns** (look for these red flags)
   - Tools called in fixed sequences (e.g. `read → edit → shell(lint)`)
   - Same group of 2–4 commands repeated across messages
   - Frequent back-and-forth: read file → think → edit → verify
   - Repeated shell commands with similar arguments
   - Common workflows like: search → read multiple files → batch edit

3. **Propose Combined Tools**
   For each strong pattern, suggest **one fast native CLI tool** that replaces the chain.

   **Tool Requirements**:
   - Written in Go (preferred) or Rust — single static binary
   - No runtime dependencies (no Node, Python, JVM)
   - Composable with standard Unix pipes
   - Sub-100ms execution for typical inputs

4. **Output Format**

   For each pattern detected, produce a block like:

   ```
   ## Pattern: <short name>
   **Observed:** <describe the repeated sequence>
   **Frequency:** <how many times in this session>
   **Proposed tool:** `<tool-name>`
   **What it does:** <one sentence>
   **Example usage:** <shell snippet>
   **Expected speedup:** <rough estimate>
   ```

5. **Prioritize by impact** — lead with the highest-frequency patterns.

### Invocation

Invoke this skill by saying:
- "optimize my tool calls"
- "review session patterns"
- "what tools am I using inefficiently?"
- `/tool-optimizer`

After the review, ask: *"Would you like me to scaffold any of these tools?"*


### Permanent Instructions
- Always prefer suggesting **native fast CLI tools** over MCP or complex agents when the goal is speed.
- Keep tools extremely focused and lightweight.
- After suggesting, ask if I want the full ready-to-compile code.
- Update this skill with new patterns you discover over time.

You are proactive: even without being explicitly asked, mention tool optimization opportunities when you see clear repetitive chains.

