ポッドキャストに戻るClaude
Claude Code skills
設定と複数ファイルによる skill 構成
A basic skill works with just a name and description, but here are some other advanced tips that can make your skills really effective in claw code.
基本的なスキルは名前と説明だけで動作しますが、Claude Code でスキルをより効果的にする高度なヒントをご紹介します。
The agentskills.io open standard has many available fields.
agentskills.io のオープン標準には多くのフィールドがあります。
We already went over the name, which identifies your skill, uses lowercase letters, numbers, and hyphens only.
名前フィールドはすでに説明しました。スキルを識別するもので、小文字・数字・ハイフンのみ使用できます。
A maximum of 64 characters and should match your directory name.
最大 64 文字で、ディレクトリ名と一致させる必要があります。
a description which is also required which tells Claude when to use the skill.
説明フィールドも必須で、Claude にいつそのスキルを使うかを伝えます。
This is a maximum of,024 characters and is the most important field.
最大 1024 文字で、最も重要なフィールドです。
Claude uses this for matching.
Claude はこれをマッチングに使用します。
But we can also add other optional fields.
ほかにもオプションフィールドを追加できます。
One of them is the allowed tools field which restricts which tools Claude can use when the skill is active.
その一つが allowed tools フィールドで、スキル有効時に Claude が使えるツールを制限します。
The model field which specifies which cla model to use for the skill.
model フィールドは、スキルで使用する Claude モデルを指定します。
Try to be explicit with your instructions.
指示はできるだけ具体的に書きましょう。
For example, if someone told me my job was to help with dogs, I wouldn't know what to do.
例えば、「犬のことを手伝う仕事だ」と言われても、何をすべきか分かりません。
So, we have to assume Claude would think the same way.
Claude も同じように考えると想定する必要があります。
A good description answers two questions.
良い説明は二つの質問に答えます。
What does this skill do?
このスキルは何をするのか?
And when should Claus use it?
Claude はいつそれを使うべきか?
Now, if this job description was given to me, I feel a little bit more confident that I could get the job done.
このような職務説明があれば、仕事をこなせる自信が持てます。
If your skill isn't triggering, add more keywords that match how you phrase requests.
スキルがトリガーされない場合は、リクエストの表現に合うキーワードを追加してください。
Sometimes you want a skill that can only read files, not modify them.
ファイルの読み取りのみ許可し、変更は許可しないスキルが必要な場合もあります。
This could be for security sensitive workflows, read only tasks or more.
セキュリティに敏感なワークフローや読み取り専用タスクなどに有効です。
We have the allowed tools field to make this possible.
これを実現するのが allowed tools フィールドです。
When this skill is active, Claw can only use those tools without asking permission.
スキルが有効なとき、Claude は許可されたツールのみを使用でき、追加の許可は不要です。
No editing, no writing, no bash commands.
編集・書き込み・bash コマンドは使用できません。
If you omit allowed tools, the skill doesn't restrict anything.
allowed tools を省略すると、スキルは何も制限しません。
Claude uses its normal permission model.
Claude は通常の権限モデルを使用します。
Skills share Claw's context window with your conversation.
スキルは会話と Claude のコンテキストウィンドウを共有します。
When Claude wants to use a skill, it will decide to load the contents of that skill into context.
Claude がスキルを使いたいとき、そのスキルの内容をコンテキストに読み込みます。
However, sometimes you'll need some references, examples, or some utility scripts that are required by the skill.
ただし、スキルが必要とする参考資料・例・ユーティリティスクリプトが必要な場合もあります。
But cramming it all into one 20,000 line text file means you take up a lot of space in the context window.
2 万行のテキストファイルにすべてを詰め込むと、コンテキストウィンドウを大量に消費します。
And let's be real here, it's just not a lot of fun to maintain that.
正直なところ、それを維持するのも大変です。
This is where progressive disclosure comes in.
ここで登場するのが「プログレッシブ・ディスクロージャー」です。
Put your essential instructions in skill.mmp and detailed reference material in separate files that Claude reads only when needed.
必須の指示は skill.md に置き、詳細な参考資料は別ファイルに分けて Claude が必要なときだけ読み込めるようにします。
The open standard also suggests having a scripts folder for executable code, references for additional documentation and assets for images, templates or other data files that would be relevant for that skill.
オープン標準では、実行可能コード用の scripts フォルダ、追加ドキュメント用の references フォルダ、画像・テンプレート・データファイル用の assets フォルダを用意することも推奨しています。
Then in skill.md link to the supporting files.
そして skill.md でサポートファイルへのリンクを貼ります。
Here, Claude reads architecture.md only when someone asks about system design.
Claude はシステム設計について質問されたときのみ architecture.md を読み込みます。
If they're asking where to add a component, let's say, it just never loads.
コンポーネントの追加場所を聞かれた場合は読み込みません。
It's like having a table of contents in the context window rather than fitting the whole entire document in there.
ドキュメント全体をコンテキストに入れるのではなく、目次をコンテキストウィンドウに置くようなイメージです。
Keep skill.md under 500 lines.
skill.md は 500 行以内に収めましょう。
If you're exceeding that, then maybe consider should this be split up into different content.
超えそうなら、別のコンテンツに分割することを検討してください。
Scripts in your skill directory can run without loading their contents into context.
スキルディレクトリのスクリプトは内容をコンテキストに読み込まずに実行できます。
The script executes and only the output consumes tokens.
スクリプトが実行され、その出力のみがトークンを消費します。
Tell claw to run the script, not read it.
スクリプトを読ませるのではなく、実行させてください。
This is very useful for environment validation, data transformations that need to be consistent, operations that are more reliable as tested code than generated code.
環境検証、一貫性が求められるデータ変換、生成コードより検証済みコードの方が信頼できる処理などに非常に役立ちます。
Skills support metadata fields.
スキルはメタデータフィールドをサポートしています。
Name and description which are required.
名前と説明は必須です。
Allowed tools restricts available tools and model specifies which claw to use.
allowed tools は使用可能ツールを制限し、model は使用する Claude モデルを指定します。
Descriptions need specific actions and trigger phrases to match for reliability.
説明には具体的なアクションとトリガーフレーズを含め、確実にマッチするようにしましょう。
For larger skills, use progressive disclosure.
大きなスキルにはプログレッシブ・ディスクロージャーを活用しましょう。
Keep your skill.md file under 500 lines and link to the supporting files that load only when needed.
skill.md ファイルを 500 行以内に収め、必要なときだけ読み込まれるサポートファイルへリンクを貼ります。
Scripts [music] can execute without loading their contents, keeping context efficient.
スクリプト [music] は内容を読み込まずに実行でき、コンテキストを効率的に保ちます。