概要
この章では、Claude Codeのスラッシュコマンドについて解説します。 よく使う操作をコマンド化することで、効率的にClaude Codeを操作できます。
スラッシュコマンドとは
スラッシュコマンドは、/で始まる特殊なコマンドです。
会話の中で素早く特定の操作を実行できます。
基本構文は以下のとおりです。
/<command-name> [arguments]Claude Codeには多数のビルトインコマンドが用意されており、さらにカスタムコマンドを作成することも可能です。
ビルトインコマンド一覧
Claude Codeには以下のビルトインコマンドが用意されています。
セッション管理
| コマンド | 説明 |
|---|---|
/clear |
会話履歴をクリア |
/compact [instructions] |
会話をコンパクト化(要約して圧縮) |
/exit |
REPLを終了 |
/export [filename] |
会話をファイルまたはクリップボードにエクスポート |
設定と情報
| コマンド | 説明 |
|---|---|
/config |
設定インターフェースを開く |
/context |
コンテキスト使用状況を可視化 |
/cost |
トークン使用統計を表示 |
/help |
使用方法ヘルプを表示 |
/model |
AIモデルを選択変更 |
/permissions |
権限を表示・更新 |
/status |
バージョン等のステータス情報を表示 |
/stats |
使用状況を可視化 |
プロジェクト管理
| コマンド | 説明 |
|---|---|
/add-dir |
追加の作業ディレクトリを追加 |
/init |
プロジェクトを初期化(CLAUDE.mdを作成) |
/memory |
CLAUDE.mdメモリファイルを編集 |
/todos |
TODOアイテムを一覧表示 |
拡張機能
| コマンド | 説明 |
|---|---|
/agents |
カスタムSubagentを管理 |
/hooks |
Hook設定を管理 |
/mcp |
MCPサーバー接続を管理 |
/plugin |
プラグインを管理 |
会話管理
| コマンド | 説明 |
|---|---|
/rename <name> |
現在のセッション名を変更 |
/resume [session] |
IDまたは名前で会話を再開 |
/rewind |
会話やコードを巻き戻す |
/teleport |
claude.aiからリモートセッションを再開 |
レビューと品質
| コマンド | 説明 |
|---|---|
/review |
コードレビューをリクエスト |
/security-review |
保留中の変更のセキュリティレビュー |
/pr-comments |
PRコメントを表示 |
環境とセキュリティ
| コマンド | 説明 |
|---|---|
/sandbox |
サンドボックス化されたBashツールを有効化 |
/remote-env |
リモートセッション環境を設定 |
/privacy-settings |
プライバシー設定を表示・更新 |
その他
| コマンド | 説明 |
|---|---|
/bashes |
バックグラウンドタスクの一覧・管理 |
/bug |
バグレポートをAnthropicに送信 |
/doctor |
インストール状態をチェック |
/ide |
IDE統合を管理 |
/install-github-app |
GitHub Actionsを設定 |
/login / /logout |
アカウント認証 |
/output-style |
出力スタイルを設定 |
/plan |
プランモードに入る |
/release-notes |
リリースノートを表示 |
/statusline |
ステータスラインUIをセットアップ |
/terminal-setup |
Shift+Enterキーバインドをインストール |
/theme |
カラーテーマを変更 |
/usage |
プラン使用量とレート制限を表示 |
/vim |
vimモードを有効化 |
カスタムコマンドの作成
独自のスラッシュコマンドを作成できます。 コマンドはMarkdownファイルとして定義します。
プロジェクトコマンド
プロジェクト固有のコマンドは.claude/commands/ディレクトリに配置します。
mkdir -p .claude/commands以下は最適化提案を行うコマンドの例です。
Analyze this code for performance issues and suggest optimizations.
Focus on:
- Algorithm efficiency
- Memory usage
- Database queriesAnalyze this code for performance issues and suggest optimizations. Focus on:
- Algorithm efficiency
- Memory usage
- Database queries
このコマンドは/optimizeとして実行できます。
/helpコマンドで確認すると、"(project)"とラベルが表示されます。
パーソナルコマンド
すべてのプロジェクトで使用できるコマンドは~/.claude/commands/に配置します。
mkdir -p ~/.claude/commands以下はセキュリティレビューを行うコマンドの例です。
Review this code for security vulnerabilities.
Check for:
- SQL injection
- XSS attacks
- Authentication issues
- Sensitive data exposureReview this code for security vulnerabilities. Check for:
- SQL injection
- XSS attacks
- Authentication issues
- Sensitive data exposure
このコマンドは/security-reviewとして実行できます。
/helpコマンドで確認すると、"(user)"とラベルが表示されます。
引数の使用
カスタムコマンドでは引数を受け取ることができます。
全引数の受け取り
$ARGUMENTSを使用すると、すべての引数を一度に受け取れます。
Fix issue #$ARGUMENTS following our coding standards.
Make sure to:
- Write tests
- Update documentation
- Follow code style guidelinesFix issue #$ARGUMENTS following our coding standards. Make sure to:
- Write tests
- Update documentation
- Follow code style guidelines
使用例は以下のとおりです。
/fix-issue 123 high-priorityこの場合、$ARGUMENTSは123 high-priorityになります。
位置引数
$1、$2などを使用すると、個別の引数を受け取れます。
---
argument-hint: [pr-number] [priority] [assignee]
description: Review pull request
---
Review PR #$1 with priority $2 and assign to $3.
Focus on security, performance, and code style.argument-hint: [pr-number] [priority] [assignee] description: Review pull request
Review PR #$1 with priority $2 and assign to $3. Focus on security, performance, and code style.
使用例は以下のとおりです。
/review-pr 456 high aliceこの場合、$1は456、$2はhigh、$3はaliceになります。
フロントマター設定
コマンドファイルの先頭にYAMLフロントマターを追加することで、詳細な設定が可能です。
---
allowed-tools: Bash(git:*), Read, Edit
argument-hint: [message]
description: Create a git commit
model: claude-3-5-haiku-20241022
context: fork
---
Command content here...| allowed-tools | Bash(git:*), Read, Edit |
|---|---|
| argument-hint | message |
| description | Create a git commit |
| model | claude-3-5-haiku-20241022 |
| context | fork |
Command content here...
この設定例では、Gitコミットを作成するコマンドを定義しています。
allowed-toolsでBashツールのGit関連コマンドのみを許可し、argument-hintでコミットメッセージの入力を促しています。
modelを指定することで、コマンド実行時に特定のモデルを使用できます。
設定フィールド一覧
| フィールド | 説明 | デフォルト |
|---|---|---|
allowed-tools |
使用を許可するツール | 会話から継承 |
argument-hint |
引数のヒント表示 | なし |
description |
コマンドの説明 | 最初の行から自動抽出 |
model |
使用するモデル | 会話から継承 |
context |
forkで独立したSubagent実行 |
インライン |
agent |
context: fork時のエージェントタイプ |
general-purpose |
disable-model-invocation |
Skillツールからの呼び出しを禁止 | false |
hooks |
コマンド実行中のHook定義(once: trueで1回のみ実行) |
なし |
高度な機能
Bashコマンド実行
!プレフィックスを使用すると、Bashコマンドの実行結果をコマンドに含めることができます。
---
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*), Bash(git diff:*)
argument-hint: [message]
description: Create a git commit with automatic staging
---
## Context
- Current git status: !`git status --short`
- Changes to commit: !`git diff --cached`
- Current branch: !`git branch --show-current`
- Recent commits: !`git log --oneline -5`
## Task
Based on the above changes, create a git commit.
If a message is provided, use it: $ARGUMENTS| allowed-tools | Bash(git add:*), Bash(git status:*), Bash(git commit:*), Bash(git diff:*) |
|---|---|
| argument-hint | message |
| description | Create a git commit with automatic staging |
Context
- Current git status: !
git status --short - Changes to commit: !
git diff --cached - Current branch: !
git branch --show-current - Recent commits: !
git log --oneline -5
Task
Based on the above changes, create a git commit. If a message is provided, use it: $ARGUMENTS
!で囲まれたコマンドは実行され、その結果がプロンプトに埋め込まれます。
ファイル参照
@プレフィックスを使用すると、ファイルの内容を参照できます。
---
argument-hint: [file-path]
description: Review a specific file
---
Review the implementation in @$1
Check for:
- Code quality
- Best practices
- Potential bugs| argument-hint | file-path |
|---|---|
| description | Review a specific file |
Review the implementation in @$1
Check for:
- Code quality
- Best practices
- Potential bugs
使用時に/review-file src/utils/helpers.jsと指定すると、そのファイルの内容がコンテキストに含まれます。
名前空間
サブディレクトリを使用してコマンドを整理できます。
.claude/commands/
├── frontend/
│ └── component.md # → /component (project:frontend)
├── backend/
│ └── test.md # → /test (project:backend)
└── deploy.md # → /deploy (project)/helpコマンドで確認すると、名前空間がラベルとして表示されます。
コマンドの優先順位
同じ名前のコマンドが複数存在する場合、プロジェクトコマンドがユーザーコマンドより優先されます。
プロジェクトコマンド(.claude/commands/)
↓ 優先
ユーザーコマンド(~/.claude/commands/)この優先順位により、プロジェクト固有の設定でユーザーのデフォルト設定を上書きできます。
プラグインコマンドとMCPコマンド
プラグインコマンド
プラグインが提供するコマンドは以下の形式で呼び出します。
# 競合がない場合
/command-name
# 曖昧さを回避する場合(プラグイン名を指定)
/plugin-name:command-name
# 引数を含める場合
/command-name arg1 arg2プラグイン名を指定することで、同名のコマンドが複数存在する場合でも意図したコマンドを確実に実行できます。
MCPスラッシュコマンド
MCPサーバーが公開するプロンプトは、以下の形式で呼び出します。
/mcp__<server-name>__<prompt-name> [arguments]以下は使用例です。
/mcp__github__list_prs
/mcp__github__pr_review 456
/mcp__jira__create_issue "Bug title" highMCPサーバー名とプロンプト名を__(ダブルアンダースコア)で連結して指定します。
引数はスペース区切りで渡すことができます。
Skillツール
Skillツールを使用すると、Claudeがスラッシュコマンドをプログラム的に呼び出すことができます。
利用条件
以下の条件を満たすコマンドがSkillツールで利用可能です。
- カスタムスラッシュコマンド(
descriptionが必須) - Agent Skills(
disable-model-invocation: trueでないもの)
自動呼び出しの設定
CLAUDE.mdでClaudeにコマンドの使用を促すことができます。
Run /write-unit-test when you are about to start writing tests.Run /write-unit-test when you are about to start writing tests.
この設定により、Claudeがテストを書く際に自動的に/write-unit-testコマンドを呼び出すようになります。
権限ルール
Skillツールの権限は以下の形式で設定します。
# 完全一致
Skill(commit)
# プレフィックス一致
Skill(review-pr:*)完全一致では特定のコマンドのみを許可し、プレフィックス一致(*)では指定したプレフィックスで始まるすべてのコマンドを許可します。
Skillツールの無効化
/permissionsコマンドで拒否ルールにSkillを追加すると、Skillツールを無効化できます。
Skillsとスラッシュコマンドの使い分け
Skillsとスラッシュコマンドは似ていますが、用途が異なります。
| 要素 | スラッシュコマンド | Skills |
|---|---|---|
| 複雑さ | シンプルなプロンプト | 複雑なワークフロー |
| 構造 | 単一の.mdファイル |
ディレクトリ + リソース |
| 発見方法 | 明示的呼び出し(/cmd) |
自動検出 |
| ファイル数 | 1ファイルのみ | 複数ファイル + スクリプト |
シンプルな操作にはスラッシュコマンド、複雑なワークフローにはSkillsを使用することを推奨します。
制限事項
ビルトインコマンドの制限
ビルトインコマンド(/compact、/initなど)はSkillツールから呼び出すことができません。
Skillツールで利用できるのは、カスタムスラッシュコマンドとAgent Skillsのみです。
キャラクタ予算制限
スラッシュコマンドには文字数制限があります。
-
デフォルト
15,000文字です。
-
カスタマイズ
SLASH_COMMAND_TOOL_CHAR_BUDGET環境変数で設定できます。
多数のコマンドがある場合、Claudeには一部のみが表示されます。
予算を超過した場合、/contextコマンドで警告が表示され、含まれているコマンド数が確認できます。
確認方法
現在のコマンド状況は以下の方法で確認できます。
# コンテキスト使用状況を確認
/context
# 利用可能なコマンドを表示(デバッグモード)
claude --debug/contextコマンドでは、スラッシュコマンドがコンテキストにどの程度含まれているかを確認できます。
デバッグモードでは、より詳細な情報を取得できます。
Extended Thinking
スラッシュコマンド内にExtended Thinking関連のキーワードを含めることで、拡張思考モードをトリガーできます。 Claudeがより深く考える必要がある複雑なタスクに有効です。
オートコンプリート
スラッシュコマンドのオートコンプリートは、入力の先頭だけでなく、入力のどこでも機能します。
/helpを入力すると、利用可能なすべてのコマンドを確認できます。
実践例
Gitコミットコマンド
自動でステージングとコミットを行うコマンドの例です。
---
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*), Bash(git diff:*)
argument-hint: [message]
description: Create a git commit with automatic staging
---
## Context
- Current status: !`git status --short`
- Staged changes: !`git diff --cached --stat`
- Unstaged changes: !`git diff --stat`
## Task
1. Review the current changes
2. Stage appropriate files
3. Create a commit with a descriptive message
If a message is provided, use it: $ARGUMENTS
Otherwise, generate an appropriate commit message based on the changes.| allowed-tools | Bash(git add:*), Bash(git status:*), Bash(git commit:*), Bash(git diff:*) |
|---|---|
| argument-hint | message |
| description | Create a git commit with automatic staging |
Context
- Current status: !
git status --short - Staged changes: !
git diff --cached --stat - Unstaged changes: !
git diff --stat
Task
- Review the current changes
- Stage appropriate files
- Create a commit with a descriptive message
If a message is provided, use it: $ARGUMENTS Otherwise, generate an appropriate commit message based on the changes.
使用例は以下のとおりです。
/commit "Add user authentication feature"メッセージを指定しない場合、Claudeが変更内容に基づいて適切なコミットメッセージを自動生成します。
PRレビューコマンド
複数の引数を使用したPRレビューコマンドの例です。
---
argument-hint: [pr-number] [priority] [focus-area]
description: Review pull request with specified priority and focus
---
You are a code reviewer.
## Task
Review PR #$1 with the following parameters:
- Priority level: $2
- Focus area: $3
## Review checklist
- [ ] Security vulnerabilities
- [ ] Performance optimizations
- [ ] Code style violations
- [ ] Test coverage
- [ ] Documentation updates
Provide detailed feedback with specific line references.argument-hint: [pr-number] [priority] [focus-area] description: Review pull request with specified priority and focus
You are a code reviewer.
Task
Review PR #$1 with the following parameters:
- Priority level: $2
- Focus area: $3
Review checklist
Provide detailed feedback with specific line references.
使用例は以下のとおりです。
/review-pr 456 high securityこのコマンドは、PR番号456に対して高優先度でセキュリティに焦点を当てたレビューを実行します。 チェックリストに基づいて体系的なレビューが行われ、具体的な行番号を含むフィードバックが得られます。
まとめ
この章では、Claude Codeのスラッシュコマンドについて解説しました。
主なポイントは以下のとおりです。
-
ビルトインコマンド セッション管理、設定、プロジェクト管理など、多数のコマンドが用意されています。
-
カスタムコマンド プロジェクト用(
.claude/commands/)とパーソナル用(~/.claude/commands/)を作成できます。 -
引数とフロントマター
$ARGUMENTSや位置引数、フロントマターで柔軟なコマンドを定義できます。 -
高度な機能 Bashコマンド実行(
!)、ファイル参照(@)、名前空間で強力なコマンドを作成できます。 -
Skillツール Claudeがコマンドをプログラム的に呼び出すことができます。
スラッシュコマンドを活用することで、繰り返しの操作を効率化できます。
参考情報
スラッシュコマンドの詳細については、以下の公式ドキュメントを参照してください。
Output Styles
Output Stylesとは
Output Stylesは、Claude Codeのシステムプロンプトを直接変更する機能です。 ソフトウェアエンジニアリング以外の用途にも適応させることができます。
主な特徴は以下のとおりです。
-
システムプロンプトの置換 デフォルトのシステムプロンプトを完全に置き換えます。
-
コア機能の維持 ローカルスクリプトの実行、ファイルの読み書き、TODO追跡などの機能は引き続き利用できます。
-
柔軟なカスタマイズ ビルトインスタイルの使用や、独自のスタイル作成が可能です。
ビルトインスタイル
Claude Codeには3つのビルトインスタイルが用意されています。
Default
効率的なソフトウェアエンジニアリングタスクの完了を目的とした既存のシステムプロンプトです。 簡潔な応答と効率的なタスク実行に最適化されています。
Explanatory
コーディングタスクの合間に教育的な「Insights」を提供するスタイルです。 実装の選択やコードベースのパターンを理解するのに役立ちます。
以下のような場面で有効です。
- コードの背景にある設計思想を学びたいとき
- ベストプラクティスの理由を理解したいとき
- チームメンバーへの知識共有
Learning
協調的な「学びながら作る」モードです。 ClaudeがInsightsを共有しつつ、ユーザーにもコードの一部を実装するよう促します。
特徴は以下のとおりです。
TODO(human)マーカーでユーザーが実装すべき箇所を示す- ペアプログラミングのような体験を提供
- 実践を通じた学習に最適
スタイルの変更方法
Output Stylesは複数の方法で変更できます。
対話メニューでの選択
/output-styleコマンドで対話的なメニューを開きます。
/output-style/configメニューからもアクセスできます。
直接指定
スタイル名を直接指定して変更します。
/output-style [style-name]以下は使用例です。
/output-style explanatory
/output-style learning
/output-style defaultビルトインスタイルを直接指定して、すぐにスタイルを切り替えることができます。
設定の保存
変更はローカルプロジェクトレベルで適用され、.claude/settings.local.jsonに保存されます。
設定ファイルの直接編集
設定ファイルのoutputStyleフィールドを直接編集することもできます。
{
"outputStyle": "explanatory"
}ユーザーレベルやプロジェクトレベルの設定ファイルでも同様に設定可能です。
カスタムスタイルの作成
独自のOutput Stylesを作成できます。 カスタムスタイルはYAMLフロントマター付きのMarkdownファイルとして定義します。
保存場所
カスタムスタイルは以下の場所に配置します。
| レベル | パス |
|---|---|
| ユーザーレベル | ~/.claude/output-styles/ |
| プロジェクトレベル | .claude/output-styles/ |
ファイル構造
カスタムスタイルの基本構造は以下のとおりです。
---
name: My Custom Style
description: A brief description of what this style does
keep-coding-instructions: false
---
# Custom Style Instructions
You are an interactive CLI tool that helps users with software engineering
tasks. [Your custom instructions here...]
## Specific Behaviors
[Define how the assistant should behave in this style...]| name | My Custom Style |
|---|---|
| description | A brief description of what this style does |
| keep-coding-instructions | false |
Custom Style Instructions
You are an interactive CLI tool that helps users with software engineering tasks. [Your custom instructions here...]
Specific Behaviors
[Define how the assistant should behave in this style...]
フロントマターの後にMarkdown形式で指示を記述します。
フロントマターオプション
カスタムスタイルで使用できるフロントマターオプションは以下のとおりです。
| プロパティ | 説明 | デフォルト |
|---|---|---|
name |
UIに表示されるスタイル名 | ファイル名 |
description |
/output-styleメニューに表示される説明 |
なし |
keep-coding-instructions |
コーディング関連のシステムプロンプトを維持するか | false |
実践例
以下はドキュメント作成に特化したスタイルの例です。
---
name: Documentation Writer
description: Technical documentation specialist
keep-coding-instructions: true
---
# Documentation Style Instructions
You are a technical documentation specialist. When writing documentation:
## Guidelines
- Use clear, concise language
- Include code examples where appropriate
- Structure content with proper headings
- Add explanations for complex concepts
## Output Format
- Use Markdown formatting
- Include table of contents for long documents
- Add cross-references to related documentation| name | Documentation Writer |
|---|---|
| description | Technical documentation specialist |
| keep-coding-instructions | true |
Documentation Style Instructions
You are a technical documentation specialist. When writing documentation:
Guidelines
- Use clear, concise language
- Include code examples where appropriate
- Structure content with proper headings
- Add explanations for complex concepts
Output Format
- Use Markdown formatting
- Include table of contents for long documents
- Add cross-references to related documentation
このスタイルは/output-style documentationで有効化できます。
スタイルの動作原理
Output Stylesがどのように機能するかを説明します。
システムプロンプトへの影響
Output Stylesはシステムプロンプトの末尾にカスタム指示を追加します。 会話中、Claudeはスタイルの指示に従うようリマインダーを受け取ります。
効率的な出力指示の除外
すべてのスタイルで、「簡潔に応答する」などの効率的な出力に関する指示が除外されます。 これにより、より詳細な説明や教育的なコンテンツを提供できます。
keep-coding-instructionsの効果
このオプションの動作は以下のとおりです。
-
false(デフォルト) コーディング関連の指示が除外されます。 ソフトウェアエンジニアリング以外の用途に適しています。 -
trueコーディング関連の指示が維持されます。 コーディングタスクも行いつつ、追加の振る舞いを定義する場合に使用します。
関連機能との比較
Output Stylesと類似機能の違いを説明します。
Output Styles vs CLAUDE.md / --append-system-prompt
Output Stylesは、Claude Codeのデフォルトシステムプロンプトのうちソフトウェアエンジニアリングに関する部分を完全に無効化します。
CLAUDE.mdと--append-system-promptはどちらもデフォルトのシステムプロンプト自体を変更しません。
CLAUDE.mdはデフォルトのシステムプロンプトの後にユーザーメッセージとして内容を追加し、--append-system-promptはシステムプロンプトの末尾に内容を追記します。
Output Styles vs Agents
| 機能 | 動作 |
|---|---|
| Output Styles | メインエージェントループに直接影響、システムプロンプトのみ変更 |
| Agents | 特定タスク用に呼び出し、モデル・ツール・コンテキストを設定可能 |
Agentsは特定のタスクを委譲する場合に使用します。 Output Stylesはセッション全体の振る舞いを変更します。
Output Styles vs Skills
Output Stylesは選択した瞬間から常に有効になり、Claudeの応答スタイル(フォーマット・トーン・構造)を変更します。
Skillsは/skill-nameで明示的に呼び出すか、関連する文脈でClaudeが自動的に読み込むタスク固有のプロンプトです。
一貫したフォーマット設定にはOutput Stylesを、再利用可能なワークフローやタスクにはSkillsを使用します。
実践例
教育・学習向けスタイル
初心者向けの丁寧な説明を行うスタイルの例です。
---
name: Beginner Friendly
description: Detailed explanations for programming beginners
keep-coding-instructions: true
---
# Beginner Friendly Style
You are a patient programming tutor. Always:
## Communication Style
- Explain concepts step by step
- Avoid jargon or define it when used
- Use analogies to explain complex ideas
- Celebrate small wins and progress
## Code Explanations
- Comment every line of code
- Explain why, not just what
- Show multiple approaches when relevant
- Include common mistakes to avoid
## Interaction
- Ask clarifying questions
- Check understanding frequently
- Provide encouragement| name | Beginner Friendly |
|---|---|
| description | Detailed explanations for programming beginners |
| keep-coding-instructions | true |
Beginner Friendly Style
You are a patient programming tutor. Always:
Communication Style
- Explain concepts step by step
- Avoid jargon or define it when used
- Use analogies to explain complex ideas
- Celebrate small wins and progress
Code Explanations
- Comment every line of code
- Explain why, not just what
- Show multiple approaches when relevant
- Include common mistakes to avoid
Interaction
- Ask clarifying questions
- Check understanding frequently
- Provide encouragement
このスタイルはプログラミング学習者のサポートに最適です。
コードレビュー向けスタイル
厳密なコードレビューを行うスタイルの例です。
---
name: Strict Code Reviewer
description: Thorough code review with security focus
keep-coding-instructions: true
---
# Code Review Style
You are a senior code reviewer with security expertise.
## Review Focus
- Security vulnerabilities (OWASP Top 10)
- Performance implications
- Code maintainability
- Test coverage adequacy
## Output Format
For each issue found:
1. Severity (Critical/High/Medium/Low)
2. Location (file:line)
3. Description of the issue
4. Suggested fix with code example
## Review Standards
- Apply principle of least privilege
- Check for input validation
- Verify error handling
- Assess logging practices| name | Strict Code Reviewer |
|---|---|
| description | Thorough code review with security focus |
| keep-coding-instructions | true |
Code Review Style
You are a senior code reviewer with security expertise.
Review Focus
- Security vulnerabilities (OWASP Top 10)
- Performance implications
- Code maintainability
- Test coverage adequacy
Output Format
For each issue found:
- Severity (Critical/High/Medium/Low)
- Location (file:line)
- Description of the issue
- Suggested fix with code example
Review Standards
- Apply principle of least privilege
- Check for input validation
- Verify error handling
- Assess logging practices
セキュリティレビューや品質管理に活用できます。
ユースケース
Output Stylesは以下のような用途に適しています。
-
ドメイン固有エージェントへの変換 Claude Codeを教育、リサーチ、ライティングなど特定分野に特化したエージェントに変換できます。
-
ロールベースペルソナの作成 メンター、テクニカルライター、ビジネスアナリストなど役割に応じた振る舞いを定義できます。
-
プロジェクト間での一貫した動作 ユーザーレベルでスタイルを定義することで、複数のプロジェクトで一貫した動作を維持できます。
-
コーディング以外の開発者ツール活用 コーディング指示を除外しつつ、ファイル操作やスクリプト実行などの機能を活用できます。
Output Stylesのまとめ
Output Stylesの主なポイントは以下のとおりです。
-
ビルトインスタイル Default、Explanatory、Learningの3つが用意されています。
-
スタイルの変更
/output-styleコマンドで対話的に、または直接指定で変更できます。 -
カスタムスタイル Markdownファイルで独自のスタイルを定義できます。
-
動作原理 システムプロンプトを置換し、
keep-coding-instructionsでコーディング指示の維持を制御します。 -
関連機能との違い
CLAUDE.mdや--append-system-prompt、Agents、Skillsとは用途が異なります。
Output Stylesを活用することで、Claude Codeをさまざまな用途に最適化できます。
参考情報
Output Stylesの詳細については、以下の公式ドキュメントを参照してください。