___ please write above 👆, below is auto-generated from
./list-rules-ai.yaml
👇 ___
features and capabilities:
- A Cloudflare-first backend
- Distributed realtime from PostgreSQL to backend workflows to frontends
- AI everything
- Automate everything
- Test everything
tech:
- postgresql (main database)
- zero sync (sync engine between Postgres, Cloudflare Durable Objects, and browsers; docs: https://zero.rocicorp.dev/docs/zero-schema)
- cloudflare workerd (sort of micoservices)
- cloudflare workers_ai (function calling)
- cloudflare ai_gateway (maybe?)
- cloudflare vectorize (embeddings)
- cloudflare r2 (unstructured data storage)
- cloudflare images (resize, optimize, transform images from R2)
- cloudflare queues (async tasks/workflows)
- cloudflare hyperdrive (Postgres connection pool)
- typescript
- effect (All custom code/business logic: error handling, piping/workflows, tracing/logging)
- workerd (cloudflare worker runtime)
code quality guidelines:
- Rely on existing code
- Only write new code when absolutely necessary
- Write testable code
- Reliability and error-free code is paramount
- Efficiency and performance are secondary to reliability
- Write code that is clear for both AI and humans
- Maintain 100% type safety
- Fix type errors until there are none
- Type casting only allowed in justified edge cases
- Stick to package.json dependencies
- Only deviate from dependencies when there's significant benefit
- Ask for clarification before proceeding with unclear tasks
code style rules:
- Naming conventions: variables => snake_case, properties => snake_case, functions => snake_case, files => kebab-case
- Custom types => PascalCase prefixed with "T" (e.g. TImage)
- External dependencies => default casing
- Comments: ai_generated => prefix with (ai)
directory specific rules for ./src/**:
- write 100% Cloudflare Workers compatible code (semi node compatible), no Bun-specific code
directory specific rules for ./scripts/**:
- use Bun exclusively for tests, write 100% Bun code, strictly no Node.js code
shell script rules:
- use "trash" to delete files and directories (never use "rm -rf")
- use "bunx" to run scripts (never use "npx", "pnpx")
- use "bun" or "bun run" to run scripts (never use "node")
core principles:
- Begin with foundational observations
- Keep exploring until a solution emerges naturally from the evidence
- Continue reasoning indefinitely when uncertain
- Question every assumption and inference
- Acknowledge and explore dead ends
- Frequently revise and backtrack as needed