plugins/openai-developers/skills/agents-sdk/SKILL.md
Build, run, deploy, and evaluate OpenAI Agents SDK apps from Codex. Use when the user asks to create or adapt an Agents SDK app, build from a prompt or Codex thread, prepare a runnable agent prototype, add a focused eval harness, or deploy locally through the Agents SDK Deployment Manager.
npx skillsauth add openai/plugins agents-sdkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill to turn an idea, repo, or prior Codex thread into a small runnable Agents SDK app. Verify it locally, then deploy it through the local Deployment Manager when the user wants a running service. Prefer Python unless the user asks for TypeScript.
SandboxAgent, workspace manifests, shell/file access, skills, or sandbox backend behavior.Classify the request before editing:
Agents SDK apps need OPENAI_API_KEY to run. Before building, running, or testing an app that calls the OpenAI API, use the openai-platform-api-key skill in this plugin as the credential gate. Follow that skill's confirmation flow and never print, summarize, or commit secret values.
Inspect the target repo.
Read README.md, dependency files, app entrypoints, existing examples, and any domain-specific skills/ or policy files.
Define the app contract. Capture the agent goal, input shape, expected output, tools, state, approval gates, and the local command that proves the workflow.
Set up dependencies using the repo's existing package manager.
For Python projects, prefer uv; add openai-agents when the project owns dependencies.
Start with one agent.
Use a single Agent with clear static instructions and Runner.run until the workflow proves it needs specialists, handoffs, structured outputs, or sandbox execution.
Add tools deliberately.
Use @function_tool for deterministic local actions such as lookups, calculations, file transforms, API calls, or validation. Keep side effects narrow and schemas explicit.
Add sandbox only for workspace tasks.
Use SandboxAgent when the agent must inspect files, run shell commands, use workspace skills, or create artifacts in an isolated environment. Keep ordinary business workflows on normal Agent plus tools.
Make it runnable. Provide a local smoke command, sample input, and expected observable output. If there is a UI, wire it to the agent path and verify the core workflow, not just rendering.
For HTTP apps that may be deployed, make uv run python main.py start the web service when PORT is present, keep CLI-only smoke behavior behind explicit arguments or the no-PORT path, and expose /health for readiness.
For every new prototype or substantial app build, prefer:
<project>/
agent.py # Agent definition, tools, and run helper
main.py # API/server/CLI entrypoint if needed
pyproject.toml # includes openai-agents if the project owns deps
docs/
prompt.md # runtime prompt or instructions used by the app agent
agent-interactions.png
agent-sequence.png
data/ # small sample inputs or fixtures
skills/<domain>/ # optional domain instructions or reusable policy
README.md # local run instructions if the project already uses READMEs
Generate diagrams directly as PNG files. Do not create SVG diagram sources or rely on browser screenshots of SVGs unless the user explicitly asks for editable vector sources. For one-off diagram generation, prefer a small script under scripts/generate_diagrams.py and run extra drawing dependencies with uv run --no-project --with ... so the app dependency file stays focused.
When the source is prior Codex work, create a compact brief before building:
Prefer the newest user direction when threads conflict. Keep secrets out of the brief and mention missing environment variable names only.
If the user already asked to build after planning, continue from the brief into the build workflow. Otherwise ask for approval before implementing.
Add evals when requested. Default to a local harness that exercises the real agent workflow rather than a mock or contract-only path.
Before creating or changing evals, read the Agents guide and Agent evals guide. Read trace grading, evals, and graders docs before generating platform eval configs, grader JSON, or dataset upload scripts.
Prefer an evals/ folder unless the repo already has a stronger convention:
<project>/
evals/
README.md
cases.jsonl
graders.py
run_local.py
results/
.gitignore
Design a small case matrix around meaningful behavior: happy path, missing evidence, escalation boundary, required or forbidden tool calls, approval gates, state updates, and regressions from observed bugs. Grade behavior such as structured output, tool calls, handoffs, guardrails, trace IDs, event logs, state changes, and approval behavior instead of volatile IDs or exact prose unless wording is contractual.
evals/run_local.py should load cases, add the app root to sys.path, run each case through the app's real agent path, isolate or reset state, require needed environment variable names up front, write evals/results/latest.json, and exit non-zero on failures.
Use the Deployment Manager from openai-cookbook for local deployments. Default to local-docker unless the user or app requires a different local target.
Check deployable app signals:
main.py;pyproject.toml;openai-agents in the app dependencies;PORT support for local app startup, with uv run python main.py starting the HTTP service when PORT is set;/health readiness endpoint;SANDBOX_BACKEND support for sandbox-backed apps;docs/prompt.md, docs/agent-interactions.png, and docs/agent-sequence.png for manager app details.Resolve the manager directory.
Prefer DEPLOYMENT_MANAGER_ROOT when set. Otherwise use $HOME/code/openai-cookbook/examples/agents_sdk/deployment_manager. If the cookbook checkout is missing, clone https://github.com/openai/openai-cookbook. If it exists, update it with git pull --ff-only unless the user asked to avoid updating local checkouts. Stop and report local changes or diverged history instead of forcing the checkout. Verify $MANAGER_DIR/Makefile exists before deploying.
Deploy through the manager:
make -C "$MANAGER_DIR" deploy PROJECT_PATH=<absolute-app-path>
Useful options:
make -C "$MANAGER_DIR" deploy PROJECT_PATH=/path/to/app APP_PORT=8421
make -C "$MANAGER_DIR" deploy PROJECT_PATH=/path/to/app TARGET=local-process
make -C "$MANAGER_DIR" deploy PROJECT_PATH=/path/to/app SANDBOX_BACKEND=docker
make -C "$MANAGER_DIR" start
make -C "$MANAGER_DIR" health
Let the manager own extraction and deployment records.
The helper imports the project, creates or reuses a matching deployment, starts it, and prints JSON with manager_url, deployment, and app_url. For local-docker, it may generate or reuse an app-level Dockerfile. If that changes the app worktree, report it and do not revert user files.
Verify the result.
Check manager health, the app /health readiness endpoint, and deployment sessions/containers when available.
curl -fsS http://127.0.0.1:8732/api/health
curl -fsS <app-url>/health
curl -fsS http://127.0.0.1:8732/api/deployments/<deployment-id>/sessions
curl -fsS http://127.0.0.1:8732/api/deployments/<deployment-id>/containers
Run git -C <app-path> status --short when the app path is inside a git checkout so generated Dockerfiles or other local edits are visible.
Before handing back:
development
Use when the user wants to spin up / create / launch / provision a DigitalOcean droplet (or "a remote dev box on DO") and connect to it from Codex as a remote SSH workspace.
data-ai
Search through Microsoft Teams chats or channels, triage unread or recent activity, draft follow-ups, and manage Planner tasks through connected Teams data.
tools
Motion / animation context for the `use_figma` MCP tool — animating Figma nodes via manual keyframes, animation styles, easing, and timeline duration. Load alongside figma-use whenever a task involves adding, editing, or inspecting animation on a node.
development
SwiftUI ↔ Figma translation. Use whenever the user mentions Swift, SwiftUI, iOS, iPhone, or iPad — in EITHER direction — translating a Figma design into SwiftUI (design → code), or pushing SwiftUI views / screens / tokens back into a Figma file (code → design). Triggers on phrases like 'implement this Figma design in SwiftUI', 'build this screen in Swift', 'push this SwiftUI view to Figma', 'mirror my Swift code in a Figma file', or whenever a Figma URL appears alongside `.swift` files / an `.xcodeproj`. Routes to a direction-specific reference doc; loads alongside `figma-use` for the code → design path.