Repository navigation
complete Scribble lab - all 4 scenarios implemented with Spec Kit artifacts - #35
Open
kshitijRastogi-ctrl-new wants to merge 15 commits into
Open
kshitijRastogi-ctrl-new wants to merge 15 commits into
kshitijRastogi-ctrl-new wants to merge 15 commits into
Conversation
… API base URL
- backend/src/api/router.ts: errorHandler returns { error } instead of
{ message } in both the ZodError branch and the general error branch
(T004, addresses analysis finding C1)
- frontend/src/services/api.ts: remove /bug suffix from fallback
API_BASE_URL; update error parsing to read error field instead of
message to match updated backend shape (T014 partial, addresses C2)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
T001 - backend/src/models/game.ts:
- RoomStatus: "lobby" | "playing"
- Participant: add isHost: boolean, score: number
- Room: add host: string
- RoomSnapshot: add host: string
T002 - backend/src/api/schemas.ts:
- createRoomSchema + joinRoomSchema: playerName required,
trim + min(1) — rejects empty/whitespace names (FR-003)
- roomCodeParamsSchema: code required, trim + min(1) (FR-004)
T003 - backend/src/api/schemas.ts:
- Add startGameSchema: playerName required trim + min(1) (FR-011)
TypeScript errors in roomStore.ts are expected and will be resolved
by T005-T007 in the next commit.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… (T005-T008)
T005 - roomStore.ts: remove displayName() fallback; update createParticipant
to require name: string and isHost: boolean; add score: 0 (FR-001)
T006 - roomStore.ts: update createRoom to set room.host = playerName and
call createParticipant(playerName, true) for the creator (FR-001)
T007 - roomStore.ts: add host: room.host to toRoomSnapshot return so
GET /rooms/:code exposes the host field (FR-002)
T008 - rooms.ts: switch POST /rooms to safeParse so Zod field-level
message ("Name cannot be empty") is returned instead of the generic
errorHandler message (FR-003)
One expected TS error remains in joinRoom (createParticipant missing
isHost arg) — resolved by T009.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
T009 - roomStore.ts: update joinRoom to require name: string (not optional), return "emptyCode" discriminant for empty code, return "duplicateName" if name already taken, call createParticipant with isHost: false — resolves final TS error from T005 (FR-004, FR-014) T010 - rooms.ts: switch POST /rooms/:code/join to safeParse; map joinRoom discriminants to 400/409/404 with spec-exact error messages "Room code cannot be empty", "Name already taken in this room", "Room not found" (FR-004, FR-013, FR-014) T011 - rooms.ts: fix GET /rooms/:code error from "Unable to load room" to "Room not found" (FR-004) Backend now compiles with zero TypeScript errors. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…name/code validation, Zod schemas, error key alignment, API URL fix, start game endpoint, lobby polling 2s, status navigation to /game/:code, host label, host-only start button, client-side form validation, localStorage session writes. All 6 SC pass.
001 room setup lobby
…e start and drawer flow Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…gnment on start, deterministic word selection, secret word visible to drawer only, role-based API filtering, GamePage drawer and guesser views, mount fetch, 2s polling, result navigation, ResultPage placeholder. All 5 SCs validated.
002 game start drawer
…ring, history sync
…lidation complete
feat(s4): complete Scenario 4 - result screen, restart flow, final va…
Two Playwright tests in e2e/regression/lobby (the start page, and creating a room through to its lobby) and one that fails on purpose (e2e/regression/demo-failing.spec.ts) to show a failure in Factory's Tests page. Delete the demo once it has been seen.
getByText('Room Code') also matched the sentence that tells players to
share the room code, so Playwright refused the ambiguous locator.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Overview
Complete implementation of the Scribble drawing and guessing game
across all 4 scenarios, following the Spec Kit workflow
(constitution → specify → clarify → plan → tasks → implement → validate).
What was built
Scenario 1 — Room Setup & Lobby
Scenario 2 — Game Start & Drawer Flow
Scenario 3 — Gameplay Interaction
Scenario 4 — Result, Restart & Final Validation
Spec Kit Artifacts
specs/constitution.md— 5 core principlesspecs/001-room-setup-lobby/— spec, clarify, plan, tasksspecs/002-game-start-drawer/— spec, clarify, plan, tasksspecs/003-gameplay-interaction/— spec, clarify, plan, tasksspecs/004-result-restart/— spec, clarify, plan, tasksTech decisions
Contributor