Claude Code Skills:Slash Commands 完全ガイド
Claude Code の Skills システムをマスターしよう。Slash Commands の仕組み、組み込み Skills、カスタム Skills の作成方法を解説します。
2026年10月21日更新: 現在の skills ドキュメントに合わせて書き直しました。Skills は専用フォルダー内の
SKILL.mdであり、frontmatter と引数の例は実際に読み取られるフィールドに修正しました(旧来のtrigger:とargs:は読み取られません)。組み込みの表も、実際のバンドル Skills と/skills、/reload-skills、/skill-doctorに差し替えています。
Skills は Claude Code の再利用可能なプロンプトとワークフローです。手順を書いた SKILL.md ファイルを /skill-name で呼び出せるほか、関連する場面では Claude 自身が読み込みます。カスタム Slash Commands は Skills に統合されました。このガイドでは、バンドル Skills、カスタマイズ、独自の Skills 作成方法について解説します。
Skills とは?
skills 公式ドキュメントによると、Skills は以下の特徴を持ちます:
- Slash Commands でトリガーされる、または関連時に自動で読み込まれる再利用可能なプロンプトテンプレート
- 複数のステップを組み合わせたワークフロー自動化
- ニーズに合わせて作成できるカスタム拡張機能
- コードベースを理解したプロジェクト固有のコマンド
Skills は、一般的なワークフローを単一のコマンドにエンコードするマクロと考えてください。Claude Code の Skills はオープンな Agent Skills 標準に準拠しており、.claude/commands/ 内のファイルも引き続き Skill として動作します。
Skills の動作原理
ユーザーが入力: /deploy
Claude Code:
1. .claude/skills/deploy/SKILL.md(プロジェクト)、
~/.claude/skills/(個人)、プラグイン、バンドル Skills から Skill を検索
2. Skill の指示全体を読み込む(呼び出し前は
description だけがコンテキストにある)
3. Skill で定義されたワークフローを実行
4. 結果をユーザーに返す
組み込みコマンドとバンドル Skills
コアコマンド
| Skill | コマンド | 目的 |
|---|---|---|
| Init | /init | 新規プロジェクトの CLAUDE.md を初期化 |
| Help | /help | 利用可能なコマンドを表示 |
| Clear | /clear | 空のコンテキストで新しい会話を開始 |
| Config | /config | 設定を表示/編集 |
| Permissions | /permissions | ツール権限を管理 |
| Doctor | /doctor | セットアップ診断(修正案を提示するバンドル Skill) |
バンドル開発 Skills
| Skill | コマンド | 目的 |
|---|---|---|
| Code Review | /code-review(別名 /review) | 現在の diff や PR の正しさに関するバグをレビュー |
| Simplify | /simplify | 変更したコードを再利用・簡潔さ・効率の観点で整理 |
| Verify | /verify | アプリをビルドして実行し、変更が機能することを確認 |
| Batch | /batch | 大きな変更を並列のバックグラウンドサブエージェントに分割 |
| Debug | /debug | デバッグログを有効にしてセッションの問題を調査 |
Skill とメモリの管理
| Skill | コマンド | 目的 |
|---|---|---|
| Skills | /skills | Skills の一覧表示、トークンコスト順の並べ替え、表示切り替え |
| Reload Skills | /reload-skills | 再起動せずに Skill ディレクトリを再スキャン |
| Skill Doctor | /skill-doctor | 各 Skill のコンテキストコストと使用回数を表示 |
| Memory | /memory | CLAUDE.md ファイルの編集と auto memory の管理 |
/memory-save や /memory-search のようなコマンドは、Memory MCP サーバーを中心に作られたカスタム Skills であり、Claude Code の一部ではありません。バンドル Skills はコマンドリファレンスで Skill と表示され、disableBundledSkills 設定で無効にできます。
Skills の使用方法
基本的な使い方
Slash Command を入力するだけです:
/code-review
Claude が Skill のワークフローを実行します。
引数付き
Skill 名の後に続く内容は $ARGUMENTS(または位置に応じて $0、$1…)として Skill に渡されます:
/code-review high 1234
/fix-issue 123
/migrate-component SearchBar JavaScript TypeScript
Skills の連鎖
Skills は連続して使用できます。メッセージの先頭にある Skill 名は直接実行され、通常の文章の後に置かれた名前は、Claude が応答中にその Skill を実行してよいという許可になります:
ユーザー: 話し合った変更を行って、その後 /commit を実行して
Claude:
→ 変更を実施
→ /commit Skill を実行
→ 適切なコミットメッセージを作成
ターミナルでは、1 つのメッセージの先頭に複数の Skills を重ねることもできます(例:/write-tests /fix-issue 123)。
Skill ファイル構造
各 Skill は SKILL.md を含むディレクトリで、.claude/skills/(プロジェクト)または ~/.claude/skills/(個人)に置きます:
.claude/
├── skills/
│ ├── commit/
│ │ └── SKILL.md # Git commit skill
│ ├── review-pr/
│ │ └── SKILL.md # Code review skill
│ └── deploy/
│ ├── SKILL.md # Deployment skill
│ └── checklist.md # Supporting file, loaded when needed
├── commands/
│ └── legacy-command.md # Older single-file format, still works
└── settings.json
ディレクトリ名(または frontmatter の name)がコマンド名になります。プラグインの Skills は /plugin-name:skill-name という名前空間になります。
Skill 定義フォーマット
---
name: commit
description: Create a git commit with a conventional commit message. Use when the user asks to commit changes.
disable-model-invocation: true
allowed-tools: Bash(git add *) Bash(git commit *) Bash(git status *)
---
# Commit Skill
## Instructions
1. Check git status for staged changes
2. Analyze the changes to understand what was modified
3. Generate a conventional commit message:
- feat: New feature
- fix: Bug fix
- docs: Documentation
- refactor: Code refactoring
- test: Test changes
- chore: Maintenance
4. Create the commit with the generated message
5. Show the commit result
## Format
Use this commit message format:
type(scope): description
- Detail 1
- Detail 2
Co-Authored-By: Claude noreply@anthropic.com
## Example Output
Created commit: abc1234
feat(auth): add JWT token refresh mechanism
- Implement automatic token refresh before expiration
- Add refresh token rotation for security
- Update auth middleware to handle refresh flow
Co-Authored-By: Claude noreply@anthropic.com
frontmatter のフィールドはすべて任意ですが、description は Skill をいつ使うかを Claude に伝えます。disable-model-invocation: true は副作用のある Skill を Claude が自分で実行しないようにし、allowed-tools はその Skill を呼び出したターンに限り、列挙したツールを事前承認します。Claude Code は認識できないフィールドをエラーなく無視します。
カスタム Skills の作成
ステップ 1:Skill ディレクトリを作成
.claude/skills/ に Skill 用のディレクトリを作成します:
mkdir -p .claude/skills/deploy
ステップ 2:Skill を定義
以下を .claude/skills/deploy/SKILL.md として保存します:
---
name: deploy
description: Deploy to staging environment
disable-model-invocation: true
---
# Deploy to Staging
## Prerequisites Check
1. Verify all tests pass
2. Check for uncommitted changes
3. Confirm current branch
## Deployment Steps
1. Build the project:
```bash
npm run build
-
Run pre-deployment tests:
npm run test:e2e -
Deploy to staging:
npm run deploy:staging -
Verify deployment:
- Check health endpoint
- Run smoke tests
Post-Deployment
- Report deployment status
- Show deployed URL
- Note any warnings
### ステップ 3:Skill を使用
/deploy
Claude Code は Skill ディレクトリを監視しているため、編集は現在のセッションに反映されます。セッションの途中で新しいトップレベルの skills ディレクトリを作成した場合は、`/reload-skills` を実行してください。
## 高度な Skill パターン
### パターン 1:パラメータ化された Skills
Skill で引数を受け付ける:
```markdown
---
name: feature
description: Start a new feature branch
argument-hint: "[feature-name]"
arguments: [feature]
disable-model-invocation: true
---
# New Feature Workflow
## Steps
1. Create branch: `feature/$feature`
2. Set up feature structure
3. Create initial files
4. Open PR draft
パターン 2:条件付き Skills
コンテキストに基づいて異なる動作:
---
name: review-changes
description: Review code changes, either a PR or the local diff
---
# Code Review
## Determine Review Type
If reviewing a PR:
- Fetch PR changes
- Compare with base branch
If reviewing local changes:
- Check git diff
- Review staged and unstaged
## Review Checklist
- [ ] Code quality
- [ ] Security considerations
- [ ] Test coverage
- [ ] Documentation
- [ ] Performance implications
パターン 3:マルチエージェント Skills
複数のエージェントをオーケストレーションする Skills(Skill 全体を独自のサブエージェントで実行するには context: fork を追加します):
---
name: audit
description: Comprehensive codebase audit
---
# Codebase Audit
## Phase 1: Parallel Analysis
Launch these agents simultaneously:
1. **Explore Agent (quick)**: Map codebase structure
2. **Explore Agent (medium)**: Find code patterns
3. **security-auditor**: Security scan
4. **code-reviewer**: Quality check
5. **test-runner**: Coverage analysis
## Phase 2: Synthesize Results
Combine findings into:
- Security issues (by severity)
- Quality concerns
- Coverage gaps
- Recommended improvements
## Output Format
Audit Report
Security (X issues)
- Critical: …
- High: …
Quality (X concerns)
- …
Coverage (X%)
- Missing: …
Recommendations
- …
- …
パターン 4:インタラクティブ Skills
入力を求める Skills:
---
name: scaffold
description: Scaffold new component/feature
---
# Scaffold Generator
## Questions
Ask the user:
1. What type? (component/api/service/hook)
2. Name?
3. Location? (suggest based on type)
## Generate Based on Answers
For component:
- Create component file
- Create test file
- Create styles file
- Export from index
For API:
- Create route handler
- Create validation schema
- Create test file
- Update API routes index
プロジェクト固有の Skills
例:E コマース Skills
# .claude/skills/add-product/SKILL.md
---
name: add-product
description: Add a new product to catalog
---
## Product Creation Workflow
1. Create product migration
2. Add product schema
3. Create API endpoints
4. Add admin UI components
5. Write tests
例:API 開発 Skills
# .claude/skills/new-endpoint/SKILL.md
---
name: new-endpoint
description: Create new API endpoint with full setup
---
## Endpoint Creation
1. Create route handler
2. Add input validation (Zod)
3. Implement business logic
4. Add error handling
5. Write tests
6. Update API docs
7. Run security-auditor
Skill カテゴリ
カスタム Skill ライブラリは、たいてい次のようなカテゴリに育ちます。バンドルの /code-review を除き、これらは自分で書くかインストールする Skills の例であり、Claude Code に付属するコマンドではありません:
ワークフロー Skills
/workflow # Full development workflow
/focus-problem # Problem analysis
/test-first # TDD workflow
/smart-commit # Intelligent git commit
品質 Skills
/self-review # Self-review and fix loop
/code-review # Code review (bundled)
/security-check # Security scan
/doc-audit # Documentation check
Git Skills
/commit-push-pr # Commit, push, and PR
/smart-commit # Conventional commits
AI Interop Skills
/handoff-codex # Hand off to Codex CLI
/handoff-gemini # Hand off to Gemini CLI
/interop-broker # Route to best CLI
Skills vs Agents vs MCP
| 機能 | Skills | Agents | MCP |
|---|---|---|---|
| 目的 | ワークフロー自動化 | タスク実行 | ツール拡張 |
| トリガー | /command または description による自動判断 | Agent tool(旧 Task tool) | ツール呼び出し |
| スコープ | 個人、プロジェクト、プラグイン、組織 | 組み込みとカスタム(.claude/agents/) | 外部サービス |
| カスタマイズ | 簡単(Markdown) | 簡単(Markdown) | 中程度(コード) |
| コンテキストコスト | 低(呼び出しまでは description のみ) | 独自のコンテキストウィンドウ | 可変(tool search 有効時は低い) |
使い分け
Skills を使用する場合:
- 繰り返し可能なワークフローがある
- Slash Command のショートカットが欲しい
- プロジェクト固有のコマンドが必要
- チームのパターンをエンコードしたい
Agents を使用する場合:
- 並列実行が必要
- 専門的な分析が欲しい
- 自律的なタスク処理が必要
- モデル選択の柔軟性が欲しい
MCP を使用する場合:
- 外部データアクセスが必要
- 永続的なストレージが欲しい
- API 統合が必要
- データベースアクセスが欲しい
Skill ベストプラクティス
1. Skills は焦点を絞る
# Good: Single purpose
/deploy-staging # Deploy to staging
/deploy-prod # Deploy to production
# Avoid: Too broad
/deploy # Deploy to... somewhere?
2. 徹底的にドキュメント化
主要なユースケースを description の先頭に書き、参照資料は補助ファイルに移して SKILL.md を 500 行程度までに保ちます:
---
name: my-skill
description: Clear one-line description of what it does and when to use it
argument-hint: "[target]"
---
# Skill Name
## Purpose
What this skill does and when to use it.
## Prerequisites
What needs to be in place before running.
## Steps
Detailed workflow steps.
## Examples
Example usage and expected output.
3. エラーハンドリングを含める
## Error Handling
If build fails:
- Show error details
- Suggest fixes
- Don't proceed with deployment
If tests fail:
- Report failed tests
- Ask before continuing
4. Agents を適切に使用
## Quality Checks
After implementation:
- Run code-reviewer agent for quality
- Run test-runner agent for coverage
- Run security-auditor if touching auth/payment
Skills の発見
利用可能な Skills を一覧表示
/skills
カスタム、プラグイン、バンドルを含むすべての利用可能な Skills が表示されます。入力して絞り込み、t でトークン数順に並べ替え、Space で Claude と / メニューに対する表示を切り替えられます。
Skill 定義を確認
.claude/skills/ と ~/.claude/skills/ を見てカスタム Skill の定義を確認できます。新しいトップレベルの skills ディレクトリを追加したら /reload-skills を、コンテキストを消費しているのに使われていない Skills を見つけるには /skill-doctor を実行します。
バンドル Skill のドキュメント
バンドル Skills はコマンドリファレンスと skills ドキュメントに記載されています。
はじめよう
今日:
- 次の変更で
/code-reviewを試す /skillsを使って利用可能な Skills を確認- バンドル Skills をレビュー
今週:
- ワークフロー用にカスタム Skill を 1 つ作成
- チーム固有の Skills をプロジェクトに追加
- README に Skills をドキュメント化
今月:
- プロジェクト Skills のライブラリを構築
- チームプロジェクト間で Skills を共有
- 複雑なワークフロー用にマルチエージェント Skills を作成
Skills はあなたの専門知識を再利用可能なコマンドにエンコードします。一度作れば、永遠に使えます。
出典: Claude Code Skills Documentation, Commands Reference, Claude Code GitHub