Vibe coding with Claude Code course Β· Module 15: Advanced Claude Code
Final project: from SPEC to deployment with Claude Code
In this lesson13
You built twelve clones from the maps of the lessons. Every lesson said what to build, which file to open in Cursor and what to check in the diff. The final project has no such map: it is your own application, with your own idea, not another clone. Without lessons it is easy to slide back into the old habit, a single request "build me a workout app". An hour later you have forty changed files that nobody has read, and you do not know which step broke something. This lesson gives you the map of the whole voyage. It is the same way of working as in the course, step by step, and every step leaves in the repository a proof that your mentor will see at the end.
What you already know
Nothing here is new. You know the interview and SPEC.md from lessons 1_6 and 13_5, a short CLAUDE.md from lessons 1_7 and 14_3, deny rules from lesson 8_4, plan mode from lesson 0_4, a test before code from lessons 4_1 and 10_4, /code-review from lesson 2_9, /security-review from lesson 8_7, the checklist from lesson 15_4, a deployment that you approve yourself from lesson 10_5, and /rewind and Git from lessons 0_6 and 1_5. The only new thing is that you put them together yourself, without a lesson that suggests the next step.
The map of the voyage
| Stage | Proof in the repository |
|---|---|
| Interview and specification | SPEC.md with a "What we are not doing" section |
| Crew rules | a short CLAUDE.md and .claude/settings.json with deny rules |
| Plan | PLAN.md with small steps |
| Build | small commits and tests run with one command |
| Reviews | a note with the accepted and rejected remarks |
| Deployment | the production address and a way back |
| Break and recover | a bad change and its revert in the history |
Choose your own land
A good final project solves one small problem you know from life: a workout log, a book swap in your class, a rota of chores at home. One main action of the user, data described with a few fields, two roles at most, for example a visitor and an owner. A small project that is finished and deployed will teach you more than a big one abandoned halfway, and I recommend that without hesitation.
When you have no idea, reach for the list of features from the old version of this lesson, corrected so that it tells the truth about the course:
- sign-in: Better Auth from lesson 8_5, Supabase for the curious from lesson 13_7;
- database: Prisma and PostgreSQL from lesson 13_4;
- entries and comments through API routes: lessons 13_5 and 15_4;
- uploading files: the video from lesson 5_4, the photo for the magnifier from lesson 13_3;
- search and filters in the address: lessons 4_5 and 6_5;
- live messages: Server-Sent Events from lesson 6_4;
- dark theme: the
dark:prefix from lesson 1_3; - deployment: Vercel from lesson 10_5, a container from lesson 12_4.
What the course did not teach, we say outright: WebSockets, payments or sending e-mails. If your idea needs them, write them into SPEC.md as a risk and start with research in the documentation, as in lesson 5_4, before the first line of code appears. The old lesson also showed a directory tree. After the corrections it could look like this:
my-project/
βββ app/
β βββ api/auth/[...all]/route.ts
β βββ api/entries/route.ts
β βββ entries/[id]/page.tsx
β βββ generated/prisma/
βββ components/
βββ lib/auth.ts, lib/prisma.ts
βββ prisma/schema.prisma
βββ SPEC.md, PLAN.md, CLAUDE.md
βββ .claude/settings.jsonTreat it as an example, not a pattern to copy. app/api/auth/[...all] is the Better Auth route from lesson 8_5, and app/generated/prisma is the generated Prisma client from lesson 13_4. Your own tree will be proposed by Claude in the plan, based on your specification.
Step 1: the interview and SPEC.md
Claude sets up an empty Next.js project as in lesson 1_2, and then you start with a conversation, not with code. The session in Manual mode, because the interview changes nothing:
Request for Claude Code:
I want to build an application: [one sentence about the problem and the user].
Interview me, at most three questions at a time: who uses it, what they
do most often, what data we save, who can change what, what the first
version does not do. Then write SPEC.md: goal, users, features of the
first version, data, routes and permissions, what we are not doing, how we
will check that it works. Do not write any code.The "What we are not doing" section keeps the voyage in check when, halfway through, you feel like adding one more feature. You read the specification in Cursor and correct it before a single line of code exists. Then a commit with the specification and a repository on GitHub, as in lesson 1_5.
Step 2: crew rules
/init gives a starting point for CLAUDE.md, and then you mostly delete lines, as in lesson 14_3. What stays are the check commands, the traps and the decisions that Claude will not read out of the code. Next to it, in .claude/settings.json, stand the hard rules from lessons 8_4 and 10_5:
{
"permissions": {
"deny": ["Read(./.env)", "Read(./.env.*)"],
"ask": ["Bash(vercel*)", "Bash(npx vercel*)", "Bash(git push *)"]
}
}deny blocks Claude from reading files with secrets in every mode, with the exceptions you know from lesson 8_4, and ask stops a deployment and a push and asks for your consent. A request in CLAUDE.md is read by the model, which decides for itself what to do with it, while a rule in the settings is enforced by the program. Both files go into the repository.
Step 3: the plan
You start building in a fresh session, because the conversation from the interview is full of rejected ideas. You type /clear, and then:
/plan Plan the first version according to @SPEC.md. Split the work into
steps, each ending with a working application, a test and a commit.
First the data model and tests of its rules, then the routes, the screens
last. For each step give the files and a command that will prove it works.
Save the plan in PLAN.md with boxes to tick.In the plan you look for two things: steps so small that you can read the diff of each in a few minutes, and a command next to every step. A step like "sign-in and the whole dashboard" you split before you accept the plan. PLAN.md survives every /clear, and a plan from the conversation does not.
Step 4: a small step, a check, a commit
Every step from PLAN.md is one request in the same shape: the goal, files through @, constraints and the definition of "done", for example "done when npm run test -- --run, npm run lint and npx tsc --noEmit pass". The test appears before the code, as in lesson 4_1, and first it must fail. Then you read the diff in Cursor and ask for a commit with the name of the step. One step is one commit, because only then do you know what to go back to.
When something does not work out, keep to the rule from lesson 0_5: after two failed fixes of the same thing you type /clear and write a better request instead of asking for a third fix. Better means more concrete: the file, the symptom, the output of a command and a description of what "fixed" looks like. Longer steps that you leave to Claude unattended get the check from lesson 14_8: /goal or a Stop hook.
Step 5: reviews
Before the first deployment the whole branch goes through two reviews and one list. /code-review from lesson 2_9 looks for bugs in behaviour, /security-review from lesson 8_7 looks for holes, and the list from lesson 15_4 guards secrets, locks, validation, responses, headers and packages. The remarks are hypotheses. You check each, fix the accepted ones with a narrow request and a test, and in docs/REVIEW.md you write down in one sentence what you accepted, what you rejected and why. That note shows best that a human read the review.
Step 6: a deployment that you approve
You deploy as in lesson 10_5. The first deployment of a new project on Vercel always goes to production, so you do it yourself, only after the reviews. The next ones go through a preview: Claude builds it with the /deploy skill, you open the address in the browser and promote the version to production in the Vercel dashboard. Before you promote, you know which earlier deployment Instant Rollback will restore. You set the variables in the dashboard, and their names you keep in .env.example.
Step 7: break and recover
The last step is an alarm drill. You ask Claude for a bad change and approve it with a commit, as if it had passed the review:
Drill: remove the owner check from the route that changes data,
and make a commit "Bad change (drill)". Do not touch the tests.If the tests still pass, the drill has already paid off: you know that no test guards that lock, and you add one after you are back. And the way back? /rewind from lesson 0_6 is the wrong rope here. It undoes files changed by Claude's tools in this conversation, but it will not undo a commit, because the Git history was written by a command in the terminal. On a real voyage a bad change often comes to light days later, in another session or already on GitHub. The Claude Code documentation says outright that checkpoints are for a quick return within a session, and that Git is the lasting history. So you go back as in lesson 1_5:
git log --oneline -3
git revert --no-edit 9b17e63
npm run test -- --rungit log shows the number of the bad commit, different for you than in the example. git revert writes a new commit that reverses its effects, and --no-edit takes the ready description beginning with Revert. The history stays untouched, so this rope works even when the bad change is already on GitHub. Green tests at the end are the proof that the lock is back.
What you send to the mentor
A link to the repository on GitHub. The mentor will check what the map left behind: SPEC.md, a short CLAUDE.md, .claude/settings.json with deny rules, tests run with one command, the history of small commits together with the bad change and its revert, the note from the reviews and the production address in the repository description.
Captain's review
- Specification before code. The commit with
SPEC.mdis in the history earlier than the first commit with feature code. - Small steps. No commit mixes two steps from
PLAN.md, and every one, except the drill from step 7, leaves the tests green. - Secrets.
git ls-filesshows no.envfile other than.env.example. - The last word. You promoted production, and the
askrules stop everyvercelandgit push.
A typical agent mistake: one huge step. You ask for the first step of the plan, and Claude "while at it" sets up the screens, the routes and the sign-in all at once, because it sees them in SPEC.md. You will recognise it by the list of files in Source Control, longer than in the plan. As long as there is no commit, you go back through /rewind and repeat the request with a list of the files that may change. In the editor below a map of the voyage is waiting: tick the stages and see what is missing before you send the link, and in the alarm drill check which rope takes you back from different shoals.
Remember: you steer your own ship by the same map as other people's, and every stage of the voyage leaves in the log a trace that can be checked.
End of the voyage
Congratulations! This is the last lesson of the Vibecoding world.
You began with your first command in the terminal and you end on your own project that went through the whole map: from the interview, through small steps and reviews, to a deployment you approved yourself. Along the way you learned the watch that Claude Code keeps without you, and the budget you count before setting sail. Start every new project with a short CLAUDE.md, deny rules and an exam, and the map will fill itself in. Sail on: more worlds and new lands of code are waiting in CodeWorlds!
Code for this lesson: App.tsx
// Voyage map of the final project: every stage leaves a proof, and the alarm drill shows which rope takes you back
import { useState } from 'react';
export interface Stage {
id: string;
name: string;
proof: string;
}
export type Situation = 'edit-without-commit' | 'terminal-command' | 'bad-commit' | 'bad-commit-on-github' | 'two-failed-fixes';
export interface Advice {
tool: string;
why: string;
}
export const STAGES: Stage[] = [
{ id: 'spec', name: 'Interview and SPEC.md', proof: 'SPEC.md with a What we are not doing section' },
{ id: 'rules', name: 'Crew rules', proof: 'a short CLAUDE.md and .claude/settings.json with deny rules' },
{ id: 'plan', name: 'Plan', proof: 'PLAN.md with small steps and a command for each' },
{ id: 'build', name: 'Build', proof: 'small commits and tests run with one command' },
{ id: 'review', name: 'Reviews', proof: '/code-review, /security-review, the list from 15_4 and a note with the decisions' },
{ id: 'deploy', name: 'Deployment', proof: 'the production address, a promotion made by you and a way back' },
{ id: 'drill', name: 'Break and recover', proof: 'a bad change and its revert in the history, tests green' },
];
export const SITUATIONS: { id: Situation; label: string }[] = [
{ id: 'edit-without-commit', label: 'Claude broke a file in this conversation, there is no commit yet' },
{ id: 'terminal-command', label: 'The file was changed only by a terminal command, without a commit' },
{ id: 'bad-commit', label: 'The bad change is already in a commit' },
{ id: 'bad-commit-on-github', label: 'The bad commit is already on GitHub' },
{ id: 'two-failed-fixes', label: 'Two fixes of the same bug in a row did not help' },
];
export function missing(done: string[]): Stage[] {
return STAGES.filter((s) => !done.includes(s.id));
}
// Stages ticked although an earlier stage of the map is still waiting
export function outOfOrder(done: string[]): string[] {
const out: string[] = [];
STAGES.forEach((stage, i) => {
if (!done.includes(stage.id)) return;
const gap = STAGES.slice(0, i).find((s) => !done.includes(s.id));
if (gap) out.push(stage.name + ' before the stage ' + gap.name);
});
return out;
}
export function recover(s: Situation): Advice {
if (s === 'edit-without-commit') {
return { tool: '/rewind and Restore code', why: 'The tools of Claude made the change in this conversation and there is no commit, so a checkpoint is enough.' };
}
if (s === 'terminal-command') {
return { tool: 'git restore <plik>', why: 'Checkpoints do not track a file changed only by a terminal command. You discard the change with Git.' };
}
if (s === 'bad-commit') {
return { tool: 'git revert <commit number>', why: 'A git command wrote the commit. /rewind would undo the files, but the commit would stay in the history.' };
}
if (s === 'bad-commit-on-github') {
return { tool: 'git revert <commit number>, then git push', why: 'Revert adds a new commit and does not rewrite the history, so you need neither reset --hard nor push --force.' };
}
return { tool: '/clear and a better request', why: 'A third fix adds to a conversation full of wrong leads. Give the file, the symptom, the output of a command and a description of what fixed looks like.' };
}
export default function App() {
const [done, setDone] = useState<string[]>(['spec', 'build']);
const [situation, setSituation] = useState<Situation>('bad-commit');
const toggle = (id: string) => setDone(done.includes(id) ? done.filter((d) => d !== id) : [...done, id]);
const left = missing(done);
const warnings = outOfOrder(done);
const advice = recover(situation);
return (
<div className="min-h-screen space-y-4 bg-slate-950 p-4 text-slate-100">
<h1 className="text-xl font-bold">Voyage map: the final project</h1>
<p className="text-sm text-slate-300">Tick a stage only when its proof is in the repository.</p>
<ol className="space-y-2">
{STAGES.map((stage, i) => (
<li key={stage.id} className="rounded border border-slate-800 p-2">
<label className="flex items-center gap-2 text-sm font-semibold">
<input type="checkbox" checked={done.includes(stage.id)} onChange={() => toggle(stage.id)} />
{i + 1}. {stage.name}
</label>
<p className="pl-6 text-xs text-slate-400">Proof: {stage.proof}</p>
</li>
))}
</ol>
{warnings.length > 0 ? (
<ul className="space-y-1 text-sm text-amber-400">
{warnings.map((w) => (
<li key={w}>Order: {w}.</li>
))}
</ul>
) : null}
<p className={'text-sm ' + (left.length === 0 ? 'text-emerald-400' : 'text-rose-400')}>
{left.length === 0 ? 'All the proofs are in the repository. Paste the link to your mentor.' : 'Before you send the link, missing: ' + left.map((s) => s.name).join(', ') + '.'}
</p>
<section className="space-y-2 rounded border border-slate-800 p-3">
<h2 className="font-semibold">Alarm drill: which rope takes you back?</h2>
<select className="w-full rounded bg-slate-900 p-1 text-sm" value={situation} onChange={(e) => setSituation(e.target.value as Situation)}>
{SITUATIONS.map((s) => (
<option key={s.id} value={s.id}>{s.label}</option>
))}
</select>
<p className="font-mono text-sm text-emerald-400">{advice.tool}</p>
<p className="text-sm text-slate-300">{advice.why}</p>
</section>
</div>
);
}Spotted a mistake in this lesson?
Check yourself
Answer the questions from this lesson. Pick an answer to see right away whether it is correct.
1. For the second time in a row you ask Claude to fix the same bug in a form, and it is still wrong. What do you do?
2. The branch of the final project is ready and the tests pass. What do you do before the first deployment?
These are 2 of 4 questions for this lesson. Solve the rest in the game.
Hands-on tasks in the game
- Vertical ordering
Arrange the stages of the final project in the order of the voyage map:
Tasks after this lesson
- QuestionQuiz: Two failed fixes in a row
- QuestionQuiz: The last review before publishing
- Put in orderSorting: The full cycle of the final project
- QuestionQuiz: The bad change is already in a commit
- QuestionQuiz: What you send to the mentor
- Project to submitCongratulations - you've completed Vibecoding!
- VideoModule Summary