← All guidesCodex for Backend Engineering · Future with Shivank
Hands-on guide

8. Plan Mode & Grilling

Part 2 begins. You look at Codex's built-in plan mode once, then let the grill skills interview you in two rounds about auctions, bids and users. At the end you approve the build slices and Codex starts writing the first one.

Part 2 · start≈ 30–45 min hands-onUses the grill skills

What you'll do

Before you start

⚙ Codex settings for this guide
Project / folderworkshop
ModelGPT-5.6 Sol
ReasoningMedium
ModePlan mode off (you try it in Step 2, then turn it off)
ApprovalsApprove for me
1

Start a new chat in the workshop project

Every new task gets a new chat. That is a habit I want you to build from today, so we start Part 2 in a fresh conversation even though the workshop project already has one from guide 7.

In the Codex sidebar, under Projects → workshop, click New chat. Above the message box you should see the chips workshop and Local (and your branch name). Under the message box, the model picker should say 5.6 Sol Medium and the approvals button Approve for me. If either is different, click it and fix it now, before the long run starts.

📘 Concept: context window and tokens

A model does not read words; it reads tokens, small chunks of text roughly three-quarters of a word long. Everything in a chat, your messages, Codex's replies, every file it opened, every command output, is converted into tokens and sent to the model again with each new turn. The total amount it can hold at once is the context window. When a chat grows long, three things happen: each turn costs more (you pay for all those tokens again), the model gets slower, and it starts to lose track of early details because the window is crowded. A fresh chat per task keeps the window small, focused and cheap. Codex still knows the project, because AGENTS.md and the files are always there.

✓ You should see

An empty chat that asks “What should we build in workshop?” with no earlier messages above it.

💡 Tip

If you see a ⚡ symbol in front of the model name, the Speed setting is on Fast. Fast costs more per token and we do not need it; click the picker and set Speed to Standard.

2

Try plan mode, then turn it off

Before we use the grill skills, I want you to see what Codex offers out of the box, so you can judge the difference yourself. Type /plan in the message box and pick Plan mode – Turn plan mode on from the menu that pops up. Do not send any message.

≡Type in Codexmessage box, then pick Plan mode
/plan
📘 Concept: plan mode

Plan mode is a built-in Codex mode where the agent is only allowed to think and write, not to edit files or run commands. You describe a task, it reads the codebase and comes back with a step-by-step plan for your approval. The intention is good: define the feature before building it. The weakness is that it mostly plans from its own assumptions; it asks you few or no questions, so the gaps in your request stay gaps in the plan. For a well-understood task it is fine. For a new feature with real design decisions (who are the users? how is money stored? what happens when two people bid at once?) I want a tool that interrogates me first. That is what grilling does, and it is why plan mode stays off for the rest of this course.

Look at the message box, then turn plan mode back off: click the Plan chip that appeared under the message box, or type /plan again and pick the “turn off” option.

✓ You should see

While it is on: a Plan chip next to “Approve for me”, and the placeholder text in the box changes to “Describe your task to generate a plan…”. After you click the chip: the chip disappears and the message box is back to normal, with the usual placeholder.

💡 Tip

If your Codex version does not show Plan mode in the / menu, skip this step entirely. Nothing in the course depends on it.

3

Check that the grill skills are installed

We are about to rely on the grill skills for a long run, so confirm they are available first. Type /grill in the message box and do not send it. Codex filters its skill list to the ones whose name matches what you typed.

≡Type in Codexmessage box, don't send
/grill
📘 Concept: grilling (interview before building)

Grilling flips the usual order. Instead of you writing a long prompt and hoping you covered everything, the agent interviews you: it reads the code, works out what is undecided, and asks numbered questions in rounds, each with options A / B / C and a recommended answer. You answer, it asks the next round, and when nothing is left open it writes the agreed design down and proposes slices to build. The value is that every design decision is made deliberately, by you, before a single line of code exists. Without this, the model makes those decisions silently, you discover them only when the code is wrong, and you pay twice to fix them. Grilling costs tokens up front and saves many more later.

What the three skills do:

  • Grilling is the interview itself: numbered questions in rounds until you and Codex agree on one design. Every question comes with options and a recommended answer. The full instructions Codex follows are in ~/.agents/skills/grilling/SKILL.md; open it in VS Code when you have a minute, it is just a Markdown file telling the model how to behave.
  • Grill Me is a shortcut that starts Grilling with a short preamble.
  • Grill with Docs runs Grilling together with the domain-modeling skill, which writes the decisions down as documentation (CONTEXT.md, docs/adr/…) inside the part's folder. Its instructions are in ~/.agents/skills/grill-with-docs/SKILL.md. This is the one we use.
📘 Concept: ADR (architecture decision record)

An ADR is a short text file that records one decision: what we decided, what the options were, and why we chose this one. For example: “Money is stored as integer cents in USD. Options: floating point dollars, decimal type, integer cents. Chosen: integer cents, because floating point rounds and the app is USD only.” Teams keep ADRs in a docs/adr/ folder so that six months later nobody has to guess why the code looks the way it does. For us they have a second use: Codex reads them in future chats, so the decisions you make today keep steering it in guides 9 and 10 without you repeating yourself.

Delete /grill from the box when you have seen the list. If the skills are missing, reinstall them with the command below, in the Terminal app:

❯Only if the skills are missingTerminal app · any folder
npx skills@latest add schneidenbach/skills

As in guide 5: tick exactly domain-modeling, grill-me, grill-with-docs, grilling, choose scope Global and method Symlink. Then quit Codex fully (Cmd+Q) and reopen it, because Codex only scans the skills folder on startup.

✓ You should see

Three entries above the message box, each marked Personal: Grill Me (Sharpen a plan through interview), Grilling (Stress-test thinking a round of questions at a time) and Grill with Docs (Grill a design and write its docs). “Personal” means the skill came from your own ~/.agents/skills folder, not from the project.

4

Send the Part 2 prompt

Now the real work starts. Read the prompt before you paste it, because every phrase in it is doing a job:

  • The first sentence states the feature in plain product language: post auctions, make bids.
  • “stored in the postgres database (see the docker compose file…)” tells Codex where data lives and points it at the file that defines the database service, so it does not invent a different database or an in-memory stand-in.
  • GRILL ME with DOCS! is the trigger. Because a skill's name appears in the text, Codex loads the grill-with-docs skill on its own; you do not have to pick it from the / menu.
  • The second paragraph says which folder to work in and how to start it: the Part 2 folder is empty, so Codex must copy Part 1 into it and build on top. Remember the root AGENTS.md rule: “work in a specific numbered part directory, and ask if unclear”. We make it clear so it does not need to ask.
✦Paste into CodexCodex message box
I want to add on the ability to post auctions and make bids. these should be stored in the postgres database (see the docker compose file - that's where the database should live). GRILL ME with DOCS!

we're working out of folder 2 - copy the files from folder 1 and build off of those in folder 2

Why both paragraphs in one message? If you send only the first, Codex reads the project, notices that folder 2 is empty, and stops to ask where it should work. That is a wasted turn and wasted tokens. Telling it up front gets you straight to the questions. Press Enter to send.

✓ You should see

The status Working for … with a running timer, then a short opening statement similar to: “I'm using the grilling skill to stress-test the auction and bidding design against the existing docs and code in Part 1… I'll run at most two focused rounds of 8–10 questions before proposing 2–4 browser-reviewable vertical slices. I'll hold off on copying or implementing until you confirm those slices.”

After about a minute, during which Codex reads docker-compose.yml and the Part 1 code, it posts Grilling round 1 — Product and domain boundaries. You get about 8 numbered questions (❓ Q1, Q2…). Each has options A / B / C and a ➡️ Recommendation line. Nothing has been copied or built yet; folder 2 is still empty.

💡 Tip

Click the small caret next to Working for … to expand what Codex is reading and thinking. You will see it open the compose file, Part 1's AGENTS.md and the server code. The “8–10 questions” and “2 rounds max” limits it mentions come straight from the workshop's root AGENTS.md you read in guide 7; that is the file doing its job.

⚠ Heads up

Cost: two grilling rounds plus the Slice 1 build is the biggest run so far. Slice 1 alone ran for about 9 minutes in my run on Sol. Check platform.openai.com → Usage afterwards if you are watching your spend.

5

Answer round 1

Read every question properly. Your questions may be worded, ordered or numbered differently from mine, because the model is not deterministic, so match them by topic and make the same decision. Here is what I decided, and why:

  • Q1 Who are the actors? → my own answer, not the recommendation: predefined users. A users table with 10 seeded users and a small user switcher at the bottom of the page. No real login. Why: real authentication (passwords, sessions, sign-up) is a whole project of its own and teaches nothing about auctions. A switcher lets us act as different bidders in seconds, which we need badly in guides 11 and 12.
  • Q2 What must a seller provide? → take the recommendation (A): title, category, description, condition, location, seller name, starting price, closing time. These are the fields the Part 1 catalog already shows, so new listings look like the seeded ones.
  • Q3 How should images work? → take the recommendation (A): the seller picks a category and the UI shows that category's illustration. No uploads or image URLs. File uploads need storage, size limits and security checks; we skip all of that.
  • Q4 When does an auction become visible? → take the recommendation (A): it goes live the moment it is created. No draft state, no approval queue.
  • Q5 How is closing defined? → A: the seller picks a future date and time, and the API stores it as an absolute UTC timestamp. UTC is the single world reference time with no time zones or daylight saving. Storing UTC means a bidder in Bangalore and a bidder in New York both see the same auction end at the same real moment; the browser converts it to local time only for display.
  • Q6 How should money be represented? → A: USD only, stored as integer cents. $18,450.00 is stored as 1845000. Never store money as a decimal number like 18450.00 in a floating-point column: computers cannot represent many decimals exactly, and you end up with bids of $10.000000001. Whole integers never round.
  • Q7 What happens to the six existing catalog items? → A: seed them into Postgres, so the catalog, detail and search screens all read from the database instead of a hard-coded list. One source of truth.
  • Q8 What should database reset mean? → I was not sure what Codex meant by this, so I asked it to explain rather than guess. It comes back as a question in round 2. Do the same whenever a question is unclear; “explain this better” is a perfectly good answer.
📘 Concept: seed data

Seed data is the starting content a database is filled with when it is created: our 10 users and 6 hardware items. It is written as a script that runs after the migrations, so every fresh database, on every machine, starts with the same rows. Without seeds a new database is empty and the app looks broken. Seeds are also what makes a “reset” meaningful: drop everything, run migrations, run seeds, and you are back to a known state.

Type your answers as one message, one line per question. Use the block below as a template and change the numbers if your questions are numbered differently.

✦My answers (round 1), adjust the numbers to match your questionsCodex message box
1. the actors are predefined users - go ahead and make a users table as well with 10 user records seeded. at the bottom of the page, add a small switcher so we can switch between users well.
2. take recommend
3. take recommend
4. take recommend
5. a
6. a
7. a
8. please explain this to me better

Shortcuts I use when answering:

  • take recommend means “go with your recommended option”. Codex understands it.
  • A single letter (a, b, c) picks that option. Codex also accepts the compact form “1A, 2B…”.
  • If Codex asks you something I was not asked, take recommend is fine unless it clashes with one of the decisions above. If it clashes, write a sentence stating the decision in your words.

If you type instead of pasting: Shift+Enter starts a new line, Enter sends. Pressing Enter after the first line sends an incomplete answer.

✓ You should see

Codex sums up what is settled, similar to: “Locked so far: ten seeded users with a persistent page-bottom user switcher, immediate publication, required listing fields, category-based illustrations, UTC closing timestamps, integer USD cents, and a fully database-backed catalog seeded from the six existing items.”

Then it explains reset: only an explicit npm run db:reset wipes Part 2. It drops only the auction_part_2 database, recreates it, runs all migrations and restores the seed data. A normal npm start or a container restart keeps everything. Part 1's database is never touched. Below that comes Grilling round 2 — Interaction and rules.

💡 Tip

I find the recommendations right 80–90% of the time, and I still read every single question. “Take all recommends and go” works too, but I almost never do it, and when I have, I have usually regretted it: the 10–20% it gets wrong are exactly the decisions that are expensive to undo later.

6

Answer round 2

Same approach: match each question by topic, not by number. Round 2 is about how users interact and what the rules are. My decisions:

  • Q9 Database reset → A: restore the 10 users and the 6 original auctions. Only auction_part_2 is dropped and rebuilt. This is the follow-up to my “explain this better” in round 1.
  • Q10 Remembering the active user → A: keep the chosen user ID in localStorage, starting with the first seeded user. localStorage is a small key-value store inside the browser that survives page reloads, so your chosen user stays selected when you refresh. We change this in guide 9 to a random user per browser tab, for reasons you will see then.
  • Q11 Ownership and self-bidding → A: the active user automatically becomes the seller of anything they post, and bidding on your own auction is rejected. Otherwise a seller could inflate their own price.
  • Q12 Minimum valid bid → A: at least $1.00 above the current amount, checked in the API and not only in the browser.
  • Q13 Simultaneous bids → A: correct one-at-a-time bidding now. Proper locking for two people bidding in the same millisecond waits for Part 3. We deliberately leave this problem in, because guides 11–14 are about discovering and fixing it.
  • Q14 Ended auctions → A: show “Ended”, disable the bid form, and have the API reject new bids on an ended auction.
  • Q15 Bid visibility → A: a compact bid history on the auction page with bidder, amount and time.
  • Q16 Posting experience → A: a Sell link in the header that goes to /auctions/new. After posting, you land on the new auction's own page.
  • Q17 Specifications on new listings → B, the one place I go against the recommendation: new listings have no specifications section, and that section is hidden when it is empty. The seeded hardware items have detailed spec tables; asking a seller to fill one in would make the form huge for no benefit.
📘 Concept: validate in the API, not only in the browser

Q12 says the minimum-bid rule is checked “in the API and not only in the browser”. Browser checks are for convenience: they give instant feedback and save a round trip. But anyone can bypass the browser and send a request straight to the API with a tool like curl, or simply have an old page open. If the rule lives only in the browser, a bid of $0.01 above (or below) the current price gets through. The API is the only place every request must pass, so every business rule is enforced in the API; the browser copy is a bonus. This is one of the most important habits in backend engineering, and the AGENTS.md rule “validate inputs” is about exactly this.

✦My answers (round 2), adjust the numbers to match your questionsCodex message box
9. a
10. a
11. a
12. a
13. a
14. a
15. a
16. a
17. b
✓ You should see

Working for …, then a summary similar to: “We have a shared design. No implementation has started yet; Folder 2 remains untouched. The final product decisions will be recorded in Folder 2's GRILL.md:” followed by a bullet list of the decisions above (ten seeded users, footer switcher, sellers cannot bid on their own auctions, bids at least $1 higher, db:reset restores users and auctions, and so on). Read that list once and confirm it matches what you meant. This is your last cheap chance to correct a misunderstanding.

💡 Tip

If your options are ordered differently, do not type my letters blindly. For each question, pick the letter that means the same decision as in the list above. If a decision you want is not offered at all, write it out in a sentence; Codex accepts free text alongside letters.

7

Look at the Mermaid diagram and the proposed slices

Scroll through the rest of Codex's reply. Below the decision list there is a diagram. Click it to open it full size; the viewer has zoom buttons in a corner.

A Mermaid diagram is a flow chart written as plain text, a few lines like flowchart LR and Web --> API, which Codex renders into boxes and arrows. The root AGENTS.md asks Codex for one after every grilling session, because a picture of “who talks to whom” is the fastest way to check that the model's understanding of the architecture matches yours.

Then read Proposed vertical slices. Each slice is one thin end-to-end piece of the feature (database → API → UI), and each one ends with a Browser checkpoint: a concrete thing you can click in Chrome to confirm the slice works before the next one starts. That checkpoint is your review gate.

✓ You should see

A diagram similar to this: inside a box React/Vite Web App :5102, Active predefined user → Footer user switcher → localStorage (active user ID). Three screens, Catalog and search, Auction details and bid history, and Post auction, each call Fastify API :3102 over HTTP, and the API stores users, auctions and accepted bids in PostgreSQL auction_part_2. Note the new ports: Part 2 gets 5102 and 3102, so it can run alongside Part 1.

Then slices similar to:

  1. Database-backed marketplace and user switching
  2. Post an auction
  3. Make and inspect bids

The reply ends with: Reply “approve the slices” to authorize Slice 1, or tell me what you want rearranged.

💡 Tip

Got different slices, or four instead of three? That is expected and perfectly fine, as long as you have 2–4 slices, each with a browser checkpoint, and together they cover users, posting and bidding. If a slice is missing something you decided (for example, no bid history anywhere), say so now in a sentence before approving.

8

Approve the slices

Send the approval. This is the moment Codex is allowed to touch files. It builds one slice, checks it with tests and a browser run, then stops and waits for you before starting the next one. You stay in control at every boundary.

✦Paste into CodexCodex message box
approve the slices
✓ You should see

Codex starts Slice 1, with an opening like: “Slice 1 is underway. I'll first copy the Part 1 application into Folder 2 while excluding installed dependencies and historical build logs…” A to-do list appears above the message box, showing progress such as Step 1/4:

  • copy Part 1 into folder 2
  • add the migrations, seed users and auctions, and add read APIs
  • swap the static catalog for API data and add the user switcher
  • run migrations, tests and the browser check

Each item gets ticked as Codex finishes it.

⚠ Heads up

Slice 1 ran for about 9 minutes in my run. Let it work; do not send more messages into this chat while the timer is running, because a new message interrupts the current task. Guide 9 continues in this same chat once Slice 1 reports done.

9

Watch the files appear in folder 2

While Codex works, it helps to see what it is actually doing on disk. The to-do list above the message box comes from the Codex app itself (the “harness” that wraps the model and gives it tools), not from the model's text, so it is a reliable progress indicator. To see the files, open the workshop in VS Code from the Terminal app, then expand part-2-create-auction-and-bid in the Explorer.

❯Run in TerminalTerminal app · any folder
code ~/codex-course/workshop

If VS Code is already open on the workshop from guide 7, this just brings that window to the front. Files Codex creates show up in the Explorer within a second or two, with the usual green “new file” colour in the tree.

✓ You should see

part-2-create-auction-and-bid filling up with a copy of Part 1: AGENTS.md, GRILL.md, README.md, package.json, server/, web/. In my run, Codex sensibly left out Part 1's node_modules (it reinstalls them), CODEX.md and codex-logs/. After the copy, Codex keeps editing files inside that folder: a new migration under server/, a seed script, new API routes, and changes to the React pages.

💡 Tip

Open part-2-create-auction-and-bid/GRILL.md as soon as it appears. It is the written record of everything you decided in Steps 5 and 6. If something there is wrong, you want to know now, not after Slice 3.

Stuck or got a very different result?

Start over: if grilling went off track, or Codex started building something odd, stop it with the ■ button to the right of the message box. Empty folder 2 with the first command below, then start a new chat and send the Step 4 prompt again. Starting over costs a few minutes; building on a wrong foundation costs hours.

❯Start Part 2 overTerminal app
cd ~/codex-course/workshop && rm -rf part-2-create-auction-and-bid && mkdir part-2-create-auction-and-bid

That line moves into the workshop, deletes the Part 2 folder with whatever is in it, and creates it again empty, which is exactly the state the Step 4 prompt expects.

Catch up: the second command replaces your Part 2 with the reference copy's version. Be aware that it is the end state of the whole part: all three slices done, plus a bidding-war test that we add in guide 12. If you use it, you skip the build steps in guides 9 and 10 and only do their browser checks (run it with npm install and npm start inside that folder).

❯Or catch up: copy the finished Part 2 from the referenceTerminal app
cd ~/codex-course/workshop && rm -rf part-2-create-auction-and-bid && cp -R ../reference/part-2-create-auction-and-bid ./ && git add -A && git commit -m "Catch up: part 2 from reference"

Key takeaways