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…
Fix Zod schema import issues in Output SDK workflows. Use when seeing "incompatible schema" errors, type errors at step boundaries, schema validation failures, or when schemas don't match between steps.
Claude Code
$ npx -y skills add growthxai/output --skill output-error-zod-import --agent claude-code
Codex
$ npx skills add growthxai/output --skill output-error-zod-import -a codex -y
Cursor
$ npx skills add growthxai/output --skill output-error-zod-import -a cursor -y
Gemini CLI
$ npx skills add growthxai/output --skill output-error-zod-import -a gemini-cli -y
GitHub Copilot
$ npx skills add growthxai/output --skill output-error-zod-import -a github-copilot -y
OpenCode
$ npx skills add growthxai/output --skill output-error-zod-import -a opencode -y
Windsurf
$ npx skills add growthxai/output --skill output-error-zod-import -a windsurf -y
name: output-error-zod-import description: Fix Zod schema import issues in Output SDK workflows. Use when seeing "incompatible schema" errors, type errors at step boundaries, schema validation failures, or when schemas don't match between steps. allowed-tools: [Bash, Read]
This skill helps diagnose and fix a common issue where Zod schemas are imported from the wrong source. Output SDK requires schemas to be imported from `@outputai/core`, not directly from `zod`.
You're seeing:
The issue occurs when you import `z` from `zod` instead of `@outputai/core`. While both provide Zod schemas, they create different schema instances that aren't compatible with each other within the Output SDK context.
**Why this matters**: Output SDK uses a specific version of Zod internally for serialization and validation. When you use a different Zod instance, the schemas are technically different objects even if they define the same shape.
Error: Incompatible schema types Error: Schema validation failed: expected compatible Zod instance TypeError: Cannot read property 'parse' of undefined
// WRONG: Importing from 'zod' directly
import { z } from 'zod';
const inputSchema = z.object( {
name: z.string()
} );Search your codebase for incorrect imports:
grep -r "from 'zod'" src/ grep -r 'from "zod"' src/
Change all imports from:
// Wrong
import { z } from 'zod';To:
// Correct
import { z } from '@outputai/core';Check your imports don't accidentally use zod elsewhere:
grep -r "import.*zod" src/
All matches should show `@outputai/core`, not `zod`.
// src/workflows/my-workflow/steps/process.ts
import { z } from 'zod'; // Wrong!
import { step } from '@outputai/core';
export const processStep = step( {
name: 'processData',
inputSchema: z.object( {
id: z.string()
} ),
outputSchema: z.object( {
result: z.string()
} ),
fn: async input => {
return { result: `Processed ${input.id}` };
}
} );// src/workflows/my-workflow/steps/process.ts
import { z, step } from '@outputai/core'; // Correct!
export const processStep = step( {
name: 'processData',
inputSchema: z.object( {
id: z.string()
} ),
outputSchema: z.object( {
result: z.string()
} ),
fn: async input => {
return { result: `Processed ${input.id}` };
}
} );# Should return no results grep -r "from 'zod'" src/ grep -r 'from "zod"' src/
npm run output:worker:build
npx output workflow run <workflowName> --input '<input>'
Add a rule to prevent direct zod imports:
// .eslintrc.js
module.exports = {
rules: {
'no-restricted-imports': [ 'error', {
paths: [ {
name: 'zod',
message: "Import { z } from '@outputai/core' instead of 'zod'"
} ]
} ]
}
};Configure your editor to auto-import from `@outputai/core`:
For VS Code, add to settings.json:
{
"typescript.preferences.autoImportFileExcludePatterns": ["zod"]
}Even one wrong import can cause issues:
import { z } from '@outputai/core';
import { z as zod } from 'zod'; // This causes problems!If a utility file uses the wrong import and is shared:
// utils/schemas.ts
import { z } from 'zod'; // Wrong! This affects all files using these schemas
export const idSchema = z.string().uuid();If using external Zod schemas, you may need to recreate them:
// Don't use: externalLibrary.schema // Instead: recreate the schema with @outputai/core's z
The 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.