install
source · Clone the upstream repo
git clone https://github.com/WeiJun0507/my_harness
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/WeiJun0507/my_harness "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.cursor/skills/tool_discovery" ~/.claude/skills/weijun0507-my-harness-tool-discovery && rm -rf "$T"
manifest:
.cursor/skills/tool_discovery/SKILL.mdsource content
Tool Discovery Skill
Metadata
- Name:
tool_discovery - Description: Detect, rank, and invoke reusable tools for each prompt before creating new implementations
Purpose
For every user prompt, determine whether an existing callable tool can fulfill the request. Reuse first; create new only when necessary.
When to Trigger
- On every user prompt (mandatory first-pass behavior).
Required Workflow
-
Parse intent into candidate actions:
- Primary action (what user wants done)
- Domain entities (users, contacts, orders, etc.)
- Constraints (filters, pagination, timing, context)
-
Search tool registry/index and tool specs in the configured skills directory (for example
).~/codex/skills/* -
Match and rank:
- Exact intent match -> use directly
- Close/partial match -> adapt arguments or select latest compatible version
- No match -> trigger
tool_creator
-
Invoke tool using its declared schema and pass normalized arguments.
-
Post-process output for the user's requested format (UI mapping, API response shaping, narrative explanation).
Invocation Contract
{ "tool": "query_user_contacts", "arguments": { "page": 1, "limit": 50 } }
Priority Rules
- Always attempt tool reuse before writing inline logic.
- Never duplicate existing tools with the same intent.
- If a partial tool exists, prefer extension/versioning over creating a separate duplicate.
- If no suitable tool exists, immediately route to
.tool_creator
Flutter Example (Reference)
Prompt: "When opening Contacts page, fetch user contact list."
- Discovery finds
-> invoke it.query_user_contacts - If missing -> trigger
to create:tool_creator- model (if needed)
- repository method (if needed)
- use-case function
- tool wrapper and registry entry
- Then call the new tool.
Output Requirement
- Must produce one of:
- A concrete tool invocation (tool name + arguments), or
- A
handoff request with normalized intent and requirements.tool_creator
- Must include brief reason for match decision (exact / partial / none).
Key Rule
Every prompt must go through tool discovery before implementation begins.