jpskill.com
🛠️ 開発・MCP コミュニティ

creating-commands

Creates new Claude Code slash commands following best practices. Guides through command structure, naming, arguments, and frontmatter. Use when user wants to create a command, build a slash command, or asks about command best practices.

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o creating-commands.zip https://jpskill.com/download/17586.zip && unzip -o creating-commands.zip && rm creating-commands.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/17586.zip -OutFile "$d\creating-commands.zip"; Expand-Archive "$d\creating-commands.zip" -DestinationPath $d -Force; ri "$d\creating-commands.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して creating-commands.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → creating-commands フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

コマンドの作成

文書化されたベストプラクティスを使用して、Claude Code スラッシュコマンドの作成をガイドします。

クイックスタート

新しいコマンドの場合:

  1. コマンドの目的と必要な引数をユーザーに尋ねます
  2. 適切なテンプレートを使用して生成します
  3. チェックリストに対して検証します

既存のコマンドを確認する場合:

  1. コマンドファイルを読みます
  2. reference.md のアンチパターンと照らし合わせて確認します
  3. 修正とともに問題を報告します

ワークフロー: 新しいコマンドの作成

進捗状況:
- [ ] 要件の収集 (目的、引数、スコープ)
- [ ] テンプレートの選択 (basic, with-args, workflow)
- [ ] コマンドファイルの生成
- [ ] チェックリストに対する検証

ステップ 1: 要件の収集

AskUserQuestion でユーザーに質問します:

  • このコマンドは何をすべきですか? (目的)
  • 引数は必要ですか? (なし、単一、複数)
  • プロジェクトまたは個人用ですか? (スコープ)

ステップ 2: テンプレートの選択

タイプ テンプレート いつ使用するか
Basic templates/basic.md 引数なし、シンプルなプロンプト
With Args templates/with-args.md 単一または複数の引数
Workflow templates/workflow.md skills/agents と統合

ステップ 3: コマンドの生成

適切な場所に作成します:

  • .claude/commands/ - プロジェクトコマンド (git で追跡)
  • ~/.claude/commands/ - 個人用コマンド (自分のマシンのみ)

ステップ 4: 検証

完了する前にチェックリストを実行します:

検証チェックリスト:
- [ ] Name: 小文字でハイフンのみ
- [ ] Name: 記述的、verb-noun 形式が推奨
- [ ] Description: コマンドの内容を説明
- [ ] Arguments: 使用する場合は argument-hint でドキュメント化
- [ ] Prompt: 明確で実行可能な指示
- [ ] Tools: 必要な場合は allowed-tools を宣言

命名規則

形式: verb-noun または action (小文字、ハイフン)

  • fix-issue
  • review-pr
  • run-tests
  • optimize

制約:

  • 小文字、数字、ハイフンのみ
  • スペースまたはアンダースコアは不可
  • 簡潔に保つ (1-3 語)

コマンドファイル形式

---
description: ヘルプに表示される簡単な説明
allowed-tools:
  - Bash(bash:*)
  - WebSearch
argument-hint: "param_name"
---

ここにコマンドプロンプトを入力してください。
すべての引数には $ARGUMENTS を使用し、位置引数には $1, $2 を使用します。

引数の構文

構文 使用法
$ARGUMENTS すべての引数を 1 つの文字列として /cmd foo barfoo bar
$1, $2 位置引数 /cmd foo bar$1=foo, $2=bar
@file ファイルの内容を含める Review @src/main.ts

Frontmatter のオプション

フィールド 目的 必須
description ヘルプに表示され、自動呼び出しを有効にします 推奨
allowed-tools コマンドが使用できるツール ツールを使用する場合
argument-hint 予期される引数をドキュメント化 引数がある場合
model 使用する特定のモデル オプション

例: 基本的なコマンド

---
description: すべてのテストを実行し、失敗を報告します
allowed-tools:
  - Bash(npm:*)
---

テストスイートを実行し、結果を要約します:

1. `npm test` を実行します
2. 失敗した場合、コンテキストとともに失敗したテストを表示します
3. 一般的な問題に対する修正を提案します

詳細なベストプラクティスとアンチパターンについては、reference.md を参照してください。

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Creating Commands

Guides creation of Claude Code slash commands using documented best practices.

Quick Start

For a new command:

  1. Ask user for command purpose and arguments needed
  2. Generate using appropriate template
  3. Validate against checklist

For reviewing existing command:

  1. Read command file
  2. Check against anti-patterns in reference.md
  3. Report issues with fixes

Workflow: Create New Command

Progress:
- [ ] Gather requirements (purpose, arguments, scope)
- [ ] Choose template (basic, with-args, workflow)
- [ ] Generate command file
- [ ] Validate against checklist

Step 1: Gather Requirements

Ask user with AskUserQuestion:

  • What should this command do? (purpose)
  • Does it need arguments? (none, single, multiple)
  • Project or personal? (scope)

Step 2: Choose Template

Type Template When to Use
Basic templates/basic.md No arguments, simple prompt
With Args templates/with-args.md Single or multiple arguments
Workflow templates/workflow.md Integrates with skills/agents

Step 3: Generate Command

Create in appropriate location:

  • .claude/commands/ - Project commands (git-tracked)
  • ~/.claude/commands/ - Personal commands (your machine only)

Step 4: Validate

Run through checklist before finishing:

Validation Checklist:
- [ ] Name: lowercase with hyphens only
- [ ] Name: descriptive, verb-noun format preferred
- [ ] Description: explains what command does
- [ ] Arguments: documented with argument-hint if used
- [ ] Prompt: clear, actionable instructions
- [ ] Tools: allowed-tools declared if needed

Naming Rules

Format: verb-noun or action (lowercase, hyphens)

  • fix-issue
  • review-pr
  • run-tests
  • optimize

Constraints:

  • Lowercase letters, numbers, hyphens only
  • No spaces or underscores
  • Keep concise (1-3 words)

Command File Format

---
description: Brief explanation shown in help
allowed-tools:
  - Bash(bash:*)
  - WebSearch
argument-hint: "param_name"
---

Your command prompt here.
Use $ARGUMENTS for all args or $1, $2 for positional.

Argument Syntax

Syntax Usage Example
$ARGUMENTS All arguments as one string /cmd foo barfoo bar
$1, $2 Positional arguments /cmd foo bar$1=foo, $2=bar
@file Include file contents Review @src/main.ts

Frontmatter Options

Field Purpose Required
description Shown in help, enables auto-invoke Recommended
allowed-tools Tools the command can use If using tools
argument-hint Documents expected args If has args
model Specific model to use Optional

Example: Basic Command

---
description: Run all tests and report failures
allowed-tools:
  - Bash(npm:*)
---

Run the test suite and summarize results:

1. Execute `npm test`
2. If failures, show failing tests with context
3. Suggest fixes for common issues

See reference.md for detailed best practices and anti-patterns.