generate_command について
`.claude/skills/` にタスク固有のスキルを作成する Claude Code スキルです。構成や必須の YAML frontmatter、検証手順を案内します。
主な機能
- 01スキル作成テンプレート
- 02必須の YAML frontmatter
- 03タスク手順の作成ガイド
- 04検証のヒント
活用シーン
- 01再利用可能なタスクスキルの作成
- 02引数と成功条件の定義
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ everyinc/ compound-engineering-plugin --skill generate_commandインストール後、Claude Code で/generate_commandを入力して読み込まれたか確認します。
詳細
カスタム Claude Code コマンドを作成する
依頼されたタスク用の新しいスキルを .claude/skills/ に作成します。
目標
#$ARGUMENTS
活用する主な機能
ファイル操作:
- Read、Edit、Write - ファイルを正確に変更します
- Glob、Grep - コードベースを検索します
- MultiEdit - 複数箇所の変更をアトミックに行います
開発:
- Bash - コマンド(git、テスト、リンター)を実行します
- Task - 複雑なタスク向けに専門エージェントを起動します
- TodoWrite - ToDo リストで進捗を管理します
Web と API:
- WebFetch、WebSearch - ドキュメントを調査します
- GitHub(gh cli) - PR、イシュー、レビューを扱います
- Playwright - ブラウザーの自動化やスクリーンショットの取得を行います
連携機能:
- AppSignal - ログとモニタリング
- Context7 - フレームワークのドキュメント
- Stripe、Todoist、Featurebase(関連する場合)
ベストプラクティス
- 具体的で明確にする - 詳細な指示ほど、より良い結果が得られます
- 複雑なタスクを分解する - 手順に沿った計画を使います
- 例を含める - 既存のコードパターンを参考にします
- 成功基準を含める - テストが通ること、リンティングに問題がないことなど
- まず考える - 複雑な問題には「think hard」や「plan」などのキーワードを使います
- 反復する - プロセスを段階的に進めます
必須:YAML フロントマター
すべてのコマンドは、必ず YAML フロントマターから始めます:
---
name: command-name
description: Brief description of what this command does (max 100 chars)
argument-hint: "[what arguments the command accepts]"
---
フィールド:
name:小文字のコマンド識別子(内部で使用)description:コマンドの目的を明確かつ簡潔に説明しますargument-hint:ユーザーに必要な引数を示します(例:[file path]、[PR number]、[optional: format])
コマンドの構成
# [Command Name]
[Brief description of what this command does]
## Steps
1. [First step with specific details]
- Include file paths, patterns, or constraints
- Reference existing code if applicable
2. [Second step]
- Use parallel tool calls when possible
- Check/verify results
3. [Final steps]
- Run tests
- Lint code
- Commit changes (if appropriate)
## Success Criteria
- [ ] Tests pass
- [ ] Code follows style guide
- [ ] Documentation updated (if needed)
効果的なコマンドを作成するためのヒント
- 動的な入力には
$ARGUMENTSプレースホルダーを使います AGENTS.mdのパターンと規約を参照します- 検証手順を含めます - テスト、リンティング、視覚的な確認など
- 制約を明確にします - X を変更しない、Y のパターンを使うなど
- 構造化されたプロンプトには XML タグを使います:
<task>、<requirements>、<constraints>
パターン例
Implement #$ARGUMENTS following these steps:
1. Research existing patterns
- Search for similar code using Grep
- Read relevant files to understand approach
2. Plan the implementation
- Think through edge cases and requirements
- Consider test cases needed
3. Implement
- Follow existing code patterns (reference specific files)
- Write tests first if doing TDD
- Ensure code follows AGENTS.md conventions
4. Verify
- Run tests: `bin/rails test`
- Run linter: `bundle exec standardrb`
- Check changes with git diff
5. Commit (optional)
- Stage changes
- Write clear commit message
コマンドファイルの作成
- ディレクトリを作成する
.claude/skills/[name]/SKILL.mdに作成します - YAML フロントマターから始める(上記のセクションを参照)
- スキルを構成する 上記のテンプレートを使います
- スキルをテストする 適切な引数を指定して使用します
コマンドファイルのテンプレート
---
name: command-name
description: What this command does
argument-hint: "[expected arguments]"
---
# Command Title
Brief introduction of what the command does and when to use it.
## Workflow
### Step 1: [First Major Step]
Details about what to do.
### Step 2: [Second Major Step]
Details about what to do.
## Success Criteria
- [ ] Expected outcome 1
- [ ] Expected outcome 2
コメント
Markdown 対応