Without notes, state yesterday’s main idea and one unresolved question.
Set up repository rules for Codex
AI-Assisted Capstone: Build Without Vibe Coding
Objective
Create an environment where agent work is constrained and verifiable.
AI is an advanced instrument or junior collaborator: it expands throughput, but the engineer still defines requirements, verifies measurements, and signs off on safety.
- README and setup
- AGENTS.md or project instructions
- scripts for checks
- small issues
Why this matters
Tomorrow an AI agent writes code in your repository. Whether that goes well is decided today, not tomorrow. An agent — like a competent new colleague on their first morning — does good work when the commands are written down, the boundaries are explicit, and there is one way to prove a change did not break anything. Without that it guesses, and its guesses look confident.
By the end of the hour, npm run check runs every check you own in one command, and a file in your
repository tells any agent how to work here.
The repository is the instruction sheet
On Day 34 you learned the discipline: define one small task, review the plan, inspect the diff, run the checks, explain every changed section. That discipline needs somewhere to stand. If "the checks" means three commands you half-remember, you will skip them; if it is one command, you will run it every time.
Everything today serves one goal: make the state of the project verifiable in seconds, by you or by an agent, without anyone remembering anything.
The work instruction and the test fixture
A technician does not build a board from a verbal description. They get a work instruction —
stack-up, torque values, what not to touch — and the board goes into a fixture that says PASS or
FAIL against a defined limit. Nobody argues with the fixture. Your project instructions are the
work instruction; npm run check is the fixture. Their value is that neither depends on memory or
mood.
README: how a human starts from nothing
The README answers one question: I have just cloned this repository on a clean machine — what do I type? Keep it short and keep it true. Four sections is enough:
# Calibration Tracker
Records instrument calibrations so overdue instruments are visible. One primary user.
## Requirements
- Node 20+, Docker Desktop
## Setup
cp .env.example .env
npm install
docker compose up -d # starts PostgreSQL
npm run db:migrate
npm run db:seed
## Commands
| Command | Does |
|---|---|
| `npm run dev` | Starts the development server |
| `npm run check` | Lint, typecheck, and tests — must pass before every commit |
| `npm run db:seed` | Resets seed data |
The test of a README is brutal and simple: follow it yourself, from a fresh clone in a different folder, typing only what it says. Anything you had to know without being told is a missing line.
Project instructions the agent reads
Codex and similar tools look for a file of project instructions in the repository — conventionally
AGENTS.md at the root — and read it before working. This is where you make expectations,
commands, and boundaries explicit, so the agent stops inferring them from whatever file it happened
to open.
Keep it under a page. An instruction file nobody reads to the end constrains nothing.
# Project instructions
## What this is
An Express API and a React frontend over PostgreSQL. See docs/architecture.md.
## Commands
- Install: `npm install`
- Run checks: `npm run check` (lint + typecheck + tests)
- Seed data: `npm run db:seed`
## How to work here
- One vertical slice per change. Do not refactor unrelated files.
- Present a plan and wait for approval before editing.
- After editing, run `npm run check` and paste the result.
- Summarise every changed file and why it changed.
## Never do these
- Never add a dependency without asking.
- Never edit files in db/migrations/ that are already applied; add a new migration.
- Never change docs/spec.md or docs/architecture.md — those are mine.
- Never write secrets into the repository. Config comes from .env, which is gitignored.
## Definition of done
The acceptance criteria named in the task pass, `npm run check` is green,
and the change is one commit with a message describing the behaviour.
Four things make this file work, and they are the four to reproduce in any project: what the project is, the exact commands, how to work, and the forbidden list. The forbidden list is the part beginners omit and the part that saves you — yesterday you wrote down which artifacts the agent must never touch, and this is where it goes.
Instructions are not a substitute for review
A file saying "run the checks" does not guarantee the checks ran, and one saying "keep diffs small" does not guarantee a small diff. The file raises the odds; your reading of the diff is what decides. Never accept a change because the rules said it should be fine.
One command that runs every check
You already have the pieces from earlier weeks: a linter, TypeScript, and tests. Today you wire them into one entry point so there is exactly one way to ask "is this repository healthy?"
{
"scripts": {
"dev": "vite",
"lint": "eslint .",
"typecheck": "tsc --noEmit",
"test": "vitest run",
"db:migrate": "node scripts/migrate.js",
"db:seed": "node scripts/seed.js",
"check": "npm run lint && npm run typecheck && npm run test"
}
}
The && matters: each command runs only if the previous one exited 0, the success exit code you
met on Day 4. The first failure stops the chain, so the first error you see is the one to fix.
npm run check
> typecheck
> tsc --noEmit
src/routes/calibrations.ts:22:5 - error TS2322: Type 'string' is not assignable to type 'number'.
That output is your evidence. "It looked right" is not evidence; a 0 exit code from npm run check is.
Seed data belongs in the same category. npm run db:seed should drop you at a known starting
state — a few instruments, a couple of calibrations — so that "given an instrument exists" from your
acceptance criteria is a fact rather than a hope. Without repeatable seed data, every test you run
by hand starts from a slightly different world and you cannot compare results between days.
Two minutes, right now
Break something on purpose: add const x: number = "no"; to any TypeScript file and run
npm run check. Watch it fail at the typecheck stage and never reach the tests. Delete the line
and run it again to see it pass. You now know what green and red look like on this project.
Small issues: work sized to a session
The last piece of scaffolding is how you write down the next piece of work. Take your spec's stories and cut them into issues small enough to finish, verify, and commit in one sitting. One issue equals one vertical slice equals one commit.
Use this shape, in a docs/backlog.md file or your tracker of choice:
ISSUE 3 — Record a calibration (SLICE 1)
Criteria: Story 1, criteria 1–4 in docs/spec.md
Touches: db/migrations, src/routes/calibrations.ts, src/web/CalibrationForm.tsx
Done when: all four criteria pass by hand on seeded data, npm run check green
Not now: editing or deleting calibrations (Issue 7)
The Not now line does the same job as a non-goal, at issue scale: it keeps the change from
growing while you are inside it. The Touches line gives you and the agent a shared expectation of
diff size — if the diff touches eleven files instead of three, something went wrong and you will
notice immediately.
Pair mode — after your repository runs
Today's AI mode is pair: the agent proposes, you verify. Get the repository working first, then ask it to look at what you have and draft instructions from the evidence.
"Inspect this repository and draft concise project instructions: architecture, commands, forbidden actions, and definition of done."
Then edit hard. Delete anything you cannot verify by running it, correct any command it guessed, and add the forbidden items only you know. Before accepting any generated change — including this one — inspect the diff, run the checks, and be able to explain the behaviour.
Walkthrough: prove the repository is clean
Do this end to end. It takes ten minutes and it is the deliverable.
cd ~
git clone <your-repo-url> clean-clone-test
cd clean-clone-test
Now follow your own README exactly — no improvising, no commands from memory:
cp .env.example .env
npm install
docker compose up -d
npm run db:migrate
npm run db:seed
npm run check
Test Files 3 passed (3)
Tests 9 passed (9)
Every place you had to deviate is a README bug. Fix the README, not your habit. Then delete the clone:
rm -rf ~/clean-clone-test
`rm -rf` deletes immediately and recursively
There is no Trash and no undo, and a mistyped path takes everything under it. Read the path twice before pressing Enter, and only ever run it on a throwaway folder like this one — never inside your real project directory.
Your turn
- Create the repository for your capstone, with
.gitignorecoveringnode_modulesand.env. - Write the README with the four sections above. Every command must be one you have run.
- Add the
checkscript chaining lint, typecheck, and tests with&&. Run it and confirm the exit code withecho $?. - Write a seed script creating a small known dataset, exposed as
npm run db:seed. - Write
AGENTS.mdwith the four sections: what this is, commands, how to work here, never do these — plus a definition of done. - Write three issues in
docs/backlog.mdusing the issue shape, with SLICE 1 first. - Do the clean-clone test from the walkthrough, fix what it exposes, then delete the clone.
- Commit:
chore: repository scaffolding, checks, and agent instructions.
You are done when
One command runs every check from a fresh clone, and AGENTS.md names at least three things the
agent must never do.
Common pitfalls
- A README you never followed. Half the setup lives in your shell history. The clean-clone test is the only way to find out.
- Instructions describing intentions, not commands. "Make sure quality is high" constrains
nothing. "Run
npm run checkand paste the output" is checkable. - Checks that are slow or noisy. If
npm run checktakes four minutes or prints 200 warnings, you will stop running it. Fix or silence the noise now. - Committing
.env. Secrets in Git history are effectively permanent. Verifygit statusshows.envas ignored before your first commit.
Verify it yourself
Open today's reference, OpenAI's Codex CLI documentation.
- Find how the CLI discovers project instructions: the filename it expects and where it looks. Confirm your file matches, and correct it if not.
- Find what it says about approvals or permissions for running commands and editing files. Decide
which mode you will use tomorrow and write your choice at the top of
AGENTS.md.
Getting the filename and location right from the documentation — rather than from memory — is the difference between instructions that are read and a file nobody opens.
The hour
- 0–5 min Recall
- 5–20 min Learn
Read only the listed concept notes and official reference sections needed today.
- 20–48 min Build
Set up repository, lint, typecheck, tests, seed data, and instructions telling Codex how to work and verify changes.
- 48–55 min Explain and verify
Run the result, inspect evidence, and explain the data/control flow in your own words.
- 55–60 min Quiz and commit
Complete the quiz, record one lesson, and commit the verified change when applicable.
What to hand in
A clean repository where one command runs all checks.
Working with AI today
Define one small task, review the plan, inspect the diff, run checks, and explain every changed section.
Inspect this repository and draft concise project instructions: architecture, commands, forbidden actions, and definition of done.
References
End-of-day quiz
Explain-back gate
Pass the quiz above to unlock completion.
Quiz + explain-back checks required.