計画書から出力SDK(アウトプット用の開発キット)ワークフローを実装する 次のような場合に使用: ユーザーが既存の計画から、ワークフローの構築・実装・コード化を依頼した場合、または「出力-計画-ワークフロー」によって計画が作成され、ユーザーがそれを実装する準備ができた場合
Implement an Output SDK workflow from a plan document. Use when the user asks to build, implement, or code a workflow from an existing plan, or after output-plan-workflow has produced a plan and the user is ready to build.
計画書に基づいて Output.ai ワークフローを実装してください。
ワークフローディレクトリはコマンドライン引数として指定されます(ワークフローディレクトリパス)。ワークフロー骨組みはそこに既に作成されているはずですが、作成されていない場合は最初に作成してください。
計画ファイルを読み込み、その仕様に従ってワークフローを実装してください。
実装プロセス全体の進捗追跡には todo ツールを使用してください。
計画書に記載されたワークフローを実装します。Output SDK のパターンとベストプラクティスに従ってください。
<pre_flight_check> 実行: Claude スキル「output-meta-pre-flight」 </pre_flight_check>
<process_flow>
<step number="1" name="plan_analysis" subagent="workflow-context-fetcher">
計画書を読み込み、内容を理解してください。
</step>
<step number="2" name="workflow_implementation" subagent="workflow-quality">
ワークフローディレクトリの workflow.ts をワークフロー定義で更新してください。
<implementation_checklist>
instanceof ではなく hasErrorType(error, ErrorClass) を使う(「output-error-try-catch」参照)
</implementation_checklist><workflow_template>
import { workflow, z } from '@outputai/core';
import { stepName } from './steps.js';
const inputSchema = z.object( {
// 計画に基づいて定義
} );
const outputSchema = z.object( {
// 計画に基づいて定義
} );
export default workflow( {
name: 'workflow-name-from-plan',
description: '計画からの説明',
inputSchema,
outputSchema,
fn: async input => {
// 計画からのオーケストレーションロジックを実装
const result = await stepName( input );
return { result };
}
} );
</workflow_template>
</step>
<step number="3" name="steps_implementation" subagent="workflow-quality">
ワークフローディレクトリの steps.ts を計画のすべてのステップ定義で更新してください。
<implementation_checklist>
<step_template>
import { step, z } from '@outputai/core';
export const stepName = step( {
name: 'stepName',
description: '計画からの説明',
inputSchema: z.object( {
// 計画に基づいて定義
} ),
outputSchema: z.object( {
// 計画に基づいて定義
} ),
fn: async input => {
// 計画からのステップロジックを実装
return output;
}
} );
</step_template>
</step>
<step number="3.5" name="evaluators_implementation" subagent="workflow-quality">
計画にエバリュエーター関数が含まれている場合は、ワークフローディレクトリの evaluators.ts に実装してください。
<decision_tree> IF 計画にエバリュエーターが含まれている: evaluators.ts を作成 計画に従ってエバリュエーター関数を実装 ELSE: ステップ 4 にスキップ </decision_tree>
<implementation_checklist>
generateText と aiSdk を '@outputai/llm' からインポートする<evaluator_template>
import { evaluator, z, EvaluationBooleanResult } from '@outputai/core';
export const evaluateName = evaluator( {
name: 'evaluate_name',
description: '計画からの説明',
inputSchema: z.object( {
// 計画に基づいて定義
} ),
fn: async input => {
// 計画からの評価ロジックを実装
return new EvaluationBooleanResult( {
value: true,
confidence: 0.95,
reasoning: '評価の説明'
} );
}
} );
</evaluator_template>
</step>
<step number="4" name="prompt_templates" subagent="workflow-prompt-writer">
計画に LLM ベースのステップが含まれている場合は、ワークフローディレクトリの prompts/ サブディレクトリにプロンプトテンプレートを作成してください。
<decision_tree> IF 計画に LLM ステップが含まれている: プロンプトテンプレートを作成 steps.ts を更新して loadPrompt と generateText を使う ELSE: ステップ 6 にスキップ </decision_tree>
<llm_step_template>
import { step, z } from '@outputai/core';
import { generateText } from '@outputai/llm';
export const llmStep = step( {
name: 'llmStep',
description: 'LLM ベースのステップ',
inputSchema: z.object( {
param: z.string()
} ),
outputSchema: z.string(),
fn: async ( { param } ) => {
const { result } = await generateText( {
prompt: 'prompt_name@v1',
variables: { param }
} );
return result;
}
} );
</llm_step_template>
<prompt_file_template>
---
provider: anthropic
# 2026年5月4日現在 — 最新情報は output-dev-model-selection を実行してください
model: claude-sonnet-4-6
temperature: 0.7
---
<assistant>
あなたは役立つアシスタントです。
</assistant>
<user>
</user>
</prompt_file_template>
</step>
<step number="5" name="readme_update">
ワークフローディレクトリの README.md をワークフロー固有のドキュメントで更新してください。
<documentation_requirements>
</step>
<step number="6" name="scenario_creation">
ワークフロー テスト用にワークフローディレクトリの scenarios/ サブディレクトリに少なくとも 1 つのシナリオファイルを作成してください。
<scenario_requirements>
scenarios/ ディレクトリを作成するtest_input.json を作成する<scenario_template>
{
// inputSchema に一致する例の値を入力
// ワークフローを実演する現実的なテストデータを使う
}
</scenario_template>
<example> inputSchema が以下のワークフロー向け:
z.object( {
topic: z.string(),
maxLength: z.number().optional()
} )
scenarios/test_input.json を作成:
{
"topic": "人工知能の歴史",
"maxLength": 500
}
</example>
</step>
<step number="7" name="validation" subagent="workflow-quality">
実装が完了し、正しいことを確認してください。
<validation_checklist>
</step>
<step number="8" name="post_flight_check">
実装が使用可能な状態になっていることを確認してください。
<post_flight_check> 実行: Claude スキル「output-meta-post-flight」 </post_flight_check>
</step>
</process_flow>
---- 開始 ----
引数として指定されたワークフロー名、ワークフローディレクトリ、計画ファイルパス、およびユーザーが指定した追加の指示を使用してください。
Your task is to implement an Output.ai workflow based on a provided plan document.
The workflow directory is provided as an argument (the workflow directory path). The workflow skeleton should already have been created there; if it has not, create it first.
Please read the plan file and implement the workflow according to its specifications.
Use the todo tool to track your progress through the implementation process.
Implement the workflow described in the plan document, following Output SDK patterns and best practices.
<pre_flight_check>
EXECUTE: Claude Skill: output-meta-pre-flight
</pre_flight_check>
<process_flow>
<step number="1" name="plan_analysis" subagent="workflow-context-fetcher">
Read and understand the plan document.
</step>
<step number="2" name="workflow_implementation" subagent="workflow-quality">
Update workflow.ts in the workflow directory with the workflow definition.
<implementation_checklist>
hasErrorType(error, ErrorClass) instead of instanceof (see output-error-try-catch)
</implementation_checklist><workflow_template>
import { workflow, z } from '@outputai/core';
import { stepName } from './steps.js';
const inputSchema = z.object( {
// Define based on plan
} );
const outputSchema = z.object( {
// Define based on plan
} );
export default workflow( {
name: 'workflow-name-from-plan',
description: 'Description from plan',
inputSchema,
outputSchema,
fn: async input => {
// Implement orchestration logic from plan
const result = await stepName( input );
return { result };
}
} );
</workflow_template>
</step>
<step number="3" name="steps_implementation" subagent="workflow-quality">
Update steps.ts in the workflow directory with all step definitions from the plan.
<implementation_checklist>
<step_template>
import { step, z } from '@outputai/core';
export const stepName = step( {
name: 'stepName',
description: 'Description from plan',
inputSchema: z.object( {
// Define based on plan
} ),
outputSchema: z.object( {
// Define based on plan
} ),
fn: async input => {
// Implement step logic from plan
return output;
}
} );
</step_template>
</step>
<step number="3.5" name="evaluators_implementation" subagent="workflow-quality">
If the plan includes evaluator functions, implement them in evaluators.ts in the workflow directory.
<decision_tree> IF plan_includes_evaluators: CREATE evaluators.ts IMPLEMENT evaluator functions per plan ELSE: SKIP to step 4 </decision_tree>
<implementation_checklist>
generateText and aiSdk from @outputai/llm if using LLM-powered evaluatorsoutput-dev-eval-testing skill)
</implementation_checklist><evaluator_template>
import { evaluator, z, EvaluationBooleanResult } from '@outputai/core';
export const evaluateName = evaluator( {
name: 'evaluate_name',
description: 'Description from plan',
inputSchema: z.object( {
// Define based on plan
} ),
fn: async input => {
// Implement evaluation logic from plan
return new EvaluationBooleanResult( {
value: true,
confidence: 0.95,
reasoning: 'Explanation of evaluation'
} );
}
} );
</evaluator_template>
</step>
<step number="4" name="prompt_templates" subagent="workflow-prompt-writer">
If the plan includes LLM-based steps, create prompt templates in the prompts/ subdirectory of the workflow directory.
<decision_tree> IF plan_includes_llm_steps: CREATE prompt_templates UPDATE steps.ts to use loadPrompt and generateText ELSE: SKIP to step 6 </decision_tree>
<llm_step_template>
import { step, z } from '@outputai/core';
import { generateText } from '@outputai/llm';
export const llmStep = step( {
name: 'llmStep',
description: 'LLM-based step',
inputSchema: z.object( {
param: z.string()
} ),
outputSchema: z.string(),
fn: async ( { param } ) => {
const { result } = await generateText( {
prompt: 'prompt_name@v1',
variables: { param }
} );
return result;
}
} );
</llm_step_template>
<prompt_file_template>
---
provider: anthropic
# current as of 2026-05-04 — run output-dev-model-selection for the latest
model: claude-sonnet-4-6
temperature: 0.7
---
<assistant>
You are a helpful assistant.
</assistant>
<user>
</user>
</prompt_file_template>
</step>
<step number="5" name="readme_update">
Update README.md in the workflow directory with workflow-specific documentation.
<documentation_requirements>
</step>
<step number="6" name="scenario_creation">
Create at least one scenario file in the scenarios/ subdirectory of the workflow directory for testing the workflow.
<scenario_requirements>
scenarios/ directory if it doesn't existtest_input.json with valid example input matching the inputSchema<scenario_template>
{
// Populate with example values matching inputSchema
// Use realistic test data that demonstrates the workflow
}
</scenario_template>
<example> For a workflow with inputSchema:
z.object( {
topic: z.string(),
maxLength: z.number().optional()
} )
Create scenarios/test_input.json:
{
"topic": "The history of artificial intelligence",
"maxLength": 500
}
</example>
</step>
<step number="7" name="validation" subagent="workflow-quality">
Verify the implementation is complete and correct.
<validation_checklist>
</step>
<step number="8" name="post_flight_check">
Verify the implementation is ready for use.
<post_flight_check>
EXECUTE: Claude Skill: output-meta-post-flight
</post_flight_check>
</step>
</process_flow>
---- START ----
Use the workflow name, workflow directory, and plan file path provided as arguments, along with any additional instructions the user provided.
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。