kolea
CLAUDE.md7 starsChanged 3 months agoMITView on GitHub
Self-hosted email — broadcasts, transactional sends, and drip sequences in one Cloudflare Worker, replacing a paid ESP so the list and engagement data stay owned. Named for the Pacific golden plover: three thousand miles of open ocean, nonstop, and it lands in the same yard every year. Delivery, and the same address, every time. Single operator. Not multi-tenant, no visual builder, no self-run SMTP. See docs/PROJECT.md. Domain: email marketing / transactional email. Cloudflare resources (Worker, D1, queues) are still named…
In this repository12 other files it gives its agents.
- agent-teamsSkill
- bdd-specsSkill
- design-principlesSkill
- githubSkill
- gof-patternsSkill
- onboardSkill
- postgres-dbaSkill
- security-webSkill
- solid-principlesSkill
- sqlite-devSkill
- typescript-best-practicesSkill
- user-storiesSkill
The file
We split this CLAUDE.md into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 63
If an MCP tool needs logic the admin UI already had, pull it down into core/ first.
- Very specific: line 87
No DOM in workerd — and src/client/ needs its own tsconfig, because workerd's Response/Headers shadow the DOM ones and silently resolve the …
- Very specific: line 111
unsubscribedis permanent: No import, sync, or backfill may return somebody to active (SPEC 1.2). - Distinctive: line 117
When in doubt, don't: Ask. An unsent mail costs nothing.
- Distinctive: line 122
DO NOT REPORT SOMETHING IS FIXED IF YOU HAVEN'T COMPILED THE APP
- Distinctive: line 123
DO NOT SEARCH node_modules for answers.
- Distinctive: line 124
Use emoji for markdown documents for readability.
- Very specific: line 125
Never install a package by editing the manifest, always use a package install tool, such as npm install, bun install, etc.
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 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
🐦 Kōlea
Self-hosted email — broadcasts, transactional sends, and drip sequences in one Cloudflare Worker, replacing a paid ESP so the list and engagement data stay owned.
Named for the Pacific golden plover: three thousand miles of open ocean, nonstop, and it lands in the same yard every year. Delivery, and the same address, every time.
Single operator. Not multi-tenant, no visual builder, no self-run SMTP. See docs/PROJECT.md.
Domain: email marketing / transactional email.
Cloudflare resources (Worker, D1, queues) are still named
big-mailer. That is deliberate — they are bound to live production data. Kōlea is the brand,big-maileris the infrastructure. Don't "fix" the mismatch without a cutover plan.
📚 Docs — read before you write
docs/ is the reference set. One doc, one owner. Never write a doc you don't own.
| Doc | What's in it | Read it when | Owner |
docs/ARCHITECTURE.md | ⭐ The agent's reference. Invariants, system shape, code map, data model, lifecycles, MCP surface, platform limits, recipes, traps. | Before changing any code. Start here. | /design |
docs/SPEC.md | Numbered, testable behavioral requirements. The reference for intended behavior. | Before changing behavior. Code disagreeing with SPEC is a bug report, not a licence to edit SPEC. | /design |
docs/INSTALL.md | Local setup, full production deploy, integrations, troubleshooting. | Setup, deploy, or config questions. | /document |
docs/PROJECT.md | The problem, who it's for, what's explicitly out of scope. | Before proposing a feature. | /explore |
docs/PLAN.md | What's built, what's verified, what isn't. | Picking up work. | /plan |
docs/STORIES.md | Backlog. Currently thin — the build went SPEC → code. | /plan runs. | /plan |
README.md | The public front door. | Changing the pitch or the install steps. | /document |
CLAUDE.md | This file. | /init runs. | /init |
src/db/schema.ts is the truth about the data. It carries dense comments explaining
why each column is shaped the way it is. Read it in full before any data change — several
shapes in there look wrong and are load-bearing.
🔁 Phase commands
/explore → /design → /plan → /build-loop → /document
🛠 Stack
- Language: TypeScript
- Runtime: Cloudflare Workers (single Worker:
fetch+scheduled+queuehandlers) - Web: Hono + JSX, server-rendered. Not Next.js.
- Data: Cloudflare D1 (SQLite) via Drizzle — follow the
sqlite-devskill's conventions - Async: Cloudflare Queues (send fan-out) + Cron Triggers (scheduling, sequence ticks)
- Mail: pluggable
EmailProviderport; Resend is the first adapter - Editor: TipTap v3, vanilla — the only browser JS in the project
- Agents: MCP server in the same Worker — 103 tools, 4 resources, 4 prompts
- Auth: Cloudflare Access (no app-level login)
- Package manager: Bun
🧭 Layering
web/ api/ mcp/ ← may import core/, never providers/ or db/ directly
↓
core/ ← the domain. Every rule lives here exactly once
↓
db/ providers/ ← import nothing above themIf an MCP tool needs logic the admin UI already had, pull it down into core/ first.
Two implementations of one rule is how consent gets broken.
▶️ Commands
- Install:
bun install - Dev:
bun run dev(builds the client bundle, thenwrangler devon :8787) - Typecheck:
bun run typecheck— Worker, browser bundle, scripts, and tests, separately - Migrations:
bun run db:generate(drizzle-kit) →bun run db:migrate. Never hand-write one - Tests:
bun test— the server-side suite (tests/specs/, one Feature per user story) - Browser tests:
bun run test:ui— Playwright; starts its ownwrangler devon :8788 with its own D1, so it never touches your local dev data - Smoke test:
bun run smoke— real Chromium against the editor; needsdevrunning - Deploy:
bun run deploy. Always--env production— top-level vars carryDEV_AUTH_BYPASS=true bun run test:all— typecheck, server suite, browser suite. Run it before a PR. Seetests/README.mdfor the suite's shape and what is real vs. faked in it
⚠️ Platform limits that bite
- D1: 1,000 queries per Worker invocation, 10 GB/db, single-threaded writes
- Queues: batches of 100, 5k msg/sec —
max_concurrencypinned to 6, because one batch is one provider request, so batch concurrency is the request rate - Workers logs retain 3–7 days — anything observable must be a row in D1, not a log line
- No DOM in
workerd— andsrc/client/needs its own tsconfig, because workerd'sResponse/Headersshadow the DOM ones and silently resolve the wrong overloads - Wrangler environments do not inherit bindings — every one is repeated under
env.production, or production deploys withenv.DB === undefined
🚨 Real people are on the other end
There are ~13.7k real addresses in production. Every one of them can be spammed by a careless write. These are hard rules, not preferences.
- Never send without an explicit, current instruction to send. Not "it would be useful to test the send path" — an actual request, for that specific mail, right now. A test send goes to Rob's own address and nowhere else.
- Bulk imports never go through
upsertSubscriber(). It firesenrollOnSubscribe(), so importing N people into a livesubscribesequence mails all N of them. Import as direct SQL (seescripts/import-kit.ts), or passtriggerSubscribeSequences: false. - Imported/backfilled content is inert on arrival. Broadcasts land as
status: 'sent'withsent_atset — the minutely tick only claimssendingorscheduled-and-due, so anything else is untouchable. Sequences land asis_active: 0— every enrollment path gates onisActive. Activating is a separate, deliberate act by Rob. EMAIL_PROVIDER=consoleis the kill switch. It renders to the in-app Outbox instead of the wire. Prefer it for anything experimental.unsubscribedis permanent. No import, sync, or backfill may return somebody toactive(SPEC 1.2). Consent only ever moves one way without the person asking.- Consent is scoped, never blanket. Leaving one sequence never touches the newsletter
or any other sequence. Do not trust your priors about how ESPs work — the full model
is in
docs/ARCHITECTURE.md, and assuming the usual shape is the most damaging mistake available here. - When in doubt, don't. Ask. An unsent mail costs nothing; an unwanted one costs a subscriber and a sender reputation that took years to build.
Rules
- DO NOT REPORT SOMETHING IS FIXED IF YOU HAVEN'T COMPILED THE APP
- DO NOT SEARCH node_modules for answers. GO ONLINE.
- Use emoji for markdown documents for readability.
- Never install a package by editing the manifest, always use a package install tool, such as
npm install,bun install, etc.
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.

