エージェントスキル

NEW

Claudeが自動的に適用するマークダウンベースのカスタムスキルでClaudeの機能を拡張します

エージェントスキルとは?

スキルは、Claudeに特定の作業方法を教えるマークダウンファイルです。スキルはモデル呼び出し方式です:Claudeがリクエストに基づいてどのスキルを使用するかを決定します。スキルの説明に一致する質問をすると、Claudeが自動的にそのスキルを適用します。

自動アクティベーション

Claudeはスキルが関連するときを検出し、自動的に適用します

マークダウンベース

YAMLフロントマターと指示を含むシンプルなSKILL.mdファイル

ホットリロード

スキルは作成または変更時に自動的にロードされます

スキルの配置場所

場所パス適用対象
EnterpriseManaged SettingsAll users in organization
Personal~/.claude/skills/You, across all projects
Project.claude/skills/Anyone in this repository
Pluginskills/ in pluginAnyone with plugin installed

優先順位:Enterprise > Personal > Project > Plugin(名前の競合時は高い方が優先)

SKILL.mdの構造

シンプルなスキル

---
name: explaining-code
description: Explains code with visual diagrams and analogies. Use when explaining how code works.
---

When explaining code, always include:

1. **Start with an analogy**: Compare the code to something from everyday life
2. **Draw a diagram**: Use ASCII art to show the flow
3. **Walk through the code**: Explain step-by-step what happens
4. **Highlight a gotcha**: What's a common mistake?

高度なスキル

---
name: pdf-processing
description: Extract text, fill forms, merge PDFs. Use when working with PDF files.
allowed-tools: Read, Bash(python:*)
model: claude-opus-4-5-20251101
context: fork
---

# PDF Processing

## Quick start
Extract text:
```python
import pdfplumber
with pdfplumber.open("doc.pdf") as pdf:
    text = pdf.pages[0].extract_text()
```

For form filling, see [FORMS.md](FORMS.md).

利用可能なメタデータフィールド

FieldRequiredDescription
nameYesLowercase letters, numbers, hyphens (max 64 chars)
descriptionYesWhat it does and when to use (max 1024 chars)
allowed-toolsNoRestrict tools Claude can use (e.g., Read, Grep, Bash)
modelNoOverride model (e.g., claude-opus-4-5-20251101)
contextNoSet to "fork" for isolated sub-agent context
agentNoAgent type when context: fork (Explore, Plan, etc.)
hooksNoDefine PreToolUse, PostToolUse, Stop handlers
user-invocableNoShow in slash menu (default: true)

フック付きスキル

スキルは、スキルのライフサイクル中に実行されるフックを定義できます。フックはスキルにスコープされ、スキル完了時に自動的にクリーンアップされます。

例:セキュリティチェックフック

---
name: secure-operations
description: Perform operations with additional security checks
hooks:
  PreToolUse:
    - matcher: "Bash"
      hooks:
        - type: command
          command: "./scripts/security-check.sh $TOOL_INPUT"
          once: true
---

Security-first operations with automatic validation.

スキル vs 他のオプション

Use ThisWhen You Want To...When It Runs
SkillsGive Claude specialized knowledgeClaude chooses when relevant
Slash CommandsCreate reusable promptsYou type /command
CLAUDE.mdSet project-wide instructionsLoaded every conversation
SubagentsDelegate to separate contextClaude delegates or explicit
HooksRun scripts on eventsOn specific tool events
MCP ServersConnect to external toolsClaude calls as needed

マルチファイルスキル(段階的公開)

複雑なスキルの場合は、段階的公開を使用してください:SKILL.mdに必須情報を入れ、詳細ドキュメントは必要な時だけClaudeが読む別ファイルに入れます。

pdf-processing/
├── SKILL.md # Overview and navigation
├── FORMS.md # Loaded when needed
├── REFERENCE.md # Loaded when needed
└── scripts/
├── fill_form.py # Executed, not loaded
└── validate.py

Tip: SKILL.mdは500行未満に保ちましょう。スクリプトはコンテキストにロードせずに実行できます。

スキルのテスト

利用可能なスキルを表示

What Skills are available?

スキルをテスト

スキルの説明に一致する質問をしてみてください:

How does this code work?

スキル作成を始める

チームの標準とワークフローでClaudeの機能を拡張する最初のスキルを作成しましょう。

完全なドキュメントを読む