Agent skill · Content & Marketing

ai-structured-output

Generate type-safe AI content using Gemini structured output with Zod validation and Code Execution Tool. Use when building AI generation functions that need guaranteed output format.

majiayu000github.com/majiayu000GitHub ↗
claude-codecan modify filesMIT
Install
npx skills add majiayu000/claude-skill-registry --skill ai-structured-output --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 14 KB
Bundled scripts: none
Allowed tools: ReadEditWriteGrepGlob
Path: skills/ai-llm/ai-structured-output/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# AI Structured Output Patterns This skill documents patterns for generating type-safe, validated AI content using Google Gemini with Vercel AI SDK. ## When to Use This Skill - Generating structured content (blog posts, reports, summaries) with guaranteed format - Need type-safe LLM output with TypeScript inference - Preventing hallucinations in data analysis through code execution - Creating reusable AI generation functions for workflows - Building multi-step AI pipelines with separate analysis and generation phases ## Architecture Overview The recommended architecture uses a **2-step generation flow**: ``` Step 1: Analysis (Accuracy) Step 2: Structured Output (Presentation) ┌─────────────────────────────┐ ┌─────────────────────────────┐ │ generateText() │ │ generateObject() │ │ + Code Execution Tool │ ──▶ │ + Zod Schema │ │ + Extended Thinking │ │ + Field Descriptions │ │ = Accurate calculations │ │ = Type-safe output │ └─────────────────────────────┘ └─────────────────────────────┘ ``` **Why 2 steps?** - Step 1 focuses on **accuracy**: Code execution prevents calculation errors - Step 2 focuses on **format**: Zod schema ensures consistent structure - Separation allows optimisati

What's inside
Steps it walks through
  1. When to Use This Skill
  2. Architecture Overview
  3. 2-Step Generation Implementation
  4. Complete Example
  5. Code Execution Tool
  6. Configuration
  7. Why It Matters
  8. When to Use
  9. Example: Data Analysis with Code Execution
  10. Extended Thinking Configuration
  11. Example: Selective Extended Thinking
  12. Zod Schema Design Patterns
  13. Field Descriptions
  14. Type Inference
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the ai-structured-output skill do?

Generate type-safe AI content using Gemini structured output with Zod validation and Code Execution Tool. Use when building AI generation functions that need guaranteed output format.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill ai-structured-output --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going