Set up your assistant and the habits that turn it into a reliable pair — not a slot machine.
Module 2 · Setup, context, prompting, and steering.
Beginner Workflow Includes Lab ~50 minPrerequisites: Module 1 — you should already have the snippet-vault Git repo from the first lab.
AI coding assistants come in two broad shapes. You'll use one as your main driver, but it helps to know both:
| Kind | What it does | Examples |
|---|---|---|
| Chat assistant | You paste code in and copy answers out. Simple, but it can't see your project or run anything. | claude.ai, ChatGPT |
| Agentic / in-editor | Reads and edits your files directly, runs commands, and works across the whole repo. This is where vibe coding gets powerful. | Claude Code, Cursor, Copilot |
Claude Code is an agentic assistant that lives in your terminal — it reads your repo, edits files, and runs commands with your approval. It's a natural fit for a course about shipping, because the terminal is where builds, tests, and deploys happen. Everything you learn here maps directly to Cursor or Copilot — the workflow is the same, only the buttons differ.
Don't get attached to one tool. Assistants change monthly; the habits in this module — context, clear prompts, small reviewed changes — are what actually make you productive, and they carry to whatever you use next.
An AI assistant only knows what's in its context window — your prompt, plus whatever files it can currently see. It cannot read your mind, remember last week, or guess your conventions. Most "the AI wrote bad code" moments are really missing context moments.
The fix is a small file at the root of your repo that the assistant reads automatically, describing the project once so you don't repeat yourself every prompt. Each tool has its own name for it:
| Assistant | Context file |
|---|---|
| Claude Code | CLAUDE.md |
| Cursor | .cursorrules |
| Copilot | .github/copilot-instructions.md |
A good one is short and concrete — stack, structure, conventions, and a few "don'ts":
If you find yourself typing the same explanation into the assistant twice, it belongs in the context file. Write it once; the assistant reads it every time.
A vague prompt gets a vague app. A good coding prompt has four parts — and one golden rule:
| Part | What to say |
|---|---|
| Goal | What you want, in one sentence. |
| Constraints | Stack, style, libraries to use or avoid. |
| Acceptance criteria | How you'll know it's done — the behavior you'll check. |
| Out of scope | What not to touch or build. |
Golden rule: for anything non-trivial, ask for a plan before code. Read the plan, correct it, then let it build. It's far cheaper to fix a plan than a pile of generated files.
"Make me a snippet app." → You'll get something, in some framework, with choices you didn't make and can't predict.
"Goal: scaffold the snippet vault as a monorepo. Constraints: React in web/, NestJS in api/, TypeScript. Acceptance: both apps start with one documented command each; no features yet. Out of scope: don't implement snippets or styling yet. First, show me the folder plan — don't write code until I say go."
The difference between a pro and a gambler isn't the prompt — it's what happens after. Four habits keep you in control:
| Habit | Why |
|---|---|
| Read every diff | Never accept code you haven't looked at. This single habit prevents most disasters. |
| Keep changes small | One concern at a time, then commit. Small diffs are reviewable; giant ones hide bugs. |
| Correct early | Wrong direction? Stop and re-steer at the first sign, not after 10 more edits pile on top. |
| Reset when confused | If the assistant contradicts itself or loops, clear the context and start the task fresh. That's context rot — failure mode #5. |
Do not accept a change you haven't read. "It ran, so it's fine" is exactly how silent bugs and security holes get shipped. You are the reviewer; the AI is the junior. Later modules (tests, quality gates) add automated backups — but your eyes come first.
You'll install your tools, teach the assistant about the project with a context file, then use a proper spec-style prompt to scaffold the real snippet vault — reviewing and committing as you go. You'll hand in the updated repo.
Your snippet-vault repo from Module 1, plus Node.js LTS and an agentic assistant (Claude Code recommended; Cursor or Copilot are fine).
For Claude Code, install it and launch it inside the project folder:
Using Cursor or Copilot instead? Just open the snippet-vault folder in the editor — the rest of this lab is identical.
Create a context file at the repo root (CLAUDE.md for Claude Code, or your tool's equivalent) using the template from the Context section above. Adjust it to your project.
Paste the structured prompt below. When the assistant replies with a folder plan, read it and push back on anything you don't like. Only then say "go".
Let it create the skeleton. Read the diff before accepting. Then start each app to confirm they run (the assistant will tell you the exact commands, typically something like):
Commit the scaffold and your context file:
Then add to REFLECTION.md: paste your context file and your prompt; note one thing the assistant got wrong or assumed and how you steered it; and in one line, how your structured prompt beat "make me a snippet app." Commit it.
Your updated snippet-vault repo. Self-check before submitting:
CLAUDE.md / .cursorrules / Copilot instructions)web/ and api/ exist and each app starts with one commandREFLECTION.md includes your prompt, the plan you approved, and one steer you made| Term | Plain meaning |
|---|---|
| Context window | Everything the model can currently "see" — your prompt plus visible files. Outside it, the model is blind. |
| Agentic assistant | An AI that reads/edits files and runs commands directly, not just chats. |
| Context file | A repo file (CLAUDE.md, .cursorrules…) the assistant reads to learn your project once. |
| Scaffold | The empty skeleton of a project — folders, config, "hello world" — before real features. |
| Monorepo | One Git repo holding multiple apps (here: web/ and api/). |
A working environment, an agentic assistant that knows your project through a context file, a repeatable prompt recipe (goal / constraints / acceptance / out-of-scope, plan-first), and the steering habits that keep you in control — plus a scaffolded React + NestJS monorepo, committed.
Next up: Module 3 — Spec-First Planning. Before we build features, we turn the vague idea "a snippet vault" into a crisp, executable spec the assistant can follow without wandering.