agentleFS
crystal-autobotcrystal-autobot/autobot/.claude/skills/autobot-tool/SKILL.md

autobot-tool

Skill47 starsChanged 8 months agoMITView on GitHub

Create new tools for Autobot agent with proper schema and safety

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Add new tool instance to the registry.

    line 23
  2. Distinctive:

    Test all tool functionality

    line 31
  3. Distinctive:

    Check command safety (for exec-like tools)

    line 101
  4. Distinctive:

    Use this skill when:

    line 106

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Creating a New Tool

Files to Create/Modify

  1. Create tool implementation:
    • src/autobot/tools/<name>_tool.cr
    • Inherit from Tool base class
    • Implement Tool interface
  2. Register tool:
    • Tools are registered in src/autobot/tools/registry.cr or src/autobot/cli/gateway.cr.
    • Add new tool instance to the registry.
  3. Add configuration (if configurable):
    • Update src/autobot/config/schema.cr
    • Add tool-specific settings
  4. Create tests:
    • spec/autobot/tools/<name>_tool_spec.cr
    • Test all tool functionality
    • Test error handling
    • Test safety guards

Tool Implementation Template

# src/autobot/tools/<name>_tool.cr
require "./tool"

module Autobot
  module Tools
    class <Name>Tool < Tool
      # Tool metadata
      def name : String
        "<tool_name>"
      end

      def description : String
        "Description of what this tool does (1-2 sentences)"
      end

      # Define JSON schema for parameters
      def parameters : ToolSchema
        ToolSchema.new(
          properties: {
            "param1" => PropertySchema.new(
              type: "string",
              description: "Description of param1"
            ),
            "param2" => PropertySchema.new(
              type: "integer",
              description: "Description of param2",
              minimum: 1_i64,
              maximum: 100_i64
            ),
          },
          required: ["param1"]
        )
      end

      # Execute the tool
      def execute(params : Hash(String, JSON::Any)) : ToolResult
        # Extract parameters
        param1 = params["param1"].as_s
        param2 = params["param2"]?.try(&.as_i) || 0

        # Execute tool logic
        begin
          result = perform_action(param1, param2)
          ToolResult.success(result)
        rescue ex
          ToolResult.error("Tool execution failed: #{ex.message}")
        end
      end

      private def perform_action(param1, param2)
        # Implement tool logic
        "result"
      end
    end
  end
end

Safety and Security

Always implement input validation:

  • Validate URLs (scheme, host, private IP ranges)
  • Sanitize file paths (prevent directory traversal)
  • Check command safety (for exec-like tools)
  • Validate numeric ranges

When to Use

Use this skill when:

  • Creating a new tool for the agent
  • Adding MCP tool wrappers
  • Implementing external service integrations

Related Skills: autobot-test

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.