add-core-tool

Adds new built-in agent-callable tools to the Rust core with schema, classification, and dispatch.

10|1|Updated Jul 7, 2026
One-click install
npx skills add https://github.com/catalystctl/catcode --skill add-core-tool-catalystctl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-core-tool
Source: https://github.com/catalystctl/catcode/tree/main/.catalyst-code/skills/add-core-tool
Command: npx skills add https://github.com/catalystctl/catcode --skill add-core-tool-catalystctl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Extending a coding agent's Rust core with a new tool requires touching several disconnected places—function-calling schema, approval classification, sync/async dispatch, and path guards—and missing any one of them causes silent failures. This Skill provides the canonical workflow for wiring a new agent-callable tool correctly end to end. ## Core Features & Use Cases - Schema and classification guidance: Append OpenAI function-calling JSON to definitions() and assign the tool to ReadOnly or Destructive approval classes in classify(). - Sync and async dispatch patterns: Add match arms in execute() for sync tools, or wire the sentinel error plus async fn execute_<name> routing in main.rs for async tools. - Safety guard integration: Apply workspace::resolve for path confinement and workspace::check_dangerous_path for write-capable tools, with diff previews for approval requests. - Use Case: You want the agent to count lines in a file. Follow the steps to add a count_lines schema, classify it as read-only, implement the function, dispatch it, and verify with cargo clippy and tests. ## Quick Start Add a new read-only tool called count_lines to the Rust core following the add-core-tool workflow, including its schema, classification, dispatch arm, and a unit test.

Frequently Asked Questions about add-core-tool

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

FAQPage Schema
How do I add a new tool to a Rust coding agent core?

Append an OpenAI function-calling JSON schema to definitions() in tools.rs, classify the tool as ReadOnly or Destructive in classify(), implement the logic, and add a match arm in execute(). Verify with cargo fmt, clippy, and tests.

How do I add an async tool to the agent dispatch loop?

Async tools are not run from execute(). Return a sentinel error from execute() and add an async fn execute_<name> routed in main.rs's tool loop. Wiring only one side makes the tool silently never run.

What is the difference between ReadOnly and Destructive tool classification?

ReadOnly tools only read or inspect state and are never gated by approvals. Destructive tools write files, shell out, or have side effects and are gated under the default Approval::Destructive rule. Anything not listed in classify() defaults to Destructive.

How do I prevent a tool from writing to dangerous paths like .git or .env?

Apply workspace::check_dangerous_path to the target path exactly as write_file, edit, and patch do, and use workspace::resolve to confine paths to the workspace. The resolver rejects absolute paths and parent-directory traversal.

Why does my new tool return its error string without ever running?

This happens when an async tool is only added to execute() without the sentinel error and the execute_<name> async route in main.rs. The error string is returned to the model as a tool_result and the tool silently never executes.