This repository is a scaffold for the Scribble lab.
This lab starts from a runnable but intentionally incomplete Scribble-style guessing game with a minimal REST backend and an in-memory room system. The work is a brownfield enhancement: inspect the starter, produce Spec Kit artifacts, implement the missing behavior incrementally, validate against acceptance criteria, and reflect on the AI-assisted workflow.
Granular, meaningful commits are encouraged so implementation decisions remain easy to assess.
| Item | Details |
|---|---|
| Project type | Brownfield enhancement |
| Tech model | Frontend plus minimal REST backend, in-memory store, manual room refresh in the starter, polling added during implementation |
| Difficulty | Intermediate |
| Estimated effort | 4-6 focused hours across multiple sessions |
| Prerequisites | Comfort reading an existing codebase |
It already provides:
frontend/: Vite + React + TypeScript clientbackend/: Node.js + Express + TypeScript service- starter routes and screens for Start, Create Room, Join Room, Lobby, and Game
- starter room API with in-memory state
- starter seed data:
- words:
rocket,pizza,castle,guitar,sunflower - roles:
drawer,guesser
- words:
It does not implement the required room and gameplay features described in the business scenarios below.
The current UI uses Scribble branding and presentational copy, but the supported behavior is still the scaffold described in this document.
Before starting, confirm the following are available:
- Node.js 18+ and npm 9+
- Git configured with your name and email
- a modern browser for two-tab multiplayer testing
- a code editor such as VS Code
- access to a Spec Kit-compatible AI coding assistant
- Spec Kit CLI installed and verified
- GitHub access to clone the starter and push your work
- network access to the npm registry
You should be comfortable with TypeScript, React components and hooks, REST APIs, command-line npm and git usage, and reading existing code before changing it.
Starter repository: https://github.com/everest-engineering/scribble-assignment
Clone the starter repository locally and work directly in it. Commit Spec Kit artifacts and implementation changes as you progress, then submit the completed work through the platform.
By the end of this lab you should be able to:
- inspect an existing codebase before writing code
- write a constitution that constrains AI-assisted development
- write a feature specification with acceptance criteria and edge cases
- resolve ambiguity through structured clarification
- produce a technical plan tied to real files and state models
- decompose work into ordered, testable tasks
- implement incrementally and validate each slice against the spec
- critically review AI-generated output before committing it
- produce a clear reflection report
The current branch is scaffold-only.
Implemented today:
- app shell and page routing
- branded landing page and cleaned starter UI
- create room flow
- join room by code flow
- fetch room snapshot flow
- in-memory room storage on the backend
- lobby participant display from the latest fetched snapshot
- game screen placeholders for canvas, guess input, scoreboard, and results
- basic light UI styling
Not implemented yet:
- host behavior or host-only permissions
- automatic lobby polling
- start game flow
- drawer assignment
- secret word visibility rules
- drawing interaction
- clear canvas action
- guess submission and synced history
- scoring
- result state
- restart flow
Backend endpoints currently available:
GET /healthPOST /roomsPOST /rooms/:code/joinGET /rooms/:code
The backend stores all room data in memory only. Restarting the backend clears all rooms.
cd backend
npm install
npm run devThe backend runs on http://localhost:3001.
cd frontend
npm install
npm run devThe frontend runs on http://localhost:5173.
If needed, point the frontend at a different backend with VITE_API_URL.
Use this to confirm the starter works from a clean clone:
- Start the backend and confirm
http://localhost:3001/healthreturns{ "ok": true }. - Start the frontend and open
http://localhost:5173. - Confirm the Start screen shows
Create RoomandJoin Room. - Create a room and confirm you land on the Lobby screen.
- Open another tab, join the same room, and use the Lobby refresh button to load the latest participant list.
- Open the Game screen and confirm the canvas, guess input, scoreboard, and result areas are placeholders only.
- Treat any start-page marketing copy as presentational only; use this README for actual supported scope.
Within each feature group, follow this loop:
- Discovery: read the relevant starter files and document gaps and assumptions.
- Specify: update the spec with acceptance criteria.
- Clarify: resolve ambiguity before planning.
- Plan: update state model changes, file-level changes, and data flow.
- Tasks: decompose the plan into ordered, testable work.
- Implement: complete one meaningful slice at a time and commit it.
- Validate: verify the acceptance criteria with two browser tabs.
- Move forward only after the current scenario passes.
Maintain these artifacts throughout the lab:
- discovery notes with at least 3 incomplete behaviors, at least 2 assumptions, and relevant files
/speckit.constitutioncovering engineering principles, AI usage rules, and review discipline/speckit.specifyfiles updated incrementally by feature group with acceptance criteria/speckit.planupdated incrementally with state model, data flow, and file-level plan/speckit.tasksupdated incrementally with ordered tasks and dependencies
Given a player wants to host or join a drawing game, when they create or join a room via a unique code, then the creator is automatically the host; invalid or empty codes are rejected with clear feedback; rooms are fully isolated; the lobby refreshes via polling at about 2 seconds; and only the host can start the game once at least 2 players are present.
Given a game is starting and player names are trimmed, when the first round begins, then empty or whitespace-only names are rejected with a message; the host or first player becomes the clearly identified drawer; and the secret word is deterministically selected from the starter list and visible only to the drawer.
Given a round is active with a drawer and guessers and all scores start at 0, when the drawer draws or clears the canvas and guessers submit their guesses, then the drawing is visible on the drawer's screen; guesses are trimmed, compared case-insensitively, and empty guesses are rejected; the guess history is synced to all players through polling; and correct guesses score 100 while incorrect guesses add 0.
Given a round has ended, when the result state is displayed and the host restarts, then all players see the correct word, final scores, and full guess history; and on restart everyone returns to the lobby with players preserved and all round state cleared.
Work through the scenarios in order and complete each checkpoint before moving to the next one.
| Group | Scenario | What should exist by the end |
|---|---|---|
| 1. Room setup and lobby | Scenario 1 | Host tracking on room creation, join validation with clear errors, multi-room isolation, automatic lobby polling within about 2 seconds, host-only start with a 2-player minimum |
| 2. Game start and drawer flow | Scenario 2 | Player name validation, drawer assignment, deterministic secret word selection, drawer-only word visibility |
| 3. Gameplay interaction | Scenario 3 | Interactive drawing canvas, clear canvas, guess submission with validation, synced guess history through polling, deterministic scoring |
| 4. Result, restart, and final validation | Scenario 4 | Shared result state visible to all players, clean restart to lobby with players preserved and round state cleared |
Complete a minimum of 4 specify iterations.
- Constitution: workflow rules, coding standards, deterministic game-rule principles, AI usage rules, self-review, and testing expectations
- Specification: room lifecycle and isolation, lobby polling cadence, start-game preconditions, drawer assignment, word selection, drawing and clear behavior, guess validation, guess history sync, scoring, result contents, restart reset, edge cases, and acceptance criteria
- Plan: findings, relevant files and endpoints, frontend and backend state model, data flow, implementation sequence, testing strategy, and risks
- Tasks: discovery, artifact, backend, frontend, game logic, testing, documentation, and review work
These should stay out of the implementation:
- WebSockets or real-time sync
- databases or persistent storage
- authentication, accounts, or sessions
- deployment, hosting, CI, or Docker work
- new state-management or routing libraries beyond what the starter ships
- multiple rounds, drawer rotation, timers, countdowns, speed bonuses, or drawer bonuses
- custom or random word packs
- spectator mode
- moderation features such as kick or mute
- room passwords or invite links
- rewriting the starter from scratch
- unjustified top-level dependencies
- unrelated refactors
These boundaries keep the lab focused and reduce drift between the spec, plan, tasks, and implementation.
Spec Kit keeps specs and source code in independent folders, connected by traceability rather than directory nesting.
| Track | Submit | Why |
|---|---|---|
| Dev | specs/ plus src/ |
Full spec-to-implementation traceability with working code that matches the artifacts |
| Specs-only | specs/, with src/ optional |
Focus on discovery, specification, planning, and task decomposition without local setup or debugging overhead |
Both tracks are assessed on artifact quality. Source code is assessed only for Dev submissions and only for alignment with the submitted specs.
| Area | What good looks like |
|---|---|
| Discovery | At least 3 gaps, at least 2 assumptions, and relevant files documented |
| Spec Kit artifacts | Constitution, spec, plan, and tasks committed and internally consistent |
| Working game flow | Two browsers can join a room, play one round, see synced result, and restart |
| Edge cases and validation | Empty or invalid inputs, case-insensitive guesses, and multi-room isolation handled |
| Implementation alignment | Code behavior matches the spec, and deviations are documented |
| Reflection | Reflection explains decisions, AI usage, and tradeoffs |
| Submission clarity | Submission is easy to review |
Provide a brief .md reflection report. Use these prompts as a starting point:
- What did the starter app already have?
- What did you add?
- How did the Spec Kit artifacts guide implementation?
- Where did AI assistance help, and where did you review or correct it?
- What tradeoffs or risks remain?
Run both builds before handing off changes:
cd backend
npm run buildcd frontend
npm run build- If the frontend cannot reach the backend, verify the backend is running on port
3001. - If the backend port is already in use, run
PORT=<new-port> npm run dev. - If local commands are missing, rerun
npm installin the relevant app directory.