An AI-Native Engineering Study
Genesis: The Loop That Prompts Itself
An AI coding plan is not a pile of prompts. It is a small machine. The machine writes the to-do list, hands each job to the AI, checks the work with a second AI, and writes down what got done — so “finished” is something proven, not something the AI just said.
GitHub and installation instructions: github.com/ayush488-glitch/genesis-kit
How to read this. We will not start with the folder. We will start with the wall. Every part of this kit exists because someone hit a wall while using an AI to write code. If we show you the wall first, you can almost guess the fix yourself. That is the goal: not that you can repeat the kit, but that you could have invented it.
One more thing. You may have read the ChatGPT memory write-up — the one about how an AI can remember you between chats. We point back to it again and again, because it solved the very same problem in a different room. If that study made sense to you, this one will too.
Part 0 / The Way of Thinking
The wall before the kit
Before the folder, two promises. One: we will not show you the answer until you have felt the problem that makes the answer obvious. Two: we will tell the honest truth about how most people use an AI to code today, and why that way quietly caps how much you can build. Everything after this is just knocking down one cap at a time.
Why do my AI coding sessions feel great for an hour and then fall apart? The AI forgets what it built. It asks me things I already told it. It says “done” on code that does not run. And I am stuck typing the next step, over and over.
The complaint we are going to fixWhy We Show the Problem First
Think of one thing you can genuinely fix yourself — a recipe, a bike chain, a bug you've squashed before. Did someone hand you the fix, or did you first get stuck without it? Which way taught you more?
You learn more by getting stuck for five minutes than by being handed the answer in five seconds. So we hand you the stuck part first.
Here is the simple idea. If we give you the folder called .genesis/ right away, you get a folder. You can copy it. But you cannot change it when your job is different from ours, because you never learned why each piece is there. If instead we make you feel the wall first, you can almost build the folder yourself. And a person who could build it can also fix it.
This is not a soft idea. It is how every big invention happened. People did not invent a new tool because it was fun. They hit a wall the old tool could not climb. So in this study, each piece of the kit comes after the wall that forced it. Read the wall. Try to guess the fix. Then check your guess. When you can guess the next page before you turn it, the idea is now yours.
The kit is the answer. The five walls are the question. We teach the question first, because anyone can carry an answer, but only the question lets you build the next one.
For each piece of the kit — could you have guessed it had to exist, just from the wall right before it?
A trick for reading any system: remove one part in your head, and name the disaster that comes back. If no disaster comes back, that part was just decoration. In a good system, every part is holding back a specific disaster.
Right Now, You Are the Loop
Picture your last long session with ChatGPT or a coding agent. Who kept track of what was already done? Who decided an answer was good enough? Who typed the next message? Jot down who did each job.
Here is how almost everyone uses a coding AI today. You type a request. The AI gives you some code. You read it, spot what it missed, and type the next request. It gives you more code. You check again. You type again.
Look at who is doing the real work. You are holding the plan in your head. You are remembering what is done. You are deciding if the work is good. You are watching the cost. The AI is just a worker you poke, again and again, until you are tired. You are the loop. The AI is only one step inside it.
This works great for twenty minutes. It is also the cause of every pain in the complaint above. Why? Because every part that keeps a project on track lives in your head and nowhere on the computer. Close your laptop, and the project's memory closes with it.
The genesis-kit makes one swap, and that swap is the whole idea. In its own words: you stop prompting the agent turn-by-turn; you run a one-time ritual that lays down a per-project spine, then a loop drives the agent against it. In plain words: stop typing every step. Set up a folder once. Let a loop type the steps for you.
The ChatGPT memory study began with the same trouble: an AI that forgets you the moment a chat ends. Its fix was to write the important facts into a store on disk, and read them back later. That is the exact shape of this kit too.
The one difference: the memory system stores facts about the user (“I use PostgreSQL,” “I am building SecondBrainLabs”). Genesis stores facts about the build (what the plan is, what is done, what we decided). Same trick, different room.
The big move: take the loop out of your head and put it on disk. Five jobs live only in you right now — remembering, judging “done,” knowing what already exists, actually running the checks, and watching the cost. Part I takes them one at a time. Each one turns into a piece of the folder.
Three Words, Before We Start
Before you read the definitions below — in your own words, what should a “plan” for a coding task contain? Name three things you'd want written down before you let an AI start typing code.
Everything ahead leans on three plain words: a plan, a loop, and a gate. Spend sixty seconds here and no later page will surprise you.
You already met one of them in the section above — “you are the loop.” Let's pin down all three now, in the simplest words possible, so that when G0 or a “gate” or a “loop” shows up later, it is already an old friend.
A plan is the work written down before you start: a goal, a clear test for “done,” and a list of small tasks. A loop is a worker that repeats one short cycle — read what's next, do it, check it, write down what happened, pick the next thing. A gate is a pass/fail checkpoint: before a step is allowed to count, it must clear the gate. Fail the gate, the step stops.
That is the whole machine in one breath: a loop works through a plan, and a gate guards every step. The rest of this study just earns each of those three words, one wall at a time.
Where does the plan come from?
This is the part that, taught badly, feels like a plan “just appears.” It does not. A plan is made, by a small, dull, three-move job you do once at the start — before any code. Start with a fuzzy wish and squeeze it into something a loop can actually drive.
WISH: “build login” ← too vague for a loop to work
move 1 · pin the goal what goes in, what comes out, what must never break
move 2 · write “done” yes/no checks, in pen, before any code
move 3 · cut the tasks small pieces, each with one command that proves it
PLAN: M1 login → demo: curl -X POST /login -d @good.json → 200 + token
Plan, loop, gate. A loop works a plan; a gate guards each step. Now we earn them. Part I shows the walls that force the plan to be locked, the loop to check itself, and the gates to be run, not narrated. When a word from this page returns, you will already know it.
Part I / Five Walls
Five walls, five rules
Each part below is a wall you have probably hit. We show the wall, let you stand at it, then name the one rule the kit uses to climb it. By the end you will have rebuilt the kit's five rules yourself — not been handed them. Read the wall before the fix. If you can guess the fix, the lesson worked.
The agent forgets; the repo doesn't. Maker is never checker. Gates are computed, not narrated. Never rebuild what already exists. Cheap driver, flagship only for the hard hops.
The kit's five rules — listed now, so you can watch each one get forcedThe AI Forgets
Have you ever opened a fresh chat and had to re-explain your whole project because the AI forgot it? What exactly did you retype? Where could that information have lived so you never type it again?
Monday, you spend an hour teaching the AI your project. Tuesday, it knows none of it.
A real day. Monday morning you tell the AI: “We use a Postgres database. The server code lives in the /server folder. We already decided to use JWT tokens for login, so don't suggest anything else.” The AI builds nicely for an hour. Tuesday you come back. The chat got long and squeezed itself, or you opened a new one. The AI has forgotten the database, the folder, the JWT decision. You explain all of it again. And again on Wednesday.
An AI's memory is called its “context window.” Think of it as a small desk. Only a few papers fit. When new papers come in, the old ones fall off the back and are gone. Anything you wrote only on that desk is gone the moment it fills up.
Stand at this wall for a second before reading on. If the AI's desk keeps clearing itself, where could the project's memory live so it survives? There is only one thing in the room that does not forget: the files on the computer. Files stay put. So the memory must live in files, not on the desk.
This is the very first problem the ChatGPT memory study solved. Its answer was a memory store on disk, plus a rule for what goes in. Genesis copies the idea exactly, only the store is a folder named .genesis/, and what goes in is the state of the build.
What is the one thing here that survives the AI losing its memory — and did we actually write everything important there?
A rule for any system: keep the part that thinks (and forgets) separate from the part that remembers. The AI is the thinker. Anything you would hate to explain twice belongs on the part that remembers.
So the first rule is forced, not chosen:
The agent forgets; the repo doesn't. State lives on disk in .genesis/, never only in context.
One file in that folder, implementation-notes.html, has the single job of holding “what is built and live right now.” A new session reads it and is caught up in seconds. Here is the kind of line it holds:
Capability Where (file / route / symbol) Status Verified by
User login server/auth/login.ts POST /login live L4 verify · M1
Password reset server/auth/reset.ts partial —
A memory that lives in files. Anything that must outlive the AI's desk becomes a file in .genesis/. The list of what is live is implementation-notes.html. The note that wakes up a cold session is KICKOFF.md. Now the AI's own memory is just a bonus, not a need.
It Grades Its Own Work
The AI writes “Done — works perfectly.” Be honest: how often do you ship it without checking? Recall one time “done” turned out broken. Who should have checked the work instead of the AI that wrote it?
The AI writes “Done! Login works perfectly.” You try it. It crashes.
A real moment. The AI finishes the login feature and writes: “Done! The implementation is complete and fully working.” You run it. It crashes on the first try, because it called a function named hashPassword that it never actually wrote. The test it “ran” was never run. The edge case it “handled” throws an error.
Why does this happen so often? Because the same AI that wrote the code is the one saying it is good. It has all of its own reasoning in front of it, so it trusts the work. It is the worst possible judge — for the same reason you cannot catch the spelling mistakes in an essay you just finished. Your eyes see what you meant, not what you wrote.
You cannot be the referee of your own game. If the person who shoots the goal also decides if it counts, every goal counts. The fix is not a smarter player. The fix is a different referee.
Stand at this wall before reading on, and you can almost build the fix yourself. The problem is that one AI both makes the work and judges it. So picture it as two boxes instead of one. On the left, today: a single AI that writes the code and then stamps its own work “done” — a stamp that always says yes. On the right, the only commonsense repair: the work crosses a wall to a second AI that never saw how it was made, and that one decides.
The memory study had a whole separate part for this, called the Evaluation subsystem (and inside it, an Evaluator). Its only job was to judge: is this memory worth keeping, and did retrieval work well? The part that made memories never got to grade itself.
Genesis does the same thing for code. A separate checker, called L4 VERIFY, decides if a job is really done. The maker never grades its own work.
Who said this was done — and did they have any reason, or any memory, that would make them say yes too easily?
A verdict is only as good as how independent the judge is. In any system where one part both makes a thing and approves it, the approval is theater. Split the two.
Maker ≠ checker. The checker is a separate AI that sees the goal, the spec, the work, and the rules — but never the story of how the work was made.
That last part matters. The checker is fed only four things: {goal, spec, artifact, invariants-at-risk}. It does not get the maker's chat. We starve it of the story on purpose, so it cannot be talked into agreeing.
Making and judging are split. “Done” becomes a verdict from a separate checker, measured against a goal sheet written before the code. And the maker is not allowed to edit that sheet. The sheet is a file called DONE.html, and it is LOCKED.
It Builds the Same Thing Twice
Have you ever found two functions in one codebase doing nearly the same thing? Before writing anything new, what one-minute check could the AI do to avoid making a duplicate?
You already have a function that reads invoices. Today the AI cheerfully writes a second one.
A real mess. Last week the AI wrote parseInvoice in one file. Today, three sessions later, it has forgotten that, so it writes parseInvoice again in a different file — slightly different. Now there are two. They slowly drift apart. A bug shows up that only happens when the code happens to call the second one. You spend an afternoon finding out there were two all along.
This comes straight out of B1. An AI that forgets cannot know what it already built. So its honest guess is: build it again. The duplicate is not careless; it is what any forgetful worker would do. And duplicates are worse than wasted time — two copies of one idea will drift, and drift is where the sneaky bugs live.
Before you make a new thing, look to see if it is already there. The looking costs a minute. The accidental duplicate can cost a day. So always look first.
The memory study's read path did exactly this. Before answering, it first retrieved what it already knew about you, so it would not ask again. Genesis has the same “look before you act” step. It is called G0, the Existence Pre-Flight — a gate in the sense from the primer, a pass/fail checkpoint — and it runs before every single task.
The fix has two halves, and you can feel both. First, a written, up-to-date answer to “what is already built?” — that is the memory from B1 doing double duty. Second, a strict rule that the AI must check it before writing. A list nobody reads stops nothing.
So before any code, G0 makes the AI read the wiki, search the “what is live” notes for the words in this task, and grep the codebase for the names it plans to use. Then it writes down a verdict. Here is a real, filled-in G0 block, in the kit's own format:
## G0 · 2024-05-14 09:02
- wiki pages read: [[concepts/Invoice]], [[concepts/Parsing]]
- implementation-notes searched for: "invoice", "parseInvoice" — found
- codebase grep: `parseInvoice` — 1 hit (existing-will-reuse)
- decisions that bind us: 0007-one-invoice-parser
- verdict: BUILT
The verdict has three possible values. UNBUILT means go ahead and build. PARTIAL means change the task to “extend the thing that's there.” BUILT means stop — it already exists, here it is. And the rule is strict: if there is no G0 block in the notes, the task never truly started.
Look before you build. The memory from B1 gets a reader: G0. The “what is live” file gains a new row every time a task passes the final check, so the next G0 can find it. Memory, plus the discipline to actually read it.
It Says, Not Does
“The tests should now pass.” Have you watched an AI type that without actually running anything? What's the gap between “should pass” and “I ran them: 6 of 6 passed” — and which would you accept from a teammate?
“The tests should now pass.” Read that again. It is a guess, not a fact.
A real trap. The AI writes: “The tests should now pass.” “This should typecheck cleanly.” “The lint errors are fixed.” None of those is a fact. Each one is the AI describing a command instead of running it. It has seen a million passing test logs, so it can write a sentence about one it never ran.
This is the most slippery wall, because the words sound right and usually seem true. But the gap between “the tests should pass” and “I ran the tests, here is the result: 0 failures” is the whole gap between a story and a fact. Bad AI output lives exactly in that gap.
Saying you washed your hands is not the same as washing your hands. Don't accept “it should work.” Run the command. Show the result. A real result cannot be made up.
The fix sounds almost too simple, which is why people skip it: a claim of “it works” only counts if it is the output of a command. So in this kit, every quality check is run for real, and the actual result is pasted into the notes. Here is what that looks like. (Those gate G1…G5 lines are the five pass/fail checkpoints every step must clear — Part III names each one; for now, just read them as “this check passed.”)
## iter 3 · 2024-05-12 14:20
- gate G1: pass · skills considered [tdd, security]; chose tdd
- gate G2: pass · +84 LOC server/auth/login.ts, +6 tests, -0 type errors
- gate G3: pass · 4.1k tokens this iter, 18.4k total
- gate G4: pass · typecheck clean, tests 6/6, lint clean
- gate G5: deferred (run at exit only)
- decision: hash with bcrypt, cost factor 12
- next: add the rate-limit on failed logins
Is this “it works” a sentence the AI typed, or a number a command gave back?
Trust the thing itself, not the report about it. Anywhere a system can either do a check or talk about the check, force it to do the check and show the raw result. Talk is free; results are earned.
Gates are computed, not narrated. Run the command, paste the result. No block in the notes, no iteration happened.
Checks are run, and the proof is pasted. “Typecheck clean, tests green” stops being a promise and becomes real results in the iteration block. The checker from B2 reads proof, not promises.
It Uses the Costly Brain for Everything
If a brilliant but pricey expert were on call, would you page them to rename your variables? In your last task, which parts were genuinely hard — and which were boring chores anyone could do?
You point your smartest, priciest AI at the whole job — including renaming a variable.
A real bill. You set the best, most expensive model loose on the project. It works. But it spends that top-tier brain on renaming a variable, moving a file, and adding a test that just copies an old one. Each tiny chore is billed at genius rates. The cost adds up fast, and so does the wait.
Most of building is not hard. Scaffolding a file, wiring an import, copying a test pattern, renaming a symbol — these are simple chores. Spending a genius on them is like flying in a brain surgeon to change a lightbulb. The hard moments are real but rare: a big design choice, a truly confusing bug, a careful final check. The smart brain should be saved for those.
Match the worker to the job. Use a cheap, fast AI for the easy 90 percent. Call in the expensive, smart AI only for the hard 10 percent — then send it back. Don't pay genius prices for chores.
The memory study made the same call. For deciding what to remember, it said the Evaluator can be a cheap classifier most of the time, and a smarter LLM judge only when the case is tricky. Cheap for the common path, smart only where it pays. Genesis runs its loop the same way.
Does this step truly need the genius brain, or am I paying top dollar for clerical work?
A good system is mostly cheap, with a few sharp, on-purpose splurges. A system that is expensive everywhere is one that never asked this question.
Cheap driver by default; flagship only for the hard hops. The loops assume the driver is not the expensive model.
So the kit's loops are built to run on a cheap model. The cheap driver may call in the expensive model for one hard sub-task — a design call, a stubborn bug — and then drop right back to cheap. This is also why the checker in B2 can afford to be a better model than the maker: you only run it at the moment of judgment, not on every keystroke, so its sharpness pays off.
Two tiers of brain. The loop names a cheap default driver and saves the expensive model for design calls and hard debugging. This is what makes a loop that runs for hours actually affordable.
The Ledger
Five walls became five rules
| B1 | AI forgets between sessions → keep state in files, in .genesis/. |
| B2 | AI grades its own work → a separate checker, L4 VERIFY. |
| B3 | Builds the same thing twice → look first, with the G0 pre-flight. |
| B4 | Says instead of does → run the command, paste the result. |
| B5 | Genius brain on chores → cheap by default, expensive only when hard. |
Part II / The Spine
The folder that remembers
Now, and only now, the folder. .genesis/ is the file-memory that Wall 1 demanded, the locked goal sheet that Wall 2's checker measures against, the “what's live” record that Wall 3 reads, and the place Wall 4's proof gets pasted. Every file traces back to a wall. We will not ask you to memorize a layout. We will show you the answers you already worked out.
If the AI's memory keeps clearing, what would a project's memory have to hold so that any fresh session — even on a different AI — could pick it up and keep going without you in the room?
The question the folder answersThe Folder That Remembers
Close your laptop now. Tomorrow a brand-new AI opens your project with nobody to explain it. Which files must it read to catch up? Write that list before you look at ours.
The setup drops one folder into your project. Each file holds one job that used to live in your head. Read the picture as a set of memories, not a folder tree.
Match each box back to Part I and the folder stops feeling random. DONE.html and PLAN.md are the goal and plan that used to live in your head (Wall 1) and that Wall 2's checker measures against. implementation-notes.html and CURRENT.md are the “what's done” record Wall 3 reads. context-graph.json holds the rules the checker defends. LOOPS.md is the how-to-build itself. KICKOFF.md is how a fresh session — or a whole different AI — wakes up and keeps going.
The memory study stored each memory as a neat record with fields: id, type, content, importance, confidence, source. Tidy fields, so every later step could use them. Genesis does the same with build state. Its “record” for “where are we right now” is CURRENT.md, and it too has tidy fields:
# CURRENT
- active_loop: BUILD
- target: M1-login
- iteration: 3
- last_gate: G4 (passed)
- last_action: ran tests — 6/6 green
- next_action: add the rate-limit on failed logins
- model: cheap-driver
- tokens_used: 18420
- tokens_budget: 40000
- skills_loaded: [agentic-swe-master, router, tdd]
One detail earns its own line, because it is the deepest answer to Wall 1: the folder is just markdown, JSON, and HTML. No special database. No AI-only memory feature. No plugin. That plain-file choice is what lets the same project survive a switch from one AI to another — the topic of Part V.
For each file in the folder, which wall from Part I would come back if you deleted it?
A good memory layer has no spare files. If deleting a file brings back no wall, it was never holding anything up. This folder passes that test exactly because each file was forced by a wall.
The Locked Goal Sheet
Imagine a student allowed to rewrite the exam after seeing the questions — why is that broken? If an AI could edit its own definition of “done,” what would it do the moment a task got hard?
DONE.html is the most important file, and the only one the AI is not allowed to edit. It holds three things, in order: the job (what goes in, what comes out, how much the AI may do alone, where a human steps in, what must never break); the definition of done as a list of yes/no checks the checker runs; and the plan, cut into small tasks.
Why locked? Because of a sneaky wall. An AI that can edit its own goal sheet will, when a task gets hard, quietly soften the goal until the work it already did happens to pass. A goal you can move is not a goal — it is a mirror. Locking the sheet gives Wall 2's checker something solid to measure against. Want to change the goal? That goes through the human, never through a quiet edit mid-build.
Write the test before you take the test, in pen, and don't let the student rewrite it halfway through. That is what “locked” means.
The checks are yes/no on purpose. Not “the code is good” — that's a feeling — but things a separate checker can mark true or false:
Definition of done — checked by the CHECKER, not the maker
[ ] code only points inward, no loops in the dependencies
[ ] every call to the outside has a timeout
[ ] every AI / data output is checked against a schema
[ ] a threat model is written; bad input was thought about
[ ] typecheck is clean AND tests are green
[ ] one check pass by a SEPARATE AI (L4)
[ ] no rule in context-graph.json is broken by the change
Each line is copied from a phase “Gate:” in the bigger agentic-swe-master guide that the kit sits on top of. So “done” is not made up for each project; it inherits a real engineering standard. And the task list below it follows one strict rule: every task must name an exact demo command that proves it works.
### M1 — User login
- Outcome: a user can log in and get a token
- Demo command: curl -X POST localhost:3000/login -d @good.json → 200 + token
- Files it may touch: server/auth/**
- Success: 200 with a valid token; 401 on a wrong password
A goal the maker cannot move. DONE.html is LOCKED; its checks are yes/no and owned by the checker; every task has a demo command. PLAN.md holds the same task list in a form the loop can read.
The Map of What Breaks What
Think of a change that passed every test but still broke something. What had quietly stopped being true? How would anyone have known to check for it?
One file answers a question the others do not: if I change this, what else might break? That is context-graph.json. Its boxes are your code files. Its arrows say “this file is used by that file.” And its most valuable part, the invariants, are plain-English rules that say what “not broken” means for this project.
It is a map. The boxes are your files. The arrows show who depends on whom. And a few sticky notes on the map say “this must always stay true.”
The kit ships a tiny tool, graphizer.mjs, that reads your code and fills in the boxes and arrows for you. But it will not write the rules. Those you write by hand — two or three, like the examples below. A tool can read your wiring; only you know what must never break.
Example invariants (you write these by hand):
"the login code must never import the billing code"
"every call to the outside has a timeout"
"p95 latency stays under 200ms"
The payoff comes at the final check. When Wall 2's separate checker judges a change, it is also handed the rules the change might affect, and asked one extra question: does this break any of them? The map turns “looks fine on its own” into “safe for the things that must not break.”
What are the two or three things that, if they stopped being true, would mean the system is broken — even if every test still passed?
Tests check the cases you thought of. Rules (invariants) check things that must hold in every case. Writing the rule down is what lets a fresh checker defend it without re-reading your whole design.
Part III / Loops & Gates
The part that types the steps for you
The folder is the memory. The loops are the heartbeat. This is the right-hand box from Part 0, made real: a set of loops that drive the cheap AI against the locked goal, and a set of checks every step must pass. The checks enforce Wall 4. The check-loop enforces Wall 2. The look-first step enforces Wall 3. You have met all of this already, in disguise. Here it runs.
If a loop, not a person, is going to drive the AI for hours, what must be true on every single step so that “ran for hours” does not mean “made hours of junk”?
The question the checks answerThe Five Checks
Suppose a loop ran on its own for two hours with no one watching. What would you want it to check after every single step, so two hours of work doesn't become two hours of garbage? List your checks.
Every step of every loop must pass five checks, in order. Fail one, and the step stops. Fail the same check three steps in a row, and the whole loop stops and calls you. The checks are the immune system; three strikes is the safety switch.
| Check | The question | Passes when |
|---|---|---|
| G1 Skill | Did we load the right guide-skills for this job, and write down which we chose? | There is a skills considered […]; chose X line |
| G2 Progress | Did this step actually move the task forward? | At least one real change (lines, a test, fewer errors). Three misses stop the loop. |
| G3 Cost | Are tokens and tool calls under the budget? | Under the cap, or it stops and calls you |
| G4 Quality | Does it typecheck, do tests pass, is lint clean for the files touched? | All pass — run for real, results pasted |
| G5 Verify | Does a separate AI approve the work against the goal? | APPROVE, with reasons (this is L4) |
Read the order as cheapest-first. G1 is free — did you even load the right skills. G2 and G3 are quick bookkeeping — are we moving, are we within budget. G4 runs the real commands (that's Wall 4 in action). G5, the priciest, hands the work to a separate, smarter AI (that's Wall 2 in action) and is saved for the very end, so you pay for it just once. Cheap checks first, costly checks last, nothing waved through.
The Five Loops
When you build a feature, you don't only “build.” Sometimes you debug, sometimes you go look something up. Name the different modes you slip into during one task. How many did you count?
There are five loops, and only one is ever the boss. L1 BUILD ships one task. It calls L2 DEBUG when a check fails, calls L3 RESEARCH when it hits something it does not know, and always ends by calling L4 VERIFY. L5 HEALTH runs when you ask, to tidy the notes — and it only reports; it never fixes things on its own.
Walk the BUILD loop once, and every wall from Part I shows up in its place. It loads its skills and writes them down (Check 1). It runs G0 first — the look-first step from Wall 3 — and may change or stop the task if it already exists. Then it loops: edit, run tests, do the five checks, write a block in the notes. A failed check starts a DEBUG loop, which is not allowed to try two blind fixes in a row — it must isolate the cause before it edits. Something it does not know starts a RESEARCH loop, which writes the answer into the wiki so the next loop already has it. And the task is not marked done until L4 VERIFY says APPROVE.
| Loop | Its one job | Starts when | Skill it uses |
|---|---|---|---|
| L1 BUILD | Ship one task, with its demo command passing | The boss loop, per task | blueprint, tdd |
| L2 DEBUG | Find the one root cause + add a test so it can't come back | A check fails | detective |
| L3 RESEARCH | Learn one missing thing, write it to the wiki | A gap blocks the build | scout |
| L4 VERIFY | Judge the work against the goal, with fresh eyes | Every build ending | verify |
| L5 HEALTH | Tidy the notes and flag drift — report only | When you ask | learn |
How the Loop Talks to Itself
Right now, after each step, who types “okay, do this next” — you or the AI? If the AI left itself a sticky note with the next step, what would you stop having to do?
This is the heart of it. In the old way, you typed the next step. In this way, the loop reads one line from a file and types the next step to itself. Let's watch it happen.
Look back at the CURRENT.md file from Part II. It has a line called next_action. That single line is the prompt. When the loop starts a step, it reads that line and does what it says. No human typed it. The loop is reading its own note from last time.
Here is one full step, slowed down. The loop reads where it is, does the next thing, runs the checks, writes down what happened, then writes a fresh next_action for the step after this. That last move — writing its own next instruction — is the self-prompt.
# CURRENT
- target: M1-login
- iteration: 3
- last_action: ran tests — 6/6 green
- next_action: add the rate-limit on failed logins ← the loop reads this. no human typed it.
## iter 4 · 2024-05-12 14:41
- gate G1: pass · skills considered [security, tdd]; chose security
- gate G2: pass · +31 LOC server/auth/rate-limit.ts, +3 tests
- gate G3: pass · 3.6k this iter, 22.0k total
- gate G4: pass · typecheck clean, tests 9/9, lint clean
- decision: lock the account for 60s after 5 bad tries
- next: run L4 VERIFY — the task looks done
# CURRENT
- target: M1-login
- iteration: 4
- last_action: added rate-limit, tests 9/9 green
- next_action: run L4 VERIFY on M1-login ← the next step is already written. the loop reads it and goes again.
The loop leaves itself a sticky note that says “do this next.” Then it does that, and leaves a new sticky note. Over and over. The sticky notes are the prompts, and the loop writes them for itself.
Now the best part. What if the session dies in the middle — the laptop sleeps, the chat resets, you switch to a different AI? The loop wakes up cold by pasting one file to itself: KICKOFF.md. It is a ready-made prompt that says, in order: load these skills, read these files, pick the next task, run the look-first check, then run the build loop. It is the self-prompt for starting from nothing.
Load skills: agentic-swe-master, router, tdd
Read in order: DONE.html, PLAN.md, wiki/index.md,
implementation-notes.html, LOOPS.md, CURRENT.md
Then:
1. Pick the next unstarted task (or resume from CURRENT.md).
2. Run G0 EXISTENCE PRE-FLIGHT first.
3. Run L1 BUILD. Enforce all five checks. Results are computed, not narrated.
4. Write a block to the notes every step.
5. End through L4 VERIFY (separate AI).
Never mark a task done without L4 APPROVE.
And while the loop runs, here is the small dashboard you watch. You are not typing steps anymore. You are reading a status line and stepping in only when it stops and asks.
L1 BUILD · M1-login · iter 4 · cheap-driver · 22.0k/40k tokens
skills: agentic-swe-master, router, tdd
phase: add rate-limit on failed logins
G1 OK G2 OK (+31 LOC, +3 tests) G3 OK G4 OK (tests 9/9) G5 waiting
next: run L4 VERIFY
If the loop writes its own next instruction every step, what is left for the human to do?
Watch the verdicts and unblock the hard parts. When a system writes its own next step, your job moves up a level: from doing the work to deciding when the work is going wrong.
The loop reads a file, does the step, then writes the next instruction back to the file. That little circle — and the KICKOFF.md wake-up note — is the whole “self-prompting” idea. The files are how the loop talks to itself across steps and even across sessions.
The Wall Between Two AIs
Ask the same AI that wrote the code “is this good?” — it has all its own reasoning in front of it. What should a fair checker be allowed to see, and what should it never see, so it can't be sweet-talked into a yes?
L4 VERIFY deserves its own picture, because it is where Wall 2 stops being a rule and becomes a wall you can see. The checker is a different AI — a smarter one when possible — and it is kept hungry on purpose. It gets the goal, a bit of the spec, the work, and the rules at risk. It does not get the maker's chat: none of the reasoning, none of the confidence, none of the story about why the code is right.
The verdict is one of three. APPROVE passes the task. REJECT sends it back with reasons, which starts a debug loop and one more try. UNCERTAIN calls you — the system would rather ask than guess at the moment of judging. This is also the right place to spend the expensive model from Wall 5: you run the smart, sharp AI exactly once per task, where being independent and being sharp both pay off.
Same shape as the memory study's Evaluation subsystem: a part whose only job is to judge quality, kept apart from the part that made the thing. The lesson repeats because it is true in both rooms — the maker is the worst judge of its own work.
One backup, in plain words: if your AI truly cannot run a second AI, you still keep the wall. Clear the session, start a fresh one, and hand it only KICKOFF.md plus the changed code. A fresh session that never saw the build chat is a weaker but real version of the same wall. The split is the rule; how you start the second AI is just plumbing.
Done is a verdict, not a feeling. The wall between maker and checker is the most important portability rule in the whole kit — every AI can build it, only the how-to-start differs. Hold that thought into Part V, where one folder has to run on four different AIs.
Part IV / The Setup
From empty folder to running loop
The folder and the loops do not appear by magic. A one-time setup lays them down: seven steps, G0 through G6. You run it once when you start (or adopt) a project. By the end, every file from Part II exists and the first loop from Part III is ready to run. This setup is the “genesis” the kit is named after.
What is the shortest list of steps that turns an empty folder into one a loop can drive — with no human in the room?
The question the setup answersThe Seven Steps, G0 to G6
Before an AI writes a single line on a new project, what should already be decided? List everything you'd want nailed down up front so it never has to guess.
The setup does all the deciding up front, so the loop never has to guess. Its most-skipped, most-costly step is the first one.
| Step | What it does (plain words) | Makes |
|---|---|---|
| G0 · The job | Answer five questions about the project — what it is, does it use AI, is it spread across machines, what must we never trust, what stage are we at — then write down the job. Don't skip; everything flows from this. | DONE.html §1 |
| G1 · Make the folder | Drop the .genesis/ folder with scaffold.sh — all files, blanks to fill. | the whole folder |
| G2 · Map + rules | Run graphizer.mjs to fill the map, then write 2–3 rules by hand. | context-graph.json |
| G3 · Seed the wiki | Add pointers (not copies) to the big shared notes you'll need — knowledge just in time. | wiki/index.md |
| G4 · Write the goal | Copy each phase's “Gate:” line from the big guide into the goal sheet. | DONE.html §2 |
| G5 · Cut the tasks | Slice the work into small tasks — each with one outcome, one demo command, and a fence of files it may touch. | PLAN.md |
| G6 · Start the loop | Fill KICKOFF.md, pick task one, run the look-first check, start L1 BUILD. | a running loop |
Two warnings the kit repeats, because they are the two ways a setup quietly fails. One: do not skip G0, the job. A loop that does not know what it must never trust, or how perfect it must be, will make those calls itself — badly. Two: do not write a task you cannot give a demo command for. The command is the task's contract; a task without one is a wish.
Part V / Any AI
One folder, any agent
Go back to the deepest form of Wall 1. If the project's memory lived inside one AI's special features, switching AIs would mean losing the project. The kit refuses that. The folder is plain files; only four things differ between AIs, and those four live in exactly one file. That is what lets you swap Claude for Codex for Hermes without touching a single piece of the project's memory.
If everything that matters is plain files on disk, what is actually left that depends on which AI you run — and can it be squeezed into one file?
The question portability answersOne Folder, Any Agent
Say you had to move your whole project from ChatGPT to Claude to Codex tomorrow. What would break? What did you store in a form only one of them can read?
Read the whole folder and you find only four things ever depend on which AI you use: how you call a skill, how you run a loop on a timer, how you run until a goal is met, and how you start a second AI for the maker/checker wall. Everything else — the goal, the plan, the map, the memory, the wiki, the loop rules — is just files any AI can read. So the kit puts all four differences into one file, AGENT-ADAPTERS.md, and has every other file point to it.
| What you do | Claude Code | Codex | Any other AI |
|---|---|---|---|
| Call a skill | Skill tool / /x | $x / /skills | paste the skill's text into the chat |
| Run a loop on a timer | /loop <time> | Automations tab | a cron job that runs the CLI with KICKOFF.md |
| Run until a goal is met | /goal "…" | /goal | a while loop that greps CURRENT.md |
| Start a second AI | Agent tool / Workflow | .codex/agents/*.toml | a second CLI run, fresh memory |
What the kit will not lean on is as telling as what it uses: no AI-only memory features (the folder is on disk instead), no AI-only tool formats (skills are plain text), no editor plugins (the folder is just files; any terminal works). Each of those “no’s” is Wall 1 again, taken all the way — durable, portable, yours.
If you had to move this project to a new AI tomorrow, how many files would you edit?
How portable a thing is = how small its one connecting seam is. A system that is fully portable except for one well-named adapter file is portable. Gather the coupling in one place; never spread it.
Part VI / Run It
From reading to running
You have rebuilt the whole machine, wall by wall. The last move is to put it together in one picture and then actually start it — because the point was never to understand a build loop. It was to run one against your own empty folder and watch it drive an AI you used to babysit.
Could you now, without re-reading, name every box in the machine and the wall it knocks down — and type the three commands that bring it to life?
The transfer testThe Whole Machine
Cover the page with your hand. Can you name the system's memory, its heartbeat, and its conscience — and the everyday headache each one removes?
Here is everything at once. The setup writes the folder. The loop reads the folder, drives the cheap AI through the five checks, branches off to debug and research when needed, ends through the checker behind the wall, and writes the result back to the folder. The folder is the memory. The loop is the heartbeat. The wall is the conscience.
Every box on that picture is a wall you stood at in Part I. The folder is Wall 1. The wall around L4 VERIFY is Wall 2. The G0 look-first step is Wall 3. The five checks are Wall 4. “Cheap AI” printed on the loop is Wall 5. Nothing here is decoration; delete any box and a real wall walks back in. That is the test a good design passes — and the test this whole study was built to let you run.
Three Commands to Start
On the project you're actually working on: which of the five walls hits you most often? Which file would you create first thing tomorrow?
Three commands install the kit and turn an empty folder into a running one. They are the setup's first steps, made real.
# 1 · install the kit into every AI on your machine
cd genesis-kit && ./install.sh
# 2 · in your project: drop the folder, then build the map
cd ~/your-project
$GENESIS_KIT_ROOT/tools/scaffold.sh .
node $GENESIS_KIT_ROOT/tools/graphizer.mjs . --write
# 3 · in your AI: call the genesis skill, run G0–G6,
# then start the BUILD loop with your goal/loop command
# Claude: /goal "M1 done — DONE.html task all-checked"
# Codex: /goal …
# Hermes: a scheduled run against KICKOFF.md
After that, waking up cold is simple: read KICKOFF.md. It tells any session — any AI — to load the skills, read the folder in order, pick the next task, run the look-first check, and run the BUILD loop under the five checks until L4 VERIFY approves. You are no longer the loop. You read the verdicts and unblock the hard parts.
Drop the folder, build the map, run the setup, and point the loop at task one with the rules pinned. Then read the notes, not the code. You are no longer typing every step. You are running a machine that types the steps for you — against a goal it cannot quietly change, judged by eyes that are not its own.
On your own project: which of the five walls hits you first, and which file in the folder would you reach for before writing any code?
If you answered without scrolling up, the idea has transferred. That was the whole point — not that you can repeat the genesis-kit, but that you could have invented it, and can change it the day your job stops matching ours.
Part VII / Five More Gates
What running it for real taught us
Five more cracks, found only by running the loop on real projects. Subtler than Part I's walls, because each looks fine right up until it isn't. One gate per crack, added exactly where it bit. Diagrams first, words second.
The plan never compared two other approaches. The agent guessed what “good” meant. Nobody remembers why the code drifted from the plan. A verify APPROVE rubber-stamped a pass. And the scaffold shipped with someone else's model prices baked in.
Five incidents, five new gatesBrainstorm Before You Build
The first workable idea and the best idea are rarely the same idea — and G0 alone never asks if there's a better one.
PLAN.md → Brainstorm section — before a single milestone is sliced. Cheapest moment in the whole project to change your mind.Interview Mode — Surface Unknown Knowns
DONE.html only locks in the goals somebody wrote down — not the trade-offs and constraints that live only in your head until you're asked.
The Deviation Log — Institutional Memory
A loop that runs for hours will sometimes hit a wall the plan didn't foresee, and pivot. Fine — unless the pivot leaves no trace.
## deviation · 2024-05-15 · M3-cache
- planned: Redis-backed sessions
- actual: in-memory sessions
- reason: Redis unavailable in the dev sandbox
- invariant impact: none — single-instance dev only, not on the prod path
PLAN.md.The Quiz-Me Gate on L4 VERIFY
Wall 2 fixed the maker grading itself. It never fixed the human nodding “looks good” at a verdict they can't actually explain.
Model & Config Prompts in Scaffold
The first scaffold.sh baked placeholders like {{CHEAP_MODEL}} into every file and left you to hunt them all down by hand.
{{CHEAP_MODEL}}-style placeholder survives into your working files.The Ledger — Round Two
Five more gates, five real incidents
| P1 | First idea gets built → G0.5 compares 3 approaches before any milestone is cut. |
| P2 | Agent guesses what “good” means → a 12-question interview, run before G0. |
| P3 | Plan silently drifts from the code → an append-only deviation log. |
| P4 | APPROVE becomes a rubber stamp → a 3-question quiz gate before “done.” |
| P5 | Scaffold bakes in someone else's model choices → scaffold.sh asks, Enter accepts the default. |
For working professionals
Want to truly learn AI-native engineering?
If you are a working professional and want to build the kind of proof needed for Applied AI Engineer, Forward Deployed Engineer, Agent Engineer, AI SWE, AI Product Engineer, or AI startup engineering roles, apply to work with us.
The AI-Native Engineering Sprint is for people who want to learn the systems behind agents, evaluation, retrieval, AI coding workflows, production capstones, and technical positioning.
Apply to work with us