AI Engineering from Scratch / Stage 1. The task, the workspace and the process
Teach the assistant your repeating process with one skill, learn when a subagent is needed, and decide which MCP servers are worth connecting.
Outcome: the `pre-commit-check` skill
For this lesson you need: an assistant with the starter folder open, the lesson-01 branch from lesson 1, and your work from the end of it saved. This lesson costs $0, and you don't need an API key (the long password-like string the model checks before it lets a program in). No assistant yet? Set one up with the "Assistant" step of lesson 0.
First, save your lesson 1 work. It lives in files that switching to the lesson 2 branch can overwrite. A commit is a saved state of the project in Git history. In the starter folder:
Already ran these two commands at the end of lesson 1, in the "Save your work before lesson 2" step? Then you can skip them: a second commit will just say nothing to commit, and that's fine. Git asks who you are? Set user.name and user.email the way you did at the end of the "Install everything in one session" step of lesson 0.
Now the lesson 2 branch. Run these two commands only after the two above:
This branch starts from the reference code of lesson 1 (tag l01), so the tests match. Your prototype stays in the lesson-01 branch. That's all the setup you need.
By the end of your first week you'll notice you close every session the same way: "run the tests, look at what changed, go through the three checks, update STATE.md". Each time you phrase it a little differently. One evening you'll skip the bit about changed files, and an API key or a deleted test will slip into the commit. And the agent will tell you everything works, because that's exactly the thing you didn't ask it to check.
Remember lesson 1. Why should the rules file be short?
A pre-commit-check skill in your project folder. It kicks in on its own when you say "commit", and you can also call it by name: it runs the tests, flags suspicious spots in your changes, goes through the three checks from KB.md and updates STATE.md. That's two steps, about 35 minutes. The rest of the steps, marked "optional", are reference: harness, subagents, MCP and why agents make mistakes. Read them when you need them.
The starter's rules file (28 lines) goes into every request, so it has no procedures in it. The pre-commit procedure has five steps with details, and you need it about once an hour. If you add it to the rules file, you pay for it in every message, even when you ask "what does this function do".
Skills exist for procedures like this. A skill lives in a folder with a SKILL.md file. At the top is a name and a description: what the skill does and when to use it. Below are the instruction steps. Next to it you can put templates, examples and scripts. The format is open (Agent Skills), so Claude Code, Codex, Antigravity and Cursor all read the same skill.