docs/development.md states the rules the code now enforces or keeps: server-only modules and the import-graph test (which now also forbids the daily pick and the region locator from client bundles), route decides best-effort and the library never swallows, typed failure kinds mapped to statuses, claim before write, one module per storage concern through the guarded store, useEffectEvent for imperative callbacks, unprefixed logical keys, three fixed region levels, and the response contract. The parameter rule now says what it always meant: React components destructure props. @radix-ui/react-tabs had no component using it. Stale lines about tabs, pagination, a leaderboard migration and a sub-second suite are corrected.
3.2 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Documentation
For detailed information about this project, refer to the documentation files in /docs/:
- Project Overview - Project summary, key characteristics, and game mechanics
- Features - Detailed game features, scoring system, and security measures
- Tech Stack - Complete technology stack and dependencies
- Development Guidelines - Development commands, coding standards, and best practices
- Game Flow - Complete gameplay flow from start to finish
- Project Structure - Directory organization and file purposes
Quick Reference
Development Commands:
npm run dev- Start development server with Turbopacknpm run build- Build the application for productionnpm start- Start production servernpm run lint- Run ESLintnpm test- Run tests against the in-memory Redis fake (no service needed)npm run test:integration- Same tests against local Redis (npm run redis:upfirst)
Key Guidelines:
- JavaScript Only: No TypeScript files (.ts, .tsx)
- Function Parameters: Use individual parameters, not object destructuring, in library functions, scripts and route helpers. React components take a single props object and destructure it, as every component here does
- File Modifications: Only modify source code,
/docs, and/plans - Generated Data:
src/data/is build output; the panorama index lives in Neon Postgres, seeded from gitignoreddata-build/panos/artifacts. Change the scripts inscripts/, never the generated files - Client Safety:
src/lib/pano-index.jsandsrc/lib/pano-db.jsare server-only. Client components usesrc/lib/regions.js - Security: Never expose secrets or keys
- Testing: Run
npm testfor changes undersrc/lib/orsrc/data/; inform user when complete - they handle manual testing of the UI
Critical Instructions
When working on this codebase, always:
- Read the relevant documentation files in
/docs/for context - Follow the JavaScript-only approach with individual function parameters
- Maintain server-side security for game sessions, coordinates, and the district a panorama resolved to
- Use existing patterns and libraries already present in the codebase
- Highlight any configuration file changes for manual processing
This is NOT the Next.js you know
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in node_modules/next/dist/docs/ (resolved from this file's directory; in monorepos the next package may not be visible from the repo root) before writing any code. Heed deprecation notices.
This block is written and re-added by next dev — verify at node_modules/next/dist/server/lib/generate-agent-files.js. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.