SKILL.md カスタム設計
生産性中級
SKILL.mdファイルのYAML frontmatter全フィールド、$ARGUMENTS置換パターン、!`command`動的コンテキスト注入、ディレクトリ構造を活用して再利用可能なカスタムスキルを設計します。個人プロジェクト用からチーム全体デプロイ用まで対応します。
トリガー
/skill-design使用頻度必要時
繰り返し作業をスキルとして標準化したい開発者なら? /skill-designでSKILL.mdを構造化しチームに共有
OSSプロジェクトにコントリビューションガイドをスキルとして提供したい場合なら? プロジェクトの.claude/skills/にワークフロースキルを配置
SKILL.mdカスタムスキルfrontmatterAgent Skills
動作フロー
/skill-design [スキル目的] 実行
↓
Phase 1: 3つの設計並列
frontmatter
YAML frontmatterフィールド設計
prompt-body
プロンプト本文 + $ARGUMENTS設計
context-inject
!`command`動的コンテキスト設計
↓
SKILL.mdファイル生成 + ディレクトリ配置
↓
✓ 実行可能なカスタムスキル
スキルコード
# SKILL.md Designer
## Trigger: /skill-design [purpose]
Design custom skills using the SKILL.md format.
### SKILL.md Structure:
```markdown
---
name: my-skill
description: What this skill does
# Optional fields:
# allowed_tools: [Read, Write, Bash]
# context: fork | share (default: share)
# invocation: user | auto
---
Your skill prompt goes here.
Use $ARGUMENTS for user input substitution.
Use !`command` for dynamic context injection.
```
### Frontmatter Fields:
| Field | Required | Description |
|-------|----------|-------------|
| name | Yes | Slash command trigger name |
| description | Yes | Shown in /help and autocomplete |
| allowed_tools | No | Restrict available tools |
| context | No | fork (isolated) or share (default) |
| invocation | No | user (manual) or auto (triggered by conditions) |
### $ARGUMENTS Pattern:
```markdown
Analyze the file at $ARGUMENTS and suggest improvements.
# User runs: /my-skill src/utils.ts
# $ARGUMENTS becomes: src/utils.ts
```
### Dynamic Context with !`command`:
```markdown
Current git status:
!`git status --short`
Review the changes above and suggest a commit message.
```
### Directory Structure:
```
.claude/skills/ # Personal skills (gitignored)
.claude/skills/my-skill.md
project-root/skills/ # Project skills (committed)
project-root/skills/team-review.md
~/.claude/skills/ # Global skills (all projects)
```
コピーしてCLAUDE.mdに貼り付ければ、すぐに使えます。
SKILL.md カスタム設計 の仕組み
SKILL.md Designerはスキルの目的を入力として受け取り、YAML frontmatter(name, description, allowed_tools, context, invocation)を設計し、$ARGUMENTS置換と!`command`動的コンテキストを含むプロンプト本文を生成します。
SKILL.md カスタム設計 が力を発揮する場面
チーム内の繰り返しワークフローを標準化する際、OSSプロジェクトにコントリビューションガイドを提供する際、組織全体にデプロイするスキルを設計する際に最適です。
主な強み
- YAML frontmatter全フィールドガイドで正確なスキル設計
- $ARGUMENTSで柔軟なパラメータ処理
- !`command`でランタイムコンテキスト自動注入
- 個人/プロジェクト/グローバルデプロイディレクトリ構造案内