Skip to content
developing-openai-agents-sdk-agents logo

Developing OpenAI Agents SDK Agents

developing-openai-agents-sdk-agents

Build, create, debug, review, implement, and optimize agentic AI applications using the OpenAI Agents SDK for TypeScript. Use when creating new agents, defining tools, implementing handoffs between agents, adding guardrails, debugging agent behavior, reviewing agent code, or orchestrating multi-a...

SKILL.md

Full skill instructions

Developing OpenAI Agents SDK Agents

Comprehensive workflow-driven skill for building production-ready agentic AI applications with the OpenAI Agents SDK.

<essential_principles>

Core Concepts

Agents are LLMs with structure: An agent combines an LLM with instructions (system prompt), tools (functions it can call), handoffs (delegation targets), and optional guardrails (validators).

Minimal abstractions: The SDK provides primitives (Agent, tool, run) rather than heavyweight frameworks. You compose behavior through code, not configuration.

Context injection: Tools and instructions receive RunContext, enabling dependency injection of user data, database connections, or other runtime context without global state.

Handoffs transfer ownership: When one agent hands off to another, the target agent becomes the active conversational participant. This differs from tools (manager pattern) where the calling agent maintains control.

Guardrails run in parallel: Input guardrails can validate user input concurrently with the LLM call, reducing latency. Output guardrails check responses before returning them.

Structured output is typed: Using Zod schemas for outputType gives you compile-time type safety and runtime validation of agent responses.

Human-in-the-loop is first-class: Tools with needsApproval create interruptions that your code handles explicitly, enabling approval workflows without special infrastructure.

Design Principles

Start simple, add complexity as needed: Begin with a single agent and basic tools. Add handoffs, guardrails, and orchestration only when requirements justify them.

Test with real LLM calls: Mocking LLMs hides emergent behavior. Use small models (gpt-4.1-mini) or cached prompts for fast iteration, but always test end-to-end.

Make instructions specific: Vague prompts ("be helpful") produce vague behavior. Specify the agent's role, available information, decision criteria, and output format.

Tools are for actions, not data: Don't create tools just to return static information. Put reference data in instructions or context. Tools should execute side effects or retrieve dynamic data.

Fail explicitly: Return error strings from tools rather than throwing exceptions. This lets the LLM see what went wrong and potentially retry with different parameters.

Trace everything: Enable tracing in development to understand agent decision-making. The SDK's built-in tracing shows tool calls, handoffs, and model reasoning.

</​essential_principles>

<intake>

What would you like to do with OpenAI Agents SDK?

Common activities:

  • Build a new agent or multi-agent system
  • Add tools (functions) to an existing agent
  • Implement agent handoffs (delegation)
  • Add guardrails (validation)
  • Debug agent behavior (unexpected actions, loops, errors)
  • Review or optimize existing agent code
  • Set up tracing and observability
  • Implement human-in-the-loop approval flows
  • Integrate with MCP servers
  • Structure agent output with Zod schemas

</​intake>

<routing>
User wants to...Route to workflow
Create a new agent from scratchworkflows/​build-new-agent.md
Add a tool (function) to an agentworkflows/​add-tool.md
Set up handoffs between agentsworkflows/​implement-handoff.md
Add validation (guardrails)workflows/​add-guardrails.md
Debug agent behaviorworkflows/​debug-agent.md
Review agent code qualityworkflows/​review-agent-code.md
Set up structured outputworkflows/​add-structured-output.md
Implement approval workflowsworkflows/​implement-human-approval.md
Add tracing/​observabilityworkflows/​enable-tracing.md
Choose orchestration patternworkflows/​choose-orchestration.md
Integrate MCP serversworkflows/​integrate-mcp.md
Optimize agent performanceworkflows/​optimize-agent.md

</​routing>

<reference_index>

Domain Knowledge References

</​reference_index>

<workflows_index>

Step-by-Step Workflows

Building

Architecting

Operating

</​workflows_index>

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View