# Tasks Work in this order. Finish a task's check before starting the next. 1. **Set up.** One npm package: Vite + React client in `src/client`, the Worker in `src/worker`, shared code in `src/shared`. `wrangler.jsonc` and the scripts from `design.md` ("Cloudflare config"); run `npm run types`. Read `spekkr.inputs.json` into `src/shared/settings.ts` at build time (the Worker imports it too). `GET /api/now` and the clock helper. Check: `npm run dev` serves a page titled `app_name` on port 8787 and `/api/now` answers; `npx wrangler deploy --dry-run --outdir /tmp/dry` bundles (R1). Do not log in to Cloudflare or deploy. 2. **Database.** `migrations/0001_init.sql` from `design.md`; the demo seed as one `batch()`. Check: `wrangler d1 migrations apply DB --local --persist-to /tmp/x` on an empty folder makes all tables, and the first API request with `seed_demo` on creates the demo user, schedule and three event types. 3. **Slot maths (R8).** `src/shared/slots.ts` and every case under "Slot tests". Check: `npm test` passes all 14 cases. 4. **Accounts and layout (R2, R3).** Auth endpoints, sessions, login and sign-up pages, the shell with sidebar and bottom bar, the guard. Check: sign up, sign out, sign in in the browser; the guard sends a signed-out visitor to `/login`. 5. **Event types (R4).** List, create dialog, editor tabs, duplicate, move, hide, delete. Check: the R4 Playwright test. 6. **Availability (R5).** List, editor, day rows, copy times, time zone select, overrides dialog; schedule validation on client and server. Check: the R5 Playwright test (without the booking-page part). 7. **Public pages and booking (R6, R7, R9).** Profile, booker with calendar, times, zone and format switches, URL state, form, the guarded create (the conditional insert in `design.md`). Check: the R6, R7 and both R9 tests, and the last part of the R5 test. Also run the overlapping-request race and the same-start reschedule test with the `computeSlots` pre-check commented out, to prove the SQL guard alone stops overlaps; then put it back. Wrong-minute/outside-hours/past cases still require the pre-check and should not be run with it off. 8. **Booking page, reschedule, cancel, .ics (R10).** Including the "What's next" box, the reschedule note and opening on the booking's own day. Check: the R10 tests. 9. **Bookings list (R11) and settings (R12).** Including host reschedule (`asHost`) from upcoming and unconfirmed rows, and the R2 owner-only vars. Check: the R11 and R12 tests, and the R2 allowlist test. 10. **Guidance copy (R14).** Every row of the R14 table, the meeting-link prompt (R4), the plain-text footer. Check: the R14 tests at desktop and 390 px. 11. **Quality and finish (R13).** Keyboard paths, focus rings, toasts, mobile widths, README. Check: every item under "Definition of done" in `spec.md` is true for R1-R14. Stop here unless the person asked for integrations. Optional, only when asked for (each stays off until configured): 12. **Integration base.** `0002_integrations.sql`, `crypto.ts`, the cron handler with its lease, `/settings/integrations`. Check: `tests/crypto.test.ts`; with nothing configured R1-R14 still pass. 13. **Email and invites (R15, R16).** Sender interface, three senders, templates, `email_log` dedupe, reminders, `buildInvite`. Check: the R15 tests with the test outbox and `tests/ics.test.ts`. 14. **iCal busy times (R17).** Parser, recurrence expansion, polling, `busy_blocks` in `computeSlots` and the guard, `/settings/calendars`. Check: `tests/ical.test.ts` and the R17 e2e test with the fixture feed. 15. **Google Calendar (R18).** OAuth with PKCE, token storage, event writes, free/busy, the walkthrough. Check: the R18 tests against the local fake. ## Testing notes - Playwright's `webServer` runs, joined with `&&`: `rm -rf .e2e`, `npm run build`, `npx wrangler d1 migrations apply DB --local --persist-to .e2e`, then `npx wrangler dev --port 3210 --ip 127.0.0.1 --persist-to .e2e --var NOW:2026-11-15T12:00:00.000Z --var TEST_CLOCK:1 --show-interactive-dev-session=false`, waiting on `/api/now`. Seed on, timezone `America/New_York`, one worker, files in order. `NOW` is a Sunday, 07:00 in New York, so Monday 2026-11-16 is the first day with slots for the demo host. Set `WRANGLER_SEND_METRICS=false`. - The "past" check in R11 opens a new browser context with the cookie `test_now=2026-12-20T12:00:00.000Z`, signs in again there (the old session has expired at that clock) and opens `/bookings/past` on the same server. - The second R9 test fires eight booking requests at once: three for a start `t` of "Intro call", two for `t + 30 min` of "Intro call", three for `t` of "Deep dive" (`t` a Friday or later that both events offer). Every answer is 201 or 409, at most one 201 per start, and if a deep dive won there is exactly one 201. - Match labels and button names exactly (`{ exact: true }`): "Name" is part of "Username", and every day button's name ("Monday, November 16, 2026") is part of that day's time buttons' names.