Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
bjornmelin avatar

Codex Sdk

  • 5 installs
  • 5 repo stars
  • Updated August 5, 2026
  • bjornmelin/dev-skills

codex-sdk is a skill giving architect-level guidance and scripts for building agentic coding systems with the OpenAI Codex SDK and CLI.

About

codex-sdk gives architect-level guidance, workflows, and scripts for building agentic coding systems with OpenAI Codex. A developer uses it for the Codex SDK (@openai/codex-sdk) threads and streaming, Codex CLI automation (codex exec), MCP server usage, multi-agent orchestration via the OpenAI Agents SDK, and durable state in SQLite. It emphasizes structured outputs, audit trails, and safe-by-default sandbox and approval patterns.

  • Architect-level guidance for building agentic coding systems with the OpenAI Codex SDK and CLI
  • Covers codex exec JSONL, @openai/codex-sdk threads/streaming, and codex mcp-server orchestration
  • Uses SQLite for durable state, audit logs, and resumable runs with safe-by-default sandboxing

Codex Sdk by the numbers

  • 5 all-time installs (skills.sh)
  • Ranked #13,046 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

codex-sdk capabilities & compatibility

Capabilities
agent orchestration · codex automation · mcp server · durable state · audit logging
Works with
openai
Use cases
orchestration · memory · planning · code review
Pricing
Bring your own API key
From the docs

What codex-sdk says it does

Build reliable, auditable, multi-step coding workflows that scale from a single run to multi-agent orchestration.
SKILL.md
**Need a scriptable one-shot in CI or cron?** → use `codex exec`
SKILL.md
SQLite is the simplest reliable substrate for:
SKILL.md
npx skills add https://github.com/bjornmelin/dev-skills --skill codex-sdk

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs5
repo stars5
Last updatedAugust 5, 2026
Repositorybjornmelin/dev-skills

What it does

Build reliable multi-step and multi-agent coding workflows with the OpenAI Codex SDK and CLI.

Who is it for?

Building multi-step, auditable, and multi-agent coding workflows with Codex.

Skip if: Simple one-off prompts where full orchestration and durable state are unnecessary.

When should I use this skill?

Building agentic coding systems with the Codex SDK, automating codex exec, running codex mcp-server, or orchestrating multi-agent workflows.

What you get

Reliable, auditable multi-step Codex workflows with JSONL-to-SQLite audit logs and gated multi-agent handoffs.

  • ExecPlans for durable planning
  • JSONL-to-SQLite audit pipeline
  • multi-agent orchestration shape

By the numbers

  • 4-branch workflow decision tree
  • 6-step default safe workflow
  • 12 reference files

Files

SKILL.mdMarkdownGitHub ↗

Codex SDK + Codex CLI (master skill)

Build reliable, auditable, multi-step coding workflows that scale from a single run to multi-agent orchestration.

ExecPlans (durable planning)

For multi-hour work, keep intent durable across compaction/restarts using an ExecPlan:

  • Contract: references/execplans.md
  • Template + rules: .agent/PLANS.md (use scripts/init_agent_workspace.py to bootstrap a repo)
  • ExecPlan skeleton: assets/templates/execplan.md (or generate a file with scripts/new_execplan.py)

Workflow decision tree

1. Need a scriptable one-shot in CI or cron? → use codex exec (references/codex-cli-exec.md) 2. Need a server-side app controlling Codex programmatically? → use @openai/codex-sdk (references/codex-sdk-typescript.md) 3. Need multi-agent orchestration or dynamic tools? → run codex mcp-server and orchestrate via OpenAI Agents SDK (references/mcp-and-agents-sdk.md) 4. Need durability across runs (memory, caching, resumable state)? → persist run metadata and event logs in SQLite (references/state-memory-sqlite.md)

Default workflow (safe + production-friendly)

1. Inventory inputs (repo root, diffs, failing commands, constraints). 2. Choose sandbox + approvals (least privilege; default to read-only). 3. Plan in explicit steps (short, verifiable; include stop conditions). 4. Use structured outputs (JSON Schema) and validate before acting. 5. Record an audit trail (JSONL events → SQLite). 6. Verify (re-run tests/lint/format; stop).

Durable state and “memory” (SQLite)

SQLite is the simplest reliable substrate for:

  • recording every codex exec --json event as an immutable audit log
  • indexing runs by repo, branch, and purpose
  • storing threadId so runs can resume deterministically
  • caching expensive analysis artifacts (diff summaries, inventories, dependency graphs)

Use the bundled scripts

  • Initialize a DB:
  • python3 scripts/codex_jsonl_to_sqlite.py --db codex-runs.sqlite --init
  • Ingest a JSONL run:
  • codex exec --json "<prompt>" | python3 scripts/codex_jsonl_to_sqlite.py --db codex-runs.sqlite --run-label "ci-autofix"
  • Summarize runs:
  • python3 scripts/codex_sqlite_report.py --db codex-runs.sqlite --latest

Multi-agent orchestration (recommended shape)

Use:

  • a single orchestrator responsible for gating and artifact checks
  • multiple scoped worker agents with strict deliverables
  • structured outputs at boundaries (handoff payloads, review findings, test results)
  • traces/telemetry to debug and tune

Details: references/mcp-and-agents-sdk.md

Safety and policy

Prefer:

  • analysis-only: sandbox: read-only, approval-policy: never
  • controlled edits: sandbox: workspace-write, approval-policy: on-request / on-failure
  • block risky commands with execpolicy rules (references/safety-and-execpolicy.md)

Resources

references/

  • references/codex-sdk-typescript.md – SDK patterns (threads, streaming, schemas)
  • references/codex-cli-exec.md – CLI patterns (JSONL, schema files, resume)
  • references/mcp-and-agents-sdk.md – Codex as MCP server + multi-agent orchestration
  • references/agents-sdk-consistent-workflows.md – gated handoffs + traces with Codex MCP + Agents SDK
  • references/execplans.md – ExecPlans for long-running work across compaction
  • references/state-memory-sqlite.md – SQLite schema + memory/caching patterns
  • references/safety-and-execpolicy.md – sandboxing, approvals, prompt-injection defenses
  • references/codex-config-knobs.md – config keys and feature flags that matter
  • references/orchestration-patterns.md – planner/executor/verifier and orchestrator/worker patterns
  • references/rag-and-memory.md – SQLite-first shared memory and RAG guidance
  • references/context-personalization.md – state + memory notes personalization patterns (Agents SDK)

scripts/

  • scripts/codex_jsonl_to_sqlite.py – ingest Codex JSONL into SQLite
  • scripts/codex_sqlite_report.py – summarize runs from SQLite
  • scripts/init_agent_workspace.py – create .agent/AGENTS.md + .agent/PLANS.md from templates
  • scripts/new_execplan.py – generate execplans/execplan-*.md from the ExecPlan template

assets/

  • assets/templates/ – copy/paste templates (ExecPlan, prompts, schemas)
  • assets/templates/agents-sdk/ – Agents SDK starter snippets (MCP stdio, sessions, personalization)

Related skills

FAQ

When should I use codex exec vs the SDK?

Use codex exec for scriptable one-shots in CI or cron and @openai/codex-sdk for a server-side app controlling Codex programmatically.

How does it handle durable state?

It persists run metadata and JSONL event logs in SQLite for immutable audit logs, run indexing, and deterministic resume via threadId.

AI & Agent Buildingagentsautomationllm

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.