Name Message Date
πŸ“ .claude Initialize SvelteKit project with Deno, TypeScript, ESLint, and Playwright 5 hours ago
πŸ“ .devcontainer Create basic devcontainer 10 hours ago
πŸ“ .vscode Initialize SvelteKit project with Deno, TypeScript, ESLint, and Playwright 5 hours ago
πŸ“ src Add initial UI: curved arc nav and mic toggle button 4 hours ago
πŸ“ static Initialize SvelteKit project with Deno, TypeScript, ESLint, and Playwright 5 hours ago
πŸ“„ .gitignore Initialize SvelteKit project with Deno, TypeScript, ESLint, and Playwright 5 hours ago
πŸ“„ .npmrc Initialize SvelteKit project with Deno, TypeScript, ESLint, and Playwright 5 hours ago
πŸ“„ CLAUDE.md Add initial UI: curved arc nav and mic toggle button 4 hours ago
πŸ“„ deno.json Add initial UI: curved arc nav and mic toggle button 4 hours ago
πŸ“„ deno.lock Initialize SvelteKit project with Deno, TypeScript, ESLint, and Playwright 5 hours ago
πŸ“„ eslint.config.js Initialize SvelteKit project with Deno, TypeScript, ESLint, and Playwright 5 hours ago
πŸ“„ package.json Initialize SvelteKit project with Deno, TypeScript, ESLint, and Playwright 5 hours ago
πŸ“„ playwright.config.ts Initialize SvelteKit project with Deno, TypeScript, ESLint, and Playwright 5 hours ago
πŸ“„ README.md Add project README and expand CLAUDE.md with vision and code style 5 hours ago
πŸ“„ svelte.config.js Initialize SvelteKit project with Deno, TypeScript, ESLint, and Playwright 5 hours ago
πŸ“„ tsconfig.json Initialize SvelteKit project with Deno, TypeScript, ESLint, and Playwright 5 hours ago
πŸ“„ vite.config.ts Initialize SvelteKit project with Deno, TypeScript, ESLint, and Playwright 5 hours ago
📄 CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What this project is

BirdGO is an offline-first SPA that works like PokΓ©monGO but for real birds. The user taps to listen; BirdNET (via TensorFlow.js) classifies bird sounds locally in the browser; identified species go into a local collection. No audio or data is sent to any server. Online accounts and leaderboards are a planned future feature.

Commands

All tasks run via Deno. Use deno task instead of npm run.

deno task dev          # start dev server
deno task build        # production build
deno task preview      # preview production build
deno task check        # svelte-kit sync + svelte-check (type checking)
deno task lint         # ESLint
deno task test         # run all Playwright e2e tests
deno fmt               # format (spaces, double quotes, includes Svelte components)

Run a single e2e test file:

deno run -A npm:playwright test src/routes/path/to/page.svelte.e2e.ts

Code style

  • TypeScript everywhere, full types. No any, no type assertions unless truly unavoidable.
  • Nested CSS inside <style> blocks. Use element and hierarchy selectors (nav a, section > h2) over classes wherever the HTML structure makes the selector unambiguous. Classes only when hierarchy isn't enough.
  • Semantic HTML. Use <main>, <nav>, <section>, <article>, <button>, <dialog>, etc. correctly.
  • Extract components when reusable. If a piece of UI is used in two or more places, make it a component. If it's only used once, keep it inline.
  • Prefer relative units. Use rem for component sizing, vw/vh/dvh for layout and viewport-relative values. Reserve px for borders and shadows only.
  • Simplest possible implementation. No abstractions for hypothetical futures. Three similar lines beat a premature helper.
  • Svelte 5 runes only. $state(), $derived(), $effect(), $props(). The Options API is disabled globally in svelte.config.js.

Architecture

This is a SvelteKit SPA using Svelte 5 with Deno as the runtime and package manager. SvelteKit is used for its component model, routing, and build tooling β€” not for SSR. All data lives in the browser (IndexedDB).

Key layers

  • src/routes/ β€” file-based routing. +page.svelte is the page, +layout.svelte wraps child routes.
  • src/lib/ β€” shared code only. Accessed via the $lib alias. Subdivide as needed: $lib/audio/, $lib/db/, $lib/model/.
  • Audio pipeline β€” Web Audio API β†’ BirdNET (TensorFlow.js TFJS model) β†’ species result. Runs entirely client-side.
  • Persistence β€” localStorage for the bird collection and user state. Sighting data is small (species, timestamp, coordinates) so localStorage is simpler and sufficient. Migrate to IndexedDB only if binary storage (audio blobs, images) is needed.
  • Offline β€” PWA / service worker (not yet implemented).

Config files

  • deno.json β€” Deno tasks and formatter config (fmt-component unstable flag enables Svelte formatting).
  • package.json β€” npm-compatible dependency declarations consumed by Deno's npm compatibility layer.
  • svelte.config.js β€” SvelteKit adapter (adapter-auto) and runes enforcement.
  • playwright.config.ts β€” e2e tests run against a production build (port 4173), not the dev server. Test files use the .e2e.{ts,js} extension, collocated with their routes.
  • tsconfig.json β€” extends .svelte-kit/tsconfig.json; strict mode enabled.

Environment

DENO_DIR is set to /home/developer/.cache/deno in .claude/settings.json (the default /deno-dir/ is not writable). This is applied automatically β€” no manual export needed.