claude-skill-creator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseClaude Skill Creator Guide
Claude Skill Creator Guide
スキル作成のガイド。Claude Codeの機能を拡張するスキルを効果的に作成する方法を説明。
A guide for creating skills. Explains how to effectively create skills that extend the functionality of Claude Code.
When to Use This Skill
When to Use This Skill
- 新規スキルを作成する時
- 既存スキルを更新・改善する時
- スキルが正しく発動しない問題を調査する時
- ドキュメントをスキル形式に変換する時
- When creating a new skill
- When updating or improving an existing skill
- When troubleshooting issues where a skill doesn't activate correctly
- When converting documentation into skill format
What Are Skills?
What Are Skills?
スキルはClaudeの機能を拡張するフォルダ構造。モデル自動発見—Claudeがリクエストに基づいて自動的に使用を判断する(スラッシュコマンドとは異なり明示的な呼び出し不要)。
Skills are folder structures that extend Claude's functionality. Auto-discovery by the model—Claude automatically decides to use them based on user requests (no explicit invocation required, unlike slash commands).
Directory Structure
Directory Structure
Personal: ~/.claude/skills/skill-name/SKILL.md
Project: .claude/skills/skill-name/SKILL.md
Plugin: パッケージに同梱Personal: ~/.claude/skills/skill-name/SKILL.md
Project: .claude/skills/skill-name/SKILL.md
Plugin: Bundled with the packageCreating a New Skill
Creating a New Skill
Step 1: ディレクトリ作成
Step 1: Create the directory
bash
mkdir -p .claude/skills/my-skill-namebash
mkdir -p .claude/skills/my-skill-nameStep 2: SKILL.md作成(YAML frontmatter必須)
Step 2: Create SKILL.md (YAML frontmatter required)
yaml
---
name: skill-identifier # 必須: 小文字/数字/ハイフンのみ、64文字以内
description: 何をするか + いつ使うか # 必須: 1024文字以内、トリガーキーワード含む
allowed-tools: Read, Grep, Edit # オプション: ツール制限
---name規則:
- 小文字、数字、ハイフンのみ
- 64文字以内
- 例: ,
api-docs-writerdb-migration-helper
description規則:
- 「何をするか」+「いつ使うか」を両方含める
- トリガーキーワードを含める
- 1024文字以内
yaml
undefinedyaml
---
name: skill-identifier # Required: Only lowercase letters, numbers, hyphens, max 64 characters
description: What it does + when to use it # Required: Max 1024 characters, include trigger keywords
allowed-tools: Read, Grep, Edit # Optional: Tool restrictions
---Name Rules:
- Only lowercase letters, numbers, and hyphens
- Maximum 64 characters
- Examples: ,
api-docs-writerdb-migration-helper
Description Rules:
- Include both "what it does" and "when to use it"
- Include trigger keywords
- Maximum 1024 characters
yaml
undefined✅ GOOD
✅ GOOD
description: E2Eテストの作成・デバッグ・失敗修正を支援。Playwrightテスト失敗時、新規テスト作成時に使用。
description: Assists with creating, debugging, and fixing failed E2E tests. Used when Playwright tests fail or when creating new tests.
❌ BAD
❌ BAD
description: テストを手伝う
undefineddescription: Helps with tests
undefinedStep 3: 本文の推奨構造
Step 3: Recommended Body Structure
markdown
undefinedmarkdown
undefinedSkill Title
Skill Title
概要(1-2文)
Overview (1-2 sentences)
When to Use This Skill
When to Use This Skill
- シナリオ1
- シナリオ2
- Scenario 1
- Scenario 2
Instructions
Instructions
- Step 1: 最初にやること
- Step 2: 次にやること
- Step 3: 最後にやること
- Step 1: First thing to do
- Step 2: Next thing to do
- Step 3: Final thing to do
Examples
Examples
Example 1: [シナリオ]
Example 1: [Scenario]
[コード例]
[Code example]
Troubleshooting
Troubleshooting
Issue: 問題
Solution: 解決方法
Issue: Problem
Solution: Resolution
AI Assistant Instructions
AI Assistant Instructions
このスキルが有効化された時:
- まず○○を確認
- 次に○○を実行
Always:
- 常に○○する
Never:
- ○○しない
undefinedWhen this skill is activated:
- First, check ○○
- Next, execute ○○
Always:
- Always ○○
Never:
- Never ○○
undefinedOptional: ツール制限
Optional: Tool Restrictions
yaml
allowed-tools: Read, Grep, Glob # 読み取り専用yaml
allowed-tools: Read, Grep, Glob # Read-onlyOptional: 補助ファイル
Optional: Supplementary Files
my-skill-name/
├── SKILL.md # メイン(必須、500行以下)
├── reference.md # 詳細リファレンス(必要時読み込み)
└── templates/ # テンプレートSKILL.mdから参照:
markdown
詳細は [reference.md](reference.md) を参照。my-skill-name/
├── SKILL.md # Main file (required, max 500 lines)
├── reference.md # Detailed reference (loaded when needed)
└── templates/ # TemplatesReference from SKILL.md:
markdown
For details, refer to [reference.md](reference.md).Best Practices
Best Practices
1. スキルは1機能に絞る
1. Focus skills on a single function
yaml
undefinedyaml
undefined✅ DO
✅ DO
- api-docs-writer: API文書生成
- test-strategy: テスト実装
- api-docs-writer: API documentation generation
- test-strategy: Test implementation
❌ DON'T
❌ DON'T
- developer-helper: 何でも(曖昧)
undefined- developer-helper: Everything (vague)
undefined2. トリガーキーワードを含める
2. Include trigger keywords
yaml
undefinedyaml
undefined✅ GOOD
✅ GOOD
description: OpenAPI/Swagger文書をExpress/FastAPIから生成。API文書作成時に使用。
description: Generate OpenAPI/Swagger documentation from Express/FastAPI. Used when creating API documentation.
❌ BAD
❌ BAD
description: API文書を手伝う
undefineddescription: Helps with API documentation
undefined3. 具体例を提供
3. Provide concrete examples
ユーザーもClaudeも例から学ぶ。実際のコード例を含める。
Both users and Claude learn from examples. Include actual code examples.
4. AI Assistant Instructionsを明示
4. Specify AI Assistant Instructions
markdown
undefinedmarkdown
undefinedAI Assistant Instructions
AI Assistant Instructions
When this skill is activated:
- まずコードベースを分析
- 必要なら質問
- 初期バージョンを生成
Always:
- TypeScriptで型安全に
- エラーハンドリングを含める
Never:
- 検証をスキップしない
undefinedWhen this skill is activated:
- First, analyze the codebase
- Ask questions if needed
- Generate an initial version
Always:
- Use TypeScript for type safety
- Include error handling
Never:
- Don't skip validation
undefined5. コンテキストウィンドウを意識
5. Be mindful of the context window
- SKILL.mdは500行以下
- Claudeの基礎知識は説明不要
- 詳細は参照ファイルに分離
- SKILL.md must be under 500 lines
- No need to explain basic knowledge that Claude already has
- Separate details into reference files
6. Progressive Disclosure
6. Progressive Disclosure
my-skill-name/
├── SKILL.md # コア(< 500行)
├── reference.md # 詳細(必要時のみ読込)
└── examples.md # 拡張例(必要時のみ読込)my-skill-name/
├── SKILL.md # Core ( < 500 lines)
├── reference.md # Details (loaded only when needed)
└── examples.md # Extended examples (loaded only when needed)Common Pattern: Code Generation
Common Pattern: Code Generation
yaml
---
name: component-generator
description: React/Vue/Angularコンポーネントを生成。新規コンポーネント作成時に使用。
---yaml
---
name: component-generator
description: Generate React/Vue/Angular components. Used when creating new components.
---Component Generator
Component Generator
Instructions
Instructions
- コンポーネント種別を確認(React/Vue/Angular)
- 名前とpropsを取得
- 生成: コンポーネント + テスト + Storybook
- プロジェクト規約に従う
undefined- Confirm the component type (React/Vue/Angular)
- Get the name and props
- Generate: Component + Tests + Storybook
- Follow project conventions
undefinedTroubleshooting
Troubleshooting
スキルが発動しない
Skill doesn't activate
| 原因 | 解決 |
|---|---|
| トリガーキーワード不足 | descriptionに具体的キーワード追加 |
| name形式が不正 | 小文字/数字/ハイフンのみに修正 |
| YAML不正 | |
| ファイル名が違う | |
| Cause | Solution |
|---|---|
| Insufficient trigger keywords | Add specific keywords to the description |
| Invalid name format | Correct to use only lowercase letters, numbers, and hyphens |
| Invalid YAML | Check the |
| Incorrect filename | Standardize to |
意図しないタイミングで発動
Activates at unintended times
| 原因 | 解決 |
|---|---|
| descriptionが広すぎる | より具体的なキーワードに変更 |
| 他スキルとキーワード重複 | ユニークなキーワードを使用 |
| Cause | Solution |
|---|---|
| Description is too broad | Change to more specific keywords |
| Keyword overlap with other skills | Use unique keywords |
指示に従わない
Doesn't follow instructions
| 原因 | 解決 |
|---|---|
| 指示が曖昧 | 番号付きステップで明示化 |
| AI Instructions欠如 | セクション追加 |
| Cause | Solution |
|---|---|
| Instructions are vague | Clarify using numbered steps |
| Missing AI Instructions | Add the section |
Team Sharing
Team Sharing
bash
undefinedbash
undefinedプロジェクトスキル
Project skills
git add .claude/skills/skill-name/
git commit -m "feat: add [skill-name] skill"
git push
git add .claude/skills/skill-name/
git commit -m "feat: add [skill-name] skill"
git push
チームメンバーは git pull で取得
Team members can get it with git pull
undefinedundefinedQuick Checklist
Quick Checklist
- ディレクトリ:
.claude/skills/skill-name/ - ファイル名: (大文字小文字注意)
SKILL.md - YAML frontmatter: で囲む
--- - : 小文字/ハイフン、64文字以内
name - : 何 + いつ、トリガーキーワード含む
description - "When to Use This Skill" セクション
- ステップバイステップ Instructions
- 具体的な Examples
- AI Assistant Instructions
- 500行以下
- Directory:
.claude/skills/skill-name/ - Filename: (note case sensitivity)
SKILL.md - YAML frontmatter: Enclosed with
--- - : Lowercase/hyphens only, max 64 characters
name - : Includes "what" + "when", with trigger keywords
description - "When to Use This Skill" section
- Step-by-step Instructions
- Concrete Examples
- AI Assistant Instructions
- Under 500 lines
AI Assistant Instructions
AI Assistant Instructions
このスキルが有効化された時:
- 要件確認: 新規作成か更新かを確認
- テンプレート提供: 上記の推奨構造に従う
- 検証: チェックリストで確認
Always:
- description に「何をするか」+「いつ使うか」を含める
- AI Assistant Instructionsセクションを含める
- 500行以下を維持する
Never:
- nameにアンダースコアやスペースを使用しない
- descriptionを曖昧にしない
- 基礎的なプログラミング概念を説明しない(Claudeは知っている)
When this skill is activated:
- Requirement Confirmation: Confirm whether it's a new creation or an update
- Provide Template: Follow the recommended structure above
- Validation: Verify using the checklist
Always:
- Ensure the description includes "what it does" + "when to use it"
- Include the AI Assistant Instructions section
- Keep it under 500 lines
Never:
- Don't use underscores or spaces in the name
- Don't make the description vague
- Don't explain basic programming concepts (Claude already knows them)