- Use
.codex/agents/implementation-planner.mdfor analysis, sequencing, risk identification, and acceptance criteria. - Use
.codex/agents/implementation-executor.mdonly after a plan is approved.
- If user intent is planning, route to
.codex/agents/implementation-planner.md. - Planning intent keywords:
planexecution plantechnical breakdownbreak into taskshow should we implement
- If user intent is implementation, route to
.codex/agents/implementation-executor.md. - Execution intent keywords:
execute planimplement planstart implementationstart codingbuild this
- If issue URL/number is provided, treat it as the primary source context.
- If issue URL/number is missing, ask for it before planner/executor proceeds.
- Default behavior:
- planning-like prompt -> planner
- implementation-like prompt -> executor
- Run planner/executor locally from your machine; do not use GitHub Actions triggers for this flow.
- Trigger by explicit local command (example target interface):
npm run agent:plan -- <issue-url>npm run agent:execute -- <issue-url>
- Parse comment directives from GitHub, but do not auto-run from GitHub events.
- Keep scope strictly tied to the user request.
- Do not silently expand requirements.
- Make assumptions explicit and minimal.
- Prefer small, reversible changes.
- If implementation changes
src/, validate build and test results before closing. - Accept execution/update directives only from approved user(s) (at minimum your GitHub username).
The planner must output:
- Objective
- Scope and explicit out-of-scope
- Files expected to change
- Ordered implementation steps
- Risks and mitigations
- Validation commands and expected outcomes
- Ready-for-execution checklist
The executor must:
- Implement only the approved plan
- Flag and pause on unclear or conflicting plan details
- Report actual file changes
- Report commands run and outcomes
- Report deviations from plan with rationale
- Planner must create or update a single issue comment for the plan, not multiple drifting comments.
- Use a stable marker in that comment, for example:
<!-- impl-plan:issue-<number> -->
- Re-planning must edit the same comment and increment version label (
v1,v2, ...). - Planner updates should incorporate user feedback from newer issue comments.
- Execution should only start after explicit approval:
- local operator trigger, and/or
- approved issue comment command such as
/plan-approveor/executeby allowed user.
- Execution runs on a dedicated branch, never directly on
main. - Branch name must be prefixed with
codex/and include issue number when available.- Example:
codex/123-targets-parser-fix
- Example:
- Before creating a branch, sync base branch locally:
git checkout maingit pull origin main
- Commit only changed files relevant to the task; avoid broad staging.
- Use conventional commit style and reference issue number when available.
- Example:
feat: improve targets parsing (#123)
- Example:
- After implementation and validation:
- push branch
- create PR to
main - include
Related: <issue-url>in PR body
- Do not use
Fixes/Closeskeywords automatically unless explicitly requested.
- Use
npm testfor tests. - Use
npm run buildfor TypeScript compile checks. - When source behavior changes, run
npm run bundleand includedist/index.jsin changes when required by release flow.
Custom Codex agents are defined in .codex/agents/.
| Agent | When to Use |
|---|---|
implementation-planner |
When asked to create an implementation plan, technical breakdown, phased tasks, or task decomposition for a feature/issue. |
implementation-executor |
When asked to implement a feature based on an existing plan (GitHub issue comment or markdown plan), with stepwise execution and verification. |
requirement-refiner |
When asked to refine raw feature requests so requirements are clear, complete, and easy to understand without implementation details. |
When the user asks to use an agent, follow this format in prompt language:
Use implementation-planner for issue #<number>: <feature request>Use implementation-executor for issue #<number> using latest plan commentUse implementation-executor with plan from <path-to-plan-md>Use requirement-refiner for issue #<number>: <raw requirement>
- Generate plan with
implementation-planner - Post/attach plan to GitHub issue
- Execute in order with
implementation-executor - Validate via tests and build/bundle checks
- Use
requirement-refineron raw request text - Produce clear scope, assumptions, acceptance criteria, and open questions
- Share refined requirement before planning/execution