Agent skill

New Provider

by finch-xu in finch-xu/cc-router

用于在 cc-router 仓库新增一个 LLM provider(即在 src-tauri/providers/ 下添加 YAML 描述符并完成配套的同步改动)。当用户说「加 provider」「接入 XX 厂商」「新增订阅源」「provider YAML」「让 cc-router 支持 OpenRouter/Together/Groq/Ollama 之类」时必须触发本…

MITAuto-check passedAI & LLM Engineering

Install New Provider

skills CLI
$ npx skills add finch-xu/cc-router --skill new-provider -a claude-code

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

GitHub CLI
$ gh skill install finch-xu/cc-router new-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/finch-xu/cc-router.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/new-provider .claude/skills/new-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
new-provider
GitHub stars
277
Token cost
~1.6k tokens
SKILL.md length
341 words
Files
1
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

用于在 cc-router 仓库新增一个 LLM provider(即在 src-tauri/providers/ 下添加 YAML 描述符并完成配套的同步改动)。当用户说「加 provider」「接入 XX 厂商」「新增订阅源」「provider YAML」「让 cc-router 支持 OpenRouter/Together/Groq/Ollama 之类」时必须触发本…

  • Works in 3 steps: :研究上游文档,决定 YAML 字段 → :写 YAML 文件 → :可选图标
  • Tasks that involve Model routing and gateways
  • SKILL.md covers 这个 skill 在做什么, 触发条件, 三步工作流(顺序执行) and 验证, plus 3 more sections
  • Calls cargo and pnpm

What it does

New Provider is an agent skill from finch-xu/cc-router. 用于在 cc-router 仓库新增一个 LLM provider(即在 src-tauri/providers/ 下添加 YAML 描述符并完成配套的同步改动)。当用户说「加 provider」「接入 XX 厂商」「新增订阅源」「provider YAML」「让 cc-router 支持 OpenRouter/Together/Groq/Ollama 之类」时必须触发本 skill;即便用户只甩了一个厂商名或一个文档 URL,只要看起来在 cc-router 仓库内做新增 provider,就走本 skill 的工作流,不要绕过。本 skill 只覆盖「描述符层」扩展(YAML + 配置 + 测试 + 文档),不涉及调度/状态机的 Rust 改动。

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering Model routing and gateways and LLM inference and serving. It works with OpenRouter, Ollama, Tauri and Rust. The repository describes itself as: 本地运行的大模型聚合网关,GUI桌面端app,零代码部署,把Coding Plan、大模型 API 额度聚合成一个虚拟 Plan,一键接入 Claude Code、Claude Desktop App、OpenClaw、OpenCode 等工具。Bundle your scattered Token Plan, Coding Plan, and LLM… The licence is MIT.

When your agent uses it

  • Tasks that involve Model routing and gateways
  • Tasks that involve LLM inference and serving

Example prompts

  • “/new-provider”

Workflow steps

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

  1. :研究上游文档,决定 YAML 字段
  2. :写 YAML 文件
  3. :可选图标

What it can do on your machine

Read from SKILL.md and the folder at commit 36e2c6c. 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

    Shell commands in SKILL.md call:

    • cargo
    • pnpm

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

  • Network

    No URLs in SKILL.md. Its commands use pnpm, 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

New Provider loads about 1.6k tokens when it runs. Until then it costs about 86 tokens; SKILL.md has 341 words of instructions outside code blocks.

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

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 finch-xu/cc-router at commit 36e2c6c, republished under its MIT licence (© finch-xu). 341 words, ~1,643 tokens.

Download SKILL.mdSave it as .claude/skills/new-provider/SKILL.md (or your agent's skills folder).
name
new-provider
description
用于在 cc-router 仓库新增一个 LLM provider(即在 src-tauri/providers/ 下添加 YAML 描述符并完成配套的同步改动)。当用户说「加 provider」「接入 XX 厂商」「新增订阅源」「provider YAML」「让 cc-router 支持 OpenRouter/Together/Groq/Ollama 之类」时必须触发本 skill;即便用户只甩了一个厂商名或一个文档 URL,只要看起来在 cc-router 仓库内做新增 provider,就走本 skill 的工作流,不要绕过。本 skill 只覆盖「描述符层」扩展(YAML + 配置 + 测试 + 文档),不涉及调度/状态机的 Rust 改动。

新增 Provider 工作流

这个 skill 在做什么

cc-router 的 Provider 抽象 = 「YAML 描述符」。把一个新厂商接入路由层不需要写 Rust——只需要一份遵循 providers/_schema.json 的 YAML,放进 providers/ 即自动内嵌进二进制;唯一的同步改动是可选的品牌图标。

这份 skill 的价值在于:

  1. 决策清单:哪些字段是「研究上游文档才能填对」的关键字段(auth、base_url、/models 端点)
  2. 同步检查清单:配套改动一处不漏(漏一处会导致 release 包加载失败 / 测试断言失败 / 文档失同步)
  3. 常见陷阱:哪些上游 API 设计会让默认假设崩塌(无 /models、key 被忽略、messages 与 /models 不同域)

触发条件

走本 skill 当且仅当用户在 cc-router 仓库内做「新增 provider」类工作。如果只是改既有 YAML 字段(如调 endpoint 顺序、改 description)则不必走完整流程,直接编辑即可。

三步工作流(顺序执行)

Step 1:研究上游文档,决定 YAML 字段

先查清楚 6 件事(用 WebFetch 或问用户):

字段关键问题
endpoints[].base_url + messages_pathAnthropic 兼容端点完整 URL?是否多区域/多 endpoint?
auth.header_formatx-api-key raw(仅 Anthropic 系)还是 Authorization: Bearer?
auth.header_name多数家是 Authorization,少数是 x-api-key/自定义
required_headers是否要 anthropic-version?是否要其他厂商专属 header?
model_discovery是否有 Anthropic 风格 /v1/models 端点?路径?是否与 messages 同域?需要独立 URL 时用 model_discovery.url 字段(完整 URL 覆盖,不走 base_url 拼接)
是否需 API Key极少数厂商(如 Ollama 本地)不校验 key——仍要保留字段,文档里说明

判断 compatibility 字段:

  • verified:自己跑通过实际请求 + SSE 流式
  • partial:有限制(如无 /models、流式有兼容 quirks)
  • untested:仅按文档接入未实测
Step 2:写 YAML 文件

位置:src-tauri/providers/<id>.yaml

id 命名:小写英文/数字/下划线(schema 强制 ^[a-z0-9_]+$)。优先用厂商英文短名(anthropic、deepseek、zhipu),不要带版本号或地域后缀。

模板骨架:

yaml
id: <provider_id>
display_name: "<厂商展示名>"   # 纯品牌名 (三语相同) 写字符串; 含中文就写成下面 description 的三语形式
icon: ""  # 没有 lucide brand icon 时留空走 Bot 兜底; 有则填 BRAND_MAP key
description:
  zh: "<一句话描述>"
  en: "<English>"
  ja: "<日本語>"
homepage: "<主页 URL>"
docs_url: "<API 文档 URL>"
api_key_url: "<控制台密钥页面 URL>"

compatibility: untested  # 或 partial/verified
compatibility_notes:
  zh: |
    <需要用户知道的限制:流式 quirks、模型列表问题、特殊计费等>
  en: |
    <English>
  ja: |
    <日本語>

endpoints:
  - id: <endpoint_id>
    label:
      zh: "<UI 显示的人话名称, 如「国内版 · 按量付费 API」>"
      en: "<如 China · Pay-as-you-go API>"
      ja: "<如 中国版 · 従量課金 API>"
    description:
      zh: "<细节说明>"
      en: "<English>"
      ja: "<日本語>"
    base_url: "<https://...>"
    messages_path: "/v1/messages"
    region: <china|global|eu|local>   # 订阅列表页据此显示「中国 / 全球 / 欧洲」标签, local 不显示
    billing: <subscription|pay_as_you_go|free>

default_endpoint: <endpoint_id>  # 必须是上面 endpoints[].id 之一

auth:
  type: api_key
  header_name: "Authorization"      # 或 "x-api-key"
  header_format: bearer             # 或 raw

required_headers:
  anthropic-version: "2023-06-01"   # 大部分厂商都接受这个 header

forward_headers: []

model_discovery:
  enabled: true                     # 无 /models 接口则填 false
  path: "/v1/models"                # 或 url: "https://..." 完整覆盖
  cache_ttl_hours: 24
  example_models:                   # enabled: false 时作为 UI 输入提示
    - "<示例模型 ID>"

关键决策点(写之前对照参考表):

auth.header_format 选哪个?
├─ x-api-key raw → 仅 anthropic / ollama 这种「Anthropic 同款」
└─ Authorization bearer → 其余几乎所有第三方

model_discovery.enabled?
├─ true(path 同 base_url 域)→ alibaba / anthropic
├─ true(url 完整覆盖, 跨域)→ deepseek / zhipu / moonshot / xiaomi
└─ false(无端点, 手动输入)→ minimax / ollama

endpoints 数量?
├─ 1 个 → 只有单一访问入口(anthropic / ollama)
├─ 2-4 个 → 区分订阅 vs 按量、国内 vs 国际、不同区域集群

上屏文字必须三语齐全(display_name / description / compatibility_notes / 端点 label / description):

  • 两种写法:纯字符串 = 三语相同,只用于 DeepSeek、OpenRouter 这类纯品牌名;其余写成 {zh, en, ja},少一个键 yaml 就解析失败。界面上没有回退,缺翻译不会显示中文兜底。
  • 含中文的字段不许用纯字符串写法,en 里不许有中日文、ja 不许照抄 zh —— loader.rs::tests::cjk_text_is_translated 锁住。
  • 用语与已有 yaml 保持一致:国内版 / 国际版 / 全球 → China / International / Global、中国版 / 国際版 / グローバル;按量付费 → Pay-as-you-go、従量課金;订阅 → subscription、サブスクリプション;端点 → endpoint、エンドポイント;官方 → Official、公式。
  • 中文厂商的英日文名用官方国际名、前面带厂商名(如 Alibaba Cloud Model Studio、Baidu AI Cloud Qianfan);日文里品牌名保留英文写法。
  • 列表按英文名排序(list_providers),不用关心中文名的排序。

已有 provider 是最好的参考:写之前先 Read 一个最相似的现有 YAML(按 auth + model_discovery 组合匹配),照葫芦画瓢比从模板硬写更可靠。

不需要登记任何清单

YAML 在编译期内嵌进二进制:src-tauri/build.rs 扫描 providers/*.yaml 生成 include_str! 表,provider/loader.rs 用 include! 引入,并且对目录声明了 rerun-if-changed。所以 Step 2 把文件放进 providers/ 就已经完成了「注册」。

  • 不要去改 src-tauri/tauri.conf.json::bundle.resources(现在只剩 ../LICENSE;往里加 yaml 是 2026-09 之前的旧流程)。
  • 没有白名单 / 总数 assert 要同步——tests/proxy_e2e.rs 早已删除。取而代之的是 loader.rs::tests::every_embedded_provider_parses_and_ids_are_unique:自动遍历所有内嵌 yaml,拦住解析失败、id 冲突、default_endpoint 不在 endpoints[].id 里这三类错误。
Step 3:可选图标

README 不用改:README 已不再维护 provider 表格(2026-09 删除),「入口与出口」章节只按协议家族分类并点名主要厂商,完整清单以 app 内「添加订阅」页为准。只有当新厂商是知名品牌、值得在出口章节的点名列表里露脸时才加一个名字,普通中转站不加。

ProviderIcon BRAND_MAP(仅当 @lobehub/icons 有该品牌图标时):

位置:src/components/ProviderIcon.tsx

tsx
import NewBrand from "@lobehub/icons/es/NewBrand";
const BRAND_MAP: Record<string, BrandIcon> = {
  ...
  <new_id>: NewBrand as unknown as BrandIcon,
};

并把 YAML 的 icon: "" 改成 icon: <new_id>(必须和 BRAND_MAP key 一致)。

@lobehub/icons 没有的品牌(如小厂中转)保持 icon: "",UI 自动用 Bot lucide 图标兜底——不要为了好看强行映射到不相关的图标。知名品牌确实需要 logo 时可以照 src/components/RequestyIcon.tsx 手画一个简化内联 SVG(彩色 + 单色两套,单色给小票黑白主题)。

验证

执行最小验证集:

bash
cd src-tauri && cargo test --lib provider::loader

通过 = 新 yaml 能被解析、id 不与现有 provider 冲突、default_endpoint 合法、上屏文字三语齐全。失败信息会直接点名出错的文件和字段。

可选:pnpm tsc --noEmit 确认 BRAND_MAP 导入没拼错(Step 3 改动时)。

不做什么

下面这些都不需要为新 provider 做改动——cc-router 的 Provider 抽象就是为了避免这些工作而存在的:

  • 改调度器(virtual_model/scheduler.rs)
  • 改状态机(virtual_model/state_machine.rs)
  • 改 SSE 流式处理(proxy/sse.rs)
  • 改 reqwest 上游调用(proxy/upstream.rs)
  • 加 migration(db/migrations/)

如果你发现确实需要改这些地方,那说明这个 provider 不是简单的 Anthropic 兼容端点——先停下来跟用户对齐,可能是 schema 设计有缺口(例如某厂商需要特殊请求体改写、或非标准认证流程),需要扩展 _schema.json 而非绕过。

决策提示词

写完 YAML 草稿、执行 Step 3 之前,主动向用户确认这 3 件事——它们没有客观正确答案:

  1. endpoints 数量:单端点够还是要列国内/国际/订阅/按量多组?
  2. API Key 字段:厂商是否真的需要 key?某些(如 Ollama)不校验,要在 compatibility_notes 写清楚
  3. example_models:当 model_discovery.enabled: false 时这是 UI 唯一提示,常用模型放前面

不要替用户拍板这些决策——它们关系到用户的实际使用偏好。

流程结束

3 步走完 + cargo test 通过 = 工作完成。不要主动提议提交 commit / 发 PR——cc-router 维护者偏好确认改动后自己提交。如果用户明确要求 commit,再走 commit 流程。

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

Files

Just SKILL.md in .claude/skills/new-provider of finch-xu/cc-router.

Open the folder on GitHubat commit 36e2c6c

Compare with similar skills

New 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.

New Provider compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
New Provider this skillfinch-xu/cc-router277—~1.6kAutomated safety check: PassMIT
Configuring Visionoxbshw/watch-skill470—~509Automated safety check: NotesMIT
QuorumDetrol/quorum-cli119—~807Automated safety check: NotesCustom licence
Update Ollama Cloud Modelsheypinchy/pinchy182—~3.9kAutomated safety check: NotesAGPL-3.0
Proxy Mode ReferenceMadAppGang/claude-code285—~1.3kAutomated safety check: PassMIT
Claudish UsageMadAppGang/claudish1k—~9kAutomated safety check: PassNone

Similar skills

  • Configuring Vision

    oxbshw/watch-skill

    The user wants to connect an LLM or vision provider, already has an API key, asks "can I use OpenAI/Anthropic/Gemini/OpenRouter", wants local Ollama, or needs different cheap and strong models.

    470 GitHub stars~509 tokensUpdated 26 days ago
    AI & LLM EngineeringAuto-check: notes
  • Quorum

    Detrol/quorum-cli

    Run a structured debate between agent CLIs (claude, codex, agy, grok) and the user's configured API or local models (OpenAI, Anthropic, Google, xAI, OpenRouter, Ollama and more) through the Quorum…

    119 GitHub stars~807 tokensUpdated 13 days ago
    AI & LLM EngineeringAuto-check: notes
  • A skill your agent uses when a new Ollama Cloud model is announced or available (e.g.

    182 GitHub stars~3.9k tokensUpdated 20 days ago
    AI & LLM EngineeringAuto-check: notes
  • Proxy Mode Reference

    MadAppGang/claude-code

    Reference guide for using external AI models via claudish CLI.

    285 GitHub stars~1.3k tokensUpdated 7 mo ago
    AI & LLM EngineeringAuto-check passed
  • Claudish Usage

    MadAppGang/claudish

    CRITICAL - Guide for using Claudish CLI ONLY through sub-agents to run Claude Code with any AI model (OpenRouter, Gemini, OpenAI, local models).

    1k GitHub stars~9k tokensUpdated 4 days ago
    Agent WorkflowsAuto-check passed
  • Page Agent

    Tommy-yw/RunbookHermes

    Embed alibaba/page-agent into your own web application — a pure-JavaScript in-page GUI agent that ships as a single <script tag or npm package and lets end-users of your site drive the UI with…

    546 GitHub starsUsed in 3 repos~2.3k tokens
    Productivity & AutomationAuto-check: notes

More from finch-xu/cc-router

  • Release Prep

    finch-xu/cc-router

    cc-router 发版准备一条龙:升版本号 → 根据上一个 tag 以来的提交写 release-notes/<版本/ 的中英日三份更新内容 → 校验 → 给用户审 → 本地提交「Bump version to X.Y.Z」,停在打 tag 之前。当用户说「准备发版」「发个版」「发 6.1.0」「写发版说明 / 更新内容 / release notes」「bump 版本」时必须走本…

    277 GitHub stars~1.5k tokensUpdated today
    Auto-check passed

Questions about New Provider

What does New Provider do?

用于在 cc-router 仓库新增一个 LLM provider(即在 src-tauri/providers/ 下添加 YAML 描述符并完成配套的同步改动)。当用户说「加 provider」「接入 XX 厂商」「新增订阅源」「provider YAML」「让 cc-router 支持 OpenRouter/Together/Groq/Ollama 之类」时必须触发本…. New Provider is an agent skill from finch-xu/cc-router.

When should I use New Provider?

New Provider fits situations like: tasks that involve Model routing and gateways; tasks that involve LLM inference and serving.

How do I install New Provider in Claude Code?

Run `npx skills add finch-xu/cc-router --skill new-provider -a claude-code`. Or copy the skill folder (.claude/skills/new-provider in finch-xu/cc-router) into .claude/skills/new-provider in your project. Claude Code loads it when a task matches its description.

How do I install New Provider in Codex?

Run `npx skills add finch-xu/cc-router --skill new-provider -a codex`. Or copy the skill folder (.claude/skills/new-provider in finch-xu/cc-router) into .agents/skills/new-provider in your project. Codex loads it when a task matches its description.

Can I use New 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 finch-xu/cc-router --skill new-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/new-provider, .gemini/skills/new-provider, .github/skills/new-provider and .opencode/skills/new-provider in your project.

What does New Provider need to run?

Going by SKILL.md and its folder, New Provider needs the command-line tools its instructions call (cargo and pnpm).

Does New Provider access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is New 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 New Provider use?

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

About 1.6k tokens (SKILL.md is roughly 6.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 New Provider?

Skills that share tags, products or a category with New Provider: Configuring Vision (oxbshw/watch-skill, 470 stars), Quorum (Detrol/quorum-cli, 119 stars), Update Ollama Cloud Models (heypinchy/pinchy, 182 stars) and Proxy Mode Reference (MadAppGang/claude-code, 285 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains New Provider?

finch-xu (a GitHub user) maintains it in finch-xu/cc-router, which has 277 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 10, 2026.

Source: finch-xu/cc-router on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.