Session 2
第二次课

Ship day

发布日

Right now your site exists in one place: a folder on your laptop. Today it gets a real address anyone on earth can open — and you learn the loop that keeps it alive.

现在你的网站只存在一个地方:你笔记本上的一个文件夹。今天它会拿到一个真地址,地球上任何人都能打开——你也会学到那个让它一直活着的循环。

Do this the night before, not in class. GitHub blocks you from creating anything until your email is verified — and it also blocks the “sign in with GitHub” step that connects your host. A student who arrives unverified cannot do any of this session, and there is no workaround in the room.

前一天晚上做,别留到课上。邮箱没验证之前,GitHub 什么都不让你建——连“用 GitHub 登录”这一步也一起挡住,而那一步是连主机用的。带着未验证的邮箱来上课,这一次课一件事都做不了,教室里没有绕过去的办法。

Before the session
上课之前

Two free accounts

两个免费账号

  1. Sign up at github.com/signup. Your username shows up in web addresses — pick one you'd say out loud.
  2. 到 github.com/signup 注册。用户名会出现在网址里,挑一个你愿意念出口的。
  3. Open the email GitHub sends and click the link.
  4. 打开 GitHub 发来的邮件,点里面的链接。
  5. Go back to github.com. If you see a yellow “verify your email” banner, you are not done. Settings → Emails → Resend verification email. Check spam.
  6. 回到 github.com。要是看到一条黄色的“verify your email”提示条,就是还没完成。Settings → Emails → Resend verification email。也查一下垃圾邮件。
  7. Sign up at vercel.com/signup using Continue with GitHub.
  8. 到 vercel.com/signup 注册,用 Continue with GitHub。

If the email never arrives, add a second address under Settings → Emails and verify that one instead. Corporate mail filters are the usual culprit.

邮件一直不来的话,在 Settings → Emails 里加一个第二邮箱,验证那个。通常是公司邮箱的过滤器在拦。

The shape of it
它长什么样

Two services, one loop

两个服务,一个循环

GitHub keeps a copy of your folder — and of Git's record of every version of it — on the internet. Vercel watches that copy and turns it into a website. Both free at this size.

GitHub 在网上存着你那个文件夹的一份副本——连 Git 记下的每一个版本一起。Vercel 盯着那份副本,把它变成一个网站。在这个规模,两个都免费。

Git and GitHub are two different things, and the names do not help. Git runs on your laptop and keeps the history; it works with no internet at all. GitHub is a matching copy kept online, so the record outlives your laptop and other people can see it.

Git 和 GitHub,名字只差三个字母,做的是两件事。Git 在你的电脑上,管的是记录:这份文件昨天什么样,上礼拜什么样;断了网,它照样管。GitHub 在网上,存的是这份记录的一个副本——它的用处,只有在“你的电脑不在了”或者“别人要看”的时候才显出来:笔记本摔了,记录还在;同事要看,给个地址就行。

GitHub is the internet part. That is the whole difference. Your files still live on your computer.

GitHub 就是“联网的那一半”,区别只在这里。文件仍旧在你的电脑上。

your computer 你的电脑 when you send it 你送过去的时候 a copy, online 网上的一份
Git is the drawer at your desk. GitHub is a matching drawer kept somewhere else, so the record outlives your laptop and other people can see it. The line is drawn once and stops: the far copy is made when you send it, not kept in step by itself.
Git 是你桌上那个抽屉。GitHub 是另一个一样的抽屉,放在别处,所以那份记录不会随你的笔记本一起没了,别人也看得到。那条线只画一次就停住:远处那一份是你送过去的时候才有的,它不会自己跟着变。
your folder 你的文件夹 on your laptop 在你电脑上 upload 上传 GitHub your copy, online 你的副本,在线上 watches 盯着 Vercel makes it a website 变成一个网站 everyone 所有人
Change a file, upload it, and the live site updates by itself. That's the whole loop.
改一个文件,上传,线上网站自己就更新了。整个循环就是这样。

Vercel's free tier is called Hobby, and it's restricted to non-commercial, personal use. A personal website is exactly what it's for. If you later want to sell something, you need a paid plan.

Vercel 的免费档叫 Hobby,限定非商业、个人使用。个人网站正好就是它的用途。以后想卖东西,就得换付费档。

Four minutes, before anything goes anywhere
四分钟,在任何东西发出去之前

Two file rules that decide whether today works

两条文件规矩,决定今天顺不顺

Do these before you upload anything. Renaming a file after it is already on GitHub means uploading again — cheap, but only if you notice, and the symptom does not tell you. Both failures look identical from the outside — a page that was fine on your laptop and is broken on the internet — and both are unfixable-looking until you know which one it is.

这两条要在上传任何东西之前做。文件传上 GitHub 之后再改名,就得再传一次——不贵,但前提是你发现了,而出问题的样子并不会告诉你是这一条。它们出问题的样子从外面看一模一样——在你笔记本上好好的页面,到了网上就坏了——而且在你搞清楚是哪一条之前,都显得没法修。

1. Your homepage must be called index.html

1. 首页文件名必须叫 index.html

Session 1's file was hello.html. It has to become index.html, because that's the filename a web server hands out by default. A blank page after publishing is almost always this.

第一次课那个文件叫 hello.html。它得改名成 index.html,因为服务器默认送出的就是这个文件名。发布完打开是空白页,几乎都是这一条。

Rename hello.html to index.html and use that as my homepage from now on.

2. Your photo must live inside the project folder

2. 照片必须放在项目文件夹里面

This one is counterintuitive, so read it twice: your photo is somewhere else on your computer — Downloads, Photos, your phone. The website can only see files inside my-website. A photo anywhere else works on your laptop today and is a broken image on the internet ten minutes from now.

这一条反直觉,读两遍:你的照片在电脑上别的地方——Downloads、照片、手机里。网站只看得见 my-website 里面的文件。放在别处的照片,今天在你笔记本上好好的,十分钟后到了网上就是一个破图标。

Drag the photo into my-website, then:

把照片拖进 my-website,然后:

My photo is now in this folder. Rename it to something simple and lowercase
with no spaces, and if it's a .HEIC file convert it to .jpg. Then use it on
the page with a plain relative path — no folder paths from my computer.

iPhone photos are .HEIC by default. They look fine on a Mac and don't render in most browsers. Convert to .jpg now, not after you've published.

iPhone 拍的照片默认是 .HEIC。在 Mac 上看着没事,多数浏览器显示不出来。现在就转成 .jpg,别等发布之后。

Step 1
第 1 步

Connect GitHub to your agent

把 GitHub 连到你的 agent 上

Your agent can talk to GitHub directly once you connect it — no tokens, no terminal, no commands. It's a menu and a login screen.

连上之后,你的 agent 能直接和 GitHub 说话——不用 token,不用 Terminal,不用敲命令。就是一个菜单和一个登录页。

IN THE CLAUDE APP
在 CLAUDE APP 里
  1. Click the + button next to the prompt box
  2. 点输入框旁边的 + 按钮
  3. Select Connectors
  4. 选 Connectors
  5. Choose GitHub and sign in when the browser opens
  6. 选 GitHub,浏览器打开后登录

Anthropic's docs describe it plainly: the + button lets you “add integrations like Google Calendar, Slack, GitHub, Linear, Notion, and more,” and connectors are just “MCP servers with a graphical setup flow.” You can manage or disconnect them later under Settings → Connectors.

Anthropic 的文档说得很直白:那个 + 按钮让你“add integrations like Google Calendar, Slack, GitHub, Linear, Notion, and more”,而 connector 就是“MCP servers with a graphical setup flow”。以后要管理或者断开,在 Settings → Connectors 里。

Codex users: the equivalent lives in the ChatGPT app's own connector settings. If you can't find it, use the fallback at the bottom of this page — it works for everyone and costs you nothing but two extra minutes.

用 Codex 的:对应的东西在 ChatGPT app 自己的 connector 设置里。找不到就用本页最下面那条备用路线——它对所有人都管用,代价只是多花两分钟。

Then just ask

然后直接开口

With Git installed and GitHub connected, the whole thing is one request:

装了 Git、连上 GitHub 之后,整件事就是一句话:

Put this project on GitHub as a new repository called my-website.
Explain each step before you do it, and stop if anything needs a
decision from me.

It creates the repository, saves your first version, and uploads it. Read what it proposes before approving — same habit as every other session.

它会建好仓库、存下你的第一个版本、然后上传。批准之前先读一遍它提出的东西,和别的课一样的习惯。

Public or private? It will ask. Choose Public for this course — fewer permission screens and you can see each other's work. The rule that matters either way: nothing goes in here that you wouldn't put on a business card.

公开还是私有?它会问。这门课选公开——少几道权限页,而且你们能互相看。不管选哪个,真正要紧的规矩是:名片上不敢印的东西,这里就不要放。

Checkpoint: open github.com in your browser and look at your repository. You can see your files, your photo included. Don't move on until you can.

检查点:在浏览器里打开 github.com,看你的仓库。你能看见自己的文件,照片也在里面。看不到就先别往下走。

Step 2
第 2 步

Turn it into a website

把它变成一个网站

  1. Go to Vercel → Add New → Project
  2. 打开 Vercel → Add New → Project
  3. Find my-website in the list → Import
  4. 在列表里找到 my-website → Import
  5. Leave every setting alone. It's plain HTML; there's nothing to configure.
  6. 所有设置都别动。这是纯 HTML,没什么可配的。
  7. Deploy.
  8. 点 Deploy。

Thirty seconds later you have a URL like my-website-xyz123.vercel.app.

三十秒后你就有了一个网址,长得像 my-website-xyz123.vercel.app。

Open it on your phone. Then text it to someone who doesn't know you were doing this.

用手机打开它。然后发给一个不知道你在干这件事的人。

The part that matters most
最要紧的那一部分

Change it live

线上改一次

Ask your agent for a change:

让你的 agent 改一处:

Change the headline on my site to say something new. Then tell me which
file changed.

Then, in the same breath:

然后,紧接着一句:

Save that as a new version and push it to GitHub.

Refresh your live URL.

刷新你那个线上网址。

The change is there. Nobody touched a server.

改动就在那儿了。没有人碰过服务器。

Vercel is watching your repository and deploys every change automatically. That's the loop you now own — and it is the same loop professional teams use. Not a simplified version of it. The same one.

Vercel 一直在看着你的仓库,每一次改动它都自动部署。这个循环现在归你了。而且它和专业团队用的是同一个循环。不是简化版,是同一个。

Do it a second time with something you actually want changed. It needs to become boring — boring means you'll do it at home.

再做一遍,改一个你真心想改的东西。它得变得无聊,无聊就意味着你回家也会做。

If the connector won't cooperate
connector 不配合的时候

The manual way — no connector, no Git

手工路线:不用 connector,不用 Git

This path works for everyone, always, and needs nothing installed. Use it if the connector fails, if you're on a tool without one, or if you simply want to see what the agent was doing on your behalf.

这条路对所有人都管用,永远管用,而且什么都不用装。connector 失灵、你用的工具没有 connector、或者你只是想看看 agent 替你做了什么,都可以走这一条。

Create the repository by hand

手工建仓库

  1. On GitHub, click the green New button
  2. 在 GitHub 上点绿色的 New 按钮
  3. Name it my-website, choose Public, click Create repository
  4. 命名 my-website,选 Public,点 Create repository
  5. Leave the page open — ignore the instructions it shows you, they assume you already know Git
  6. 页面别关——它显示的那些说明先不管,那是写给已经会 Git 的人看的

Upload the files by hand

手工上传文件

Click uploading an existing file, drag every file from your my-website folder in — photo included — and click Commit changes.

点 uploading an existing file,把 my-website 文件夹里所有文件拖进去(照片也要)然后点 Commit changes。

To change something later: Add file → Upload files → drag the changed file in → Commit changes. GitHub replaces the old version; that's expected.

以后要改东西:Add file → Upload files → 把改过的文件拖进去 → Commit changes。GitHub 会替换掉旧版本,这是正常的。

It reaches the same place. Vercel doesn't care how the files arrived. The only thing you lose is the version history on your own laptop — which is exactly what Git was for, so come back and finish setting it up when you have a quiet ten minutes.

走到的是同一个地方。Vercel 不在乎文件是怎么来的。你唯一失去的,是自己笔记本上那份版本历史。那恰好就是 Git 的用处,所以哪天有安静的十分钟,回来把它配完。

Optional, and it costs money
可选,而且要花钱

An address with your name on it

一个挂着你名字的地址

Right now your site lives at something like my-website-xyz123.vercel.app. That is a real address and it keeps working for as long as the project is there. A domain of your own is the same website with a nicer name in front of it — nothing about your files, your repo, or the publish loop changes.

现在你的网站在 my-website-xyz123.vercel.app 这样的地址上。那是个真地址,只要项目还在,它就一直能用。自己的域名,就是同一个网站前面挂一个好看点的名字——你的文件、你的仓库、发布的那个循环,一样都不变。

This is the first thing in the whole course that is not free. The price depends almost entirely on the ending you pick. Three quotes for the same name, pulled from Vercel on 6 August 2026 — these are first-registration prices, and what a domain costs to renew is a separate number that can be higher:

这是整门课里第一样不免费的东西。价钱几乎完全取决于你挑的那个结尾。同一个名字的三个报价,2026 年 8 月 6 日从 Vercel 拉的——这是头一次注册的价,续费是另一个数字,可能更贵:

.dev

$9.99 / year

$9.99 / 年

.com

$11.25 / year

$11.25 / 年

.me

$26.99 / year

$26.99 / 年

Same name, nearly three times the price. Check before you fall in love with an ending. And these were true on one day at one seller — the price on the checkout screen is the real one, not the one printed here.

同一个名字,价钱差了将近三倍。在你爱上某个结尾之前先查一下。而且这只是某一天、某一家的价——结账页面上那个数才算数,不是这页上印的这个。

Two halves, and people only do one

两半,而多数人只做了一半

Buying a domain gets you a name. It does not point that name anywhere, and Vercel does not know it exists. Both sides have to be told — that is the whole job, and doing one side is the commonest way to get stuck:

买下域名,你得到的是一个名字。它不指向任何地方,Vercel 也不知道它存在。两边都得说一声——活就是这么点,而只做了一边是最常见的卡法:

SIDE 1 · IN VERCEL
第一边 · 在 Vercel 里

Add both forms to the project — the bare name and the www one. Then pick which is the real address; Vercel sends the other one there.

把两种写法都加到项目里——光名字的,和带 www 的。然后挑一个当正式地址,另一个由 Vercel 转过去。

Skip this and one of the two forms answers with a 404 no matter how correct your DNS is.

漏了这一步,不管 DNS 多正确,两种写法里总有一个回 404。

SIDE 2 · WHERE DNS LIVES
第二边 · DNS 在哪儿

Add the records Vercel asks for. Careful: this is not always where you bought the name. It is wherever the domain's nameservers point — sometimes the seller, sometimes Cloudflare, and if you bought the domain inside Vercel it may already be done.

把 Vercel 要的记录加上。注意:这地方不一定就是你买名字的那家。它是域名的 nameserver 指向的地方——可能是卖家,可能是 Cloudflare;要是你在 Vercel 里买的域名,这一步可能已经自动做好了。

Check this before you go hunting for a DNS screen that isn't there.

先确认这一条,别去找一个根本不存在的 DNS 页面。

In the ordinary case the records have two shapes. The placeholders below are the shape; the values are not yours — and Vercel may ask you for something else again, such as a TXT record to prove you own the name. Whatever it prints once you add the domain is the only correct source; records change and this page does not change with them.

常见情况下记录有两种形状。下面这两条是形状,值不是你的——而且 Vercel 有可能还要你加别的,比如一条用来证明域名是你的 TXT 记录。你把域名加进去之后它打出来的那组,才是唯一正确的来源;记录会变,这一页不跟着变。

type: A       name: @      value: <the number Vercel shows you>
type: CNAME   name: www    value: <the name Vercel shows you>

One trap in that table: the name column wants www, not www.example.com. Some providers add the rest for you and some don't, so read what the field already says before you type.

这张表里有一个坑:name 那一栏要填的是 www,不是 www.example.com。有的服务商会替你把后半截补上,有的不会,动手之前先看那个输入框里本来写着什么。

Let the agent walk you through it

让 agent 一步步带你做

Same move as setup night — don't follow a menu written months ago. Your agent cannot see your screen, so this prompt makes it ask before it tells:

和装机那晚一个套路:别照着几个月前写的菜单点。你的 agent 看不见你的屏幕,所以这段提示词让它先问、后说:

I want a domain I own to point at my site on Vercel.

Before giving me any values, ask me these one at a time and wait:
  - the domain name, and my Vercel project name
  - where I bought it, and whether I bought it inside Vercel
  - whether the nameservers were ever moved somewhere else
  - whether I want the plain name or the www one as the real address

Then walk me through it one step at a time, waiting after each.
When a step needs a value from Vercel, stop and ask me to paste in
what Vercel is showing. Never guess a DNS value. Tell me plainly
when it is my turn to click something.

It will not work immediately, and that is normal. The change has to spread across the internet's address books. Often minutes, sometimes hours, and it can take up to two days. Do not undo anything while you wait — most broken domains are someone who changed the record three times in ten minutes.

它不会立刻生效,这是正常的。这条改动要在互联网的通讯录里扩散开。常常几分钟,有时要几个小时,最长可能要两天。等的时候什么都别撤——大多数弄坏的域名,都是十分钟里把记录改了三遍的那种人。

Checkpoint, all three: Vercel's Domains screen shows both forms as valid · typing the name with www and without both reach your site, one redirecting to the other · the browser does not say Not Secure. That last one is the certificate, issued automatically — you never buy or install one. Don't hunt for a padlock icon; browsers stopped showing it, and its absence means nothing.

验收,三条都要:Vercel 的 Domains 页面上两种写法都显示有效 · 带 www 和不带各输一次,都能到你的网站,其中一个跳到另一个 · 浏览器没有写 Not Secure。最后这条说的是证书,自动签发,你不用买也不用装。别去找那把小锁,浏览器已经不显示它了,没有它不代表出问题。

Before you go
走之前

Money, and staying safe

花钱,和别出事

What this costs

这要花多少钱

Your AI subscription is the only bill — about $20/month.

只有 AI 订阅这一笔——一个月 二十美元上下。

GitHub and Vercel are free at this size.

GitHub 和 Vercel 在这个规模都是免费的。

A domain of your own is the one optional extra — roughly $10–$27 to register for a year depending on the ending, and it has to be renewed, at a price quoted separately. Skipping it costs you nothing but a longer address.

自己的域名是唯一那笔可选的额外开销——按结尾不同,注册一年大约 10 到 27 美元,而且到期要续,续费另外报价。不买也没什么损失,就是地址长一点。

If anyone offers you an “API key” setup, that bills per use — a different model entirely. Ask before enabling it.

要是有人让你配一个“API key”,那是按用量计费的,完全另一种模式。启用之前先问清楚。

Simple work does not need the biggest model. Use the default or a lighter one, and keep an eye on the usage meter; when it gets close to the limit, switch down or wait for the reset rather than losing the session.

简单的活不用最大的模型。用默认的,或者更轻的那个,同时留意用量显示;快到上限的时候换轻一点的,或者等它重置,别把手上这一段丢了。

And once anything you use bills per use, make it a standing order: ask me before anything that costs money, and tell me how much. You cannot tell in advance what one long run will cost.

只要你用的东西里有按用量计费的,就把这句写成常设命令:ask me before anything that costs money, and tell me how much。一次长时间的运行到底花多少,事先是看不出来的。

Repeated, because you're confident now

重说一遍,因为你现在有底气了

Read permission prompts. Confidence grows faster than judgement.

看授权提示。底气长得比判断力快。

Never paste passwords, cards, or keys.

绝不粘贴密码、卡号或者密钥。

Anything public is public forever. Assume it's screenshotted.

公开的东西就永久公开。就当它已经被截过图。

From here
从这里往下

Three doors

三扇门

Keep going on this site

接着做这个网站

New idea? Back to Move 1. Interview, design, approve, plan, build. The five moves never change.

有新想法?回到第一步。问询、设计、批准、计划、动手。五步永远不变。

Start something else

换一件事做

Copy AGENTS.md across, empty it out, start at Move 1. The method transfers to anything.

把 AGENTS.md 拷过去,清空内容,从第一步开始。这套方法什么都能搬。

Understand what you built

看懂你做出来的东西

Ask it to teach you: “Explain index.html line by line, as if I've never seen code.” Infinite patience, no ego.

让它教你:“Explain index.html line by line, as if I've never seen code.”耐心无限,没有脾气。

You didn't learn to code. You learned something that transfers further: how to give a clear instruction, check the work, refuse bad work, and write things down. That works on AI agents. It also works on contractors, teammates, and kids.

你学的不是编程。你学到的是更能迁移的东西:怎么把一条指令说清楚、怎么验活、怎么拒掉不合格的活、怎么把事情写下来。这套在 AI agent 上管用,在承包商、同事和孩子身上也管用。

The website is proof you can do it. Next session it stops being yours alone — other people open that URL, use it in front of you, and tell you what they hit. Then you decide what to change. Being live is what makes that possible, and it is why shipping comes before the hard conversation rather than after it.

这个网站就是你能做到的证据。下一次课它就不只属于你了——别人会打开那个网址,当着你的面用,然后告诉你他们撞上了什么。改什么,由你定。正因为它上线了,这件事才做得成,这也是为什么发布排在那场难谈话的前面,而不是后面。

This week, not someday
这一周,不是有空再说

Keep it alive

让它别死掉

1 · Change something and publish it

1 · 改一处,然后发布

Anything. The muscle you need is change → upload → live. If it goes cold you'll never do it again.

改什么都行。你要练的那块肌肉是:改 → 上传 → 上线。凉掉了,你就再也不会做了。

2 · Send the URL to five people

2 · 把网址发给五个人

Real ones. A website nobody has seen is a folder with extra steps.

真的五个人。没人看过的网站,就是一个多几个步骤的文件夹。

3 · Keep two habits above all others

3 · 有两个习惯要保住,别的都可以让

No code until there's a design you approved. Not even for “it's simple.” Especially for “it's simple.”

设计没经你批准,就不写代码。“这个很简单”也不行。尤其是“这个很简单”。

When you type the same correction twice, write it into AGENTS.md instead.

同一句纠正打到第二遍,就把它写进 AGENTS.md。

The first is why your projects end up being what you actually wanted. The second is the difference between an assistant that gets better every week and one that stays exactly as annoying as it was on day one.

第一条决定了你的项目最后是不是你真正想要的那个。第二条决定了你手上这个助手是每周都在变好,还是永远和第一天一样烦人。

Put the live address in the course forum when it is up. It is the one place where the people reading it know what it took.

上线之后,把网址发到课程论坛。那是唯一一个看的人知道这东西花了多少功夫的地方。

Next

下一步

Now it belongs to its readers. Next session someone who didn't build it uses your live site in front of you, and you decide what that's worth changing.

现在它属于读它的人了。下一次课,一个没参与做的人当着你的面用你的线上网站,然后由你决定这值不值得改。

Bring two things next time: whatever you have — a live URL, the folder on your laptop, or just design.md — and one sentence naming the part you're least sure about. That sentence is what someone else's agent gets pointed at first. What session 3 does with it.

下次带两样东西:你手上有的那个——线上网址、笔记本上的文件夹,或者就一份 design.md——外加一句话,说清楚哪一处你最没底。别人的 agent 会先被指到那句话上。第三次课拿它做什么。