W3
Block 1 · Class 3 · Theory

Save points.

Last week you fixed a bug in a folder. Today the folder becomes a repo, and you build a feature the way a team does.

Class 3 · Today

What we'll do.

1Git, the idea — four words.
2Your folder becomes a repo — last week's fix is your first commit.
3One line, one commit — bug #0, me first, then you.
4A spec from the PM — and the tests that say when it's done.
5Feature 1, live — branch → build → green → merge. Then you start yours.

Same groups as last week. Today every laptop gets its own private repo.

Class 3 · Git, the idea

Git is save points for code.

Repo

The project

A folder git watches. Yours is on your laptop; a copy lives on GitHub.

Commit

A save point

A snapshot of the folder with a message. You can always go back to it.

Branch

A parallel copy

Build on the side. main keeps working while you try.

Push

Upload

Send your commits to GitHub. Until you push, they're only on your laptop.

All of it from GitHub Desktop. Buttons, no terminal.

Class 3 · Git, the idea

Two copies. You keep them in sync.

Your laptop

Where you work

Edit files, run the app, run the tests. Commit when something works.

GitHub

Where the team looks

The history, the branches, the pull requests. Push to get your commits here.

1

Commit small. One bug, one feature, one commit.

2

The message says what changed: "Fix group title showing the id".

3

Push before you close the laptop.

Class 3 · Your folder becomes a repo · 20 min

Publish to GitHub.

1Install GitHub Desktop from desktop.github.com. Sign in with your GitHub account.
2File → Add local repository → choose last week's folder. It says "not a repository" → Create a repository here.
3Publish repository. Name it splitit or tiny-crm. Leave Keep this code private ticked.
4Repository → View on GitHub. Your files, your fix, online. That was your first commit.

One repo per person. Same folder, same fix, your own copy. Private: only you see it.

Class 3 · Live · Bug #0

One line. One commit.

1Read the report. issues/000-group-title.md: the group page says "Group 2" instead of the name.
2Run the test. uv run pytest tests/test_bugs.py. The bug has a test, and it's red.
3Follow the click. st.title(logic.group_title(group)) → group_title returns "Group " + group["id"].
4Fix. return group["name"]. Run the test: green. Refresh the app: "Surf Trip Ericeira".
5Commit. GitHub Desktop shows logic.py changed → summary → Commit to main → Push origin. Refresh GitHub.
Class 3 · Your turn · 8 min

Bug #0 in your repo.

Done early? Read specs/feature-1. It's next.

Class 3 · A spec from the PM

What a product manager sends you.

specs/feature-1-balances.md

Why — as a member, I want balances in words I can read out loud.
What — a checklist. balance_lines(group_id), one sentence per member, "João is owed €20.00".
Out of scope — settle up, rounding, storage.
Done when — tests green · visible on the page · on a branch, pushed.

Read it as an engineer

Which file changes? logic.py and app.py.
What do I reuse? compute_balances, get_group_members.
What's ambiguous? Ask, or read the test.

The spec is also your prompt. Paste it to Codex as is.

Class 3 · Tests

Tests are the spec, in code.

What a test is

A tiny program that calls your function and checks the answer. Green = matches. Red = doesn't.

Why you care

You didn't write most of your code. Tests tell you whether the AI did what you asked.

The loop

Red → build → run → still red? Read the failure. → green. Then click through the app anyway.

uv run pytest tests/test_feature_1.py — four tests, one per line of the spec's checklist.

Class 3 · Live · Feature 1

Branch → build → green → merge.

1Branch. GitHub Desktop → Current branch → New branch → feature-1-balances.
2Red. uv run pytest tests/test_feature_1.py. Four failures. That's the to-do list.
3Prompt. Paste the spec and the test file into Codex. Ask for balance_lines in logic.py.
4Read the diff in GitHub Desktop. Does it reuse compute_balances? Two decimals? No minus sign?
5Green. Run the tests. Then show_balances in app.py prints the lines. Refresh, look.
6Commit, push, Create Pull Request, merge. One button each. Then switch back to main and Pull origin.
Class 3 · Your turn · 15 min, finish at home

Feature 1 in your repo.

Tiny CRM: fix issues/002 first, it says so at the top of the spec.

Class 3 · When git is confusing

You can't lose a commit.

1Wrong branch? Current branch → switch. GitHub Desktop asks to bring your changes along. Say yes.
2Broke a file? GitHub Desktop → right-click the file → Discard changes. Back to the last commit.
3Broke the data? uv run python seed.py, same as last week.
4An error you don't understand? Screenshot it, ask Codex to explain it, then ask us.
Class 3 · Before next week

Next week: a spec you build alone.

← → navigate · N notes · F fullscreen