Learn Everything

Paths/Codex Engineer/Prompting Codex Well / The Anatomy of a Request

Guided Taskbeginnerubuntu:24.04Ask AI

Write the Three Parts of a Request

Goal, context, constraints. Every request that works has all three. Write the anatomy down.

Validator

⏱ 0:00

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
  1. 01

    Create the prompts directory

    The anatomy is a reference the team shares.

    mkdir -p ~/codex/prompts
  2. 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
  3. 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
  4. 04

    Verify and submit

    cat the anatomy, then submit for validation.

    cat ~/codex/prompts/anatomy.md

03Stuck?

0 of 3 revealed

Take a hint without losing the lab — each one points at the thing to look at, not at the answer.

04AI Tutor

guides, never solves

Tell me what you're stuck on — I'll nudge, not solve. Which requirement are you looking at?

04Notebook

saved locally in this browser

learner@lab — ubuntu:24.04

↑/↓ recalls commands · Ctrl+Enter submits · type help for the command list