···11+# CLAUDE.md
22+33+Development guidelines for rookery, an open-source multi-tenant PDS for AI agents on AT Protocol.
44+55+## Project Overview
66+77+rookery is a Cloudflare Worker (Hono + TypeScript) that gives AI agents their own identity and data repository on the atproto network. Agents enroll via the WelcomeMat protocol, then read and write arbitrary lexicon records through standard XRPC endpoints.
88+99+Source layout:
1010+- `src/worker.ts` - Hono app entrypoint
1111+- `src/account-do.ts` - per-agent Account Durable Object (SQLite-backed repo)
1212+- `src/sequencer-do.ts` - firehose sequencing Durable Object
1313+- `src/auth.ts` - DPoP/WelcomeMat authentication
1414+- `src/identity.ts` - DID/handle resolution
1515+- `src/directory.ts` - D1 account directory
1616+- `src/storage.ts` - repo storage layer
1717+- `src/types.ts` - shared types
1818+1919+## Commands
2020+2121+```bash
2222+npm install # Install dependencies
2323+npm test # Run tests (vitest)
2424+wrangler dev # Local development
2525+wrangler deploy # Production deploy
2626+```
2727+2828+## Development Principles
2929+3030+- **Simple code** - Prefer plain functions. Keep modules self-contained.
3131+- **DRY, KISS** - Extract common logic, prefer simple solutions.
3232+- **Fail fast** - Validate inputs and external state early. Clear error messages.
3333+3434+## Verification
3535+3636+- Always run `npm test` before committing — all tests must pass.
3737+3838+## File Headers
3939+4040+All TypeScript source files must include this header:
4141+4242+```
4343+// SPDX-License-Identifier: MIT
4444+// Copyright (c) 2026 sol pbc
4545+```
4646+4747+## Dogfooding
4848+4949+Ship meaningful work as caps. Use `vit ship` after completing a feature, fix, or improvement — not for typos or formatting.
5050+5151+```
5252+vit ship --title "Short Title" --description "One sentence of value." --ref "three-word-slug" --kind feat <<'EOF'
5353+Body paragraph explaining what the cap does and how it works.
5454+EOF
5555+```
5656+5757+Flags:
5858+- `--title`: concise noun phrase (2-5 words)
5959+- `--description`: one sentence explaining the value
6060+- `--ref`: three lowercase hyphenated words — a memorable discovery slug
6161+- `--kind`: one of `feat`, `fix`, `test`, `docs`, `refactor`, `chore`, `perf`, `style`
6262+- `--recap <ref>`: link to a prior cap this one derives from (e.g. after `vit remix`)
6363+- Body (stdin): short paragraph for another developer or agent who might adopt it