Contents Lesson 1 of 18

14 min read · foundations

Write the plan before you write the prompt

By the end of this lesson you will have a PLAN.md in your copy of the starter, written in your own words, one line in AGENTS.md that sends every agent to it, and a commit holding both.

There is a way of building with an AI assistant that feels fast and produces nothing you can maintain. You describe a vague thing, you get 300 lines, you ask for a change, you get 300 different lines, and four hours later you have an app you cannot explain. The fix is not a better prompt. It is a page of writing you do before the first prompt.

This lesson is that page. It takes fifteen minutes and it is the difference between vibe-coding and gambling.

The tool you are going to build

A watchlist. Not a demo watchlist — yours, with the instruments you actually check, deployed at a URL you own, by the end of this course.

Small on purpose. A watchlist still contains every hard part of a real market tool: data you do not control, a secret kept out of the browser, numbers that must line up, data that is stale or missing, and a quota. Get those right once and the later courses are variations, not new problems.

What a one-page plan contains

Five sections. Resist making it six.

1. One sentence of purpose. Not features. The job.

A page I open at 7am that tells me, for the twelve instruments I care about, what moved overnight and by how much.

If you cannot write that sentence, you do not yet know what you are building, and no assistant can know it for you.

2. The data you need, named precisely. For each thing on screen, which endpoint answers it. You do not need to know the API yet — you need to know the question.

On screen The question Endpoint
Last price What is it trading at now? /real-time/{ticker}
Change since yesterday How far did it move? same call, change and change_p
History for a sparkline Where has it been? /eod/{ticker}
Calls used today How close am I to the limit? /user

The academy's reference is built exactly for this column: every endpoint, the market question it answers, and the lesson underneath it. Use it now and you will not guess later.

3. What you are deliberately NOT building. This is the section people skip and the one that saves the project. Write it down and your assistant stops inventing.

Not building: user accounts, a database, charts beyond a sparkline, mobile-native anything, alerts that push to my phone. Not yet: notes on symbols (Build Your First Tool, unit 3).

4. Done, defined as something you can check. Not "it works". A sentence you can be wrong about.

Done = deployed at a URL, showing my twelve tickers with live-ish prices and change, on my phone, without my API key appearing anywhere in the browser.

5. The riskiest unknown. One thing. For this project it is always the same one, and it is the subject of lesson 3: the API key must never reach the browser, and everything about how you fetch data follows from that.

Why writing it down changes the output

For the agent, a plan is context: it stops the model inventing a database you did not ask for, and "this is out of scope, see the plan" is a sentence that works.

For you, which matters more, a plan is what makes a diff reviewable. Without a standard, every generated change looks equally plausible. With one, you can look at 200 new lines and say that is not in the plan — which is how you catch the thing that would have cost you a weekend.

Put it in the repository, and point the agent at it

Your plan lives in the project as PLAN.md, not in a chat window. Chat scrolls away; a file gets edited when you change your mind, and git shows when.

academy-dashboard-starter/
  AGENTS.md        ← the house rules, already in the starter
  CLAUDE.md        ← one line: @AGENTS.md
  PLAN.md          ← you write this, first
  src/

But your agent does not read every file at the start of a session. Claude Code reads CLAUDE.md; Codex, Cursor and GitHub Copilot read AGENTS.md. Anything else, PLAN.md included, is read only when one of those files points at it or you ask. The starter's CLAUDE.md is the single line @AGENTS.md, which pulls AGENTS.md into every Claude Code session — one file for every agent.

AGENTS.md says how; PLAN.md says what

PLAN.md is this project: what you are building and what you are not. AGENTS.md is the rules of the house — what an agent must do on every change, whatever the change is. The starter's file has seven, and in short they say:

1. All market data goes through the proxy. Never call eodhd.com from the browser.
2. Never read, print or edit .env files, and never echo the key.
3. Never put the key in a NEXT_PUBLIC_ variable or a "use client" file.
4. Work on fixtures: EODHD_MOCK=1 while iterating.
5. State the cost in API calls before writing a fetch, and wait for a yes.
6. Done means green: npm test && npm run check:leak, plus lint and typecheck.
7. Small steps, one commit each. Never --no-verify.

Read the real file: the details are the point, and each rule comes back in this course with its reason — the proxy and the prefix in lesson 3, the cost in lesson 4, fixtures and tests in unit 2.

Then add the line that connects the two files: Read PLAN.md before starting any change, and say so if a request is not in it. Every agent understands it. For Claude Code you can also put @PLAN.md on a line of its own, which loads the plan the way CLAUDE.md loads AGENTS.md; Codex would read that line as plain text, so the sentence is the one that works for both.

Keep the house rules short. An instruction file of a few hundred lines is followed less, not more.

Try it now

The prompt

Write the plan yourself first, in a scratch file: the five sections above, a purpose sentence that names a real time of day and a real reason, and at least four items under "not building". An agent asked to write your plan writes a generic one. Read the starter's AGENTS.md too, all seven rules. Then start the agent in the starter folder, press Shift+Tab until plan mode shows under the prompt, and paste, with your draft in place of the brackets:

Read AGENTS.md, then my draft plan below. Do not edit any file. For
each of the five sections, tell me in one line how I could be wrong
about it, and quote anything too vague to check. For each row of the
data section, name the endpoint and what it costs per page load, using
estimateCalls() in src/lib/cost.ts. Spend no API calls and use no EODHD
tool.

[your draft plan]

Keep the comments you agree with, then paste:

Save my plan as PLAN.md, in my words plus only the changes I accepted.
If PLAN.md already holds lines I wrote earlier: my new purpose sentence
replaces a practice Purpose line, my Data rows go in beside a
development-budget line, a Status section stays as it is, and every
section gets my plan's content. If AGENTS.md does not already point at PLAN.md, add
this line above the numbered rules: "Read PLAN.md before starting any change, and say so if
a request is not in it." Change nothing else, and show me the diff.

Approve the plan it proposes only if it names those two files. A good answer touches PLAN.md and adds one line to AGENTS.md; nothing under src/ changes. If you took Pair With Your Agent, the pointer is already there in its own wording ("Read PLAN.md before proposing any change..."): then do not add a second line, and only PLAN.md changes.

Check it yourself

  1. Before you approved anything, git status showed no change: the first answer was comments and costs only.
  2. Its cost column agrees with this lesson: quotes cost one call per ticker on every load, and reading the account costs nothing.
  3. git diff --stat lists PLAN.md and, unless the pointer was already there, AGENTS.md with one added line. In git diff PLAN.md, your purpose sentence and your Data rows are there, not only the lines from before.
  4. Start a fresh conversation — /clear in Claude Code; in Codex quit and run codex again, since it reads AGENTS.md when a session starts — and ask: what are we building, and what are we not? The answer quotes your purpose sentence and your list. A generic dashboard means the pointer is not working.
  5. Ask for something on your "not building" list, such as alerts pushed to your phone. The agent says it is not in the plan and asks before doing anything.

You will edit the plan in unit 3, when the tool turns out to need something you did not predict.

Compare with ours

Our plan, shortened, and the pointer
Purpose       A page I open at 7am, before the US open, that tells me
              what moved since the last close and by how much, so I
              know what to read first.
Data          Last price and change: real-time, one request for the
              list, one call per ticker. Data age: the same response.
              Calls used today: the account, read on the server, free.
Not building  Accounts or a login. A database. Charts. Push alerts.
              A search box. Not yet: notes on symbols.
Done          Deployed at a URL, my tickers with price and change, on
              my phone, no request to eodhd.com in the network tab.
Riskiest      The key must never reach the browser.

And in AGENTS.md, one line above the numbered rules:

Read PLAN.md before starting any change, and say so if a request is not in it.

The full state at the end of this unit is on the starter's branch ref/build-your-first-tool/u1. That branch starts from the plain starter, so compare only the files this unit touches. If you cloned the starter (as Pair With Your Agent has you do), origin already points at it: run git fetch origin, then git diff origin/ref/build-your-first-tool/u1 -- PLAN.md AGENTS.md. If you made your own copy some other way, add the starter as a remote once with git remote add upstream https://github.com/EodHistoricalData/academy-dashboard-starter.git, then git fetch upstream and use upstream/ in place of origin/.

Checkpoint

git status   # only the files you expect, and no .env*
git add -A
git commit -m "Plan the watchlist on one page, and point every agent at it"

Then answer this lesson's questions.