with one click
output-dev-prompt-file
// Create .prompt files for LLM operations in Output SDK workflows. Use when designing prompts, configuring LLM providers, or using Liquid.js templating.
// Create .prompt files for LLM operations in Output SDK workflows. Use when designing prompts, configuring LLM providers, or using Liquid.js templating.
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.
Create offline evaluation tests for Output SDK workflows using @outputai/evals. Use when implementing test evaluators with verify(), creating dataset YAML files, building eval workflows, or running workflow tests via CLI.
Create shared HTTP clients in src/shared/clients/ for Output SDK workflows. Use when integrating external APIs, creating service wrappers, or standardizing HTTP operations.
Pick the right LLM model for an Output SDK prompt file. Use when writing a new .prompt file, reviewing a model choice, or upgrading a stale model. Walks through priority (reasoning/balance/speed/cost), provider selection, and a live lookup against the Vercel AI Gateway model index.
Create .md skill files for Output framework's lazy-loaded instruction system. Use when adding skills to prompts, configuring skill loading, or debugging skill resolution.
Bulk-upgrade the model field across .prompt files to the latest version of each prompt's existing family. Use when prompt models have drifted (eg sonnet-4 ā sonnet-4-6), after a long pause between framework updates, or as part of a periodic model-freshness pass. Within-family only ā never changes provider or tier.
| name | output-dev-prompt-file |
| description | Create .prompt files for LLM operations in Output SDK workflows. Use when designing prompts, configuring LLM providers, or using Liquid.js templating. |
| allowed-tools | ["Read","Write","Edit"] |
This skill documents how to create .prompt files for LLM operations in Output SDK workflows. Prompt files use YAML frontmatter for configuration and Liquid.js templating for dynamic content.
Prompt files are stored INSIDE the workflow folder:
src/workflows/{workflow-name}/
āāā workflow.ts
āāā steps.ts
āāā types.ts
āāā prompts/
āāā analyzeContent@v1.prompt
āāā generateSummary@v1.prompt
āāā extractData@v2.prompt
Important: Prompts are workflow-specific and live inside the workflow folder, NOT in a shared location.
{promptName}@v{version}.prompt
Examples:
generateImageIdeas@v1.promptanalyzeContent@v1.promptsummarizeText@v2.promptThe version suffix (@v1, @v2) allows for prompt versioning without breaking existing code.
Picking a model? See
output-dev-model-selectionfor the current decision tree and AI Gateway lookup script. Examples below show concrete IDs as of 2026-05-04 ā refresh them with that skill.
---
provider: anthropic
# current as of 2026-05-04 ā run output-dev-model-selection for the latest
model: claude-sonnet-4-6
temperature: 0.7
maxTokens: 4096
---
<system>
System instructions go here.
</system>
<user>
User message with {{ variable }} placeholders.
</user>
---
provider: anthropic # LLM provider: anthropic, openai, vertex
# current as of 2026-05-04 ā run output-dev-model-selection for the latest
model: claude-sonnet-4-6
---
All prompt files in a workflow should use the same provider unless the user explicitly requests otherwise. Mixing providers (e.g., some prompts using anthropic and others using openai) requires the user to have API keys for all providers, which causes runtime failures if they don't.
When no existing prompts dictate a provider, default to anthropic. For the model itself, see output-dev-model-selection ā it walks priority (reasoning/balance/speed/cost), provider lookup, and produces a current model ID.
---
provider: anthropic
# current as of 2026-05-04 ā run output-dev-model-selection for the latest
model: claude-sonnet-4-6
temperature: 0.7 # 0.0 to 1.0, default varies by provider
maxTokens: 4096 # Maximum output tokens
providerOptions: # Provider-specific options
thinking:
type: enabled
budgetTokens: 2000
---
Each example below pins a model that was current as of 2026-05-04. Run
output-dev-model-selectionwhen picking or refreshing.
---
provider: anthropic
model: claude-sonnet-4-6
temperature: 0.7
maxTokens: 8192
---
---
provider: anthropic
model: claude-sonnet-4-6
temperature: 0.7
maxTokens: 32000
providerOptions:
thinking:
type: enabled
budgetTokens: 2000
---
---
provider: openai
# current as of 2026-05-04 ā run output-dev-model-selection for the latest
model: gpt-5-5
temperature: 0.7
maxTokens: 4096
---
---
provider: vertex
# current as of 2026-05-04 ā run output-dev-model-selection for the latest
model: gemini-3-pro
temperature: 0.7
maxTokens: 8192
---
Use XML-style tags to define message roles:
<system>
You are an expert at analyzing technical content.
Your responses should be clear and structured.
</system>
<user>
Please analyze the following content:
{{ content }}
</user>
<assistant>
I'll analyze this content step by step...
</assistant>
<user>
Analyze this content about {{ topic }}:
{{ content }}
Generate {{ numberOfIdeas }} ideas.
</user>
<system>
You are an expert content analyzer.
{% if colorPalette %}
**Color Palette Constraints:** {{ colorPalette }}
{% endif %}
{% if artDirection %}
**Art Direction Constraints:** {{ artDirection }}
{% endif %}
</system>
<user>
Analyze each of these items:
{% for item in items %}
- {{ item.name }}: {{ item.description }}
{% endfor %}
</user>
<user>
Generate {{ numberOfIdeas | default: 3 }} ideas for {{ topic }}.
</user>
Based on a real prompt file (generateImageIdeas@v1.prompt):
---
provider: anthropic
# current as of 2026-05-04 ā run output-dev-model-selection for the latest
model: claude-sonnet-4-6
temperature: 0.7
maxTokens: 32000
providerOptions:
thinking:
type: enabled
budgetTokens: 2000
---
<system>
You are an expert at creating structured, precise infographic prompts optimized for Gemini's image generation model.
Your task is to generate prompts for informational infographics that illustrate key concepts from the provided content.
CRITICAL RULES you MUST follow:
- Use Markdown dashed lists to specify constraints
- Use ALL CAPS for "MUST" requirements to ensure strict adherence
- Include specific compositional constraints (e.g., rule of thirds, lighting)
- Always include negative constraints to prevent unwanted elements
- Keep each infographic focused on ONE clear concept
{% if colorPalette %}
**Color Palette Constraints:** {{ colorPalette }}
{% endif %}
{% if artDirection %}
**Art Direction Constraints:** {{ artDirection }}
{% endif %}
</system>
<user>
Generate {{ numberOfIdeas }} structured infographic prompts based on key topics from this content.
<content>
{{ content }}
</content>
Each prompt MUST follow this structure:
Create an infographic about [specific topic]. The infographic MUST follow ALL of these constraints:
- The infographic MUST use the reference images as a visual style guide
- The composition MUST follow the rule of thirds for visual balance
- The infographic MUST use clean, minimal design with simple lines and shapes
{% if colorPalette %}- The color palette MUST strictly follow: {{ colorPalette }}{% endif %}
{% if artDirection %}- The art direction MUST strictly follow: {{ artDirection }}{% endif %}
- NEVER include any watermarks, logos, or decorative overlays
- NEVER use generic AI art buzzwords like "hyperrealistic"
Focus on the most important concepts that would benefit from visual explanation.
</user>
The variables field in generateText and Agent only accepts string | number | boolean values. You cannot pass arrays or objects as variables -- TypeScript will reject them.
When your step has complex data (arrays, objects), pre-format it into a string before passing it as a variable:
// WRONG - arrays/objects as variables cause TS2322
const { output } = await generateText( {
prompt: 'rank@v1',
variables: {
stories: storyArray, // Type error: not assignable to string | number | boolean
interests: interestArray // Type error: not assignable to string | number | boolean
}
} );
// CORRECT - pre-format complex data into strings
const storiesText = stories.map( s =>
`- ${s.title} (score: ${s.score}, by: ${s.author})`
).join( '\n' );
const interestsText = interests.join( ', ' );
const { output } = await generateText( {
prompt: 'rank@v1',
variables: {
stories: storiesText, // string - OK
interests: interestsText // string - OK
}
} );
The prompt template then uses the pre-formatted string directly with {{ stories }} instead of Liquid loops. This is simpler and avoids the type constraint entirely.
import { generateText, Output } from '@outputai/llm';
import { z } from '@outputai/core';
const { output } = await generateText( {
prompt: 'generateImageIdeas@v1', // References prompts/generateImageIdeas@v1.prompt
variables: {
content: 'Solar panel technology explained...',
numberOfIdeas: 3,
colorPalette: 'blue and green tones',
artDirection: 'minimalist style'
},
output: Output.object( {
schema: z.object( {
ideas: z.array( z.string() )
} )
} )
} );
// output contains { ideas: [...] }
import { generateText } from '@outputai/llm';
const { result } = await generateText( {
prompt: 'summarize@v1',
variables: {
content: 'Long article text...',
maxLength: 200
}
} );
// result contains the generated text string
Prompts can load skill files that provide lazy-loaded instructions to the LLM. Skills keep the initial context small while giving the LLM access to deep expertise on demand. See output-dev-skill-file for the full guide on creating skill files.
The simplest approach is colocated auto-discovery. Place .md files in a skills/ folder next to your prompt file:
src/workflows/{workflow-name}/
āāā prompts/
āāā writing_assistant@v1.prompt
āāā skills/
āāā clarity_guidelines.md
āāā structure_guide.md
The prompt file does not need any special configuration. Output auto-discovers the skills/ directory and injects a load_skill tool the LLM can call. Mention load_skill in the system message so the LLM knows to use it:
<system>
You are an expert technical writing assistant.
Use load_skill to get the full instructions for any skill before applying it.
</system>
You can also list skill paths explicitly in frontmatter, or create inline skills in code. See output-dev-skill-file for all three methods.
Prompts work with both generateText and the Agent class. Use Agent for multi-step tool loops and stateful conversations. See output-dev-agent-class for the full guide.
import { Agent, Output } from '@outputai/llm';
const agent = new Agent( {
prompt: 'writing_assistant@v1',
variables: {
content_type: 'documentation',
focus: 'clarity',
content: input.content
},
output: Output.object( { schema: reviewSchema } ),
maxSteps: 5
} );
const { output } = await agent.generate();
When a step uses Output.object() with generateText, the Zod schema is automatically sent to the LLM provider as a tool definition. The LLM already knows the exact JSON shape it must return. Do not also specify the schema in the prompt.
This is a best practice documented by multiple LLM providers:
.describe() on fields is how you guide the model's output. The SDK automatically transforms unsupported constraints into field descriptions.Why this matters:
When Output.object() is used, do not include any of these in the prompt:
## Output Format sections describing the JSON shape<!-- WRONG - prompt duplicates what Output.object() already sends -->
<system>
## Output Format
Return a JSON object with this shape:
{
"title": "string",
"summary": "string",
"tags": ["string"]
}
</system>
Use the prompt for quality expectations, domain knowledge, and content guidance -- things the schema cannot express:
<!-- CORRECT - prompt focuses on content quality, not structure -->
<system>
Write a concise, specific title (under 80 characters).
The summary should capture the main argument, not just the topic.
Choose tags from the reader's domain -- avoid generic terms like "technology".
</system>
.describe() on Schema Fields InsteadThe right place to communicate field-level expectations is on the schema itself, using .describe(). LLM providers use these descriptions when generating output:
// In types.ts -- .describe() guides the LLM on each field
const ArticleSummarySchema = z.object( {
title: z.string().describe( 'Concise title under 80 characters' ),
summary: z.string().describe( 'One-sentence summary capturing the main argument' ),
tags: z.array( z.string() ).describe( '3-5 domain-specific tags, avoid generic terms' )
} );
The schema handles structure AND field-level guidance; the prompt handles task framing, methodology, and quality standards.
If generateText is called without Output.object() (plain text output), then including output format instructions in the prompt is appropriate since no schema is sent to the provider.
<system>
CRITICAL RULES you MUST follow:
- Rule 1
- Rule 2
- NEVER do X
- ALWAYS do Y
</system>
<user>
Analyze the following:
<content>
{{ content }}
</content>
<requirements>
{{ requirements }}
</requirements>
</user>
<system>
You analyze sentiment. Return: positive, negative, or neutral.
</system>
<user>
"I love this product!"
</user>
<assistant>
positive
</assistant>
<user>
"{{ text }}"
</user>
When making significant changes, create a new version:
analyzeContent@v1.prompt - OriginalanalyzeContent@v2.prompt - Improved with better examplesUpdate the step to use the new version:
prompt: 'analyzeContent@v2' // Changed from v1
{% if optionalField %}
Additional context: {{ optionalField }}
{% endif %}
The model lines in the patterns below were current as of 2026-05-04. Refresh via
output-dev-model-selectionwhen copying into a new prompt.
---
provider: anthropic
model: claude-sonnet-4-6
temperature: 0.3
---
<system>
You are a content classifier. Categorize content into exactly one category.
Available categories: {{ categories | join: ", " }}
</system>
<user>
Classify this content:
{{ content }}
</user>
---
provider: anthropic
model: claude-sonnet-4-6
temperature: 0.2
---
<system>
You extract structured data from text. Be precise and only include information explicitly stated.
</system>
<user>
Extract the following fields from this text:
{% for field in fields %}
- {{ field }}
{% endfor %}
Text:
{{ text }}
</user>
---
provider: anthropic
# current as of 2026-05-04 ā run output-dev-model-selection for the latest
model: claude-sonnet-4-6
temperature: 0.8
---
<system>
You are a creative writer. Generate engaging content based on the given parameters.
</system>
<user>
Generate {{ count }} {{ type }} about {{ topic }}.
Requirements:
{{ requirements }}
</user>
prompts/ folder inside workflow directory{promptName}@v{version}.promptprovider and model<system>, <user>, <assistant>){{ variableName }} syntax{% if %}...{% endif %} syntaxOutput.object() (schema handles structure)output-dev-skill-file - Creating skill files for promptsoutput-dev-agent-class - Using the Agent class with promptsoutput-dev-step-function - Using prompts in step functionsoutput-dev-evaluator-function - Using prompts in evaluatorsoutput-dev-folder-structure - Understanding prompts folder locationoutput-dev-workflow-function - Orchestrating LLM-powered stepsoutput-eval-judge-prompt ā Methodology for designing effective LLM judge prompts