Teach your agent system design first: 7 rules and a 12-step prompt
damnGruz · x · 2026-11-04
The thread argues the bottleneck now is system design, not code: agents write functions in seconds but can't decide what the system should be, trapping you in a prompt→code→bug→prompt loop.
Principle 1: Design before code — list components, interfaces, and owned data on paper; write code once, last.
Seven rules (each a question the agent won't ask itself):
- Design before code
- Find the bottleneck: what breaks at 10x load, then scale up vs out
- Pick your CAP trade-off: consistent or available when the network splits
- Cache on purpose: every cache needs invalidation and eviction rules
- Queue the slow stuff: async producers/consumers
- Guard the edges: rate limits and circuit breakers
- Make retries safe: idempotency keys on every send/write
Principle 2: Multiple bots are a distributed system — bots are services, routines are queue consumers, memory is a stale-able cache, external APIs sit behind circuit breakers, sends pass a rate limiter and approval gate with idempotency keys. No new tools needed — just answer: where work waits, what limits it, what happens on failure, what must never run twice.
More from coding & agent
- SurrealDB 4 launches with SurrealDB Earth: serverless agent database on Cloudflare — ritakozlov · 2026-11-04
- Karpathy's "vibe coding" post hailed as a shoo-in for the test-of-time award — MillionInt · 2026-11-04
- OpenAI SDK ships official WebSocket helpers for Responses, GPT-Live and Realtime APIs — craigsdennis · 2026-11-04
- Pydantic AI adds ConversationStore to prevent concurrent chat saves from overwriting each other — samuelcolvin · 2026-11-04
- Gemini API CLI skill lets agents call image, TTS and video models with one command — _philschmid · 2026-11-04
- Anthropic silently pushed a server-side rule to Claude Code banning recreations of specific games — alex_verem · 2026-11-04