Agent skill

Add Tool

by AlphaLab-USTC in AlphaLab-USTC/OhMyCode

Guide for adding a new tool to OhMyCode. An agent skill from AlphaLab-USTC/OhMyCode.

MITAuto-check passedTesting & QA

Install Add Tool

skills CLI
$ npx skills add AlphaLab-USTC/OhMyCode --skill add-tool -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install AlphaLab-USTC/OhMyCode add-tool --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/AlphaLab-USTC/OhMyCode.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/add-tool .claude/skills/add-tool && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
add-tool
GitHub stars
131
Token cost
~758 tokens
SKILL.md length
271 words
Files
2
Skills in repo
10
Repo updated
First seen
Licence
MIT

At a glance

Guide for adding a new tool to OhMyCode. An agent skill from AlphaLab-USTC/OhMyCode.

  • Works in 6 steps: Define the Tool → Create the Tool File → Write Tests (TDD) → …
  • User wants to create a custom tool
  • SKILL.md covers When to Use, Prerequisites, Step-by-Step Guide and Key Requirements, plus 1 more section
  • Runs Python scripts from its folder; calls python3 and git

What it does

Add Tool is an agent skill from AlphaLab-USTC/OhMyCode. Guide for adding a new tool to OhMyCode. Use when user wants to create a custom tool.

Its SKILL.md is about 760 tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `templates/tool_template.py`).

It sits in Testing & QA. The repository describes itself as: Minimal and Customizable CC-Style Coding Agent. The licence is MIT.

When your agent uses it

  • User wants to create a custom tool

Example prompts

  • “/add-tool”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Define the Tool
  2. Create the Tool File
  3. Write Tests (TDD)
  4. Verify
  5. Test End-to-End
  6. Commit

What it can do on your machine

Read from SKILL.md and the folder at commit 4d1bb28. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Add Tool loads about 758 tokens when it runs. Until then it costs about 24 tokens; SKILL.md has 271 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~24
When it runs · the whole SKILL.md, loaded when a task matches
~758

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from AlphaLab-USTC/OhMyCode at commit 4d1bb28, republished under its MIT licence (© AlphaLab-USTC). 271 words, ~758 tokens.

Download SKILL.mdSave it as .claude/skills/add-tool/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
add-tool
description
Guide for adding a new tool to OhMyCode. Use when user wants to create a custom tool.

Add a New Tool to OhMyCode

Create a new tool that the AI assistant can use during conversations.

When to Use

  • User says "add a tool", "create a tool", "I want a new tool"
  • User describes a capability they want the AI to have (e.g., "I want it to run SQL queries")

Prerequisites

  • Read docs/DEVELOPMENT_GUIDE.md for project conventions
  • Read ohmycode/tools/base.py to understand Tool, ToolContext, ToolResult, @register_tool
  • Look at an existing tool (e.g., ohmycode/tools/bash.py) as reference

Step-by-Step Guide

Step 1: Define the Tool

Ask the user:

  1. Tool name — short, lowercase, snake_case (e.g., sql_query, docker_run)
  2. Description — one sentence for the LLM to understand when to use it
  3. Parameters — what inputs does it need? (JSON Schema format)
  4. Concurrent safety — can it run in parallel with other tools? (True for read-only, False for side effects)
Step 2: Create the Tool File

Copy the template from templates/tool_template.py to ohmycode/tools/<tool_name>.py.

Fill in:

  • name, description, parameters, concurrent_safe class attributes
  • execute() method with the actual logic
Step 3: Write Tests (TDD)

Create tests/tools/test_<tool_name>.py:

python
import pytest
from ohmycode.tools.base import ToolContext
from ohmycode.tools.<tool_name> import <ToolClass>

@pytest.fixture
def ctx(tmp_path):
    return ToolContext(mode="auto", agent_depth=0, cwd=str(tmp_path), is_sub_agent=False)

@pytest.mark.asyncio
async def test_<tool_name>_basic(ctx):
    tool = <ToolClass>()
    result = await tool.execute({"param": "value"}, ctx)
    assert not result.is_error
    assert "expected" in result.output
Step 4: Verify
bash
python3 -m pytest tests/tools/test_<tool_name>.py -v   # New tests pass
python3 -m pytest tests/ -v                              # No regressions
Step 5: Test End-to-End
bash
ohmycode -p "Use the <tool_name> tool to ..." --mode auto
Step 6: Commit
bash
git add ohmycode/tools/<tool_name>.py tests/tools/test_<tool_name>.py
git commit -m "feat(tools): add <tool_name> tool"

Key Requirements

  • Tool file goes in ohmycode/tools/ — auto-imported, no other files need to change
  • Use @register_tool decorator on the class
  • execute() must be async and return ToolResult
  • Never raise exceptions from execute() — return ToolResult(is_error=True) instead
  • Keep the file under 150 lines
  • Parameters must be valid JSON Schema

Common Mistakes

  • Forgetting @register_tool decorator → tool won't be available
  • Raising exceptions instead of returning ToolResult(is_error=True) → crashes the loop
  • Using concurrent_safe = True on tools with side effects → race conditions
  • Not handling missing optional parameters → KeyError at runtime
  • File name collision with existing tools → check ohmycode/tools/ first

© AlphaLab-USTC, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .agents/skills/add-tool of AlphaLab-USTC/OhMyCode.

  • SKILL.md
  • templates/tool_template.py

Open the folder on GitHubat commit 4d1bb28

Compare with similar skills

Add Tool next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Add Tool compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Add Tool this skillAlphaLab-USTC/OhMyCode131—~758Automated safety check: PassMIT
Web Application Testinganthropics/skills180k51 repos~966Automated safety check: PassApache-2.0
Diagnosing Bugsfossasia/eventyay-interpretation1.6k32 repos~2.1kAutomated safety check: PassApache-2.0
TDDpietheinstrengholt/rssmonster56430 repos~906Automated safety check: PassMIT
TDD WorkflowhellangleZ/burn-in-cceverywhere-ralph11211 repos~2.4kAutomated safety check: PassNone
TDDsanity-io/sanity6.4k20 repos~1kAutomated safety check: PassMIT

Similar skills

  • Web Application Testing

    anthropics/skills

    Official

    Tests local web applications with Python Playwright scripts, checking frontend behavior, capturing screenshots and reading browser console logs.

    180k GitHub starsUsed in 51 repos~966 tokens
    Testing & QAAuto-check passed
  • Diagnosing Bugs

    fossasia/eventyay-interpretation

    Diagnosis loop for hard bugs and performance regressions. An agent skill from fossasia/eventyay-interpretation.

    1.6k GitHub starsUsed in 32 repos~2.1k tokens
    Testing & QAAuto-check passed
  • TDD

    pietheinstrengholt/rssmonster

    Test-driven development. An agent skill from pietheinstrengholt/rssmonster.

    564 GitHub starsUsed in 30 repos~906 tokens
    Testing & QAAuto-check passed
  • TDD Workflow

    hellangleZ/burn-in-cceverywhere-ralph

    A skill your agent uses when writing new features, fixing bugs, or refactoring code.

    112 GitHub starsUsed in 11 repos~2.4k tokens
    Testing & QAAuto-check passed
  • TDD

    sanity-io/sanity

    Official

    Test-driven development with red-green-refactor loop. An agent skill from sanity-io/sanity.

    6.4k GitHub starsUsed in 20 repos~1k tokens
    Testing & QAAuto-check passed
  • Context Driven Development

    Ibrahim-3d/orchestrator-supaconductor

    A skill your agent uses when working with Conductor's context-driven development methodology, managing project context artifacts, or understanding the relationship between product.md, tech-stack.md…

    381 GitHub starsUsed in 9 repos~2.9k tokens
    Testing & QAAuto-check passed

More from AlphaLab-USTC/OhMyCode

All 10 skills in this repo
  • Add Feature

    AlphaLab-USTC/OhMyCode

    Guide for adding a new feature to OhMyCode. An agent skill from AlphaLab-USTC/OhMyCode.

    131 GitHub stars~995 tokensUpdated 6 mo ago
    Auto-check passed
  • Add Provider

    AlphaLab-USTC/OhMyCode

    Guide for adding a new LLM provider to OhMyCode. An agent skill from AlphaLab-USTC/OhMyCode.

    131 GitHub stars~888 tokensUpdated 6 mo ago
    Auto-check passed
  • Bench

    AlphaLab-USTC/OhMyCode

    Run OhMyCode benchmarks — score any provider/model with token tracking.

    131 GitHub stars~941 tokensUpdated 6 mo ago
    Auto-check passed
  • Customize Response Style

    AlphaLab-USTC/OhMyCode

    Guide for customizing OhMyCode's terminal output style and rendering.

    131 GitHub stars~1.1k tokensUpdated 6 mo ago
    Auto-check passed
  • Customize System Prompt

    AlphaLab-USTC/OhMyCode

    Guide for customizing OhMyCode's AI personality and behavior via system prompt.

    131 GitHub stars~819 tokensUpdated 6 mo ago
    Auto-check passed
  • Debug Ohmycode

    AlphaLab-USTC/OhMyCode

    Guide for debugging OhMyCode issues. An agent skill from AlphaLab-USTC/OhMyCode.

    131 GitHub stars~1.3k tokensUpdated 6 mo ago
    Auto-check passed

Categories

Questions about Add Tool

What does Add Tool do?

Guide for adding a new tool to OhMyCode. An agent skill from AlphaLab-USTC/OhMyCode. Add Tool is an agent skill from AlphaLab-USTC/OhMyCode. Guide for adding a new tool to OhMyCode.

When should I use Add Tool?

Add Tool fits situations like: user wants to create a custom tool.

How do I install Add Tool in Claude Code?

Run `npx skills add AlphaLab-USTC/OhMyCode --skill add-tool -a claude-code`. Or copy the skill folder (.agents/skills/add-tool in AlphaLab-USTC/OhMyCode) into .claude/skills/add-tool in your project. Claude Code loads it when a task matches its description.

How do I install Add Tool in Codex?

Run `npx skills add AlphaLab-USTC/OhMyCode --skill add-tool -a codex`. Or copy the skill folder (.agents/skills/add-tool in AlphaLab-USTC/OhMyCode) into .agents/skills/add-tool in your project. Codex loads it when a task matches its description.

Can I use Add Tool in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add AlphaLab-USTC/OhMyCode --skill add-tool -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/add-tool, .gemini/skills/add-tool, .github/skills/add-tool and .opencode/skills/add-tool in your project.

What does Add Tool need to run?

Going by SKILL.md and its folder, Add Tool needs Python for the scripts in its folder and the command-line tools its instructions call (python3 and git). Our summary lists: Python 3.

Does Add Tool access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Add Tool safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Add Tool use?

Add Tool is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Add Tool use?

About 758 tokens (SKILL.md is roughly 3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Add Tool?

Skills that share tags, products or a category with Add Tool: Web Application Testing (anthropics/skills, 180k stars), Diagnosing Bugs (fossasia/eventyay-interpretation, 1.6k stars), TDD (pietheinstrengholt/rssmonster, 564 stars) and TDD Workflow (hellangleZ/burn-in-cceverywhere-ralph, 112 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Add Tool?

AlphaLab-USTC (a GitHub user) maintains it in AlphaLab-USTC/OhMyCode, which has 131 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on April 2, 2026.

Source: AlphaLab-USTC/OhMyCode on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.