llm-driven-system-design / google-sheets
CLAUDE.md60 starsChanged 10 months agoMITView on GitHub
A collaborative spreadsheet application focusing on real-time multi-user editing, similar to Google Sheets.
We split this CLAUDE.md into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Decision: Use @tanstack/react-virtual for row and column virtualization
- Distinctive: line 46
No need for complex middleware
- Distinctive: line 97
Update on resize events
≈ “Common” is an estimate: at least 1 in 5 of the 25,680 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Google Sheets - Development with Claude
Project Context
A collaborative spreadsheet application focusing on real-time multi-user editing, similar to Google Sheets.
Key Design Decisions
Virtualization with TanStack Virtual
Decision: Use @tanstack/react-virtual for row and column virtualization Rationale:
- Modern, well-maintained library
- Supports both horizontal and vertical virtualization
- Efficient for large grids (1000+ rows/columns)
- Framework-agnostic core with React bindings
WebSocket for Real-Time Sync
Decision: Native WebSocket with custom protocol instead of Socket.io Rationale:
- Lower overhead than Socket.io
- More control over message format
- Simpler for this use case (no fallback needed)
- Built-in browser support
Sparse Cell Storage
Decision: Store only non-empty cells in database and state Rationale:
- Massive storage efficiency (most cells are empty)
- Faster queries and state updates
- Natural fit for spreadsheet data model
Last-Write-Wins Conflict Resolution
Decision: Simple per-cell last-write-wins instead of OT/CRDT Rationale:
- Much simpler to implement
- Good enough for learning purposes
- Each cell is independent unit
- Real conflicts are rare in practice
State Management with Zustand
Decision: Zustand instead of Redux or Context Rationale:
- Minimal boilerplate
- Excellent TypeScript support
- Built-in selector optimization
- No need for complex middleware
Implementation Phases
Phase 1: Core Grid (Completed)
- Virtualized grid with TanStack Virtual
- Cell component with editing
- Selection (single cell)
- Keyboard navigation
- Column/row headers
Phase 2: Collaboration (Completed)
- WebSocket server setup
- Connection management
- Cell edit broadcasting
- Cursor position sharing
- User presence indicators
- Collaborator cursor overlays
Phase 3: Data Persistence (Completed)
- PostgreSQL schema
- Cell CRUD operations
- Spreadsheet/sheet management
- REST API
Phase 4: Polish (Planned)
- HyperFormula for formulas
- Column/row resize handles
- Range selection
- Copy/paste
- Undo/redo
- Cell formatting
Technical Challenges
Cell Memoization
React re-renders can be expensive with thousands of cells. Solution:
- Memoized Cell component with custom comparison
- Selector-based state access to minimize re-renders
- Virtualization limits DOM nodes
WebSocket Reconnection
Need to handle disconnects gracefully:
- Heartbeat (ping/pong) every 30 seconds
- Full state sync on reconnect
- Optimistic updates with server confirmation
Cursor Position Calculation
Converting cell coordinates to pixel positions:
- Sum row heights/column widths up to target
- Cache calculations where possible
- Update on resize events
Resources
In this repository94 other files it gives its agents.
- AGENTS.mdAGENTS.md
- 20forms-20designs/CLAUDE.mdCLAUDE.md
- ad-click-aggregator/CLAUDE.mdCLAUDE.md
- ai-code-assistant/CLAUDE.mdCLAUDE.md
- airbnb/CLAUDE.mdCLAUDE.md
- airtag/CLAUDE.mdCLAUDE.md
- amazon/CLAUDE.mdCLAUDE.md
- apns/CLAUDE.mdCLAUDE.md
- apple-maps/CLAUDE.mdCLAUDE.md
- apple-music/CLAUDE.mdCLAUDE.md
- apple-pay/CLAUDE.mdCLAUDE.md
- apple-tv/CLAUDE.mdCLAUDE.md
- app-store/CLAUDE.mdCLAUDE.md
- bitly/CLAUDE.mdCLAUDE.md
- calendly/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- coinbase/CLAUDE.mdCLAUDE.md
- collaborative-editor/CLAUDE.mdCLAUDE.md
- confluence/CLAUDE.mdCLAUDE.md
- dashboarding/CLAUDE.mdCLAUDE.md
- discord/CLAUDE.mdCLAUDE.md
- distributed-cache/CLAUDE.mdCLAUDE.md
- docusign/CLAUDE.mdCLAUDE.md
- doordash/CLAUDE.mdCLAUDE.md
- dropbox/CLAUDE.mdCLAUDE.md
- etsy/CLAUDE.mdCLAUDE.md
- excalidraw/CLAUDE.mdCLAUDE.md
- facetime/CLAUDE.mdCLAUDE.md
- fb-live-comments/CLAUDE.mdCLAUDE.md
- fb-news-feed/CLAUDE.mdCLAUDE.md
- fb-post-search/CLAUDE.mdCLAUDE.md
- figma/CLAUDE.mdCLAUDE.md
- gallery/CLAUDE.mdCLAUDE.md
- github/CLAUDE.mdCLAUDE.md
- gmail/CLAUDE.mdCLAUDE.md
- google-calendar/CLAUDE.mdCLAUDE.md
- google-docs/CLAUDE.mdCLAUDE.md
- google-search/CLAUDE.mdCLAUDE.md
- health-data-pipeline/CLAUDE.mdCLAUDE.md
- hotel-booking/CLAUDE.mdCLAUDE.md
- icloud/CLAUDE.mdCLAUDE.md
- imessage/CLAUDE.mdCLAUDE.md
- instagram/CLAUDE.mdCLAUDE.md
- jira/CLAUDE.mdCLAUDE.md
- job-scheduler/CLAUDE.mdCLAUDE.md
- kindle-highlights/CLAUDE.mdCLAUDE.md
- leetcode/CLAUDE.mdCLAUDE.md
- linkedin/CLAUDE.mdCLAUDE.md
- local-delivery/CLAUDE.mdCLAUDE.md
- loom/CLAUDE.mdCLAUDE.md
- mcplator/CLAUDE.mdCLAUDE.md
- mdreader/CLAUDE.mdCLAUDE.md
- microsoft-teams/CLAUDE.mdCLAUDE.md
- netflix/CLAUDE.mdCLAUDE.md
- news-aggregator/CLAUDE.mdCLAUDE.md
- notification-system/CLAUDE.mdCLAUDE.md
- notion/CLAUDE.mdCLAUDE.md
- online-auction/CLAUDE.mdCLAUDE.md
- payment-system/CLAUDE.mdCLAUDE.md
- paypal/CLAUDE.mdCLAUDE.md
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

