🔨output-build-workflow
- プラグイン
- outputai
- 引数
- [workflow-plan-file-path] [workflow-name] [workflow-directory]
- ソース
- GitHub で見る ↗
説明
Output SDK ワークフローをプランドキュメントから実装します。 次のような場合に使用: - ユーザーが既存のプランをもとにワークフローのビルド・実装・コーディングを依頼したとき - `output-plan-workflow` によってプランが生成され、ユーザーがビルドを開始する準備ができたとき
原文を表示
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 ワークフローを実装するタスクです。
ワークフローのスケルトンはすでに $3 に作成されています(作成されていない場合は作成してください)。
プランファイルを読み込み、その仕様に従ってワークフローを実装してください。
実装の進捗管理には todo ツールを使用してください。
実装ルール
概要
プラン文書に記載されたワークフローを、Output SDK のパターンとベストプラクティスに従って実装します。
<pre_flight_check>
実行: Claude Skill: output-meta-pre-flight
</pre_flight_check>
<process_flow>
<step number="1" name="plan_analysis" subagent="workflow-context-fetcher">
ステップ 1: プラン分析
プラン文書を読み込み、内容を理解します。
$1からプランファイルを読み込む- ワークフロー名・説明・目的を特定する
- 入力・出力スキーマの定義を抽出する
- 必要なステップとその関係性をすべて列挙する
- プロンプトテンプレートが必要な LLM ベースのステップを確認する
- エラーハンドリングとリトライ要件を把握する
</step>
<step number="2" name="workflow_implementation" subagent="workflow-quality">
ステップ 2: ワークフロー実装
$3/workflow.ts をワークフロー定義で更新します。
<implementation_checklist>
- 必要な依存関係をインポートする(
@outputai/coreからworkflow,z) - プランの仕様に基づいて
inputSchemaを定義する - プランの仕様に基づいて
outputSchemaを定義する steps.tsからステップ関数をインポートする- 適切なオーケストレーションを含むワークフロー関数を実装する
- プランに指定された条件分岐ロジックを処理する
- 適切なエラーハンドリングを追加する </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: '$2',
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">
ステップ 3: ステップ実装
$3/steps.ts をプランに記載されたすべてのステップ定義で更新します。
<implementation_checklist>
- 必要な依存関係をインポートする(
@outputai/coreからstep,z) - 適切なスキーマバリデーションを含む各ステップを実装する
- 指定されたエラーハンドリングとリトライロジックを追加する
- ステップ名がプランの仕様と一致していることを確認する
- 複雑なロジックには説明コメントを追加する </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">
ステップ 3.5: エバリュエーター実装(必要な場合)
プランにエバリュエーター関数が含まれる場合、$3/evaluators.ts に実装します。
<decision_tree> プランにエバリュエーターが含まれる場合: evaluators.ts を作成 プランに従ってエバリュエーター関数を実装 含まれない場合: ステップ 4 へスキップ </decision_tree>
<implementation_checklist>
- 必要な依存関係をインポートする(
@outputai/coreからevaluator,z, 結果型) - LLM ベースのエバリュエーターを使用する場合は
@outputai/llmからgenerateTextとOutputをインポートする - 適切なスキーマバリデーションを含む各エバリュエーターを実装する
- 適切な結果型を使用する(
EvaluationBooleanResult,EvaluationNumberResult,EvaluationStringResult) - 信頼度スコアを含める(0.0〜1.0)
- 透明性のための推論根拠を追加する
- すべてのインポートに
.js拡張子を使用する - データセット駆動の検証にはオフライン評価テストを検討する(
output-dev-eval-testingスキルを参照) </implementation_checklist>
<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">
ステップ 4: プロンプトテンプレート(必要な場合)
プランに LLM ベースのステップが含まれる場合、$3/prompts/ にプロンプトテンプレートを作成します。
<decision_tree>
プランに LLM ステップが含まれる場合:
プロンプトテンプレートを作成
loadPrompt と generateText を使用するよう steps.ts を更新
含まれない場合:
ステップ 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-05-04 時点の最新モデル — 最新情報は output-dev-model-selection を実行して確認
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">
ステップ 5: README 更新
$3/README.md をワークフロー固有のドキュメントで更新します。
<documentation_requirements>
- ワークフロー名と説明を更新する
- 入力スキーマをサンプルとともに記載する
- 出力スキーマをサンプルとともに記載する
- 各ステップの目的を説明する
- 使用例を提供する
- 前提条件やセットアップ要件を記載する
- テスト手順を含める </documentation_requirements>
</step>
<step number="6" name="scenario_creation">
ステップ 6: シナリオファイルの作成
$3/scenarios/ にテスト用のシナリオファイルを少なくとも1つ作成します。
<scenario_requirements>
scenarios/ディレクトリが存在しない場合は作成するinputSchemaに一致する有効なサンプル入力を含むtest_input.jsonを作成する- 入力値はワークフローの目的を示す現実的なものにする
- JSON は有効かつパース可能な形式にする </scenario_requirements>
<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">
ステップ 7: 実装の検証
実装が完全かつ正確であることを確認します。
<validation_checklist>
- プランに記載されたすべてのステップが実装されている
- 入力・出力スキーマがプランの仕様と一致している
- ワークフローのオーケストレーションロジックが正しい
- エラーハンドリングが実装されている
- LLM プロンプトが作成されている(必要な場合)
- エバリュエーターが実装されている(プランに指定されている場合)
- エバリュエーターが正しい結果型と信頼度スコアを使用している
- README が正確な情報で更新されている
- コードが Output SDK のパターンに従っている
- TypeScript の型が適切に定義されている
- 有効なサンプル入力を含むシナリオファイルが存在する
- オフライン評価テストが作成されている(該当する場合) </validation_checklist>
</step>
<step number="8" name="post_flight_check">
ステップ 8: ポストフライトチェック
実装が使用可能な状態であることを確認します。
<post_flight_check>
実行: Claude Skill: output-meta-post-flight
</post_flight_check>
</step>
</process_flow>
<post_flight_check>
実行: Claude Skill: output-meta-post-flight
</post_flight_check>
---- 開始 ----
ワークフロー名: $2
ワークフローディレクトリ: $3
プランファイルパス: $1
追加指示:
$ARGUMENTS
原文(English)を表示
Your task is to implement an Output.ai workflow based on a provided plan document.
The workflow skeleton has already been created at: $3 (if not it should be)
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.
Implementation Rules
Overview
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">
Step 1: Plan Analysis
Read and understand the plan document.
- Read the plan file from:
$1 - Identify the workflow name, description, and purpose
- Extract input and output schema definitions
- List all required steps and their relationships
- Note any LLM-based steps that require prompt templates
- Understand error handling and retry requirements
</step>
<step number="2" name="workflow_implementation" subagent="workflow-quality">
Step 2: Workflow Implementation
Update $3/workflow.ts with the workflow definition.
<implementation_checklist>
- Import required dependencies (workflow, z from '@outputai/core')
- Define inputSchema based on plan specifications
- Define outputSchema based on plan specifications
- Import step functions from steps.ts
- Implement workflow function with proper orchestration
- Handle conditional logic if specified in plan
- Add proper error handling </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: '$2',
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">
Step 3: Steps Implementation
Update $3/steps.ts with all step definitions from the plan.
<implementation_checklist>
- Import required dependencies (step, z from '@outputai/core')
- Implement each step with proper schema validation
- Add error handling and retry logic as specified
- Ensure step names match plan specifications
- Add descriptive comments for complex logic </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">
Step 3.5: Evaluators Implementation (if needed)
If the plan includes evaluator functions, implement them in $3/evaluators.ts.
<decision_tree> IF plan_includes_evaluators: CREATE evaluators.ts IMPLEMENT evaluator functions per plan ELSE: SKIP to step 4 </decision_tree>
<implementation_checklist>
- Import required dependencies (evaluator, z, result types from '@outputai/core')
- Import generateText and Output from '@outputai/llm' if using LLM-powered evaluators
- Implement each evaluator with proper schema validation
- Use appropriate result types (EvaluationBooleanResult, EvaluationNumberResult, EvaluationStringResult)
- Include confidence scores (0.0-1.0)
- Add reasoning for transparency
- All imports use .js extension
- Consider offline eval tests for dataset-driven verification (see
output-dev-eval-testingskill) </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">
Step 4: Prompt Templates (if needed)
If the plan includes LLM-based steps, create prompt templates in $3/prompts/.
<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">
Step 5: README Update
Update $3/README.md with workflow-specific documentation.
<documentation_requirements>
- Update workflow name and description
- Document input schema with examples
- Document output schema with examples
- Explain each step's purpose
- Provide usage examples
- Document any prerequisites or setup requirements
- Include testing instructions </documentation_requirements>
</step>
<step number="6" name="scenario_creation">
Step 6: Scenario File Creation
Create at least one scenario file in $3/scenarios/ for testing the workflow.
<scenario_requirements>
- Create
scenarios/directory if it doesn't exist - Create
test_input.jsonwith valid example input matching the inputSchema - Input values should be realistic and demonstrate the workflow's purpose
- JSON must be valid and parseable </scenario_requirements>
<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">
Step 7: Implementation Validation
Verify the implementation is complete and correct.
<validation_checklist>
- All steps from plan are implemented
- Input/output schemas match plan specifications
- Workflow orchestration logic is correct
- Error handling is in place
- LLM prompts are created (if needed)
- Evaluators are implemented (if specified in plan)
- Evaluators use correct result types and confidence scores
- README is updated with accurate information
- Code follows Output SDK patterns
- TypeScript types are properly defined
- Scenario file exists with valid example input
- Offline eval tests created (if applicable) </validation_checklist>
</step>
<step number="8" name="post_flight_check">
Step 8: 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>
<post_flight_check>
EXECUTE: Claude Skill: output-meta-post-flight
</post_flight_check>
---- START ----
Workflow Name: $2
Workflow Directory: $3
Plan File Path: $1
Additional Instructions:
$ARGUMENTS
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。