provider-switch
БесплатноЗапускает вложенные скриптыНе проверенConfigure alt API providers: DeepSeek, Z.ai/GLM, Qwen, MiniMax, OpenRouter. Triggers: switch provider, openrouter.
от kochetkov-ma★ 41 звезда на GitHubОб этом скилле
[DICT: P=Phase, PRV=provider, EXEC=EXECUTE using Bash tool, AUQ=AskUserQuestion, REF=references, ALIAS=shell alias, CFG=configured, BASE=ANTHROPIC_BASE_URL, MOD=ANTHROPIC_DEFAULT_OPUS_MODEL]
Provider Switch
Claude Code alt API providers, each an isolated ALIAS in ~/.zshrc: DeepSeek V4 (priority default, 1M ctx, native Anthropic endpoint; recommend first), Z.ai/GLM, Qwen/DashScope, MiniMax, OpenRouter.
Prompt contract
$ARGUMENTS is one free-form RU/EN prompt; mode tokens and flags may sit anywhere in it.
- Mode: an explicit mode token wins outright; else the most distinct whole-word keyword hits
(mode table in P1 below). Tie with a destructive mode ->
AskUserQuestion; withstatus->status; of two mutating modes -> the keyword that comes first. No hit or empty ->status. - Scope: prose that is not a mode/provider name is still input: take the provider or scope from it.
- Ask: at most ONE
AskUserQuestion(max 4 questions) to resolve mode and scope, before any work, only when the answer changes what gets written.statusitself is read-only and asks nothing.
Print once, before the first action (labels literal, values in the conversation language):
PLAN — brewtools:provider-switch
INPUT: <arguments verbatim, or "(empty)">
MODE: <resolved> — <explicit | matched keyword: X | default>
SCOPE: <resolved paths / target / level / flags>
DO: <2-5 imperative bullets>
RESULT: <what the user ends up holding>
Robustness Rules (MANDATORY)
| Rule | Scope |
|---|---|
Every Bash call: && echo "OK ..." || echo "FAILED ..." |
ALL |
| On FAILED: stop phase, report error, !=retry blindly | ALL |
| Max 3 AUQ per phase | ALL |
| !=write secrets anywhere except ~/.zshrc | ALL |
!=ask for, receive, repeat or compose a key value (no AUQ, prompt or Bash line with it): the user places it out of band, scripts/read-secret.sh moves it. CC 2.1.296 has no masked input: AUQ answers land in the transcript; sensitive userConfig never reaches skill content |
ALL |
| !=commit ~/.zshrc changes | ALL |
| ~/.zshrc comments: ENGLISH only | ALL writes |
Error format on ANY failure:
SCRIPT_ERROR: <name>
PHASE: <current>
ACTION: <attempted>
SUGGESTION: <fix>
P0: Language Selection
Read-only modes: conversation language, no question. Mutating modes, language unresolved only: "Select language / Выберите язык" | "English (Recommended)", "Russian / Русский"; skipped → English for the session.
P1: Mode Detection
EXEC (quoted heredoc: quotes, backticks and $( in the prompt stay inert text):
IFS= read -r -d '' ARGS <<'__SKILL_ARGS__' || true
$ARGUMENTS
__SKILL_ARGS__
ARGS=${ARGS%$'\n'}
bash "${CLAUDE_SKILL_DIR}/scripts/detect-mode.sh" "$ARGS" && echo "OK detect" || echo "FAILED detect"
FAILED → report it and match the prompt against the table by hand; never retry blindly.
Output: ARGS: [...] MODE: [...]
| Mode | EN keywords | RU keywords | Mutates? |
|---|---|---|---|
status |
(empty), status, check | статус, проверь | no |
install |
install, configure | настрой, установи, поставь | yes |
help |
help, how | помощь, как | no |
provider-deepseek |
deepseek, ds, dpsk | дипсик | yes |
provider-glm |
glm, zai, z.ai | глм, зай | yes |
provider-qwen |
qwen, dashscope | квен, дашскоуп | yes |
provider-minimax |
minimax, mini | минимакс | yes |
provider-openrouter |
openrouter, router | опенроутер, роутер | yes |
verify |
verify, test, token | проверка, тест, токен | no |
model-check |
model-check, identify | проверь модель, идентифицируй | no |
Typos (model-cehck, cehck, hlpe, instal, ...) fuzzy-match to the closest row above.
PLAN goes before any P0 question or P1/P2 call; DO for read-only modes = "probe state, report"; install names the intended PRV scope, resolved in P3 before P4's first write.
P2: Status Check (ALL modes)
EXEC:
bash "${CLAUDE_SKILL_DIR}/scripts/check-status.sh" && echo "OK status" || echo "FAILED status"
STOP if FAILED — report the secret-free error; never print raw ~/.zshrc/key assignments into context.
Per PRV: configured = ALIAS + KEY true; partial = ALIAS true, KEY false;
not configured = ALIAS false; active = ACTIVE_PROVIDER matches. Render:
# Provider Switch — [MODE]
## Current Status
| PRV | Alias | API Key | Model | Status |
|-----|-------|---------|-------|--------|
| DeepSeek (priority) | claudeds | DEEPSEEK_API_KEY | deepseek-v4-pro | ... |
| Z.ai / GLM | claudeglm | ZAI_API_KEY | glm-5.2 | ... |
| Qwen | claudeqwen | DASHSCOPE_API_KEY | qwen3.7-plus[1m] | ... |
| MiniMax | claudeminimax | MINIMAX_API_KEY | MiniMax-M3 | ... |
| OpenRouter | claudeor | OPENROUTER_API_KEY | (user-selected) | ... |
## How to Use
Run `claudeds` — sets env vars + launches Claude (recommended default).
Return to Anthropic: new terminal → `claude`.
status is TERMINAL — it never writes and neve
Установить provider-switch в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBashAgentAskUserQuestionGlobGrepВложенные файлы
FAQ
Что делает скилл provider-switch?
Configure alt API providers: DeepSeek, Z.ai/GLM, Qwen, MiniMax, OpenRouter. Triggers: switch provider, openrouter.
Как установить скилл provider-switch?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл provider-switch запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic