Starter projects for the RS School React course.
Each course module has its own branch with a ready-to-run project, the task spec and theory in docs/,
and an AI coaching harness: you build the app with an AI assistant coaching you, not writing it for you.
mainis the task-less template the module branches are generated from. There is nothing to build onmain— pick a module branch below.
| Branch | Task |
|---|---|
functional-components |
Task 1 — Functional Components, State & Testing |
routing |
Task 2 — Routing, SPA |
state-management |
Task 3 — State Management + Context |
queries |
Task 4 — Data Queries |
advanced-hooks |
Task 5 — Advanced Hooks & Patterns |
forms |
Task 6 — Forms |
nextjs-ssr-ssg |
Task 8 — Next.js SSR / SSG |
On every module branch:
- 📋 What to build:
docs/TASK.md— requirements, feature/points breakdown, penalties. - 📚 What to read:
docs/— curated theory per topic and an index (docs/README.md) mapping each decision to its reading. - 🤖 How the AI must help you:
AGENTS.md— the coaching contract (canonical source:CLAUDE.md). - 📝 Your decision log:
CHANGELOG.md— mandatory (missing = -90 points).
-
Create your own repository from this template: on GitHub, click Use this template → Create a new repository, and tick Include all branches — otherwise you only get
mainand none of the module branches. -
Clone your repository and install the prerequisites below.
-
For each module, create your working branch from that module's branch:
git switch functional-components git switch -c functional-components_your-github-account pnpm install
-
Work on your branch, commit, and push it to your repository.
-
Open a pull request from your branch into the module branch (e.g.
functional-components_your-github-account→functional-components) in your repository. That PR is what gets reviewed.
- Working branches are named
{module_name}_{github_account}, where{module_name}is the module branch you started from — e.g.functional-components_my-shiny-github-acc→functional-components. - Pull requests go into the module branch only — never into
main. - Don't merge one module's work into another module's branch; each module starts from its own branch.
- Node.js 24 (LTS) — the version CI uses.
.nvmrcpins it, sonvm use/fnm usepicks it up. - pnpm — install it once with
corepack enableor from https://pnpm.io/installation. Other package managers are blocked (only-allow pnpm).
pnpm install # install dependencies + set up Husky hooks
pnpm dev # start Vite dev server
pnpm test # run Vitest (unit/component) once
pnpm coverage # run unit tests with coverage (statements >= 80% required)
pnpm e2e # run Playwright end-to-end tests (builds + serves the app)
pnpm lint # Oxlint
pnpm format # Oxfmt (check); pnpm format:fix to write
pnpm build # type-check + production buildFirst E2E run:
pnpm exec playwright install chromiumdownloads the browser once.
- Vite + React 19 + TypeScript (
strict, noany, nots-ignore). - Oxlint (
.oxlintrc.json— recommended + React/TypeScript/jsx-a11y) as the linter. - Oxfmt (
.oxfmtrc.json) as the formatter — one unified oxc toolchain with Oxlint. - Vitest + React Testing Library + jsdom + jest-dom for unit/component tests (a smoke test is in
src/App.test.tsx— replace it with real tests). - Playwright for end-to-end tests (config in
playwright.config.ts, specs ine2e/; a smoke spec is included). Vitest ownssrc/**, Playwright ownse2e/**— separate globs. - Husky hooks: pre-commit runs
verify:harness+lint+format, pre-push runsverify:harness+test. (E2E runs in CI, not in local hooks — browser downloads are heavy.) - Per-assistant enforcement hooks (on top of the instruction files below):
- Claude Code (
.claude/settings.json): starts in plan mode, uses the course's Coach output style (.claude/output-styles/coach.md, part of the system prompt), and aUserPromptSubmithook re-states the coaching contract each turn. Personal overrides go in.claude/settings.local.json(git-ignored). - Codex (
.codex/config.toml): aUserPromptSubmithook re-injects the same contract every turn (runs once you trust the project in Codex). - Cursor (
.cursor/hooks.json): the contract is always applied via.cursor/rules/coaching.mdc; abeforeSubmitPrompthook additionally blocks if the instruction files have been stripped.
- Claude Code (
- Coaching skills (
.claude/skills/, mirrored to.agents/skills/) — see below. - Playwright MCP, opt-in (
.mcp.json,.cursor/mcp.json,.codex/config.toml) — see below. - Optional: add MSW yourself if you prefer it over Vitest mocks for the network layer.
Whichever assistant you use follows the same coaching rules. AGENTS.md is the
cross-tool standard baseline — the open agents.md convention read by Codex, OpenCode,
Kiro, Windsurf, Amazon Q, Aider, Gemini, Zed, VS Code, and more. The other files below carry the same full
rules (not pointers) as redundancy for assistants that prefer their own file:
| Assistant | Instruction file |
|---|---|
| Any tool / the standard | AGENTS.md |
| Claude | CLAUDE.md (canonical source) |
| GitHub Copilot | .github/copilot-instructions.md |
| Gemini | GEMINI.md |
| Cursor | .cursor/rules/coaching.mdc |
Using another assistant? Whatever tool you use, point it at AGENTS.md (or CLAUDE.md) — the same
coaching rules apply no matter which file loaded. Convenience hooks (plan-mode default, a per-turn reminder,
a tamper tripwire) ship for Claude/Codex/Cursor, but the rules don't depend on them.
The assistant will: not write the whole app; ask you to plan first; at each decision point lay out
the options + the criteria to weigh them + what to read in docs/, then let you choose and justify
(it will decline "just build it" and "which is better? / you decide" — it won't hand you the pick);
and record every decision in CHANGELOG.md. You own the code and must be able to explain every line.
This repo ships a coaching-harness integrity check (
pnpm verify:harness, run by the Husky hooks and CI): it confirms the instruction files and the in-codeAI-COACH-RULESnotes are present. Removing them is not the assignment — the check will fail your commit, and it's visible in review.
Slash-command helpers that coach, never implement — they report findings, point to the reading and ask
you questions; you make the changes. You run them on purpose (/review, /quiz-me, …); the AI can suggest
them but never triggers them by itself.
| Always available | What it does |
|---|---|
/explain [concept] |
Explains a concept with a small example unrelated to your task + where to read |
/options [decision] |
Options + criteria + reading for a decision — you pick |
/review [path] |
Findings on your changes (severity, rule, reading) — no rewrites |
/test-ideas |
Behaviors worth testing (Given/When/Then) — no test code |
/debug-coach |
Hypotheses + what to inspect — not the fix |
/quiz-me, /defend |
Self-check and a mock cross-check on your own code |
/log-decision |
Drafts the CHANGELOG.md entry from your words |
Topic skills (/hooks-review, /routing-review, /state-review, /query-review, /a11y-review,
/composition-review, /forms-review, /rsc-review, /e2e-review, …) ship on the module branches whose
task needs them (none on main) and are switched on in .claude/settings.json → skillOverrides. If a
branch ships one that is off, turn it on for yourself in the git-ignored .claude/settings.local.json:
{ "skillOverrides": { "a11y-review": "on" } }Skills used for a step are noted in CHANGELOG.md. Assistants other than Claude Code read the same skills
from .agents/skills/; the coaching rules are written into each skill, so they apply there too.
Lets your assistant open the running app to inspect it — accessibility tree, console, network — so it can
help you debug and explore role-based locators. It is off until you enable it, pinned to one version,
headless, and configured with --codegen none.
- Claude Code: asks for approval the first time (
.mcp.json). - Cursor: enable
playwrightunder Settings → MCP (.cursor/mcp.json). - Codex: shipped with
enabled = false; runcodex -c mcp_servers.playwright.enabled=trueto opt in. - VS Code / Copilot: discovers
.mcp.jsonin trusted workspaces; disable it for yourself via MCP: List Servers.
It will not write your E2E tests — those are graded work. Playwright's test agents (
npx playwright init-agents: planner / generator / healer) are not allowed here, and the harness check fails if their files appear.
- Branch off
main:git switch main && git switch -c <module>— the branch name is the module name (students' branches are<module>_<github-account>). Add the branch to the table at the top of this README onmain. package.json: setname(rs-react-<module>) andaiCoaching.task(e.g."Task 3") — the mirror headers read this label.docs/TASK.md: paste the task spec fromreact/modules/tasks/. Make every relative link absolute (theory modules →https://github.com/rolling-scopes-school/tasks/tree/master/react/modules/<topic>), and replace the "Fresh repository; dedicated branch; first commit onlyREADME.md" requirement with this repo's workflow (branch<module>_<github-account>from<module>, PR into<module>, nevermain). Add one theory file per topic (copied fromreact/modules/<topic>/README.md) and fill the decision → reading table indocs/README.md.CLAUDE.md: set the H1, §1 context (the app being built), and §4 task-specific decision points (options + criteria + reading — never a recommended pick). Then runpnpm instructions:sync.scripts/verify-harness.mjs: add the theory file(s) todocsFiles.- Topic skills: add the task's topic skills to
.claude/skills/(keep theCOACH-SKILLpreamble anddisable-model-invocation: true), switch them on in.claude/settings.json→skillOverrides, and runpnpm instructions:syncto mirror them into.agents/skills/. - Tasks without E2E (1, 7): remove
@playwright/test,playwright.config.ts,e2e/, thee2e*scripts, the CI browser/E2E steps, andplaywright.config.tsfromsentinelFiles. - Rename the placeholder heading (
index.htmltitle,src/App.tsx, both smoke tests), set theCHANGELOG.mdtitle, then runpnpm install && pnpm verify:harness && pnpm lint && pnpm format && pnpm test.