From plugin-generator
Claude Code プラグインの command 仕様知識。スラッシュコマンドの正しい形式、フロントマター、変数、model 指定を提供。Use when creating, updating, or maintaining commands, understanding command structure, or implementing slash commands. Also use when user says コマンド, スラッシュコマンド, commands.
How this skill is triggered — by the user, by Claude, or both
Slash command
/plugin-generator:command-specThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Claude Code プラグインの command(スラッシュコマンド)仕様知識を提供する。
Claude Code プラグインの command(スラッシュコマンド)仕様知識を提供する。
このスキルは command の正しい形式と実装パターンについての知識を提供します。
重要: 実装前に必ず公式ドキュメント(英語版)を確認し、最新の仕様に従ってください。
commands/{command-name}.md
my-command.md)---
description: コマンドの説明(必須)
---
---
description: コマンドの説明
model: claude-haiku-4-5-20251001
allowed-tools: Read, Glob, Grep, Bash
argument-hint: [引数のヒント]
disable-model-invocation: false
---
| フィールド | 型 | 説明 |
|---|---|---|
description | String | コマンドの説明(必須) |
model | String | 使用モデル(フルモデル ID) |
allowed-tools | String | 使用可能ツールを制限 |
argument-hint | String | 引数のヒント表示 |
disable-model-invocation | Boolean | true でモデル呼び出し無効化 |
commands では model フィールドの省略を推奨(ユーザーの使用モデルがそのまま使われる)。
特定のモデルを指定する場合はフルモデル ID を使用:
| モデル | ID | 用途 |
|---|---|---|
| (省略) | - | ユーザーのモデルを継承(推奨) |
| Haiku 4.5 | claude-haiku-4-5-20251001 | 高速・定型タスク向け |
| Opus 4.6 | claude-opus-4-6 | 高精度・複雑なタスク向け |
注意: Sonnet は現在の Claude Code では推奨されません。
| 変数 | 説明 | 例 |
|---|---|---|
$ARGUMENTS | 引数全体 | fix bug |
$1 | 第1引数 | fix |
$2 | 第2引数 | bug |
$3, $4, ... | 第3引数以降 |
# 単一引数
コミットメッセージ: $ARGUMENTS
# 複数引数
PR #$1 をレビュー(優先度: $2)
/plugin-name:command-name [arguments]
例:
/git-actions:commit-push "fix: bug修正"/plugin-generator:create my-plugin---
description: ファイルを検索する
---
# Search
指定されたパターンでファイルを検索します。
引数: $ARGUMENTS
1. パターンを解析
2. Glob で検索を実行
3. 結果を報告
---
description: コードをレビューする
allowed-tools: Read, Glob, Grep
---
# Code Review
指定されたファイルのコードをレビューします。
対象: $ARGUMENTS
1. ファイルを読み込む
2. コード品質をチェック
3. 改善点を報告
構文:
! + バッククォートで囲んだコマンド(例: ! + `git status`)@/path/to/file重要: !プレフィックス記法はスラッシュコマンド(commands/*.md)でのみ有効です。スキルファイル(SKILL.md)では使用できません。
使用例(コマンドファイル内での記述):
現在の状態:
- Status: !` + `git status` + `
- Diff: !` + `git diff HEAD` + `
コミットメッセージ: $ARGUMENTS
※ 上記のバッククォートを連結してください(例: ! と git status を連結 → 感嘆符+バッククォート+コマンド+バッククォート)
| ルール | 重要度 |
|---|---|
フロントマターに description 必須 | エラー |
| ファイル名は kebab-case | 推奨 |
| model はフルモデル ID | 必須(指定時) |
Q: 新しいコマンドを作りたい
A: commands/{name}.md を作成し、フロントマターに description を必ず含めてください。
$ARGUMENTS で引数を受け取れます。model を指定する場合はフルモデル ID を使用してください。
Q: コマンドで使うモデルを指定したい
A: 通常は model フィールドを省略することを推奨します(ユーザーのモデルを継承)。
特定のモデルが必要な場合のみ model: claude-haiku-4-5-20251001 などを指定してください。
npx claudepluginhub biwakonbu/cc-plugins --plugin plugin-generatorGuides creating slash commands for Claude Code: structure, YAML frontmatter, dynamic arguments, file references, bash execution, user interactions, organization, and best practices.
Guides developers on creating, structuring, and organizing slash commands for Claude Code. Covers YAML frontmatter, dynamic arguments, bash execution, user interactions, and best practices for reusable command workflows.
Guides creation of Claude Code slash commands using YAML frontmatter, XML tags like <objective> and <process>, dynamic context, and argument handling.