Planning Poker with Tomatoes in 49 Minutes Using Claude Code: Architecture, AI Security Audit, and Bugs Missed by TestsLongread · digest for November 26
Still life of a developer's desk with planning poker cards, a ripe tomato, and a timer set to 49 minutes
Longread6 sections≈ 21 min

Planning Poker with Tomatoes in 49 Minutes Using Claude Code: Architecture, AI Security Audit, and Bugs Missed by Tests

In 49 minutes from the first commit to a live production URL, you really can ship a complete web app for team task estimation. It can have hidden voting, WebSocket rooms, strict protection against IP spoofing, 135 automated tests, and even the option to throw a tomato at a teammate who drops a 13 on a simple ticket. That's how Guesstimato was born: a free, no-signup planning poker app built almost entirely with Claude Code. It only worked because of one strict rule: instead of a lazy "build me planning poker" prompt, development started with a detailed design doc and a list of invariants the agent wasn't allowed to break.

Let's unpack how that workflow ran from the first line of the spec to production, what real security holes the AI found in its own day-old code, and why 135 passing tests still missed three annoying bugs caught by human eyes.

49 Minutes to Production and the 'Spec First, Code Second' Rule

The motivation is familiar. Teams estimate tasks with planning poker every sprint, yet free sites in search results are either covered in ads or look like they were built in 2005 and nobody dared touch them since. The goal was a fast, clean Scrum alternative: everyone picks a card in secret, all votes reveal at once, the app calculates round stats, and you can toss a tomato at the table's biggest pessimist to lighten the mood.

If you feed that idea to an AI agent in a single sentence, it will almost certainly generate a mess of random libraries, forget host disconnects, and mix business logic into React components. This project took a different route. It started with a brainstorm that Claude Code turned into a clear design doc: screens, room lifecycle, host handoff rules on disconnect, card decks, and tight v1 boundaries.

On top of the design doc, the agent drafted a step-by-step plan with a file structure and global constraints. Every subsequent task had to obey these invariants:

  • no accounts, databases, or personally identifiable information (PII): rooms live in memory and expire after 12 hours of inactivity;
  • the server never sends another player's vote value before the room enters the revealed phase;
  • if the host goes offline for more than 60 seconds, host control automatically transfers to the earliest online participant (preferring non-observers);
  • no dangerouslySetInnerHTML, and the system prefers-reduced-motion setting disables screen shake and flying tomatoes.

From there, the build moved strictly in layers: pure domain logic with tests first, then the server, then sockets with integration tests, and finally the UI. Each layer landed as a clean, readable commit. Whenever the spec was silent, the agent didn't guess—it paused and asked for a product decision. The human developer's job was reading diffs, setting boundaries, and approving risky steps like deployment or DNS changes.

WhenWhat Was DoneStage Outcome
Nov 3, 19:22Domain logic: decks, stats, fun round 'titles', validation schemasCore ready with zero network coupling
Nov 3, 19:25Server: room state machine, in-memory store, rate limiterProtection and phase transitions
Nov 3, 19:26Sockets, Fastify, integration testsRealtime connection live
Nov 3, 19:44Web app, Docker, Railway config, E2E testsFull stack in one image
Nov 3, 19:55Small UI fixes (e.g., fixed dropped repeat tomato throws)Interactive feel polished
Nov 3, 20:11Production deploy to RailwayLive URL in exactly 49 minutes
Nov 4, 11:16–12:38Round history, analytics, domain behind Cloudflare, security audit, privacy policy, SEOSide project became a real site
Nov 5Anonymous log stats, surviving redeploys via JSON snapshotsSessions survive updates
Nov 11 & 18Manual bug fixes, guest invite prompt, and feedback formFirst steps toward growth

What's impressive isn't just the first evening's speed, but the next morning. In an hour and a half, the agent knocked out the boring chores most side projects skip: privacy policy, security headers, analytics, and SEO. The human had to do exactly one thing: pay for the domain.

Across 21 commits, the codebase grew into a tidy project with 120 unit and integration tests plus 15 Playwright E2E scenarios running on both desktop and mobile viewports. The share of test code ended up much higher than in a typical weekend project.

Guesstimato Codebase Breakdown by TypeScript Lines

7,200total lines

Tests make up more than a quarter of the repo. In an evening pet project, you rarely get around to that kind of coverage, but here the spec and layered rhythm forced the agent to back every commit with tests.

Server as Source of Truth and Per-Viewer Room Projections

Under the hood, there's nothing exotic in the architecture, and that's its main strength: a simple layout is easier for both humans and AI to reason about. The repo is a pnpm monorepo with three packages:

  • shared — pure domain logic (decks, stats, playful round "titles") and Zod validation schemas;
  • server — backend on Fastify 5 (current branch for Node.js 20+ with Diagnostics Channel support) and Socket.IO for real-time two-way events;
  • web — client on React 19, Vite, Tailwind CSS 4, and Zustand.

Everything ships in one Docker image that serves the HTTP API, handles WebSocket connections, and delivers the built frontend static files. Rooms live in server RAM, and the server is the single source of truth. The browser never dictates room state; it only sends an intent like "I pick 5" or "reveal cards."

This is where one of the strictest rules from the initial plan paid off. In naive planning poker clones, the server broadcasts one shared room object to all sockets, and the client simply hides other players' numbers behind card backs until someone clicks Reveal. That looks fine until the most curious developer on the team opens DevTools, checks the WebSocket tab, and reads everyone's raw JSON votes before the round ends.

In Guesstimato, the server never sends the full room state. Instead, it builds a per-viewer projection: other players' votes are wiped on the backend until the room switches to the revealed phase.

Isometric diagram of a pnpm monorepo separating the server and per-viewer client projections

// Build a per-viewer room projection for a specific participant
export function projectRoom(room: Room, viewerId: string): RoomView {
  const revealed = room.phase === 'revealed';
  return {
    // ...other room fields
    participants: [...room.participants.values()].map((p) => {
      const v = room.votes.get(p.id);
      return {
        id: p.id,
        name: p.name,
        hasVoted: !!v,
        // Other players' votes are sent only after cards are revealed
        vote: v && (revealed || p.id === viewerId) ? v.value : null,
      };
    }),
    result: revealed ? room.result : null,
  };
}

The result is simple and solid: until the reveal command, neither other players' estimates nor the calculated result ever hit the wire. Each player sees hasVoted (whether someone voted or is still thinking) and their own card, while everyone else's vote arrives as null. Because this rule was locked into the upfront plan, the agent didn't break it when adding sockets, round history, or reconnects.

AI vs. Its Own Code: A One-Morning Security Audit

The morning after launch brought the most telling part of the story. The creator asked Claude Code to forget for a moment that it had written the repo and audit it through an attacker's eyes. Usually, you'd be skeptical: you expect the model to praise yesterday's work and offer generic textbook advice. In practice, the agent uncovered four concrete flaws in its own code.

The first issue was seat hijacking. Participant IDs in a room are visible to everyone in the roster. In v1, anyone could supply another user's id on connect and take over their seat, including the host role. The fix needed no accounts or passwords: the browser generates a random secret key, and each seat is now bound to an "ID + secret key" pair. Peeking at someone's id in the roster is now useless.

The second hole was subtler: bypassing rate limits via IP spoofing. The app runs on Railway behind Cloudflare, so the backend's TCP peer address points to the proxy rather than the real user. If you blindly trust the CF-Connecting-IP header (where Cloudflare puts the visitor's IP), there's a classic trap: anyone can hit the internal *.railway.app domain directly, bypass Cloudflare, and forge any CF-Connecting-IP they want. Your rate limiter becomes useless.

The right fix is to trust CF-Connecting-IP in one case only: when the previous hop's real address in x-real-ip actually belongs to official Cloudflare IP ranges, and the header value validates as a proper IP.

// Extract the real IP while guarding against spoofed Cloudflare headers
export function clientIp(
  headers: IncomingHttpHeaders,
  peer: string
): string {
  const real = first(headers['x-real-ip']);
  if (real) {
    const viaCf = first(headers['cf-connecting-ip']);
    // Trust the header only if the request came from a Cloudflare IP
    return isCloudflare(real) && viaCf && isIP(viaCf) ? viaCf : real;
  }
  // Local and tests: last hop of X-Forwarded-For, then TCP peer
}

Now sending a fake header directly around the proxy won't work. The function checks isCloudflare(real), sees an outside address, and falls back to the real real IP for rate limiting.

The third batch of fixes closed common but painful flood vectors: brute-forcing room codes, spamming socket events, and sending oversized megabyte payloads. The agent immediately wrote integration tests for every limit so they wouldn't silently break in a future refactor.

The fourth measure was a strict Content-Security-Policy (CSP) header—the browser rule that defines where a page can load scripts, styles, fonts, and send requests. A live check of guesstimato.com confirms the production server sends a tight policy: scripts are allowed only from its own domain and static.cloudflareinsights.com for analytics, while object-src, base-uri, and frame-ancestors are locked down with 'none'. A Playwright E2E test sits on top and fails immediately if even a single CSP violation appears in the browser console.

None of these four items are rocket science, yet pet projects routinely ignore them until the first incident. Running a dedicated audit pass with the same agent that wrote the code works much better than a generic checklist—it points straight at specific lines in your repo.

SEO for a Client-Side React SPA Without SSR and Leak-Free Previews

With a client-side React app (SPA), you quickly hit a familiar wall: the server returns the same empty index.html for every route, and the browser renders everything. Links in Slack and other messengers look dull and identical, while search crawlers see an empty shell. Pulling in a full SSR framework like Next.js or Remix just for a few meta tags would complicate builds and deployment.

The workaround was surprisingly cheap and simple. Fastify keeps the built index.html in memory and, before serving it, swaps only the <head> contents: title, description, canonical, hreflang links (for English and Russian via ?lang=ru), Open Graph tags, and WebApplication JSON-LD structured data. The rest of the page stays pure client-side React.

Live responses from guesstimato.com show careful handling of edge cases that custom SPAs often miss:

  • the English and Russian homepages return localized titles, canonical URLs, and cross-linked hreflang tags;
  • room pages like /r/brave-otter-999 get <meta name="robots" content="noindex" /> and a generic title You're invited to estimate · Guesstimato, so private task names never leak in messenger link previews;
  • any nonexistent route returns a real HTTP 404 instead of a misleading 200 OK with an empty app shell;
  • the server serves robots.txt (blocking /r/ and /new) and a bilingual sitemap.xml for /, /privacy, and /terms.

That was plenty for search engines: Google indexed both language versions of the homepage within 24 hours. Better yet, building the Open Graph banner uncovered one of the funny visual bugs we'll look at next.

Guesstimato Open Graph banner after fixing the tomato logo (Source: guesstimato.com)

In-memory <head> injection is a great fit for small utilities and tools: you keep the speed and simplicity of plain Vite + React without paying the complexity tax of SSR, while still getting clean link previews and indexing.

Surviving Redeploys Without a Database: JSON Snapshots and setpriv in Docker

In-memory rooms work great right up until your first production deploy. Push a tiny button fix, the container restarts, and every team currently estimating a sprint loses their votes, chat, and round history. Spinning up PostgreSQL or Redis just for that went against the minimalist "no database" rule.

The solution was a simple snapshot mechanism backed by Railway Volumes. Every 5 seconds—and on SIGTERM shutdown—the server serializes all active rooms into a single JSON file, then reads it back on startup. To avoid thrashing the disk when rooms are idle, it compares the new string against the previous saved copy.

Diagram of reliable JSON snapshot persistence to disk without an external database

Writes are done carefully so a sudden crash never leaves a truncated JSON file: data is written to a .tmp file with 0o600 permissions first, then atomically renamed over the main file with renameSync.

// Atomically save all active rooms to JSON on the Railway volume
save(): boolean {
  const rooms = JSON.stringify(
    this.store.all().map((r) => r.toSnapshot())
  );
  // Skip disk write if state has not changed
  if (rooms === this.last) return false;
  const tmp = `${this.path}.tmp`;
  writeFileSync(
    tmp,
    `{"v":1,"savedAt":${Date.now()},"rooms":${rooms}}`,
    { mode: 0o600 }
  );
  // Rename is atomic: a write crash will not leave a corrupted file
  renameSync(tmp, this.path);
  this.last = rooms;
  return true;
}

After a restart, clients drop offline for a moment and reconnect on their own. If the restart happened during a reveal countdown, the round cleanly reveals as soon as the snapshot loads. Votes, the current topic, history, and chat all stay intact.

Persistent volumes on Railway do come with a known infrastructure catch. The platform mounts the volume owned by root, whereas a Node.js process should run as the unprivileged node user. Railway's docs suggest setting RAILWAY_RUN_UID=0, which makes the entire server run as root and defeats basic container isolation.

Guesstimato handles this more cleanly. The container starts as root for a split second just to create the snapshot directory and hand ownership to node via chown. Right after that, Linux's built-in setpriv utility (from util-linux) drops UID and GID, loads supplementary groups with --init-groups, and exec replaces the shell with the Node.js process.

# Change volume ownership as root and immediately drop privileges to node
CMD ["sh", "-c", \
  "if [ -n \"$SNAPSHOT_PATH\" ]; then \
     d=$(dirname \"$SNAPSHOT_PATH\"); \
     mkdir -p \"$d\" && chown node:node \"$d\"; \
   fi; \
   exec setpriv --reuid=node --regid=node --init-groups \
     node server/dist/index.js"]

In the actual Dockerfile, the command sits on a single line, but the idea is clear: the app never listens on the network as root, and it needs no extra tools like gosu or su-exec. There's one honest trade-off from Railway itself: when a volume is attached, redeploys have a brief downtime because Railway stops the old container before starting the new one so two processes don't write to the same volume. For planning poker, that's totally fine—sockets reconnect within a couple of seconds.

Three Live Bugs That 135 Tests Missed, and Honest Growth Math

With 120 unit and integration tests, 15 desktop and mobile Playwright E2E scenarios, and strict CSP checks, what could possibly break? This is where autonomous coding theory meets reality. All three of Guesstimato's most noticeable bugs were found manually just by using the site.

Bug one: a squished tomato. On the generated Open Graph banner og.png, CSS flexbox rules quietly squeezed the tomato icon into a thin stripe. The fix was a single line: flex-shrink: 0. Yet no unit or functional test could look at the finished PNG and say, "Hey, the vegetable looks wrong."

Bug two had a much sneakier root cause: tomatoes couldn't cross the table. In a real four-person session (two sitting at the top, two across), throwing a tomato at a neighbor in your own row worked fine. For a teammate across the table, the throw menu opened, but clicking the throw button did nothing.

Digging under the hood revealed why. To stack all players in one row on mobile while splitting them across two sides of the table on desktop, the "far side" cards were rendered in the DOM twice: one visible copy and one hidden via CSS for mobile layout. When you clicked a player across the table, the throw menu opened in both copies. When you clicked the throw button in the visible menu, the hidden copy caught the mousedown event as an "outside click" and closed the menu before click could fire. Neighbors in your own row weren't affected because their cards only existed once in the DOM.

The funniest part? The existing E2E test for throwing a tomato stayed green the whole time. That test only had two players, both sitting in the same row. First the agent wrote a failing three-player E2E test ("throw across the table"), then rewrote the layout: instead of duplicating DOM nodes, each seat renders once and matchMedia splits the rows.

// Render each seat once: a hidden duplicate would open a second
// throw menu and close the visible one on mousedown
const wide = useMedia('(min-width: 40rem)');
const half = wide ? Math.ceil(players.length / 2) : players.length;
const rows = [players.slice(0, half), players.slice(half)];

This small bug illustrates the golden rule of AI-written tests: the model only tests the scenarios it thought to imagine. It never pictured four colleagues sitting on opposite sides of the table until a human hit it in real life.

Bug three: an infinite loader on a bad room code. Enter a nonexistent code in the right format like brave-otter-999 on the homepage, and the app properly showed "room not found." Type a plain word like hello, and the screen froze on "Connecting…" forever. The server rejected the request as invalid rather than not found, and the client didn't handle that response. The fix was simple: validate the code format on the client upfront so an impossible address goes straight to "room not found" without hitting the server.

Once the app was stable, another question came up: is anyone actually using it? Cookie-free Cloudflare Web Analytics shows page views, but it can't tell whether five engineers ran a full grooming session or one person opened a tab and left. So the server started writing one anonymous log line on room creation and close—just raw counters (people, votes, rounds, chat messages, thrown tomatoes, active minutes) with no names, topics, or IPs. A small script pulls those lines from Railway logs into a report.

To keep the app's own post-deploy E2E tests from faking real usage, Playwright appends a marker to userAgent so the server filters out test rooms.

// Add a marker to userAgent so E2E runs do not skew metrics
const withMarker = <T extends { userAgent: string }>(device: T): T => ({
  ...device,
  userAgent: `${device.userAgent} guesstimato-e2e`,
});

A four-line trick that prevents self-deception in charts. And the numbers from the first two weeks were sobering: there was exactly one real live room—the creator's own team (8 people and 7 rounds). Building a solid app in one evening with an AI agent turned out to be far easier than getting strangers to use it.

So the next iterations shifted focus to growth. Planning poker spreads through facilitators: one team lead brings 5–10 people into a room at once. Guests who sat through a couple of rounds without ever creating their own room started seeing a prompt to start a table for their own team. At first, the card sat inside the game room where it was easy to misclick during voting, so it was moved to the homepage after leaving. Rooms created from that prompt carry a separate flag in the stats, and a feedback form appeared in the footer and room view, logging messages straight to the server logs.

Workflow for a Fast Side Project with an AI Agent

  • Before writing any code, create a design doc with screens, lifecycle, and 3–5 strict invariants (security, data storage, resilience).
  • Build the repo in layers: pure domain logic and schemas → server logic → networking/sockets with integration tests → UI and E2E.
  • After the first release, run a dedicated 'attacker's eye' security audit with tests for every rate limit and CSP.
  • Test the app manually in realistic scenarios (bad inputs, varying player counts, visual checks on OG banners) and turn every bug into a regression test.
  • Keep MVP scope, product trade-offs, and explicit approval before deploys, DNS edits, or paid actions in human hands.

The limits of this approach are just as clear. For a small greenfield project where one person makes every call, "spec + layered build + Claude Code audit" moves absurdly fast and produces more tests and hardening than most side projects ever see. On a massive ten-year-old legacy codebase at work, that trick won't fly: there's no clean spec at the start, and real context is scattered across hundreds of undocumented past decisions. Meanwhile, Guesstimato keeps running in production in English and Russian with no signup required, and Jira integration is next on the roadmap.

Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 13