/build command for Codex agent skills
/build is a slash command from Addy Osmani's agent-skills that has Codex implement a plan one task at a time: build, test, verify and commit. It is for developers who want incremental, test-driven progress, and adding "auto" runs the whole plan after a single approval.
What it does
In default mode it picks the next pending task, reads its acceptance criteria, writes a failing test, writes the minimum code to pass, runs the full suite and the build, commits and stops. It calls the incremental-implementation and test-driven-development skills.
How to use it
Type /build for one careful slice, or /build auto (or all) to run every task without stepping in between.
Requirements and limits
Autonomous mode is not faster per task. It runs the same test loop and only removes the human pause between tasks.
More in Commands and the Codex library.
Full text
Front matter
description: Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.
disable-model-invocation: trueInvoke the agent-skills:incremental-implementation skill alongside agent-skills:test-driven-development.
Modes
/build— implement the next pending task, then stop (careful, one slice at a time)./build auto— generate the plan if needed, get a single approval, then implement every task without stopping between them.
$ARGUMENTS selects the mode. Treat auto (canonical) or all as autonomous mode; anything else (or empty) is the default single-task mode. Note: autonomous mode is not faster per task — it runs the same test-driven loop — it only removes the human stepping between tasks.
Default: one task
Pick the next pending task from the plan. Then:
- Read the task's acceptance criteria
- Load relevant context (existing code, patterns, types)
- Write a failing test for the expected behavior (RED)
- Implement the minimum code to pass the test (GREEN)
- Run the full test suite to check for regressions
- Run the build to verify compilation
- Commit with a descriptive message
- Mark the task complete and stop
Autonomous: the whole plan (/build auto)
Use this once a spec exists and you want to collapse plan + build into one run. It removes the manual stepping between tasks — not the verification. Every task still earns a passing test and its own commit.
- Require a spec. Look only for a spec at a known path:
SPEC.mdat the repo root, a root-levelSPEC-<change>.mddelta spec (per the spec-driven-development skill's Spec Evolution section — when one exists and the run is building that follow-up change, it takes precedence overSPEC.md; if there are several, use the one whoseStatus:line is notimplemented, and if more than one remains, ask which change to build),docs/SPEC.md, or a file underspec/. A README or arbitrary doc does not count. If none exists, stop and tell the user to run/specfirst — do not invent requirements. - Establish a clean baseline. Run
git status --porcelain. If there are uncommitted changes outside the expected planning artifacts (SPEC.md, root-levelSPEC-.md,docs/SPEC.md,spec/,tasks/plan.md,tasks/todo.md), stop and ask the user to commit, stash, or confirm how to handle them. Autonomous per-task commits must not absorb unrelated local work, or the clean-rollback guarantee breaks. - Plan if needed. If there is no
tasks/plan.md, invoke agent-skills:planning-and-task-breakdown to generate one, and record the spec it was generated from as aSource spec: <path>line at the top of the plan (e.g.Source spec: SPEC-ocr.md). Iftasks/plan.mdalready exists, reuse it only when itsSource spec:line matches the spec selected in step 1. On a mismatch — including an older plan with noSource spec:line — stop and ask the user whether to archive or replace it; never silently execute a plan generated from a different spec. - Single checkpoint. Present the full plan and wait for an unambiguous affirmative (e.g. "approve", "go", "yes"). Treat hedged responses ("looks reasonable", "I guess") as not approved. This is the only human gate — after approval, run autonomously. If you generated
tasks/plan.md, commit it as a single preparatory commit now so it doesn't bleed into the first task's commit. - Execute every task in dependency order. Use each task's declared dependencies; if they aren't explicit, execute in the order the plan lists them. For each task, run the full default loop above (RED → GREEN → regression → build → commit → mark complete). Stage only the files that task touched plus its task-status update — never
git add -Ablindly — and make one commit per task so any point is a clean rollback. - Stop and ask the user (do not push through) when:
- a test can't be made to pass or the build breaks without an obvious fix → follow agent-skills:debugging-and-error-recovery
- the spec is ambiguous, or a task needs a decision the spec doesn't cover
- a task is high-risk or irreversible — auth/permission changes, destructive data migrations, payments, deletions, deploys, anything touching secrets, or anything you can't undo with
git revert→ follow agent-skills:doubt-driven-development and get explicit sign-off before continuing
After the user resolves a blocker, they re-invoke /build auto — it resumes from the next pending task.
- Summarize at the end: tasks completed, tests added, commits made, and anything skipped, flagged, or left for the user.
If any step fails, follow the agent-skills:debugging-and-error-recovery skill.
Source and license
Source: https://github.com/addyosmani/agent-skills/blob/main/.claude/commands/build.md
Author: addyosmani, Addy Osmani agent skills. License: MIT.
Shown here with formatting for the web. Keep the author and license notice when you reuse it.
Related entries
There are more like this in the members library
The Codex library holds 7,009 entries. Members can search all of them by meaning and read every one in full.