Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
La commande reste sur une seule ligne. Faites défiler horizontalement pour la vérifier avant de la copier.
Vous préférez une copie locale ? Téléchargez les fichiers actuellement disponibles dans SkillsMP.
Affichage de SKILL.md
SKILL.md
Instructions source · Aperçu en lecture seule
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"]
Creating Step Functions
Overview
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.
When to Use This Skill
Implementing I/O operations for a workflow
Adding HTTP client integrations
Implementing LLM-powered steps
Handling errors with FatalError and ValidationError
Creating reusable step components
File Organization
Option 1: Flat File (Default)
For smaller workflows, use a single steps.ts file:
src/workflows/{workflow-name}/
├── workflow.ts
├── steps.ts # All steps in one file
├── types.ts
└── ...
Option 2: Folder-Based (Large workflows)
For larger workflows with many steps, use a steps/ folder:
// CORRECT - Import from @outputai/coreimport { step, z, FatalError, ValidationError } from'@outputai/core';
// WRONG - Never import z from zodimport { z } from'zod';
HTTP Client Import
// CORRECT - Use @outputai/http wrapperimport { createKyClient } from'@outputai/http';
// WRONG - Never use axios directlyimport axios from'axios';
Related Skill: output-error-http-client
LLM Client Import
// CORRECT - Use @outputai/llm wrapperimport { generateText, aiSdk } from'@outputai/llm';
// WRONG - Never call LLM providers directlyimportOpenAIfrom'openai';
When a non-HEAD request only uses response metadata, such as response.url, response.status, or headers, cancel the
unused body in a finally block. Responses read with .json(), .text(), etc. are already consumed.
Related Skill: output-dev-http-client-create for creating shared clients
LLM Operations
Important: Define LLM Schemas in types.ts
Schemas used in aiSdk.Output.object()must be defined in types.ts and imported -- never defined inline in step functions. Inline schemas lead to duplication, drift between the step's outputSchema and the LLM schema, and make it harder to maintain types.
The variables field accepts scalars, nested objects, and arrays. Use Liquid loops and dot notation in the prompt when it owns presentation; pre-format in the step when the exact rendered text is application logic.
The returned promise rejects on stream failures, allowing Temporal to retry the activity. Use streamText() only when direct stream access is required; capture onError and throw the captured error after consumption. See output-dev-llm-streaming for complete patterns.
Error Handling
FatalError (Non-Retryable)
Use FatalError for permanent failures that should not be retried: