Agent skill

Add Provider

by AlphaLab-USTC in AlphaLab-USTC/OhMyCode

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

MITAuto-check passed

Install Add Provider

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

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

GitHub CLI
$ gh skill install AlphaLab-USTC/OhMyCode add-provider --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-provider .claude/skills/add-provider && 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-provider
GitHub stars
131
Token cost
~888 tokens
SKILL.md length
314 words
Files
2
Skills in repo
10
Repo updated
First seen
Licence
MIT

At a glance

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

  • Works in 7 steps: Understand the Provider Protocol → Create the Provider File → Handle Message Conversion → …
  • User wants to connect a new AI model backend
  • 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 Provider is an agent skill from AlphaLab-USTC/OhMyCode. Guide for adding a new LLM provider to OhMyCode. Use when user wants to connect a new AI model backend.

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

The repository describes itself as: Minimal and Customizable CC-Style Coding Agent. The licence is MIT.

When your agent uses it

  • User wants to connect a new AI model backend

Example prompts

  • “/add-provider”

Requirements

  • Python 3

Workflow steps

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

  1. Understand the Provider Protocol
  2. Create the Provider File
  3. Handle Message Conversion
  4. Write Tests
  5. Add Config Support
  6. Verify
  7. 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 Provider loads about 888 tokens when it runs. Until then it costs about 29 tokens; SKILL.md has 314 words of instructions outside code blocks.

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

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). 314 words, ~888 tokens.

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

Add a New LLM Provider to OhMyCode

Connect a new LLM backend (e.g., Gemini, Ollama, DeepSeek, local models).

When to Use

  • User says "add a provider", "connect to Gemini", "support Ollama"
  • User wants to use a model from a new API that isn't OpenAI-compatible

Prerequisites

  • Read docs/DEVELOPMENT_GUIDE.md
  • Read ohmycode/providers/base.py to understand Provider Protocol, register_provider()
  • Read ohmycode/core/messages.py for TextChunk, ToolCallStart, TurnComplete, TokenUsage
  • Look at ohmycode/providers/openai.py as reference

Step-by-Step Guide

Step 1: Understand the Provider Protocol

Every provider must implement one method:

python
async def stream(
    self,
    messages: list[Message],
    tools: list[ToolDef],
    system: str,
    model: str,
    **kwargs,
) -> AsyncIterator[StreamEvent]:

It must yield these events in order:

  1. TextChunk(text="...") — for each streamed text token
  2. ToolCallStart(tool_name="...", tool_use_id="...", params={...}) — for each tool call
  3. TurnComplete(finish_reason="stop"|"tool_use", usage=TokenUsage(...)) — always last
Step 2: Create the Provider File

Copy templates/provider_template.py to ohmycode/providers/<name>.py.

Fill in:

  • __init__() — initialize the API client
  • stream() — handle the streaming response format of the target API
Step 3: Handle Message Conversion

Different APIs have different message formats. Key conversions:

  • UserMessage → the API's user message format
  • AssistantMessage (with tool_calls) → the API's assistant + tool use format
  • ToolResultMessage → the API's tool result format
  • system parameter → some APIs put it in messages, some as a separate param
Step 4: Write Tests

Create tests/providers/test_<name>_provider.py:

python
import pytest
from ohmycode.providers.base import PROVIDER_REGISTRY

def test_provider_is_registered():
    import ohmycode.providers.<name>
    assert "<name>" in PROVIDER_REGISTRY

def test_provider_instantiation():
    from ohmycode.providers.<name> import <ProviderClass>
    provider = <ProviderClass>(api_key="test")
    assert provider.name == "<name>"
Step 5: Add Config Support

Add any new config fields to ohmycode/config/config.py OhMyCodeConfig class and DEFAULT_CONFIG dict if needed (e.g., gemini_api_key).

Step 6: Verify
bash
python3 -m pytest tests/ -v                              # No regressions
ohmycode -p "Hello" --provider <name> --model <model>      # End-to-end test
Step 7: Commit
bash
git commit -m "feat(providers): add <name> provider"

Key Requirements

  • File goes in ohmycode/providers/ — auto-imported via auto_import_providers()
  • Call register_provider("<name>", <Class>) at module level
  • stream() must be an async generator (use yield)
  • Always yield TurnComplete as the last event
  • Handle tools=[] case (no tool use)
  • Never raise from stream() during normal API errors — the loop handles retries

Common Mistakes

  • Forgetting to call register_provider() → provider not found at runtime
  • Not yielding TurnComplete → loop hangs waiting for turn end
  • finish_reason wrong: use "tool_use" when model wants to call tools, "stop" when done
  • Not handling streaming tool call deltas (arguments come in chunks)
  • Not converting message formats correctly → API returns 400 errors

© 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-provider of AlphaLab-USTC/OhMyCode.

  • SKILL.md
  • templates/provider_template.py

Open the folder on GitHubat commit 4d1bb28

Compare with similar skills

Add Provider 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 Provider compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Add Provider this skillAlphaLab-USTC/OhMyCode131—~888Automated safety check: PassMIT
Add Model Provideropenclaw/openclaw392k—~1.1kAutomated safety check: PassMIT
OmniRoute Provider Managementdiegosouzapw/OmniRoute74k—~2.4kAutomated safety check: PassMIT
OmniRoute Providers CLIdiegosouzapw/OmniRoute74k—~2.2kAutomated safety check: PassMIT
LobeHub Model Provider Integrationlobehub/lobehub83k—~2.8kAutomated safety check: PassCustom licence
Cosmos Providerdotnet/efcore15k—~242Automated safety check: PassMIT

Similar skills

  • Add Model Provider

    openclaw/openclaw

    Add and live-prove a model provider with non-interactive config one-liners, without exposing credentials.

    392k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • OmniRoute Provider Management

    diegosouzapw/OmniRoute

    Manages AI provider connections, API keys, OAuth flows and connection tests through OmniRoute's REST API across its 327-provider catalog.

    74k GitHub stars~2.4k tokensUpdated today
    Backend & APIsAuto-check passed
  • OmniRoute Providers CLI

    diegosouzapw/OmniRoute

    Command reference for managing provider connections in the omniroute gateway: browse the catalog, test and validate connections, rotate API keys and read per-provider metrics.

    74k GitHub stars~2.2k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Adds an AI model provider to LobeHub end to end: runtime integration, model cards, configuration, branding and documentation, or documentation-only updates.

    83k GitHub stars~2.8k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Cosmos Provider

    dotnet/efcore

    Official

    Implementation details for the EF Core Azure Cosmos DB provider.

    15k GitHub stars~242 tokensUpdated today
    Auto-check passed
  • Provider

    evanca/flutter-ai-rules

    A skill your agent uses when setting up providers, consuming state, optimizing rebuilds, using ProxyProvider, or migrating from deprecated providers (Provider package).

    650 GitHub stars~901 tokensUpdated 25 days ago
    MobileAuto-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 Tool

    AlphaLab-USTC/OhMyCode

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

    131 GitHub stars~758 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

Questions about Add Provider

What does Add Provider do?

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

When should I use Add Provider?

Add Provider fits situations like: user wants to connect a new AI model backend.

How do I install Add Provider in Claude Code?

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

How do I install Add Provider in Codex?

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

Can I use Add Provider 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-provider -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-provider, .gemini/skills/add-provider, .github/skills/add-provider and .opencode/skills/add-provider in your project.

What does Add Provider need to run?

Going by SKILL.md and its folder, Add Provider 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 Provider 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 Provider 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 Provider use?

Add Provider 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 Provider use?

About 888 tokens (SKILL.md is roughly 3.6k 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 Provider?

Skills that share tags, products or a category with Add Provider: Add Model Provider (openclaw/openclaw, 392k stars), OmniRoute Provider Management (diegosouzapw/OmniRoute, 74k stars), OmniRoute Providers CLI (diegosouzapw/OmniRoute, 74k stars) and LobeHub Model Provider Integration (lobehub/lobehub, 83k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Add Provider?

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.