Paths/Codex Engineer/Prompting Codex Well / The Anatomy of a Request
Write the Three Parts of a Request
Goal, context, constraints. Every request that works has all three. Write the anatomy down.
Validator
IDLE — checks run live as you type commands; submit when done
01Requirements
live checks- Directory ~/codex/prompts exists○
- File ~/codex/prompts/anatomy.md exists○
- The document defines the three parts○
- The document gives an example of each part○
02Walkthrough
4 steps- 01
Create the prompts directory
The anatomy is a reference the team shares.
mkdir -p ~/codex/prompts - 02
Define the three parts
The goal says what changes. The context says where to look. The constraints say what not to do.
echo '# The anatomy of a request\n\n## The three parts\n\n- goal - what changes, in one sentence, from the outside\n- context - where the code is and what it does today\n- constraints - what must not change, and how the work is verified' > ~/codex/prompts/anatomy.md - 03
Give an example of each
An example teaches the shape faster than a paragraph. Use a real request from the repository.
echo '\n## Example\n\n- goal - the orders list endpoint accepts a cursor and returns the next page\n- context - src/server/orders/routes.ts already parses the limit parameter, and the query lives in src/server/orders/query.sql\n- constraints - do not change the response shape, add a test for the cursor, and do not touch the export route' >> ~/codex/prompts/anatomy.md - 04
Verify and submit
cat the anatomy, then submit for validation.
cat ~/codex/prompts/anatomy.md
03Stuck?
0 of 3 revealedTake a hint without losing the lab — each one points at the thing to look at, not at the answer.
04AI Tutor
guides, never solvesTell me what you're stuck on — I'll nudge, not solve. Which requirement are you looking at?
04Notebook
saved locally in this browserlearner@lab — ubuntu:24.04
Session is disposable
↑/↓ recalls commands · Ctrl+Enter submits · type help for the command list