1.4 KiB
AGENTS.md — Rules for AI Agents Working in This Repo
Core Principles
-
Zod schemas are the contract. Every content file, API payload, and LLM output is validated by Zod. Never write data that hasn't passed schema validation.
-
No direct LLM calls in request handlers. All LLM work runs in the queue consumer. Handlers enqueue and return immediately (202 Accepted).
-
Canonical JSON everywhere. All files under
content/,config/, andsite-context.jsonmust usestringifyCanonical()— sorted keys, 2-space indent, trailing newline. -
No git in the orchestrator. Content persistence is filesystem-only via
writeContentFile. Deployment of images happens outside this codebase. -
Human confirmation before any write. The propose → summary → YES/NO → apply pipeline must be followed for all edit channels (SMS, HTTP, editor).
-
SQLite, not Redis. Idempotency, proposals, rate limits, and audit logs all live in a single SQLite file. No BullMQ, no Redis.
Anti-Patterns
- Do NOT call
fs.writeFileSyncdirectly on content files. Always usewriteContentFile. - Do NOT skip Zod validation before writing.
- Do NOT put LLM calls inside Express route handlers.
- Do NOT add git operations (commit, push, etc.) anywhere in the orchestrator.
- Do NOT use
console.log— use the structuredloggerfromserver/src/logger.ts. - Do NOT expose raw JSON or LLM output in SMS replies — use SMS_TEMPLATES.