tool-prompt-optimization

Measures schema-prompt overlap to prune redundant lines from AI agent tool prompts.

28.8k|2.9k|Updated Dec 31, 2025
One-click install
npx skills add https://github.com/can1357/oh-my-pi --skill tool-prompt-optimization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tool-prompt-optimization
Source: https://github.com/can1357/oh-my-pi/tree/main/.omp/skills/tool-prompt-optimization
Command: npx skills add https://github.com/can1357/oh-my-pi --skill tool-prompt-optimization

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @oh-my-pi/pi-ai, @oh-my-pi/pi-catalog, @oh-my-pi/pi-coding-agent, and includes scripts (resource) components.

What problem does it solve?

Tool description prompts for AI coding agents often restate information already inferable from the tool's JSON parameter schema, wasting context tokens. This Skill provides an evidence-based method to identify which prompt lines are redundant and which are load-bearing, plus authoring rules for what belongs in a tool prompt versus in code.

Core Features & Use Cases

  • Schema-to-prompt inference probe: Runs a multi-model panel (Fireworks Kimi, Claude Opus, GPT) that reconstructs a tool prompt from only its wire schema and a blanked outline, flagging reliably recovered lines as prune candidates.
  • Builtin tool shortcut: Resolves live builtin tools from the coding agent to extract the exact wire schema and real prompt, with a --show mode for inspection before spending API tokens.
  • Authoring guidelines: Defines what belongs in a tool prompt (when to choose the tool, input grammar, agent-owned failures, anti-patterns) versus what stays in code (recovery logic, caching, internals).
  • Use Case: Before deleting a line from a tool's .md prompt, run the probe across multiple samples and models, then git blame the line to confirm it is schema restatement rather than incident scar tissue.

Quick Start

Run the builtin probe on the read tool with --show to inspect its wire schema and derived outline, then launch the multi-model panel to find prune candidates in its prompt.

Frequently Asked Questions about tool-prompt-optimization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test whether a tool prompt line is redundant with its JSON schema?

Run the probe script with the tool's wire schema and a blanked outline of the prompt. Lines that multiple models reliably reconstruct across samples are prune candidates, while lines no model recovers are load-bearing and should be kept.

How do I probe a builtin tool prompt without writing the schema by hand?

Use probe-builtin.ts with --tool <name>, which instantiates the live builtin tool and extracts the exact wire schema and real prompt automatically. Add --show to inspect the schema and outline without making API calls.

Can I delete a prompt line just because models can predict it?

No. Inferability is necessary but never sufficient for deletion. You must git blame each candidate line and read its commit history, since many lines are incident scar tissue preventing past failures like hallucinated flags or shell-outs.

What API keys does the prompt probe require?

The default three-model panel requires FIREWORKS_API_KEY, ANTHROPIC_API_KEY, and OPENAI_API_KEY. You can override the panel with --model provider/id to use only providers you have keys for.

What content belongs in a tool prompt versus in code?

Prompts should cover when to choose the tool, input grammar, worked examples, agent-owned failure shapes, and anti-patterns. Implementation details like recovery logic, caching, fuzz matching, performance characteristics, and internal function names belong in code.