/cook:design-patternsfrom cook
Analyzes codebase for design pattern usage, suggests applicable patterns, evaluates SOLID principle compliance, and detects anti-patterns. Also supports refactoring and impact analysis.
Claude never picks this command on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /cook:design-patterns still runs it.
コードベースに適用可能なデザインパターンを提案し、SOLID 原則の遵守状況を評価します。
/design-patterns [分析対象] [オプション]
--suggest : 適用可能なパターンを提案 (デフォルト)--analyze : 既存パターンの使用状況を分析--refactor : リファクタリング案を生成--solid : SOLID 原則の遵守状況をチェック--anti-patterns : アンチパターンを検出# プロジェクト全体のパターン分析
/design-patterns
# 特定ファイルへのパターン提案
/design-patterns src/services/user.js --suggest
# SOLID 原則チェック
/design-patterns --solid
# アンチパターン検出
/design-patterns --anti-patterns
S - Single Responsibility Principle (単一責任の原則)
O - Open/Closed Principle (開放閉鎖の原則)
L - Liskov Substitution Principle (リスコフの置換原則)
I - Interface Segregation Principle (インターフェース分離の原則)
D - Dependency Inversion Principle (依存性逆転の原則)
デザインパターン分析レポート
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
現在使用中のパターン
├─ Observer Pattern: EventEmitter (12 箇所)
├─ Factory Pattern: UserFactory (3 箇所)
├─ Singleton Pattern: DatabaseConnection (1 箇所)
└─ Strategy Pattern: PaymentProcessor (5 箇所)
推奨パターン
├─ [HIGH] Repository Pattern
│ └─ 対象: src/models/*.js
│ └─ 理由: データアクセスロジックの分離
│ └─ 例:
│ class UserRepository {
│ async findById(id) { ... }
│ async save(user) { ... }
│ }
│
├─ [MED] Command Pattern
│ └─ 対象: src/api/handlers/*.js
│ └─ 理由: リクエスト処理の統一化
│
└─ [LOW] Decorator Pattern
└─ 対象: src/middleware/*.js
└─ 理由: 機能の組み合わせ改善
SOLID 原則違反
├─ [S] UserService: 認証と権限管理の両方を担当
├─ [O] PaymentGateway: 新決済手段追加時に修正必要
├─ [D] EmailService: 具象クラスに直接依存
└─ [I] IDataStore: 使用されないメソッドを含む
リファクタリング提案
1. UserService を認証と権限管理に分割
2. PaymentStrategy インターフェースの導入
3. EmailService インターフェースの定義
4. IDataStore を用途別に分離
# パターン適用の影響分析
/design-patterns --impact-analysis Repository
# 特定パターンの実装例生成
/design-patterns --generate Factory --for src/models/Product.js
# パターンの組み合わせ提案
/design-patterns --combine --context "API with caching"
# アーキテクチャパターンの評価
/design-patterns --architecture MVC
class OrderService {
processOrder(order, paymentType) {
if (paymentType === "credit") {
// クレジットカード処理
} else if (paymentType === "paypal") {
// PayPal 処理
}
// 他の決済方法...
}
}
// 戦略インターフェース
class PaymentStrategy {
process(amount) {
throw new Error("Must implement process method");
}
}
// 具象戦略
class CreditCardPayment extends PaymentStrategy {
process(amount) {
/* 実装 */
}
}
// コンテキスト
class OrderService {
constructor(paymentStrategy) {
this.paymentStrategy = paymentStrategy;
}
processOrder(order) {
this.paymentStrategy.process(order.total);
}
}
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub wasabeef/claude-code-cookbook --plugin cook2 plugins ship this exact command · first indexed Jul 16, 2026
39 commands in this plugin
/analyze-dependenciesプロジェクトの依存関係を分析し健全性を評価プロジェクトの依存関係を分析し、アーキテクチャの健全性を評価します。/analyze-performanceCore Web Vitals に基づくパフォーマンス分析アプリケーションのパフォーマンスをユーザー体験の観点から分析し、改善による体感速度向上を定量化します。Core Web Vitals に基づく UX スコアを算出し、優先順位付けされた最適化戦略を提案します。/check-factコードベースとドキュメントで情報の正誤を確認プロジェクト内のコードベース、ドキュメント (docs/、README.md など)を参照し、与えられた情報の正誤を確認するためのコマンド。/check-promptAI プロンプトの品質評価と改善提案AI Agent 向けプロンプトの品質を評価・改善するための包括的ベストプラクティス集です。実際のプロンプト改善プロセスで培った知見を体系化し、曖昧性の排除・情報統合・強制力強化・追跡システム・継続改善など、すべての重要観点を網羅しています。/commit-messageステージング変更からコミットメッセージを生成ステージングされた変更 (git diff --staged) から適切なコミットメッセージを生成します。git コマンドの実行は行わず、メッセージの生成とクリップボードへのコピーのみを行います。/context7Context7 MCP で技術ドキュメントを検索技術ドキュメントを MCP の Context7 で検索します。Other plugins' commands for the same job