toolsDetail.backToAllTools
toolsDetail.projectRecordtoolsDetail.categories.aiDevtoolsDetail.statuses.openSourcetoolsDetail.updatedOn

Agency Coding Agent

A ready-to-use template for building autonomous AI coding agents, powered by developer tools and APIs.

Agency Coding Agent is an open-source template for standing up your own autonomous coding assistant, similar in spirit to Lovable, Codex, or Cursor. It wires a GPT-5.1 model up to real developer tools — file editing, shell execution, task planning, image generation, and web search — so it can carry out multi-step coding work rather than just answer questions about code.

toolsDetail.overview

Calling a large language model and asking it to "write some code" only gets you text. What turns that into an agent that can actually build software is the tool layer around it: the ability to read and modify real files, run commands to test what it just wrote, keep track of a multi-step plan, and loop until the work is done. Agency Coding Agent is a template that provides exactly that layer, built on the Agency Swarm framework with GPT-5.1 as the underlying model.

The agent is configured with OpenAI's Apply Patch tool for precise, diff-based file edits, a shell execution tool for running commands and tests inside a workspace directory, a plan-management tool for tracking multi-step tasks, an image generation tool for producing web assets on the fly, and web search for pulling in documentation or solutions mid-task. Together these let the agent scaffold a project, write and revise files, execute and observe the results, and adjust course — the same basic loop used by dedicated coding-agent products, exposed here as a template you can run yourself or extend.

A meaningful amount of the value is in the details most people underestimate: the shell tool auto-detects commands that would start a long-running dev server or watcher and forces them into the background instead of hanging the agent, applies non-interactive flags to common scaffolding commands (npm create, expo, django migrations, and similar) so the agent doesn't stall waiting on a prompt it can't answer, and enforces both a hard timeout and an inactivity timeout so a stuck process doesn't block the whole run. File edits are sandboxed to a workspace directory, with path resolution that rejects any operation that tries to escape it.

The repository ships as a Python project (Agency Swarm plus FastAPI) with a local terminal demo, a FastAPI entry point for serving the agent over HTTP, and a Dockerfile for containerized deployment, plus a deploy path to Agencii.ai for anyone who wants managed hosting rather than running it themselves. Because instructions, tools, and model settings are all defined in code, it's meant to be forked and customized — swap the system prompt, add a new tool, or point it at a different model — rather than used as-is.

toolsDetail.keyFeatures

Agentic tool-calling loop

The agent runs a GPT-5.1 model configured with medium reasoning effort and a defined tool set, letting it plan, call tools, observe results, and continue autonomously instead of stopping after a single response.

Diff-based file editing

File creation, updates, and deletion go through OpenAI's Apply Patch tool against a sandboxed workspace editor, which resolves and validates every path to keep operations inside the workspace directory.

Guarded shell execution

A shell tool runs commands with configurable timeouts and an inactivity watchdog, auto-detects dev servers and watchers and backgrounds them safely, and injects non-interactive flags into common scaffolding commands so setup steps don't hang waiting for input.

Structured task planning

An UpdatePlan tool lets the agent maintain a todo list with pending, in-progress, and completed states (enforcing a single in-progress task at a time), persisted through shared agency context so progress is visible across a session.

Built-in image generation and web search

The agent can generate web assets on demand via OpenAI's image generation API, saving output to a specified directory, and can pull in current documentation or solutions through an integrated web search tool.

Deployable as a template

Ships with a local terminal demo, a FastAPI server entry point, and a Dockerfile, plus a documented path to managed deployment on Agencii.ai — the instructions, tools, and model config are all editable code meant to be forked.

toolsDetail.architecture

Agent coreBuilt on the Agency Swarm framework: a single Agent is configured with a name, instructions file, model ("gpt-5.1-codex"), reasoning settings, and an explicit list of tools, then wrapped in an Agency for execution.
Tool definitionsTools live under coding_agent/tools/ as discrete modules: apply_patch.py (file operations via a sandboxed WorkspaceEditor), shell.py (a ShellExecutor with timeout, inactivity, and background-process handling), UpdatePlan.py (todo/plan state), and OpenAIImageGenerationTool.py (async image generation).
Model provider integrationUses the OpenAI Agents SDK primitives (ApplyPatchTool, ShellTool, WebSearchTool) alongside a direct AsyncOpenAI client for image generation, with the model and reasoning effort set centrally in coding_agent.py.
Orchestration and hooksA system_hooks module injects periodic system reminders (after each user message and every 15 tool calls) and deduplicates or reorders function-call messages in the shared thread history to keep multi-turn tool use consistent.
Runtime and deploymentagency.py builds the Agency and exposes a terminal demo; main.py serves it through agency_swarm's FastAPI integration; a Python 3.13-slim Dockerfile (with Node.js installed for JS/TS scaffolding) packages it for containerized or Agencii.ai deployment.
PythonAgency SwarmOpenAI Agents SDKGPT-5.1FastAPIDockerNode.js

toolsDetail.bottomCtaQuestion

toolsDetail.browseAllTools