output-build-workflow
Implement an Output SDK workflow from a plan document. Use when the user asks to build, implement, or code a workflow from an…
Create step functions in steps.ts for Output SDK workflows. Use when implementing I/O operations, error handling, HTTP requests, or LLM calls.
Claude Code
$ npx -y skills add growthxai/output --skill output-dev-step-function --agent claude-code
Codex
$ npx skills add growthxai/output --skill output-dev-step-function -a codex -y
Cursor
$ npx skills add growthxai/output --skill output-dev-step-function -a cursor -y
Gemini CLI
$ npx skills add growthxai/output --skill output-dev-step-function -a gemini-cli -y
GitHub Copilot
$ npx skills add growthxai/output --skill output-dev-step-function -a github-copilot -y
OpenCode
$ npx skills add growthxai/output --skill output-dev-step-function -a opencode -y
Windsurf
$ npx skills add growthxai/output --skill output-dev-step-function -a windsurf -y
name: output-dev-step-function description: Create step functions in steps.ts for Output SDK workflows. Use when implementing I/O operations, error handling, HTTP requests, or LLM calls. allowed-tools: [Read, Write, Edit]
This skill documents how to create step functions in `steps.ts` for Output SDK workflows. Steps are where all I/O operations happen - HTTP requests, LLM calls, database operations, file system access, etc.
For smaller workflows, use a single `steps.ts` file:
src/workflows/{workflow-name}/
├── workflow.ts
├── steps.ts # All steps in one file
├── types.ts
└── ...For larger workflows with many steps, use a `steps/` folder:
src/workflows/{workflow-name}/
├── workflow.ts
├── steps/ # Steps split into individual files
│ ├── fetch_data.ts
│ ├── process.ts
│ └── validate.ts
├── types.ts
└── ...**Important**: `step()` calls MUST be in files containing 'steps' in the path:
Steps are Temporal activities with strict import rules to ensure deterministic replay.
**Example of WRONG imports:**
// WRONG - steps cannot import other steps
import { otherStep } from '../../shared/steps/other.js'; // ✗
import { anotherStep } from './other_steps.js'; // ✗// CORRECT - Import from @outputai/core
import { step, z, FatalError, ValidationError } from '@outputai/core';
// WRONG - Never import z from zod
import { z } from 'zod';// CORRECT - Use @outputai/core/http wrapper
import { createKyClient } from '@outputai/core/http';
// WRONG - Never use axios directly
import axios from 'axios';**Related Skill**: `output-error-http-client`
// CORRECT - Use @outputai/core/llm wrapper
import { generateText, aiSdk } from '@outputai/core/llm';
// WRONG - Never call LLM providers directly
import OpenAI from 'openai';All imports MUST use `.js` extension:
// CORRECT
import { InputSchema, OutputSchema } from './types.js';
import { GeminiService } from '../../shared/clients/gemini_client.js';
// WRONG - Missing .js extension
import { InputSchema, OutputSchema } from './types';import { step, z, FatalError, ValidationError } from '@outputai/core';
import { createKyClient } from '@outputai/core/http';
import { generateText, aiSdk } from '@outputai/core/llm';
import { StepInputSchema, StepOutputSchema } from './types.js';
export const myStep = step( {
name: 'myStep',
description: 'Description of what this step does',
inputSchema: StepInputSchema,
outputSchema: StepOutputSchema,
fn: async input => {
// Implementation with I/O operations
return { /* output matching outputSchema */ };
}
} );Unique identifier for the step. Use camelCase.
name: 'generateImageIdeas'
Human-readable description of the step's purpose.
description: 'Generate creative infographic prompt ideas using Claude'
Schema for validating step input. Define in `types.ts` and import.
inputSchema: z.object( {
content: z.string(),
numberOfIdeas: z.number()
} )Schema for validating step output. Define in `types.ts` and import.
outputSchema: z.array( z.string() )
The step execution function. This is where I/O operations happen.
fn: async input => {
const result = await someExternalService( input );
return result;
}import { createKyClient } from '@outputai/core/http';
import { FatalError, ValidationError } from '@outputai/core';
const RETRY_STATUS_CODES = [ 408, 429, 500, 502, 503, 504 ];
const FATAL_STATUS_CODES = [ 401, 403, 404 ];
const client = createKyClient( {
timeout: 30000,
retry: {
limit: 3,
statusCodes: RETRY_STATUS_CODES
},
hooks: {
beforeError: [
( { error } ) => {
const status = error.response?.status;
const message = error.message;
if ( status && FATAL_STATUS_CODES.includes( status ) ) {
throw new FatalError(
`HTTP ${status} error: ${message}. This is a permanent error.`
);
}
throw new ValidationError(
`HTTP request failed: ${message}`
);
}
]
}
} );// GET request
const response = await client.get( 'https://api.example.com/data' );
const data = await response.json();
// POST request with JSON body
const response = await client.post( 'https://api.example.com/submit', {
json: { field: 'value' }
} );
// HEAD request (check URL accessibility)
const response = await client.heThe open-source TypeScript framework for building AI workflows and agents. Designed for Claude Code — describe what you want, Claude builds it, with all the best practices already in place. One framework.
Implement an Output SDK workflow from a plan document. Use when the user asks to build, implement, or code a workflow from an…
View, edit, and set encrypted credentials in an Output.ai project. Use when adding secrets, updating API keys, verifying…
Wire encrypted credentials to environment variables using the credential: convention. Use when setting up LLM provider keys…
Initialize encrypted credentials for an Output.ai project. Use when setting up credentials for the first time, adding…
Debug Output SDK workflow issues. Use when user reports a workflow failing, erroring, hanging, producing wrong results, or asks…
Use the Agent class for multi-step tool loops, conversation history, streaming progress, and reusable LLM agents. Use when…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.