model-switcher

shiiman's avatarfrom shiiman

タスクの複雑さに応じて Claude のモデルを自動的に切り替える。複雑なタスク(アーキテクチャ設計、大規模リファクタリング、難解なバグ修正)では opus を、単純なタスク(小さな修正、フォーマット、簡単な質問)では sonnet を自動選択。コストと品質のバランスを最適化。

⭐0stars🔀0forks📁View on GitHub🕐Updated Jan 3, 2026⬇️1downloads

When & Why to Use This Skill

The Model Switcher skill optimizes the balance between performance and cost by intelligently recommending the most appropriate Claude model based on task complexity. It analyzes the scope of work—such as the number of files affected, lines of code, and reasoning depth—to suggest switching to Claude Opus for high-stakes architectural tasks or maintaining Sonnet for efficient, routine updates.

Use Cases

  • Complex System Refactoring: Automatically identifies when a task involves multiple modules or architectural changes and suggests switching to Claude Opus for superior reasoning.
  • Cost-Efficient Routine Coding: Recognizes simple tasks like documentation updates, unit test generation, or code formatting to ensure they are handled by Sonnet, saving API costs.
  • Deep Debugging and Security Audits: Triggers a recommendation for higher-tier models when the user faces obscure bugs or requires a comprehensive security analysis of a codebase.
  • Workflow Orchestration: Acts as a smart router that evaluates the technical requirements of a prompt before execution, ensuring the agent's capabilities match the user's needs.
namemodel-switcher
descriptionタスクの複雑さに応じて Claude のモデルを自動的に切り替える。複雑なタスク(アーキテクチャ設計、大規模リファクタリング、難解なバグ修正)では opus を、単純なタスク(小さな修正、フォーマット、簡単な質問)では sonnet を自動選択。コストと品質のバランスを最適化。
allowed-tools[Read, Bash]

Model Switcher

タスクの複雑さに応じて Claude のモデルを自動的に切り替えます。

ワークフロー

1. タスクの複雑さを評価

ユーザーのリクエストを分析し、タスクの複雑さを判断:

複雑なタスク(opus 推奨):

  • アーキテクチャ設計
  • 大規模リファクタリング
  • 難解なバグ修正
  • セキュリティ監査
  • パフォーマンス最適化
  • 複数ファイルにまたがる変更
  • 新機能の設計と実装

単純なタスク(sonnet 推奨):

  • 小さなバグ修正
  • コードフォーマット
  • 簡単な質問への回答
  • ドキュメント更新
  • 単一ファイルの小さな変更
  • 定型的なコード生成

2. モデル切り替えを提案

タスクの複雑さに基づいてモデル切り替えを提案:

このタスクは複雑なため、opus モデルへの切り替えを推奨します。
切り替えますか?

/model opus

または

このタスクは単純なため、sonnet モデルで十分です。
現在のモデルを維持します。

3. ユーザーの判断を尊重

最終的なモデル選択はユーザーに委ねる。

モデル特性

モデル 特性 推奨用途
opus 高い推論能力、複雑な問題解決 設計、大規模変更、難解な問題
sonnet バランスの取れた性能、高速 日常的なタスク、小さな変更

判断基準

複雑さの指標

  • ファイル数: 3 ファイル以上 → 複雑
  • 変更行数: 100 行以上 → 複雑
  • 依存関係: 複数のモジュールに影響 → 複雑
  • 新規設計: 新しいパターンや構造 → 複雑
  • デバッグ: 原因不明のバグ → 複雑

重要な注意事項

  • ✅ タスクの複雑さを客観的に評価
  • ✅ ユーザーの判断を尊重
  • ✅ コストと品質のバランスを考慮
  • ❌ 自動的にモデルを切り替えない(提案のみ)