You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/codex_exec_plans.md
+43-45Lines changed: 43 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Using PLANS.md for multi-hour problem solving
2
2
3
-
Codex and the `gpt-5-codex` model can be used to implement complex tasks that take significant time to research, design, and implement. The approach described here is one way to prompt the model to implement these tasks and to steer it towards successful completion of a project.
3
+
Codex and the `gpt-5.2-codex` model (recommended) can be used to implement complex tasks that take significant time to research, design, and implement. The approach described here is one way to prompt the model to implement these tasks and to steer it towards successful completion of a project.
4
4
5
5
These plans are thorough design documents, and "living documents". As a user of Codex, you can use these documents to verify the approach that Codex will take before it begins a long implementation process. The particular `PLANS.md` included below is very similar to one that has enabled Codex to work for more than seven hours from a single prompt.
6
6
@@ -22,7 +22,7 @@ When writing complex features or significant refactors, use an ExecPlan (as desc
22
22
23
23
Below is the entire document. The prompting in this document was carefully chosen to provide significant amounts of feedback to users and to guide the model to implement precisely what a plan specifies. Users may find that they benefit from customizing the file to meet their needs, or to add or remove required sections.
24
24
25
-
````md
25
+
~~~md
26
26
# Codex Execution Plans (ExecPlans):
27
27
28
28
This document describes the requirements for an execution plan ("ExecPlan"), a design document that a coding agent can follow to deliver a working feature or system change. Treat the reader as a complete beginner to this repository: they have only the current working tree and the single ExecPlan file you provide. There is no memory of prior plans and no external context.
@@ -97,82 +97,80 @@ Prefer additive code changes followed by subtractions that keep tests passing. P
97
97
98
98
## Skeleton of a Good ExecPlan
99
99
100
-
```md
101
-
# <Short, action-oriented description>
100
+
# <Short, action-oriented description>
102
101
103
-
This ExecPlan is a living document. The sections `Progress`, `Surprises & Discoveries`, `Decision Log`, and `Outcomes & Retrospective` must be kept up to date as work proceeds.
102
+
This ExecPlan is a living document. The sections `Progress`, `Surprises & Discoveries`, `Decision Log`, and `Outcomes & Retrospective` must be kept up to date as work proceeds.
104
103
105
-
If PLANS.md file is checked into the repo, reference the path to that file here from the repository root and note that this document must be maintained in accordance with PLANS.md.
104
+
If PLANS.md file is checked into the repo, reference the path to that file here from the repository root and note that this document must be maintained in accordance with PLANS.md.
106
105
107
-
## Purpose / Big Picture
106
+
## Purpose / Big Picture
108
107
109
-
Explain in a few sentences what someone gains after this change and how they can see it working. State the user-visible behavior you will enable.
108
+
Explain in a few sentences what someone gains after this change and how they can see it working. State the user-visible behavior you will enable.
110
109
111
-
## Progress
110
+
## Progress
112
111
113
-
Use a list with checkboxes to summarize granular steps. Every stopping point must be documented here, even if it requires splitting a partially completed task into two (“done” vs. “remaining”). This section must always reflect the actual current state of the work.
112
+
Use a list with checkboxes to summarize granular steps. Every stopping point must be documented here, even if it requires splitting a partially completed task into two (“done” vs. “remaining”). This section must always reflect the actual current state of the work.
114
113
115
-
-[x] (2025-10-01 13:00Z) Example completed step.
116
-
-[ ] Example incomplete step.
117
-
-[ ] Example partially completed step (completed: X; remaining: Y).
Document unexpected behaviors, bugs, optimizations, or insights discovered during implementation. Provide concise evidence.
122
+
Document unexpected behaviors, bugs, optimizations, or insights discovered during implementation. Provide concise evidence.
124
123
125
-
- Observation: …
126
-
Evidence: …
124
+
- Observation: …
125
+
Evidence: …
127
126
128
-
## Decision Log
127
+
## Decision Log
129
128
130
-
Record every decision made while working on the plan in the format:
129
+
Record every decision made while working on the plan in the format:
131
130
132
-
- Decision: …
133
-
Rationale: …
134
-
Date/Author: …
131
+
- Decision: …
132
+
Rationale: …
133
+
Date/Author: …
135
134
136
-
## Outcomes & Retrospective
135
+
## Outcomes & Retrospective
137
136
138
-
Summarize outcomes, gaps, and lessons learned at major milestones or at completion. Compare the result against the original purpose.
137
+
Summarize outcomes, gaps, and lessons learned at major milestones or at completion. Compare the result against the original purpose.
139
138
140
-
## Context and Orientation
139
+
## Context and Orientation
141
140
142
-
Describe the current state relevant to this task as if the reader knows nothing. Name the key files and modules by full path. Define any non-obvious term you will use. Do not refer to prior plans.
141
+
Describe the current state relevant to this task as if the reader knows nothing. Name the key files and modules by full path. Define any non-obvious term you will use. Do not refer to prior plans.
143
142
144
-
## Plan of Work
143
+
## Plan of Work
145
144
146
-
Describe, in prose, the sequence of edits and additions. For each edit, name the file and location (function, module) and what to insert or change. Keep it concrete and minimal.
145
+
Describe, in prose, the sequence of edits and additions. For each edit, name the file and location (function, module) and what to insert or change. Keep it concrete and minimal.
147
146
148
-
## Concrete Steps
147
+
## Concrete Steps
149
148
150
-
State the exact commands to run and where to run them (working directory). When a command generates output, show a short expected transcript so the reader can compare. This section must be updated as work proceeds.
149
+
State the exact commands to run and where to run them (working directory). When a command generates output, show a short expected transcript so the reader can compare. This section must be updated as work proceeds.
151
150
152
-
## Validation and Acceptance
151
+
## Validation and Acceptance
153
152
154
-
Describe how to start or exercise the system and what to observe. Phrase acceptance as behavior, with specific inputs and outputs. If tests are involved, say "run <project’s test command> and expect <N> passed; the new test <name> fails before the change and passes after>".
153
+
Describe how to start or exercise the system and what to observe. Phrase acceptance as behavior, with specific inputs and outputs. If tests are involved, say "run <project’s test command> and expect <N> passed; the new test <name> fails before the change and passes after>".
155
154
156
-
## Idempotence and Recovery
155
+
## Idempotence and Recovery
157
156
158
-
If steps can be repeated safely, say so. If a step is risky, provide a safe retry or rollback path. Keep the environment clean after completion.
157
+
If steps can be repeated safely, say so. If a step is risky, provide a safe retry or rollback path. Keep the environment clean after completion.
159
158
160
-
## Artifacts and Notes
159
+
## Artifacts and Notes
161
160
162
-
Include the most important transcripts, diffs, or snippets as indented examples. Keep them concise and focused on what proves success.
161
+
Include the most important transcripts, diffs, or snippets as indented examples. Keep them concise and focused on what proves success.
163
162
164
-
## Interfaces and Dependencies
163
+
## Interfaces and Dependencies
165
164
166
-
Be prescriptive. Name the libraries, modules, and services to use and why. Specify the types, traits/interfaces, and function signatures that must exist at the end of the milestone. Prefer stable names and paths such as `crate::module::function` or `package.submodule.Interface`. E.g.:
165
+
Be prescriptive. Name the libraries, modules, and services to use and why. Specify the types, traits/interfaces, and function signatures that must exist at the end of the milestone. Prefer stable names and paths such as `crate::module::function` or `package.submodule.Interface`. E.g.:
If you follow the guidance above, a single, stateless agent -- or a human novice -- can read your ExecPlan from top to bottom and produce a working, observable result. That is the bar: SELF-CONTAINED, SELF-SUFFICIENT, NOVICE-GUIDING, OUTCOME-FOCUSED.
176
174
177
175
When you revise a plan, you must ensure your changes are comprehensively reflected across all sections, including the living document sections, and you must write a note at the bottom of the plan describing the change and the reason why. ExecPlans must describe not just the what but the why for almost everything.
0 commit comments