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.
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 1: Plan Analysis
Read and understand the plan document.
- Read the plan file from the provided plan file path
- 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 2: Workflow Implementation
Update workflow.ts in the workflow directory 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
- When catching a specific step or evaluator error, use
hasErrorType(error, ErrorClass)instead ofinstanceof(seeoutput-error-try-catch)
</implementation_checklist>
<workflow_template>
</workflow_template>
</step>
Step 3: Steps Implementation
Update steps.ts in the workflow directory 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>
</step_template>
</step>
Step 3.5: Evaluators Implementation (if needed)
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>
- Import required dependencies (evaluator, z, result types from '@outputai/core')
- Import
generateTextandaiSdkfrom@outputai/llmif 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>
</evaluator_template>
</step>
Step 4: Prompt Templates (if needed)
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>
</llm_step_template>
<prompt_file_template>
</prompt_file_template>
</step>
Step 5: README Update
Update README.md in the workflow directory 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 6: Scenario File Creation
Create at least one scenario file in the scenarios/ subdirectory of the workflow directory 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>
</scenario_template>
<example>
For a workflow with inputSchema:
Create scenarios/test_input.json:
</example>
</step>
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 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>
---- START ----
Use the workflow name, workflow directory, and plan file path provided as arguments, along with any additional instructions the user provided.


