All Modules Assistant Context Prompting Steering عربي

Your AI Coding Workflow

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 min

What You'll Learn

  • Set up a real environment (Node.js) and an agentic AI assistant — Claude Code shown; any assistant works
  • Know the two kinds of assistant and when to reach for each
  • Understand why context is everything, and feed it with a project context file
  • Write prompts that produce working code: goal, constraints, acceptance criteria, plan-first
  • Steer instead of gamble: small diffs, constant review, resetting a confused assistant
  • Hands-on lab: install your tools, add a context file, and scaffold the snippet vault with a spec-style prompt

Prerequisites: Module 1 — you should already have the snippet-vault Git repo from the first lab.

Meet Your Assistant

AI coding assistants come in two broad shapes. You'll use one as your main driver, but it helps to know both:

KindWhat it doesExamples
Chat assistantYou paste code in and copy answers out. Simple, but it can't see your project or run anything.claude.ai, ChatGPT
Agentic / in-editorReads and edits your files directly, runs commands, and works across the whole repo. This is where vibe coding gets powerful.Claude Code, Cursor, Copilot

We'll use Claude Code as the concrete example

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.

Tool-agnostic, on purpose

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.

Context Is Everything

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 project context file

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:

AssistantContext file
Claude CodeCLAUDE.md
Cursor.cursorrules
Copilot.github/copilot-instructions.md

A good one is short and concrete — stack, structure, conventions, and a few "don'ts":

# Snippet Vault A small app to save code snippets (title + language tag + search). ## Stack - Front end: React (in web/) - API: NestJS (Node) (in api/) - One repo, two apps (a monorepo). ## Conventions - TypeScript everywhere. Small, focused commits. - Every feature needs a test before it's "done". ## Don't - Don't add a feature I didn't ask for. - Don't hard-code secrets. Don't skip error handling.

Rule of thumb

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.

Prompts That Get Working Code

A vague prompt gets a vague app. A good coding prompt has four parts — and one golden rule:

PartWhat to say
GoalWhat you want, in one sentence.
ConstraintsStack, style, libraries to use or avoid.
Acceptance criteriaHow you'll know it's done — the behavior you'll check.
Out of scopeWhat 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.

Vague prompt

"Make me a snippet app." → You'll get something, in some framework, with choices you didn't make and can't predict.

Structured prompt

"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."

Steer, Don't Gamble

The difference between a pro and a gambler isn't the prompt — it's what happens after. Four habits keep you in control:

HabitWhy
Read every diffNever accept code you haven't looked at. This single habit prevents most disasters.
Keep changes smallOne concern at a time, then commit. Small diffs are reviewable; giant ones hide bugs.
Correct earlyWrong direction? Stop and re-steer at the first sign, not after 10 more edits pile on top.
Reset when confusedIf the assistant contradicts itself or loops, clear the context and start the task fresh. That's context rot — failure mode #5.

The one rule you never break

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.

Practical Lab: Set Up Your Workspace & Scaffold the App

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.

What you need

Your snippet-vault repo from Module 1, plus Node.js LTS and an agentic assistant (Claude Code recommended; Cursor or Copilot are fine).

1

Install Node.js and verify

Install the LTS build from nodejs.org, then confirm:

node -v npm -v
2

Install your assistant

For Claude Code, install it and launch it inside the project folder:

npm install -g @anthropic-ai/claude-code cd snippet-vault claude

Using Cursor or Copilot instead? Just open the snippet-vault folder in the editor — the rest of this lab is identical.

3

Give the assistant context

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.

4

Ask for a plan — before any code

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".

Goal: scaffold the snippet vault as a monorepo. Constraints: React front end in web/, NestJS API in api/, TypeScript. Acceptance: each app starts with one documented command; no features yet. Out of scope: don't implement snippets, search, or styling yet. First show me the folder plan. Do not write code until I say "go".
5

Scaffold, review, and run

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):

# API cd api && npm install && npm run start:dev # Web (in a second terminal) cd web && npm install && npm run dev
6

Commit, then reflect

Commit the scaffold and your context file:

git add . git commit -m "Scaffold monorepo (web + api) and add 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.

What to hand in

Your updated snippet-vault repo. Self-check before submitting:

  • Repo has a context file (CLAUDE.md / .cursorrules / Copilot instructions)
  • web/ and api/ exist and each app starts with one command
  • New commits for the scaffold and the reflection
  • REFLECTION.md includes your prompt, the plan you approved, and one steer you made

Mini Glossary

TermPlain meaning
Context windowEverything the model can currently "see" — your prompt plus visible files. Outside it, the model is blind.
Agentic assistantAn AI that reads/edits files and runs commands directly, not just chats.
Context fileA repo file (CLAUDE.md, .cursorrules…) the assistant reads to learn your project once.
ScaffoldThe empty skeleton of a project — folders, config, "hello world" — before real features.
MonorepoOne Git repo holding multiple apps (here: web/ and api/).

Recap & What's Next

You now have

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.

Your AI Coding Workflow

Objectives Your Assistant Context Prompting Steering Practical Lab Glossary Recap