📝output-dev-skill-file
- プラグイン
- outputai
- ソース
- GitHub で見る ↗
説明
`.md` スキルファイルを作成し、Output フレームワークの遅延ロード型インストラクションシステムに組み込みます。 次のような場合に使用: - プロンプトへのスキル追加 - スキルのロード設定 - スキル解決のデバッグ
原文を表示
Create .md skill files for Output framework's lazy-loaded instruction system. Use when adding skills to prompts, configuring skill loading, or debugging skill resolution.
ユースケース
- ✓プロンプトへのスキル追加
- ✓スキルのロード設定
- ✓スキル解決のデバッグ
本文(日本語訳)
Skillファイルの作成
概要
このSkillは、OutputフレームワークのSkillsシステム向けに .md Skillファイルを作成する方法を説明します。
SkillはLazy-loadされるインストラクションパッケージであり、プロンプトを軽量に保ちます。
LLMはシステムメッセージでSkill名と説明の一覧を参照し、必要に応じて load_skill ツールを呼び出すことで完全なインストラクションを取得します。
重要: ここで扱うのはフレームワークSkill(LLMがランタイムにロードする .md ファイル)であり、Claude CodeのPluginスキルとは異なります。
名称は似ていますが、両システムは別物です。
次のような場合に使用
- LLMプロンプトに再利用可能なインストラクションセットを追加したい場合
- Skillのロード方法(自動検出・フロントマター・インライン)を設定したい場合
- Skill解決や
load_skillツールの問題をデバッグしたい場合 - 複数のプロンプト間で共通の知識・ノウハウを整理・共有したい場合
ファイルの配置規則
Skillファイルはプロンプトファイルと同じ場所の skills/ フォルダに置きます。
設定不要でOutputが自動検出します。
src/workflows/{workflow-name}/
├── workflow.ts
├── steps.ts
├── types.ts
└── prompts/
├── writing_assistant@v1.prompt
└── skills/
├── clarity_guidelines.md
├── response_format.md
└── structure_guide.md
skills/ フォルダの基準はワークフルートではなく、プロンプトファイルの場所です。
Skillファイルのフォーマット
SkillファイルはMarkdownドキュメントで、任意でYAMLフロントマターブロックを含めることができます。
---
name: clarity_guidelines
description: Rules for writing clear, readable technical content
---
# Clarity Guidelines
When reviewing or writing technical content for clarity:
1. **Sentence length**: Keep sentences under 25 words when possible.
Break complex ideas into multiple sentences.
2. **Active voice**: Prefer active voice ("The function returns X")
over passive ("X is returned by the function").
3. **Jargon**: Define technical terms on first use.
Avoid unnecessary acronyms without explanation.
4. **Concrete examples**: Every abstract concept should have
a concrete example.
When applying this skill, flag any violations you find
and suggest improvements.
フロントマターフィールド
| フィールド | 必須 | デフォルト | 説明 |
|---|---|---|---|
name |
不要 | .md を除いたファイル名 |
LLMが load_skill で使用する識別子 |
description |
不要 | name と同じ |
システムメッセージに表示され、LLMがロードするかどうかを判断するために使用 |
| Body | 必須 | - | LLMが load_skill を呼び出したときに返される完全なインストラクション |
フロントマターを省略した場合、ファイル名(.md を除く)がnameとdescriptionの両方として使用されます。
フロントマターなしの clarity_guidelines.md には、name: "clarity_guidelines"、description: "clarity_guidelines" が設定されます。
descriptionは丁寧に書いてください。
システムメッセージに表示され、LLMがSkillをロードするかどうかを判断するために使用されます。
"clarity_guidelines" より "Rules for writing clear, readable technical content" のほうが適切です。
Skillのロード方法
方法1: 同一場所への配置による自動検出(デフォルト)
プロンプトファイルの隣の skills/ フォルダに .md ファイルを置くと、Outputが自動検出します。
プロンプトファイルへの特別な設定は不要です。
(以下のモデル指定は2026-05-04時点のものです。最新情報は output-dev-model-selection で確認してください。)
---
provider: anthropic
model: claude-sonnet-4-6
maxTokens: 2048
---
<system>
You are an expert technical writing assistant.
Use load_skill to get full instructions for any skill before applying it.
</system>
<user>
Review the following {{ content_type }} content focusing on {{ focus }}.
Content:
{{ content }}
</user>
ランタイム時、Outputは同一場所の skills/ ディレクトリを見つけ、すべての .md ファイルをロードして以下を実行します。
- 利用可能なSkillの一覧をシステムメッセージに追加
- LLMが呼び出せる
load_skillツールを注入
方法2: フロントマターパス(明示的指定)
プロンプトのYAMLフロントマターで特定のSkillファイルまたはディレクトリを参照します。 パスはプロンプトファイルからの相対パスで解決されます。
---
provider: anthropic
# 2026-05-04時点の指定 — 最新はoutput-dev-model-selectionで確認
model: claude-sonnet-4-6
skills:
- ./skills/
- ../shared_skills/tone_guide.md
---
フロントマターに skills: が設定されている場合、自動検出はスキップされ、指定されたパスのみがロードされます。
方法3: インラインSkill(コード)
@outputai/llm の skill() 関数を使ってSkillをプログラム的に作成します。
import { skill } from '@outputai/llm';
const audienceSkill = skill( {
name: 'audience_adaptation',
description: 'Tailor feedback for the specified expertise level',
instructions: `# Audience Adaptation
When the target audience is specified, adjust your feedback:
**Beginner**: Flag jargon as high-priority issues.
**Expert**: Focus on accuracy and completeness.
Always mention the audience level in your summary.`
} );
インラインSkillを generateText または Agent に渡します。
const { result } = await generateText( {
prompt: 'writing_assistant@v1',
variables: { content_type: 'documentation', focus: 'clarity', content: input.content },
skills: [ audienceSkill ],
maxSteps: 5
} );
インラインSkillはファイルベースのSkillとマージされます。
解決の優先順位
Skillは以下の順序で解決されます。
- フロントマターパス: プロンプトフロントマターに
skills:が設定されている場合、そのパスがロードされます - 同一場所への配置による自動検出: フロントマターに
skills:がない場合、プロンプトファイルの隣のskills/ディレクトリがスキャンされます - 呼び出し元から渡されたSkill: コード経由で渡されたSkill(
generateTextまたはAgentのskills: [...])は常にマージされます
フロントマターパスと自動検出は互いに排他的です。
フロントマターに skills: を設定すると自動検出が無効になります。
呼び出し元から渡されたSkillは、どのファイルベースの方法を使用しているかに関わらず、常に追加されます。
Skillの無効化
プロンプトのフロントマターに skills: [] を設定すると、自動検出を無効にできます。
---
provider: anthropic
# 2026-05-04時点の指定 — 最新はoutput-dev-model-selectionで確認
model: claude-haiku-4-5-20251001
skills: []
---
同じフォルダ内の他のプロンプト用に skills/ ディレクトリが存在するが、特定のプロンプトではSkillをロードしたくない場合に便利です。
完全な例
Skillファイル
---
name: response_format
description: Standard format requirements for all review responses
---
# Response Format
Every response MUST end with the exact string "OUTPUT_COMPLETE" on its own line.
Structure your review as follows:
1. **Summary**: 2-3 sentence overview of the content quality
2. **Issues**: Numbered list of specific problems found
3. **Suggestions**: Actionable improvements for each issue
4. **Score**: Overall quality score from 0-100
OUTPUT_COMPLETE
Skillを使用するプロンプトファイル
---
provider: anthropic
# 2026-05-04時点の指定 — 最新はoutput-dev-model-selectionで確認
model: claude-sonnet-4-6
maxTokens: 2048
---
<system>
You are an expert technical writing assistant.
Use load_skill to get the full instructions for any skill before applying it.
After reviewing, provide structured feedback with specific issues and suggestions.
</system>
<user>
Review the following {{ content_type }} content focusing on {{ focus }}.
Content:
{{ content }}
</user>
プロンプトを使用するStep
import { step, z } from '@outputai/core';
import { Agent, Output } from '@outputai/llm';
export const reviewContent = step( {
name: 'reviewContent',
description: 'Review content using skills for specialized expertise',
inputSchema: z.object( {
content: z.string(),
content_type: z.string(),
focus: z.string()
} ),
outputSchema: z.object( {
summary: z.string(),
issues: z.array( z.string() ),
suggestions: z.array( z.string() ),
score: z.number()
} ),
fn: async input => {
const agent = new Agent( {
prompt: 'writing_assistant@v1',
variables: input,
output: Output.object( {
schema: z.object( {
summary: z.string().describe( '2-3 sentence overview' ),
issues: z.array( z.string() ).describe( 'Specific problems found' ),
suggestions: z.array( z.string() ).describe( 'Actionable improvements' ),
score: z.number().describe( 'Quality score 0-100' )
} )
} ),
maxSteps: 5
} );
const { output } = await agent.generate();
return output;
}
} );
ベストプラクティス
1. 焦点を絞ったSkillを作成する
各Skillは1つの専門領域をカバーするようにします。 大きな1つのSkillより、焦点を絞った複数のSkillを優先してください。
skills/
├── clarity_guidelines.md # 文章の明瞭さ
├── structure_guide.md # ドキュメント構造
└── response_format.md # 出力フォーマット
2. 説明的なdescriptionを書く
descriptionはシステムメッセージに表示されます。 LLMがいつこのSkillをロードすべきかが明確になるように書いてください。
---
name: clarity_guidelines
description: Rules for writing clear, readable technical content
---
次のような記述は避けてください。
---
name: clarity_guidelines
description: clarity_guidelines
---
3. ヘッダーを使ってインストラクションを整理する
MarkdownのヘッダーとリストでSkimしやすいインストラクションにします。
# Clarity Guidelines
## Rules
1. Keep sentences under 25 words
2. Prefer active voice
3. Define jargon on first use
## When to Flag
- Sentences over 30 words
- Passive voice in instructions
- Undefined acronyms
4. 実行可能なガイダンスを含める
Skillが何についてのものかだけでなく、LLMが何をすべきかを伝えてください。
When applying this skill, flag any violations you find and suggest improvements.
確認チェックリスト
- [ ] Skillファイルはプロンプトファイルの隣の
skills/ディレクトリに.md形式で置かれている - [ ] 各Skillのフロントマターに明確で説明的な
descriptionがある - [ ] Skill本文に実行可能なインストラクションが含まれている
- [ ] プロンプトファイルのシステムメッセージに
load_skillの言及がある(自動検出を使用する場合) - [ ] フロントマターパスを使用する場合、すべてのパスが正しく解決される
- [ ]
skills: []を使用する場合、自動検出を意図的に無効にしている - [ ] Skillが焦点を絞っている(1ファイルにつき1専門領域)
- [ ] Stepコードにツールループの反復を許容する
maxSteps(デフォルト10)が渡されている
関連Skill
output-dev-prompt-file— Skillを使用する.promptファイルの作成output-dev-agent-class— SkillとともにAgentクラスを使用する方法output-dev-step-function— Step関数でSkillを使用する方法output-dev-folder-structure— Skillファイルの配置場所の理解
原文(English)を表示
Creating Skill Files
Overview
This skill documents how to create .md skill files for the Output framework's skills system. Skills are lazy-loaded instruction packages that keep prompts lightweight. The LLM sees a list of skill names and descriptions in the system message, then calls a load_skill tool to retrieve full instructions on demand.
Important: These are framework skills (.md files loaded by LLMs at runtime), not Claude Code plugin skills. The naming is similar but the systems are separate.
When to Use This Skill
- Adding reusable instruction sets to LLM prompts
- Configuring how skills are loaded (auto-discovery, frontmatter, inline)
- Debugging skill resolution or
load_skilltool issues - Organizing shared expertise across multiple prompts
Location Convention
Skill files live in a skills/ folder next to the prompt file. Output auto-discovers them with no configuration needed:
src/workflows/{workflow-name}/
├── workflow.ts
├── steps.ts
├── types.ts
└── prompts/
├── writing_assistant@v1.prompt
└── skills/
├── clarity_guidelines.md
├── response_format.md
└── structure_guide.md
The skills/ folder is relative to the prompt file location, not the workflow root.
Skill File Format
Skill files are markdown documents with an optional YAML frontmatter block:
---
name: clarity_guidelines
description: Rules for writing clear, readable technical content
---
# Clarity Guidelines
When reviewing or writing technical content for clarity:
1. **Sentence length**: Keep sentences under 25 words when possible.
Break complex ideas into multiple sentences.
2. **Active voice**: Prefer active voice ("The function returns X")
over passive ("X is returned by the function").
3. **Jargon**: Define technical terms on first use.
Avoid unnecessary acronyms without explanation.
4. **Concrete examples**: Every abstract concept should have
a concrete example.
When applying this skill, flag any violations you find
and suggest improvements.
Frontmatter Fields
| Field | Required | Default | Description |
|---|---|---|---|
name |
No | Filename without .md |
Identifier the LLM uses with load_skill |
description |
No | Same as name |
Shown in system message, helps LLM decide when to load |
| Body | Yes | - | Full instructions returned when LLM calls load_skill |
If you omit the frontmatter entirely, the filename (without .md) is used as both the name and description. A file named clarity_guidelines.md with no frontmatter gets name: "clarity_guidelines" and description: "clarity_guidelines".
Write good descriptions. They appear in the system message and are what the LLM uses to decide whether to load a skill. "Rules for writing clear, readable technical content" is better than "clarity_guidelines".
How Skills Are Loaded
Method 1: Colocated Auto-Discovery (Default)
Place .md files in a skills/ folder next to your prompt file. Output discovers them automatically. The prompt file needs no special configuration. (Model lines below are current as of 2026-05-04 — refresh via output-dev-model-selection.)
---
provider: anthropic
model: claude-sonnet-4-6
maxTokens: 2048
---
<system>
You are an expert technical writing assistant.
Use load_skill to get full instructions for any skill before applying it.
</system>
<user>
Review the following {{ content_type }} content focusing on {{ focus }}.
Content:
{{ content }}
</user>
At runtime, Output finds the colocated skills/ directory, loads all .md files, and:
- Adds a summary of available skills to the system message
- Injects a
load_skilltool the LLM can call
Method 2: Frontmatter Paths (Explicit)
Reference specific skill files or directories in the prompt YAML frontmatter. Paths resolve relative to the prompt file:
---
provider: anthropic
# current as of 2026-05-04 — run output-dev-model-selection for the latest
model: claude-sonnet-4-6
skills:
- ./skills/
- ../shared_skills/tone_guide.md
---
When skills: is set in frontmatter, auto-discovery is skipped. Only the listed paths are loaded.
Method 3: Inline Skills (Code)
Create skills programmatically with the skill() function from @outputai/llm:
import { skill } from '@outputai/llm';
const audienceSkill = skill( {
name: 'audience_adaptation',
description: 'Tailor feedback for the specified expertise level',
instructions: `# Audience Adaptation
When the target audience is specified, adjust your feedback:
**Beginner**: Flag jargon as high-priority issues.
**Expert**: Focus on accuracy and completeness.
Always mention the audience level in your summary.`
} );
Pass inline skills to generateText or Agent:
const { result } = await generateText( {
prompt: 'writing_assistant@v1',
variables: { content_type: 'documentation', focus: 'clarity', content: input.content },
skills: [ audienceSkill ],
maxSteps: 5
} );
Inline skills are merged with any file-based skills.
Resolution Priority
Skills are resolved in this order:
- Frontmatter paths: If
skills:is set in the prompt frontmatter, those paths are loaded - Colocated auto-discovery: If no
skills:in frontmatter, theskills/directory next to the prompt file is scanned - Caller-provided skills: Skills passed via code (
skills: [...]ingenerateTextorAgent) are always merged in
Frontmatter paths and colocated auto-discovery are mutually exclusive. Setting skills: in frontmatter disables auto-discovery. Caller-provided skills are always added regardless of which file-based method is used.
Disabling Skills
Set skills: [] in the prompt frontmatter to opt out of auto-discovery:
---
provider: anthropic
# current as of 2026-05-04 — run output-dev-model-selection for the latest
model: claude-haiku-4-5-20251001
skills: []
---
This is useful when you have a skills/ directory for other prompts in the same folder, but a specific prompt should not load any skills.
Complete Example
Skill File
---
name: response_format
description: Standard format requirements for all review responses
---
# Response Format
Every response MUST end with the exact string "OUTPUT_COMPLETE" on its own line.
Structure your review as follows:
1. **Summary**: 2-3 sentence overview of the content quality
2. **Issues**: Numbered list of specific problems found
3. **Suggestions**: Actionable improvements for each issue
4. **Score**: Overall quality score from 0-100
OUTPUT_COMPLETE
Prompt File Using Skills
---
provider: anthropic
# current as of 2026-05-04 — run output-dev-model-selection for the latest
model: claude-sonnet-4-6
maxTokens: 2048
---
<system>
You are an expert technical writing assistant.
Use load_skill to get the full instructions for any skill before applying it.
After reviewing, provide structured feedback with specific issues and suggestions.
</system>
<user>
Review the following {{ content_type }} content focusing on {{ focus }}.
Content:
{{ content }}
</user>
Step Using the Prompt
import { step, z } from '@outputai/core';
import { Agent, Output } from '@outputai/llm';
export const reviewContent = step( {
name: 'reviewContent',
description: 'Review content using skills for specialized expertise',
inputSchema: z.object( {
content: z.string(),
content_type: z.string(),
focus: z.string()
} ),
outputSchema: z.object( {
summary: z.string(),
issues: z.array( z.string() ),
suggestions: z.array( z.string() ),
score: z.number()
} ),
fn: async input => {
const agent = new Agent( {
prompt: 'writing_assistant@v1',
variables: input,
output: Output.object( {
schema: z.object( {
summary: z.string().describe( '2-3 sentence overview' ),
issues: z.array( z.string() ).describe( 'Specific problems found' ),
suggestions: z.array( z.string() ).describe( 'Actionable improvements' ),
score: z.number().describe( 'Quality score 0-100' )
} )
} ),
maxSteps: 5
} );
const { output } = await agent.generate();
return output;
}
} );
Best Practices
1. Write Focused Skills
Each skill should cover one area of expertise. Prefer multiple focused skills over one large skill:
skills/
├── clarity_guidelines.md # Writing clarity
├── structure_guide.md # Document structure
└── response_format.md # Output formatting
2. Write Descriptive Descriptions
The description appears in the system message. Make it clear when the LLM should load this skill:
---
name: clarity_guidelines
description: Rules for writing clear, readable technical content
---
Not:
---
name: clarity_guidelines
description: clarity_guidelines
---
3. Structure Instructions with Headers
Use markdown headers and lists for scannable instructions:
# Clarity Guidelines
## Rules
1. Keep sentences under 25 words
2. Prefer active voice
3. Define jargon on first use
## When to Flag
- Sentences over 30 words
- Passive voice in instructions
- Undefined acronyms
4. Include Actionable Guidance
Tell the LLM what to do with the skill, not just what the skill is about:
When applying this skill, flag any violations you find and suggest improvements.
Verification Checklist
- [ ] Skill files are
.mdformat in askills/directory next to the prompt file - [ ] Each skill has a clear, descriptive
descriptionin frontmatter - [ ] Skill body contains actionable instructions
- [ ] Prompt file mentions
load_skillin system message (when using auto-discovery) - [ ] If using frontmatter paths, all paths resolve correctly
- [ ] If using
skills: [], auto-discovery is intentionally disabled - [ ] Skills are focused (one area of expertise per file)
- [ ] Step code passes
maxSteps(default 10) to allow tool loop iterations
Related Skills
output-dev-prompt-file- Creating .prompt files that use skillsoutput-dev-agent-class- Using the Agent class with skillsoutput-dev-step-function- Using skills in step functionsoutput-dev-folder-structure- Understanding skill file locations
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。