Skip to the lesson
CivOps AI Academy · F00Set Up: Your Accounts, Your Keys, Your Computer and an Empty Live Platform
0%

Chapter 1 · Session 1

Before you start: what you are building, in what order

You do not need to be a programmer. Claude Code writes the code; you decide what it is for, paste the prompts in this course, check what comes back and own the result. This chapter shows the whole build in the order you will do it, and sets up the names every later step uses.

15 min2 stepsNo installs yet

By the end of this chapter you can

  • Say what each of the four services is for, in one sentence each.
  • Follow the build order and say why each stage comes before the next.
  • Enter your company's names once, so every prompt, command and address in the course is ready to copy.

How this course works

Every build step in this course has the same five parts. Why says what the step is for and what goes wrong without it. Do this gives you the exact text to paste: a prompt for Claude Code, a command for the terminal, or a web address to open, each with a Copy button. You will see shows the screen you should get, recreated so it stays readable. Check it worked says how to tell. If it goes wrong lists the problems we actually hit building the CivOps platform, and the fix for each.

You will rarely type anything yourself. Copy, paste, read what comes back, and compare it with the screen in the lesson. When they match, tick Done and move on. When they do not, open If it goes wrong before trying anything else: most problems are already there.

The four services, and what each one is for

Where everything livesYour computer, with you and Claude Code, sends changes to GitHub. Vercel builds the website from GitHub and serves it to people. Supabase holds the data and sends its keys to Vercel directly. The password manager holds every password and recovery code. Your computeryou + Claude Codethe code, while you workGitHubthe code andevery change to itVercelbuilds and runsthe websiteSupabasethe data, who maysee it, sign-inPeopleoperators,supervisorsPassword managerevery password andrecovery codepullbuildusekeysKeys move service to service (Supabase to Vercel). People keep passwords in the password manager.
Where everything lives. You direct Claude Code on your computer. The code goes to GitHub. Vercel turns the code into the website people use. Supabase holds the data and decides who may see it.
ServiceWhat it is forWho owns itPlan you need
GitHubThe code, every change to it, and the tests that must pass before a change is acceptedThe company, with two ownersTeam ($4 per user per month): the free plan cannot protect a private repository
SupabaseThe database: every record, who may read it, and sign-inThe company, with two ownersFree to build; Pro ($25 a month) before the plant depends on it
VercelBuilds the website from GitHub and runs it at an addressThe company, with two ownersPro ($20 per user per month): the free plan is for non-commercial use only
Claude CodeThe developer: reads your prompts and writes, tests and explains the codeA company seatA Claude plan that includes Claude Code, bought by the company

The build order

The order is not a teaching choice. Each stage needs what the one before it made, and doing them out of order is the main cause of rework. This is the order the whole course follows:

SessionsWhat you makeWhy it comes here
1. Set up (this session)Accounts, keys, your computer, an empty live websiteEverything else is stored, built and run here
2. IntentOne page: the decision the platform servesWithout it, nothing tells you or the agent what to build
3. Directing the agentBriefs, checks first, reading a changeYou use it in every later session
4. NamesThe naming standard for sites, lines, equipment and measuresTables, addresses and screens are named from it
5. SchemaThe tables, committed before any screenEvery screen, report and rule is built on the tables
6. Test dataRealistic made-up data in every tableScreens and tests need data before real data flows
7–9. Roles and accessThe role matrix, access rules on every table, sign-in that denies by defaultRules need tables to protect, and must exist before people sign in
10. Quality checksThe ten checks every change must passFrom here on, agents work faster than you can read
11. First real deployMigrations on deploy, previews, rollback, backupsShip early so every later session is tested where it runs
12–15. ScreensOperator, supervisor and manager screens, the first workflow, the dashboardNow there is data, access and a pipeline to build on
16–17. Many agentsSplitting the work across agents, overnight buildsOnly safe once checks and access rules exist
18–21. Prove itSecurity tests, the testing protocol, plant connectivity, the IT packageProof needs a finished system to test
22–23. Go liveThe cost case, handover, runbook, restore drillThe last step is showing someone else can run it
Step 1

Agree who owns what, before anyone signs up

10 minutes

Why

The costliest mistake in plant software is finding, years later, that the code is in a contractor's account, the database is on someone's personal card and the person who set it up has left. Deciding owners first means every account is created in the company's name, once, and never has to be moved.

Do this

Get two people to agree, in writing (an email is enough):

  • Owner one (pat@acme.com) and owner two (sam@acme.com): both get full control of every account. Two, so the platform never depends on one person.
  • The company password manager where every account password, recovery code and key is kept. Use the one your IT department already runs. If there is none, ask IT before choosing one.
  • The company card that pays for the accounts, and who approves spending.
  • Work email addresses only. Every account is opened with a acme.com address, never a personal one.

Send this, so the decision is written down and IT hears about it before anything is created, not after:

Email to send (copy, then fill in the name)
To: sam@acme.com; IT
Subject: Ownership of the Acme Bottling platform accounts

We are setting up the accounts for the Acme Bottling platform (Cleveland first). Before anything is created, please confirm:

1. Owners: pat@acme.com and sam@acme.com, both with full control of every account.
2. Accounts, all opened with acme.com addresses: GitHub organisation acme-ops, Supabase organisation Acme Bottling, Vercel team acme-ops, Claude seats for both owners.
3. Passwords, recovery codes and keys: kept only in the company password manager, in a vault shared by both owners. Never in email, chat or files.
4. Payment: the company card, approved by <name>.
5. IT: is there anything you need from us before we create these accounts?

Reply "agreed", or tell us what to change.

You will see recreated screen

Company password manager
Vault: acme-platform
Shared with: pat@acme.com, sam@acme.com
1
ItemKindAdded by
GitHub: acme-ops (owner one)Login + recovery codespat@acme.com
GitHub: acme-ops (owner two)Login + recovery codessam@acme.com
Supabase: acme-platform-prod database passwordPasswordpat@acme.com
Vercel: acme-opsLogin + recovery codespat@acme.com
Your password manager, with a shared vault for the platform. Both owners can open it.
  1. The vault is shared by both owners. You will add these items as you go; it starts empty.

Check it worked

Both owners have agreed by email, both can open the shared vault, and you know which card pays.

If it goes wrong

IT says the company does not allow cloud services

Stop here and ask IT what is allowed. The IT approval package (Session 21) explains how the platform is placed and protected; IT may want to read it now. Building on accounts IT later refuses means building twice.

Only one person is available

Set up as owner one now, but do not go past Step 17 until a second owner exists. Everything in this course assumes two.

Step 2

Enter your names once

5 minutes

Why

Every prompt, command and web address in this course has your company's names in it. Typing them once here means you never edit a command by hand, which is where most copy-and-paste mistakes come from. The names follow the naming standard you will write in Session 4: lower case, letters, digits and hyphens.

Do this

Fill in what you know. Leave the rest blank: blank fields show an example (underlined with dots) or are worked out from the others. You will fill in the Supabase reference and live address later, when those services give them to you.

Saved with your progress. Every prompt, command and address in the course now uses these names. Change them any time from Your names at the top of the page.

You will see recreated screen

Your names
Enterprise codeacme1
Repositoryacme-platform2
Live addresshttps://acme-platform.vercel.app
After you type, this lesson uses your names. Here the enterprise code is the only thing typed; the repository, team and address are worked out from it.
  1. What you typed.
  2. Worked out from it. Type over it if you want something else.

Check it worked

The repository name in this sentence is yours, not an example: acme-platform. If it is underlined with dots, it is still an example.

Fastest path

Use Copy my names in the Your names panel (top of the page) and paste them into the first lesson you open on another computer or in your company's learning system. Lessons on the same site share them automatically.

If it goes wrong

My names disappear when I come back

Your browser may be clearing site data (private browsing, or a company setting). The names are also saved with your progress in your company's learning system. If both are lost, use Copy my names and keep the text in your notes.

Knowledge check

Why does the course build the schema before any screen?

Knowledge check

Where may a database password be pasted?

References

  1. GitHub Docs: About organizations. https://docs.github.com/en/organizations/collaborating-with-groups-in-organizations/about-organizations
  2. Claude Code docs: Overview. https://code.claude.com/docs/en/overview
  3. Supabase Docs: Architecture. https://supabase.com/docs/guides/getting-started/architecture

Chapter 2 · Session 1

Accounts in the company's name

Four accounts, each opened with a company email, each with two owners and two-step sign-in, each with a spending limit. About 30 minutes, all in the browser.

30 min4 stepsBrowser only

By the end of this chapter you can

  • Create the GitHub organisation on the Team plan and require two-step sign-in.
  • Create the Supabase organisation and project, with the password in the company password manager.
  • Create the Vercel team and the company's Claude seats.
  • Set a spending limit on every paid service.
Step 3

Create the GitHub organisation

10 minutes

Why

GitHub holds the code and every change ever made to it. An organisation (not a personal account) means the code belongs to the company, survives any one person leaving, and can require two-step sign-in for everyone. The Team plan is needed because the free plan cannot protect a private repository, and protection is what makes it safe to let an AI agent propose changes.

Do this

Open

https://github.com/account/organizations/new?plan=team

Sign in with your acme.com address first. Organisation name: acme-ops. Contact email: pat@acme.com. Choose My company or institution and enter Acme Bottling.

Then require two-step sign-in for every member:

Open

https://github.com/organizations/acme-ops/settings/security

Tick Require two-factor authentication for everyone in the acme-ops organization and save.

Then invite owner two with the Owner role:

Open

https://github.com/orgs/acme-ops/people

Choose Invite member, enter sam@acme.com, choose Owner.

You will see recreated screen

github.com/organizations/acme-ops/settings/security
GeneralBilling and plansMember privilegesAuthentication securitySecrets and variables
Authentication security
Require two-factor authentication for everyone in the acme-ops organization1
Save
The organisation's authentication settings. Two-step sign-in is required for everyone.
  1. Tick this. Members without two-step sign-in are removed until they turn it on, so tell owner two first.

Check it worked

The organisation page shows Team as the plan, two people with the Owner role, and two-step sign-in required.

If it goes wrong

The name acme-ops is taken

GitHub organisation names are unique worldwide. Pick another (for example add the site code: acme-cle-ops), then change GitHub organisation in Your names. Every later command updates.

Owner two never got the invitation

Invitations go to the email on their GitHub account, which must exist first. Ask them to create a GitHub account with their acme.com address and turn on two-step sign-in, then invite them again.

Someone lost their phone and cannot sign in

This is why recovery codes go in the password manager the day two-step sign-in is turned on. Download them from https://github.com/settings/security and store them now.

Step 4

Create the Supabase organisation and project

10 minutes

Why

Supabase is the database. Every record the plant creates lives here, and Supabase enforces who may see each record. It is created now, before any code, so the company owns the data from the first row. The region decides where the data physically sits: pick the one nearest the plant so screens are fast and the data stays in the country IT expects.

Do this

Open

https://supabase.com/dashboard/sign-up

Sign up with your acme.com address (not "Continue with GitHub": the account should not depend on one person's GitHub login).

Open

https://supabase.com/dashboard/new

Create an organisation called Acme Bottling, type Company. Then create a project: name acme-platform-prod, region nearest Cleveland.

On the Database password field, choose Generate a password, then copy it straight into the password manager as Supabase: acme-platform-prod database password before you press Create new project. You will not be shown it again.

When the project is ready, look at the address bar. The 20 letters after /project/ are the project reference. Type them into Supabase project reference in Your names, and the region into Supabase region.

Open

https://supabase.com/dashboard/project/abcdefghijklmnopqrst/settings/general

This should open your project's settings. If it says the project does not exist, the reference in Your names is wrong.

You will see recreated screen

supabase.com/dashboard/new
Create a new project
OrganizationAcme Bottling ▾
Project nameacme-platform-prod
Database password••••••••••••••••1
Generate a password
Regionus-east-2 ▾2
Create new project
Creating the project. The password goes into the password manager before you press Create.
  1. Generate it, then copy it into the password manager now.
  2. Nearest the plant. It cannot be changed later without moving the database.

You will see recreated screen

supabase.com/dashboard/project/abcdefghijklmnopqrst
Project overviewTable EditorSQL EditorDatabaseAuthenticationProject Settings
acme-platform-prod
Project referenceabcdefghijklmnopqrst1
The project reference is in the address bar of every project page.
  1. Copy this into Your names. Every Supabase address in the course uses it.

Check it worked

The settings link above opens your project, and the database password is in the password manager.

Fastest path

Invite owner two now while you are here: Organization settings, then Team, then Invite, role Owner.

If it goes wrong

I did not save the database password

Reset it: Project Settings, then Database, then Reset database password. Put the new one straight into the password manager. Nothing else uses it yet, so nothing breaks.

A free project stopped working after a week

Free projects pause after a week with no activity. Restore it from the dashboard. Move to Pro before anyone in the plant relies on it.

Step 5

Create the Vercel team

5 minutes

Why

Vercel turns the code in GitHub into the website people use, and rebuilds it every time a change is accepted. A company team on the Pro plan is needed because the free Hobby plan is for non-commercial use only. Everyone who will approve changes must be a member, or Vercel will refuse to build their changes.

Do this

Open

https://vercel.com/signup

Sign up with your acme.com email address and choose the Pro plan for a team named acme-ops. When asked to connect a Git provider, choose GitHub and allow access to the acme-ops organisation only.

Open

https://vercel.com/teams/acme-ops/settings/members

Invite sam@acme.com with the Owner role.

You will see recreated screen

github.com/apps/vercel/installations/new
Install Vercel
Install on your organization acme-ops
All repositories
Only select repositories1
Install
Vercel's GitHub access, limited to the company's organisation.
  1. Choose only the platform repository once it exists, or all repositories in acme-ops if this organisation holds nothing else.

Check it worked

The team page shows acme-ops on Pro, with two owners.

If it goes wrong

Vercel asks to install on my personal GitHub account

Choose the acme-ops organisation in the account picker. If it is not listed, you are not an owner of it yet: finish Step 3 first.

Step 6

Company Claude seats, and spending limits everywhere

5 minutes

Why

Claude Code needs a Claude plan that includes it. Buying it as the company means the company controls who has a seat and what is spent, and work done on the platform is not tied to someone's personal subscription. Spending limits on every service mean a mistake (an agent stuck in a loop, a forgotten test project) costs a known, small amount.

Do this

Open

https://claude.com/pricing

Choose a plan that includes Claude Code, bought by the company. Add seats for both owners.

Then set a limit in each paid service:

You will see recreated screen

vercel.com/teams/acme-ops/settings/billing
GeneralMembersBillingSecurity
Spend Management
Enable spend management1
Monthly amount (USD)200
Send a notification at 50%, 75% and 100%
Save
Vercel's spend management. The amount is your choice; the point is that there is one.
  1. On. Record the amount you chose in docs/KEYS.md in Step 13.

Check it worked

Each paid service shows a limit, and both owners have a Claude seat.

If it goes wrong

We already pay for Claude personally

Fine for learning, but move the platform's work to a company seat before Step 10. Code an agent writes belongs to whoever directs it under their agreement; keep that the company.

Knowledge check

Why is the GitHub organisation put on the Team plan rather than the free plan?

Knowledge check

When should the Supabase database password go into the password manager?

References

  1. GitHub Docs: Requiring two-factor authentication in your organization. https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-two-factor-authentication-for-your-organization/requiring-two-factor-authentication-in-your-organization
  2. GitHub Docs: About protected branches (plan availability). https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches
  3. Supabase: Pricing and spend cap. https://supabase.com/pricing
  4. Vercel Docs: Fair use and the Hobby plan. https://vercel.com/docs/limits/fair-use-guidelines
  5. Vercel Docs: Spend management. https://vercel.com/docs/spend-management

Chapter 3 · Session 1

Your computer and Claude Code

Four free programs, one repository, and the guard rails that keep Claude Code safe: written in one prompt and accepted through your first pull request.

30 min4 stepsMac or Windows

By the end of this chapter you can

  • Install Git, Node.js, the GitHub command-line tool and Claude Code, and check each one.
  • Create the repository from the terminal and protect its main branch.
  • Have Claude Code write the guard rails: what it may never read, never run and must always do.
Step 7

Install the four tools

15 minutes

Why

Git keeps track of every change to the code. Node.js runs the tools the platform is built with. The GitHub command-line tool (gh) lets Claude Code open pull requests for you, which removes most of the back and forth between the terminal and the browser. Claude Code is the developer you direct.

Do this

On a Mac, paste these one at a time. The first opens a window asking to install developer tools: choose Install and wait for it to finish.

Terminal (Mac)
xcode-select --install
Terminal (Mac)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Terminal (Mac)
brew install node gh
Terminal (Mac)
curl -fsSL https://claude.ai/install.sh | bash

On Windows, paste these into PowerShell one at a time:

PowerShell (Windows)
winget install --id Git.Git -e; winget install --id OpenJS.NodeJS.LTS -e; winget install --id GitHub.cli -e
PowerShell (Windows)
irm https://claude.ai/install.ps1 | iex

Close the terminal window and open a new one, so it finds the new programs. Then check all four at once:

Terminal or PowerShell
git --version; node --version; gh --version; claude --version

You will see recreated screen

Terminal
$ git --version; node --version; gh --version; claude --version
git version 2.51.0
v22.20.0
gh version 2.80.0 (2026-09-12)
2.1.40 (Claude Code)
Four version numbers, one per line. Your numbers will be newer; what matters is that none says "not found".

Check it worked

Four version numbers and no "command not found". Node's number starts with 20 or higher.

If it goes wrong

command not found: claude (or brew, or gh)

Close every terminal window and open a new one; programs installed a moment ago are only found by new windows. On a Mac, if brew is still not found, run the two lines Homebrew printed under Next steps at the end of its install.

npm or the installer fails with a certificate or proxy error

Your company network inspects web traffic. Do not turn security checks off. Ask IT for the company certificate and proxy settings for developer tools; send them this page.

winget is not recognised

Install App Installer from the Microsoft Store, or ask IT to install Git, Node.js LTS and GitHub CLI for you.

Step 8

Sign in, and create the repository from the terminal

5 minutes

Why

Signing the GitHub tool in once lets both you and Claude Code create repositories and pull requests without copying any token. Creating the repository from the terminal makes it, connects it to your computer and puts it in the right folder in one command.

Do this

Terminal or PowerShell
gh auth login --web --git-protocol https

It prints a one-time code and opens the browser: paste the code, choose Authorize, and allow the acme-ops organisation. Then create the repository and its folder:

Terminal (Mac)
mkdir -p ~/code && cd ~/code && gh repo create acme-ops/acme-platform --private --add-readme --clone && cd acme-platform
PowerShell (Windows)
New-Item -ItemType Directory -Force ~/code | Out-Null; cd ~/code; gh repo create acme-ops/acme-platform --private --add-readme --clone; cd acme-platform

You will see recreated screen

Terminal
$ gh repo create acme-ops/acme-platform --private --add-readme --clone
✓ Created repository acme-ops/acme-platform on GitHub
https://github.com/acme-ops/acme-platform
Cloning into 'acme-platform'...
The repository is created in the company organisation and copied to your computer.

If it goes wrong

GraphQL: pat@acme.com does not have the correct permissions to execute CreateRepository

Run gh auth refresh -h github.com and, in the browser, grant access to the acme-ops organisation (the Grant button next to it). Then run the create command again.

Name already exists on this account

Someone already created it. Use gh repo clone acme-ops/acme-platform ~/code/acme-platform instead, then cd ~/code/acme-platform.

Step 9

Protect the main branch

5 minutes

Why

The main branch is the code that runs the plant's website. Protecting it means no change reaches it without a pull request, a passing check and a person saying yes. This is the setting that makes it safe to let Claude Code write code: it can propose anything, and nothing lands unreviewed.

Do this

Open

https://github.com/acme-ops/acme-platform/settings/rules/new?target=branch

New branch ruleset. Name: protect main. Enforcement: Active. Target branches: Include default branch.

Tick Restrict deletions, Require a pull request before merging (1 approval), Block force pushes. Leave Require status checks to pass for Session 10, when the checks exist. Press Create.

You will see recreated screen

github.com/acme-ops/acme-platform/settings/rules/new
GeneralCollaborators and teamsRulesActionsSecrets and variables
Ruleset nameprotect main
Enforcement statusActive ▾1
Target branchesDefault branch
Restrict deletions
Require a pull request before merging (1 approval)2
Block force pushes
Require status checks to pass3
Create
The ruleset for main. These four settings are the minimum.
  1. Active, not Evaluate: Evaluate only reports.
  2. One approval: the person who did not write the change.
  3. Turned on in Session 10, once there are checks to require.

Check it worked

Rules shows protect main as Active. On your computer, git push origin main now fails with "protected branch": that failure is what you want.

If it goes wrong

Rulesets are not available, or the rule saves but does not apply

The organisation is on the free plan. Upgrade at https://github.com/organizations/acme-ops/settings/billing and come back.

A change reached main even though a check was red

The ruleset is not Active, or someone is allowed to bypass it. Only owner one should be on the bypass list. In Session 10, a CODEOWNERS file also names who must review the database and sign-in folders.

I am the only reviewer, so I cannot approve my own pull request

Correct, and intended. Owner two approves. Until owner two has access, you can set approvals to 0 and set it back to 1 at Step 17.

Step 10

Start Claude Code and have it write the guard rails

10 minutes

Why

Claude Code reads a file called CLAUDE.md at the start of every session; it is where the platform's standing rules live, so you do not repeat them in every prompt. A settings file stops it from reading the files that hold keys and from running commands that change the live database. We learned this the hard way: a "reset the database" command, run to fix a small error, used the everyday login and wiped a shared database. Writing them first means every later session starts safe. One prompt does all of it and opens the pull request, which is much faster than creating each file yourself.

Do this

Terminal or PowerShell
cd ~/code/acme-platform && claude

The first time, Claude Code asks you to choose a colour theme, then to sign in: choose Claude account with subscription and sign in with your company seat in the browser. It then asks whether you trust the files in this folder: choose Yes (it is your repository). Then paste:

Paste into Claude Code
You are setting up the repository for Acme Bottling's plant platform. I am not a programmer: explain anything you need me to decide in plain words.

Create a branch called setup/guard-rails and add these files:

1. CLAUDE.md with the standing rules for every session:
   - The platform serves Acme Bottling, site Cleveland (code cle). Read docs/INTENT.md before any task once it exists.
   - Never read, print or ask me for keys, passwords or tokens. They live in Vercel, GitHub secrets and the company password manager. If something needs a key, tell me which setting needs it and I will enter it myself.
   - Work on a branch and open a pull request with gh. Never push to main.
   - Every change comes with a test that would fail without it. Run the tests before opening the pull request and show me the result.
   - Explain each pull request in plain English: what changed, why, and how I can see it working.
2. .claude/settings.json that denies reading .env, .env.* and any *.pem or *.key file, and denies these commands: git push to main, git push --force, supabase db push, supabase db reset, vercel --prod.
3. .gitignore for a Node and Next.js project, including .env* (but not .env.example) and .vercel.
4. docs/KEYS.md: a register of every key and secret with columns Name, What it unlocks, Where it lives, Who holds it, Last rotated. Names and locations only, never values. Start it with the Supabase database password (in the company password manager, held by pat@acme.com and sam@acme.com).
5. .github/pull_request_template.md with three headings: What changed, Why, How to check it.

Commit, push the branch and open a pull request titled "Guard rails for working with Claude Code". Then show me the pull request link.

You will see recreated screen

claude — acme-platform
> You are setting up the repository for Acme Bottling's plant platform. I am not a programmer…
☒ Create branch setup/guard-rails
☒ Write CLAUDE.md
☒ Write .claude/settings.json
☐ Write .gitignore, docs/KEYS.md, PR template
☐ Commit, push and open the pull request
1
⏺ Write(.claude/settings.json)
+{
+ "permissions": {
+ "deny": [
+ "Read(./.env)", "Read(./.env.*)", "Read(./**/*.pem)", "Read(./**/*.key)",
+ "Bash(git push origin main:*)", "Bash(git push --force:*)",
+ "Bash(npx supabase db push:*)", "Bash(npx supabase db reset:*)", "Bash(npx vercel --prod:*)"
+ ]
+ }
+}
2
Do you want to proceed? Bash(gh pr create --title "Guard rails for working with Claude Code" …)
❯ 1. Yes
  2. Yes, and don't ask again for gh pr create commands
  3. No, and tell Claude what to do differently
3
⏺ Bash(gh pr create …)
⎿ https://github.com/acme-ops/acme-platform/pull/1
⏺ Pull request #1 is open. It adds the standing rules (CLAUDE.md), blocks me from reading key files or pushing to main (.claude/settings.json), and starts your key register (docs/KEYS.md). To check it: open the link and read the Files changed tab.
Claude Code plans the work, writes each file, and asks before running commands. Read each question before answering.
  1. The plan, ticked off as it goes.
  2. The deny list: Claude Code cannot read key files or run these commands, even if asked.
  3. Choose 1 (Yes) for a single command. Choose 2 only for commands you are happy to allow every time, like opening pull requests.

Check it worked

Pull request #1 is open on GitHub with five files. Open Files changed and read CLAUDE.md: it should say what the prompt asked, in plain words.

Fastest path

When Claude Code asks permission, option 2 ("don't ask again") is safe for read-only and pull-request commands (gh pr create, npm test). It saves dozens of interruptions later. Never choose it for commands that delete, push to main or touch the live database.

If it goes wrong

Claude Code asks me for a key or password

Answer: No. Keys are entered by a person in the website that needs them. Tell me which setting needs it. Then check CLAUDE.md says the same; if it does not, ask Claude Code to add it.

Claude Code pushed straight to main, or tried to

The branch rule from Step 9 refuses it. Say: Main is protected. Create a branch, push that, and open a pull request.

It stops and asks what to do next, again and again

Answer the question, then add: For the rest of this task, make reasonable choices yourself and list them in the pull request description. Questions about keys or deleting things are the exception: always answer those yourself.

Knowledge check

What is CLAUDE.md for?

References

  1. Claude Code docs: Set up Claude Code. https://code.claude.com/docs/en/setup
  2. Claude Code docs: Settings and permission rules. https://code.claude.com/docs/en/settings
  3. Claude Code docs: Memory and CLAUDE.md. https://code.claude.com/docs/en/memory
  4. GitHub CLI manual: gh repo create. https://cli.github.com/manual/gh_repo_create
  5. GitHub Docs: About rulesets. https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets

Chapter 4 · Session 1

Keys, the first deploy and the two-person test

An empty website, live at the company's address, connected to the database without anyone copying a key, and proven to belong to the company because a second person can change it.

30 min7 stepsEnds with a gate

By the end of this chapter you can

  • Have Claude Code create the empty app and merge it through a reviewed pull request.
  • Connect Supabase to Vercel so the keys move between them without anyone copying them.
  • Deploy, open it on a phone, and record every key in the register.
  • Prove ownership: a second person changes the live site.
Step 11

Review and merge your first pull request

5 minutes

Why

Every change to the platform arrives as a pull request: a proposed change you can read before it is accepted. Doing the first one now, on a harmless change, teaches the routine you will use hundreds of times.

Do this

Open

https://github.com/acme-ops/acme-platform/pulls

Open pull request #1. Read the description, then the Files changed tab.

If everything matches what you asked for, owner two approves it (Review changes, Approve) and either of you presses Merge pull request. Then, in Claude Code:

Paste into Claude Code
The pull request is merged. Switch to main, pull the latest, and delete the setup/guard-rails branch locally.

You will see recreated screen

github.com/acme-ops/acme-platform/pull/1
Guard rails for working with Claude Code #1
ConversationCommitsFiles changed
Merge pull request2
A pull request ready to merge: one approval, nothing conflicting.
  1. The approval from the person who did not ask for the change.
  2. Merge. The branch can be deleted afterwards.

Check it worked

The README and the five new files are on main at https://github.com/acme-ops/acme-platform.

If it goes wrong

Merging is blocked: review required

That is the rule from Step 9 working. Owner two approves; you cannot approve your own.

Step 12

Create the empty app

10 minutes

Why

Before building anything useful, deploy something empty. It proves the whole chain works (your computer, GitHub, Vercel, Supabase) while there is nothing to break, so later problems are about the feature, not the plumbing.

Do this

Paste into Claude Code
Create a branch called setup/empty-app. Create a Next.js app with TypeScript, the App Router, Tailwind and ESLint in this folder, without interactive questions, keeping CLAUDE.md, docs/ and .claude/ as they are.

Add one page at / that says "Acme Bottling platform — Cleveland" and the date and time it was built. Add the Supabase client library (@supabase/supabase-js and @supabase/ssr) and a file .env.example listing the names of the Supabase variables the app will read, with no values.

Run the build and the lint, show me they pass, then commit, push and open a pull request titled "Empty app".

You will see recreated screen

claude — acme-platform
⏺ Bash(npx create-next-app@latest . --ts --app --tailwind --eslint --use-npm --yes)
⎿ Success! Created acme-platform
⏺ Bash(npm run build)
⎿ ✓ Compiled successfully · Route / (static)
⏺ Bash(npm run lint)
⎿ No ESLint warnings or errors
1
⏺ Bash(gh pr create --title "Empty app" …)
⎿ https://github.com/acme-ops/acme-platform/pull/2
⏺ Pull request #2 adds an empty Next.js app with one page. The build and lint pass. Nothing is connected to the database yet: that is the next step.
Claude Code creates the app, runs the build, and only then opens the pull request.
  1. The build passing before the pull request is the routine for every change from now on.

Check it worked

Pull request #2 exists and Claude Code showed the build passing. Do not merge it yet: Vercel will build it first in Step 14.

If it goes wrong

create-next-app refuses because the folder is not empty

Say: Create the app in a temporary folder and move its files in, keeping CLAUDE.md, README.md, docs/, .claude/ and .github/.

The build fails

Paste the last 30 lines of the error back with: The build fails with this. Find the cause, fix it, and run the build again before telling me it works.

Step 13

Connect Supabase to Vercel, so nobody copies a key

5 minutes

Why

The website needs the database's address and keys. If a person copies them, they end up in chats, emails and laptops. Supabase's Vercel integration puts them straight into Vercel's protected settings and keeps them up to date, so the keys never pass through anyone's hands.

Do this

Open

https://supabase.com/dashboard/project/abcdefghijklmnopqrst/settings/integrations

Under Vercel, choose Install (or Add new project connection), pick the acme-ops team, then the project acme-platform. If acme-platform is not listed yet, do Step 14 first and come back.

Then check what arrived, by name only:

Open

https://vercel.com/acme-ops/acme-platform/settings/environment-variables

You should see the Supabase variables listed, with their values hidden.

And record them in the register:

Paste into Claude Code
On a new branch docs/keys, update docs/KEYS.md: add every environment variable name you can see with "npx vercel env ls" (names only, never values), what each unlocks, where it lives (Vercel, synced from Supabase by the integration), and who holds it (pat@acme.com and sam@acme.com). Mark any variable whose name contains SERVICE_ROLE or SECRET as "server only: must never be used in browser code". Open a pull request.

You will see recreated screen

vercel.com/acme-ops/acme-platform/settings/environment-variables
GeneralDomainsEnvironment VariablesGitDeployment Protection
1
KeyValueEnvironments
NEXT_PUBLIC_SUPABASE_URL••••••••All
NEXT_PUBLIC_SUPABASE_ANON_KEY••••••••All
SUPABASE_SERVICE_ROLE_KEY••••••••All
POSTGRES_URL••••••••All
The variables in Vercel, values hidden. The exact names depend on the integration's version; the point is that they are here and nobody typed them.
  1. Names visible, values hidden. Variables starting NEXT_PUBLIC_ are meant to be seen by browsers; the others must stay on the server.
  2. Kept in step by the integration: if a key is rotated in Supabase, Vercel gets the new one.

Check it worked

Vercel lists the Supabase variables, and docs/KEYS.md lists the same names with no values.

If it goes wrong

A variable is listed but the feature still fails, or an email never arrives

The value is there but wrong: on our Academy, a key's value turned out to be the variable's own name, pasted in by mistake. When you type a value into Vercel or GitHub, paste the value only, never NAME=value. Session 10 adds a start-up check that names any missing or malformed key without printing it.

Claude Code tries to open .env.local to read the keys

The deny rule from Step 10 blocks it, which is correct. Say: Use npx vercel env ls for names only.

A key was pasted into a chat or committed by mistake

Treat it as public. Rotate it the same day: in Supabase, Project Settings, API Keys, create a new secret key and revoke the old one. The integration updates Vercel. Then note the date in docs/KEYS.md.

Key or secretWhat it unlocksWhere it livesWho holds itNever
Supabase database passwordFull control of the databaseCompany password managerpat@acme.com, sam@acme.comNever in Vercel, a chat or a file
Supabase secret (service role) keyReads and writes everything, ignoring access rulesVercel (server only), synced by the integrationNobody copies itNever in browser code or a NEXT_PUBLIC_ variable
Supabase publishable (anon) keyWhat a signed-out visitor may do, which access rules limitVercel, syncedPublic by designNever treated as a secret, and never relied on for protection
GitHub sign-in (gh)Creating branches and pull requests as youYour computer's keychain, set by gh auth loginEach person their ownNever shared between people
Claude seatClaude Code as youYour computer, set by signing inEach person their ownNever shared between people
Step 14

Deploy, and open it on your phone

5 minutes

Why

Importing the repository into Vercel makes every pull request get its own preview address, and every merge to main update the live site. Opening it on a phone proves it works for someone who is not at your desk.

Do this

Open

https://vercel.com/new

Choose Import next to acme-ops/acme-platform. Leave the settings Vercel detects (Next.js) and press Deploy.

When it finishes, copy the address Vercel shows into Live address in Your names (it may have a suffix if the name was taken). Then go back to pull request #2: Vercel has added a preview link. Open it, check the page, then approve and merge.

Open

https://acme-platform.vercel.app

Your live site. Open it on your phone too.

You will see recreated screen

vercel.com/acme-ops/acme-platform
acme-platform
Domainshttps://acme-platform.vercel.app2
Visit
The first deployment. The address under Domains is your live address.
  1. Ready means built and live.
  2. Copy this into Your names if it differs from what is shown.

You will see recreated screen

github.com/acme-ops/acme-platform/pull/2
Empty app #2
vercel botPreview: Ready · Visit Preview1
Pull request #2 with Vercel's preview: the change, running, before it is accepted.
  1. Open the preview before approving. This is how every screen will be checked from now on.

Check it worked

https://acme-platform.vercel.app shows "Acme Bottling platform — Cleveland" on your phone, after pull request #2 is merged.

If it goes wrong

The build failed on Vercel but worked in Claude Code

Open the failed deployment, copy the last 40 lines of the build log and paste them into Claude Code with: The Vercel build fails with this but the local build passed. Find what differs (Node version, environment variables, files not committed) and fix it.

The build runs out of memory

We hit this as the platform grew. Ask Claude Code: The Vercel build is running out of memory. Check for large files or imports pulled into the build, and only raise the memory limit if that is not the cause.

The preview asks me to sign in to Vercel

That is Deployment Protection, on by default: previews are only for your team. Leave it on.

Step 15

Get the keys onto your computer, the safe way

3 minutes

Why

Later sessions run the app on your computer, which needs the same variables. Pulling them with Vercel's tool writes them to a local file that Git ignores and Claude Code is forbidden to read, so they still never pass through a chat.

Do this

Terminal or PowerShell, in ~/code/{{repo}}
npx vercel login && npx vercel link --yes --project acme-platform --scope acme-ops && npx vercel env pull .env.local

You will see recreated screen

Terminal
$ npx vercel env pull .env.local
Downloading `development` Environment Variables for acme-ops/acme-platform
✓ Created .env.local file
$ git status --short
(nothing: .env.local is ignored)
The variables are written to .env.local, which .gitignore keeps out of the repository.

Check it worked

git status does not list .env.local. If it does, stop: the .gitignore from Step 10 is wrong.

If it goes wrong

git status lists .env.local

Do not commit. In Claude Code: git status shows .env.local. Fix .gitignore so every .env file except .env.example is ignored, without reading the file.

Step 16

Turn off public sign-up

2 minutes

Why

A plant platform is not a public website. With sign-up on, anyone who finds the address can create an account. Off, people only get an account when an owner invites them. One switch closes a whole class of attack before there is anything to attack.

Do this

Open

https://supabase.com/dashboard/project/abcdefghijklmnopqrst/auth/providers

Turn off Allow new users to sign up and save.

You will see recreated screen

supabase.com/dashboard/project/abcdefghijklmnopqrst/auth/providers
UsersSign In / ProvidersEmailPoliciesURL Configuration
User Signups
Allow new users to sign up1
Save changes
Supabase's sign-in settings, with public sign-up off.
  1. Off. Session 8 adds the access rules and Session 9 the invitations that go with them.

Check it worked

The switch is off after you reload the page.

Step 17

The two-person test

5 minutes

Why

This is the proof that the platform belongs to the company. If a second person, on their own computer with their own sign-in, can change the live site, nothing depends on you alone. We found one problem only this test catches: Vercel refuses to build a change from someone who is not a member of the Vercel team.

Do this

Owner two, on their own computer, after Steps 7 and 8 (sign-in only: the repository already exists, so they clone it):

Owner two's terminal
gh repo clone acme-ops/acme-platform ~/code/acme-platform && cd ~/code/acme-platform && claude
Paste into Claude Code
On a new branch, change the home page so it also says "Owned by Acme Bottling". Run the build, then open a pull request.

Owner one reviews the preview and approves; owner two merges. If you set approvals to 0 in Step 9, set them back to 1 now.

You will see recreated screen

https://acme-platform.vercel.app
Acme Bottling platform — Cleveland
Owned by Acme Bottling1
Built 2026-10-14 09:42
The live site after the second person's change.
  1. The second person's change, live, without your login.

Check it worked

The live site shows the second person's line, and their name is on the merge in GitHub.

If it goes wrong

Vercel says the deployment was blocked because the commit author is not a member of the team

Invite owner two to the Vercel team (Step 5), then use Redeploy on the blocked deployment.

Owner two cannot push: permission denied

They are not yet an owner of the acme-ops organisation, or have not accepted the invitation. Check https://github.com/orgs/acme-ops/people.

Before you go on · Session 1 is done whenTick each one

Knowledge check

Why connect Supabase to Vercel with the integration instead of copying the keys across?

Knowledge check

A second owner's change does not deploy and Vercel says the author is not a team member. What is the fix?

References

  1. Supabase Docs: Vercel integration. https://supabase.com/docs/guides/integrations/vercel-marketplace
  2. Vercel Docs: Environment variables. https://vercel.com/docs/environment-variables
  3. Vercel CLI: vercel env pull. https://vercel.com/docs/cli/env
  4. Vercel Docs: Deployment protection. https://vercel.com/docs/deployment-protection
  5. Supabase Docs: API keys. https://supabase.com/docs/guides/api/api-keys

Chapter 5 · 12 questions · 80% passes

Final assessment

Twelve questions across the session. Score 80% (10 of 12) to pass. Your LMS records your score and each answer; you can review the chapters and try again.

15 min12 questions≈ 15 minutesRetake allowed

Choose one answer for each question, then submit. You will see the right answer and why for every question.

1. Who should own the GitHub organisation, the Supabase project and the Vercel team?
2. Claude Code asks you for the database password to finish a task. What do you do?
3. Why does the GitHub organisation need the Team plan?
4. What does the 'protect main' ruleset make sure of?
5. Which file holds the standing rules Claude Code reads at the start of every session?
6. What does .claude/settings.json add that CLAUDE.md cannot?
7. How do the Supabase keys get into Vercel in this session?
8. docs/KEYS.md should contain:
9. Why deploy an empty app before building anything?
10. A key was pasted into a chat by mistake. What now?
11. Why is 'Allow new users to sign up' turned off?
12. What does the two-person test prove?