ポッドキャストに戻るClaude
Claude Code skills
はじめてのスキルを作る
So, let's create a skill.
skill を作成しましょう。
This skill will teach Claude how we would like it to explain code using visual diagrams and analogies.
この skill は、Claude がコードを視覚的な図と類推を使って説明する方法を教えます。
[music]
[music]
Then, we'll look at what happens under the hood when Claude uses it.
次に、Claude がこれを使うときに内部で何が起きているか見てみましょう。
First, [music] let's create a directory for your skill.
まず、[music] skill 用のディレクトリを作成します。
We're going to be making a personal skill, so it'll live in many projects, so it will go in your home directory.
個人用 skill なので複数のプロジェクトで使えるよう、ホームディレクトリに配置します。
Take into consideration that we're creating a directory with the skill name inside of the skills directory.
skills ディレクトリの中に skill 名のディレクトリを作成していることに注意してください。
Now create the skill.
skill を作成します。
The name identifies your skill.
name フィールドが skill を識別します。
The description tells Claude when to use it.
description は Claude にいつ使うかを伝えます。
This is the matching criteria.
これがマッチング条件です。
And then everything after the second dashes is the instructions that Claude follows.
2 番目のダッシュ以降がすべて Claude が従う指示になります。
Cloud code loads skills at startup.
Claude Code は起動時に skill をロードします。
So restart your session.
セッションを再起動してください。
Then verify it's available.
次に、利用可能かどうか確認します。
You should see PR description in the list.
リストに PR description が表示されるはずです。
Now test it.
テストしてみましょう。
Make some changes on a branch and say, "Write a PR description for my changes."
ブランチに変更を加え、「変更の PR description を書いて」と言います。
Claude will then show you that it's using the PR description skill.
Claude は PR description skill を使用していることを表示します。
After that, it'll check your diff and write a description following your template.
その後、diff を確認してテンプレートに沿った説明を書きます。
Same format every single time.
毎回同じフォーマットです。
When Cloud Code starts, it scans four locations for skills.
Claude Code が起動すると、4 つの場所で skill をスキャンします。
Enterprise paths, your personal Claude skills, the project's Claude skills, and installed plugins.
enterprise パス、個人の Claude skill、プロジェクトの Claude skill、インストール済み plugin です。
It loads only the name and description of each skill, not the full content.
各 skill の名前と説明のみをロードし、全内容はロードしません。
This is important later.
これは後で重要になります。
When you send a request, Claude compares it to the descriptions of your skills.
リクエストを送ると、Claude はそれを skill の説明と比較します。
Explain what this function does matches a skill described as explain code with visual diagrams because the intent overlaps.
「この関数の動作を説明して」は、意図が重なるため「視覚的な図でコードを説明する」という説明の skill にマッチします。
It will then ask you to confirm loading up the skill.
その後、skill のロードを確認するよう求めます。
This confirmation step keeps you aware of what context Claude is using.
この確認ステップで、Claude がどのコンテキストを使っているか常に把握できます。
After you confirm, Claude reads the complete file and follows its instructions.
確認後、Claude は完全なファイルを読み込み、その指示に従います。
Now, let's say you clone a Git repository and have an overlapping skill name.
Git リポジトリをクローンして、同名の skill がある場合はどうなるでしょうか。
Well, which one wins?
どちらが優先されるのか?
Here's the priority list.
優先度リストをご覧ください。
The highest is enterprise, which lives in the manage settings.
最高位は enterprise で、管理設定に保存されます。
Two is the personal, which lives in your root directory configuration like we're doing right now.
2 番目は personal で、今やっているようにルートディレクトリの設定に保存されます。
Three is the project which is the claw directory inside of your repository.
3 番目は project で、リポジトリ内の .claude ディレクトリです。
And the lowest is the plugins where you store your plugins that you got online.
最低位は plugins で、オンラインで入手した plugin を保存する場所です。
This lets organizations enforce standards while allowing individual customization through differently named skills.
これにより組織は標準を統一しつつ、異なる名前の skill による個人カスタマイズを許可できます。
If your company has an enterprise code review skill and you create a personal code review skill, the enterprise version of that takes precedence.
会社に enterprise のコードレビュー skill があり、個人でもコードレビュー skill を作成した場合、enterprise 版が優先されます。
To avoid conflicts, use descriptive names.
競合を避けるには、説明的な名前を使いましょう。
Instead of review, use front-end PR review or security review.
review という名前は避けて、front-end PR review や security review のように具体的な名前を使いましょう。
To update a skill, edit it skill.md file.
skill を更新するには、skill.md ファイルを編集します。
Simple.
シンプルです。
To remove one, delete its directory.
削除するには、そのディレクトリを削除します。
Restart clock code after changes for them to take effect.
変更を反映させるには、Claude Code を再起動してください。
Creating a skill means making a directory with a skill.md file containing metadata and instructions.
skill の作成とは、メタデータと指示を含む skill.md ファイルを持つディレクトリを作ることです。
Claude loads skill names and descriptions at startup.
Claude は起動時に skill の名前と説明をロードします。
matches incoming requests against those descriptions and asks for confirmation before loading the full content.
受信したリクエストをそれらの説明と照合し、全内容をロードする前に確認を求めます。
Priority rules handling name conflicts.
優先度ルールが命名の競合を処理します。
Enterprise overrides personal personal overrides project overrides plugins.
優先度の順は enterprise、personal、project、plugins の順で、上位が下位を上書きします。
[music]
[music]
Edit the skill.md file to update a skill and restart cloud code for changes to take effect.
skill.md ファイルを編集して skill を更新し、変更を反映させるには Claude Code を再起動してください。