Goal Loop Engineering
Create a prompt for a future Codex Goal session. Never create, start, update, or execute the Goal itself.
Workflow
Resolve the requested result from current evidence.
- Preserve the user's natural wording and intended outcome.
- When a workspace is available, inspect only the code, plans, work logs, git state, and checks that can change the prompt.
- Treat earlier summaries as provisional; current source and test results win.
Check Goal readiness.
- Draft
/goal directly when the outcome, important constraints, and final verification are clear enough for autonomous implementation.
- When an unresolved architecture, public-contract, or approval decision would materially change the Goal, recommend
/plan first instead of burying that decision inside a long-running Goal.
Design one durable Goal and its checkpoint loop.
- State one user-visible objective and one observable final stopping condition.
- Limit each Goal turn to one coherent risk boundary, acceptance criterion, or failure cluster plus targeted validation.
- Select checkpoints dynamically from dependency order and current evidence.
- Reuse an existing plan or work log; avoid creating competing progress artifacts.
Draft with the Goal loop pattern.
- Keep ordinary checkpoints narrow and reserve broad regression gates for cross-cutting or final checkpoints.
- Rely on
AGENTS.md for durable repository rules. Repeat only task-specific boundaries that prevent a real failure or unintended action.
- Make clear that completing one checkpoint does not complete the Goal.
Prune the prompt.
- Keep only the Goal, context that changes the work, required output, important boundaries, checkpoint rule, and completion evidence.
- Remove generic process narration, discoverable command inventories, repeated prohibitions, and examples that do not change behavior.
- Confirm failures trigger diagnosis and retry within the checkpoint rather than premature completion or blocking.
Output
Lead with one short explanation of the partitioning decision, then return one copyable prompt in the user's requested language. Start it with /goal when Goal is ready. If /plan must come first, explain the missing decision and return the smallest useful plan prompt instead.
When the user asks for current Codex syntax, behavior, or citations, verify the official OpenAI documentation rather than relying on the bundled reference alone.
1---2name: goal-loop-engineering3description: Drafts copyable GPT-5.6 Sol and Codex Goal prompts that turn a software-engineering objective into incremental checkpoints with validation loops, approval boundaries, durable progress, and verifiable completion. Use when the user asks to create or rewrite a `/goal`, Codex Goal prompt, Loop Engineering prompt, or long-running coding-task prompt that should progress across multiple bounded Goal turns.4---56# Goal Loop Engineering78Create a prompt for a future Codex Goal session. Never create, start, update, or execute the Goal itself.910## Workflow11121. Resolve the requested result from current evidence.13 - Preserve the user's natural wording and intended outcome.14 - When a workspace is available, inspect only the code, plans, work logs, git state, and checks that can change the prompt.15 - Treat earlier summaries as provisional; current source and test results win.16172. Check Goal readiness.18 - Draft `/goal` directly when the outcome, important constraints, and final verification are clear enough for autonomous implementation.19 - When an unresolved architecture, public-contract, or approval decision would materially change the Goal, recommend `/plan` first instead of burying that decision inside a long-running Goal.20213. Design one durable Goal and its checkpoint loop.22 - State one user-visible objective and one observable final stopping condition.23 - Limit each Goal turn to one coherent risk boundary, acceptance criterion, or failure cluster plus targeted validation.24 - Select checkpoints dynamically from dependency order and current evidence.25 - Reuse an existing plan or work log; avoid creating competing progress artifacts.26274. Draft with [the Goal loop pattern](references/goal-loop-pattern.md).28 - Keep ordinary checkpoints narrow and reserve broad regression gates for cross-cutting or final checkpoints.29 - Rely on `AGENTS.md` for durable repository rules. Repeat only task-specific boundaries that prevent a real failure or unintended action.30 - Make clear that completing one checkpoint does not complete the Goal.31325. Prune the prompt.33 - Keep only the Goal, context that changes the work, required output, important boundaries, checkpoint rule, and completion evidence.34 - Remove generic process narration, discoverable command inventories, repeated prohibitions, and examples that do not change behavior.35 - Confirm failures trigger diagnosis and retry within the checkpoint rather than premature completion or blocking.3637## Output3839Lead with one short explanation of the partitioning decision, then return one copyable prompt in the user's requested language. Start it with `/goal` when Goal is ready. If `/plan` must come first, explain the missing decision and return the smallest useful plan prompt instead.4041When the user asks for current Codex syntax, behavior, or citations, verify the official OpenAI documentation rather than relying on the bundled reference alone.