kjuhwa/skills-hub/agent-structured-output

Claude Code and agent skill by kjuhwa/skills-hub

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Configure an agent to return a Pydantic model as its final output instead of plain text.

Install

npx vskill@latest install kjuhwa/skills-hub/agent-structured-output

SKILL.md

The same SKILL.md was published earlier as kjuhwa/skills-hub/agent-structured-output.

agent-structured-output

Set output_type on an Agent to a Pydantic BaseModel. The SDK enforces structured output and returns a typed instance via result.final_output_as(MyModel).

When to apply

When downstream code must parse the agent's reply (routing, classification, evaluation pipelines). Replaces fragile string parsing with typed data.

Core snippet

python
from pydantic import BaseModel
from agents import Agent, Runner
class OutlineCheckerOutput(BaseModel):
good_quality: bool
is_scifi: bool
outline_checker_agent = Agent(
name="outline_checker_agent",
instructions="Read the given story outline, and judge the quality. Also, determine if it is a scifi story.",
output_type=OutlineCheckerOutput,
)
async def main():
result = await Runner.run(outline_checker_agent, "A space opera about clones...")
output = result.final_output_as(OutlineCheckerOutput)
print(output.good_quality, output.is_scifi)

Key notes

  • result.final_output is the raw Pydantic model instance when output_type is set
  • Use result.final_output_as(MyModel) for type-checked access
  • The agent runs until it produces output matching the schema (strict JSON schema by default)
  • Works with nested models and optional fields

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/kjuhwa/skills-hub/agent-structured-output/badge)](https://verified-skill.com/skills/kjuhwa/skills-hub/agent-structured-output)

Something wrong with this skill or its page? Tell us.