···11+# Task lifecycle
22+33+End-of-task skill. Run after the work is done, before claiming completion.
44+55+## Steps
66+77+1. If a plan was generated in this conversation, persist it to `agent-notes/plans/<slug>.md` (Goal, Approach, Alternatives, Files anticipated, Test plan, Acceptance criteria). Slug matches the task note.
88+2. Copy `agent-notes/0000-00-00-00-task-template.md` to `agent-notes/YYYY-MM-DD-NN-<slug>.md`. **Always.** No skip-step.
99+3. Fill all sections from the work just done. Size scales with task; trivial tasks get short notes.
1010+4. Run verification per AGENTS.md, fill `## Verification` with results.
1111+5. Hand back with a one-line summary and a pointer to the note file.
1212+1313+## Rules
1414+1515+- Task notes are records, not scratchpads. Fill at end, not during.
1616+- Plan files in `agent-notes/plans/` are write-only at task end. Do not read them as part of starting a task.
1717+- AGENTS.md is always in context. Do not re-read it.
···11-# sv
22-33-Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
44-55-## Creating a project
66-77-If you're seeing this, you've probably already done this step. Congrats!
88-99-```sh
1010-# create a new project
1111-npx sv create my-app
1212-```
1313-1414-To recreate this project with the same configuration:
11+# Suede
1521616-```sh
1717-# recreate this project
1818-pnpm dlx sv@0.15.2 create --template minimal --types ts --add prettier eslint vitest="usages:unit,component" sveltekit-adapter="adapter:cloudflare+cfTarget:workers" drizzle="database:d1" storybook --install pnpm suede
1919-```
2020-2121-## Developing
2222-2323-Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
2424-2525-```sh
2626-npm run dev
2727-2828-# or start the server and open the app in a new browser tab
2929-npm run dev -- --open
3030-```
3131-3232-## Building
3333-3434-To create a production version of your app:
3535-3636-```sh
3737-npm run build
3838-```
3939-4040-You can preview the production build with `npm run preview`.
4141-4242-> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
33+SvelteKit starter template. Entry point for stack, conventions, and process: `AGENTS.md`.
···11+# <slug>
22+33+## Task
44+<the determined task description — what was asked, what scope, what done-when>
55+66+## Decisions
77+- <choice made> — <why>
88+99+## Actions
1010+- <step taken> — <brief result or pointer>
1111+1212+## Files touched
1313+- `path/to/file.ts` — <what changed>
1414+1515+## Verification
1616+- `pnpm lint` — pass
1717+- `pnpm check` — pass
1818+- `pnpm test` — not run (no test changes)
1919+2020+## Follow-ups / stubs
2121+- <thing deferred, stubbed, or flagged for later>
-233
stack.md
···11-# Default Stack
22-33-_Last updated: May 8, 2026_
44-55-This document defines the default technology stack across all projects. Deviations should be intentional and documented at the project level.
66-77----
88-99-## Frontend
1010-1111-**SvelteKit**
1212-1313-Full-stack framework for all web projects. SvelteKit server routes handle in-app API needs. Vite is the local dev server. Deployed via the Cloudflare adapter.
1414-1515----
1616-1717-## Styling
1818-1919-**stylebase + Bits UI via Suede**
2020-2121-stylebase provides global design tokens, fluid type scale, fluid spacing, layout primitives, and sensible element defaults. It is imported once globally as an npm package.
2222-2323-Bits UI provides headless accessible component primitives (focus traps, ARIA, keyboard navigation). Component-level styles are written in scoped Svelte CSS against stylebase tokens.
2424-2525-Suede is the starter template — a SvelteKit repo with Bits UI wired to stylebase, preconfigured with the full default stack. New projects begin by duplicating Suede. It is not a versioned dependency; each project owns its copy from that point. Storybook is included for developing and reviewing components in isolation.
2626-2727-**Design principles:**
2828-- Screen-native only. No shadows, no skeuomorphism.
2929-- Hierarchy through color, scale, weight, and space.
3030-- Color is semantic, not decorative.
3131-3232-**Authorship model:**
3333-All presentational code — Svelte component markup, scoped CSS, layout, spacing, typography, and Bits UI wiring — is authored by hand. LLM agents do not generate or modify presentation layer code. Agents own TypeScript logic: data fetching, server routes, Drizzle queries, form handling, API integrations, and Workers. Svelte's file structure (separate `<script>`, markup, and `<style>` blocks) enforces this boundary naturally.
3434-3535----
3636-3737-## Backend Runtime
3838-3939-**SvelteKit server routes / Hono**
4040-4141-SvelteKit server routes handle all in-app API needs. Hono is used for standalone Cloudflare Workers or independent API services that live outside a SvelteKit app.
4242-4343----
4444-4545-## Compute & Hosting
4646-4747-**Cloudflare Pages + Cloudflare Workers / Railway**
4848-4949-SvelteKit apps deploy to Cloudflare Pages. Standalone services and Workers deploy to Cloudflare Workers. Railway is used for anything outside the Cloudflare ecosystem — primarily Postgres-backed services and Node-based workloads.
5050-5151----
5252-5353-## Database
5454-5555-**Cloudflare D1 + Drizzle / Postgres on Railway + Drizzle**
5656-5757-Drizzle is the ORM across all database targets. The database is selected based on deployment environment and query needs.
5858-5959-| Scenario | Database |
6060-|---|---|
6161-| Cloudflare-native projects | Cloudflare D1 |
6262-| Full relational database needs | Postgres on Railway |
6363-| Caching and key-value | Cloudflare KV |
6464-| Non-Cloudflare lightweight SQL | Turso |
6565-6666----
6767-6868-## Real-time
6969-7070-**Cloudflare Durable Objects / Web Push API**
7171-7272-Durable Objects handle in-app real-time features — one DO instance per shared resource (e.g. shared quest, collaborative session). Web Push API + Workers handle device push notifications.
7373-7474----
7575-7676-## Social & Identity Layer
7777-7878-**ATProto**
7979-8080-ATProto is the primary social layer across all applicable projects. Private data is handled by whichever database fits the project. ATProto OAuth is used for authentication on ATProto projects.
8181-8282----
8383-8484-## Auth
8585-8686-**ATProto OAuth / Better Auth**
8787-8888-ATProto OAuth for all ATProto projects. Better Auth for everything else — it is edge-native, has native D1 support, and integrates cleanly with SvelteKit.
8989-9090----
9191-9292-## File & Blob Storage
9393-9494-**Cloudflare R2**
9595-9696-S3-compatible API, no egress fees, native Workers integration.
9797-9898----
9999-100100-## CMS & Content
101101-102102-**Payload / Markdown + MDX**
103103-104104-Payload is the standard CMS. It is TypeScript-native, self-hosted, and schema-as-code. Used proactively across projects to build familiarity, not only when a CMS is strictly required.
105105-106106-Markdown and MDX are used for simple static content that does not warrant a CMS.
107107-108108----
109109-110110-## Search
111111-112112-**Postgres FTS / Meilisearch**
113113-114114-Postgres FTS for Postgres projects. Meilisearch for D1 projects that need real search — it is open source, fast, and has a clean hosted option.
115115-116116----
117117-118118-## Payments
119119-120120-**Stripe + Stripe Tax**
121121-122122-Stripe for all payment processing. Stripe Tax for automated sales tax and VAT compliance across regions.
123123-124124----
125125-126126-## Transactional Email
127127-128128-**Resend**
129129-130130-Modern API, excellent developer experience, React Email for templates (server-side only, no React frontend required).
131131-132132----
133133-134134-## Monitoring
135135-136136-**Sentry + Axiom + Cloudflare Analytics**
137137-138138-| Tool | Purpose |
139139-|---|---|
140140-| Sentry | Error tracking |
141141-| Axiom | Log aggregation |
142142-| Cloudflare Analytics | Traffic and CDN-level metrics |
143143-144144----
145145-146146-## Product Analytics
147147-148148-**PostHog**
149149-150150-Event tracking, funnels, session replay, and feature flags. Used for understanding what users actually do — not just pageviews.
151151-152152----
153153-154154-## Web Analytics
155155-156156-**Plausible**
157157-158158-Privacy-friendly, no cookies, GDPR compliant. Covers pageviews, referrers, and Web Vitals. Complements Cloudflare Analytics rather than replacing it.
159159-160160----
161161-162162-## AI & LLM Integration
163163-164164-**OpenRouter**
165165-166166-Unified API gateway across all model providers. Model selection is per use case — better models for quality-critical tasks, cheaper models for volume. No dependency on any single provider.
167167-168168----
169169-170170-## LLM-Assisted Coding
171171-172172-**OpenCode / Claude Code / Zed**
173173-174174-OpenCode is the primary coding agent — open source, model-agnostic, supports 75+ providers via OpenRouter including local models.
175175-176176-Claude Code is the fallback when OpenCode is insufficient.
177177-178178-Zed is the editor. Fast. AI autocomplete is available but not a primary workflow.
179179-180180-**LLM Documentation conventions:**
181181-- `CLAUDE.md` at the repo root for every project: architecture context, conventions, and agent guardrails
182182-- Skills files for reusable procedural knowledge — format standard is cross-agent compatible
183183-- This stack document serves as a shared reference across all projects and agents
184184-185185----
186186-187187-## CI/CD
188188-189189-**GitHub Actions**
190190-191191-Native Cloudflare Wrangler integration, largest ecosystem of actions, free for public repos.
192192-193193----
194194-195195-## Code Hosting
196196-197197-**Tangled / GitHub**
198198-199199-Tangled for public and open source projects. GitHub for private projects, client work, and anything requiring CI/CD pipelines. DNS always managed through Cloudflare regardless of registrar.
200200-201201----
202202-203203-## Package Manager
204204-205205-**pnpm**
206206-207207-Faster than npm, strict dependency resolution, content-addressable store, monorepo support via workspaces.
208208-209209----
210210-211211-## Domain Registrar
212212-213213-**Cloudflare Registrar / Porkbun**
214214-215215-Cloudflare Registrar by default — at-cost pricing, no markup, native DNS management. Porkbun for TLDs not supported by Cloudflare. DNS always managed through Cloudflare regardless of registrar.
216216-217217----
218218-219219-## Testing
220220-221221-**Vitest + Playwright**
222222-223223-Vitest for unit and integration tests — Vite-native, fast, Jest-compatible API. Playwright for end-to-end tests — native SvelteKit integration, runs cleanly in GitHub Actions CI.
224224-225225----
226226-227227-## Mobile
228228-229229-**Web-first + PWA / React Native + Expo**
230230-231231-All projects are web-first. PWA capabilities are the default mobile story.
232232-233233-React Native and Expo are used when a project specifically requires genuine native feel and App Store distribution. Targets both iOS and Android from a single codebase.