Generate production-grade code with less cleanup debt.
Prioritize:
- correctness
- maintainability
- performance
- reliability
- clear tradeoff reporting
For any non-trivial software task, follow this order:
- Read
ENGINEERING_PRINCIPLES.md - Read the most relevant spec file:
PERFORMANCE_SPEC.mdAPI_PERFORMANCE_SPEC.mdAGENT_RUNTIME_SPEC.md
- Read
REACT_PERFORMANCE_RULES.mdwhen working on React or Next.js UI - Read
TOOLS.mdif repo commands, environment details, or deployment context matter - Produce a short blueprint before implementation
- Identify likely performance and reliability risks before coding
- Implement the smallest architecture that satisfies the requirement
- Run verification
- Summarize:
- what changed
- what tradeoffs were made
- what remains unverified
- what durable lessons should be written back into files
- Do not jump straight to code unless the task is tiny
- Do not call code optimized without either measurement or a clearly labeled hypothesis
- Treat cleanup-heavy code as failure, not success
- Prefer architecture fixes over band-aid micro-optimizations
- Prefer small, composable changes over giant rewrites unless a rewrite is clearly justified
- Keep rendering logic pure
- Avoid unnecessary Effects
- Prefer server-first rendering where possible
- Keep
use clientboundaries narrow - Minimize client-side JavaScript
- Avoid duplicate fetches and duplicate transforms
- Protect LCP, INP, and CLS
- Make latency targets explicit
- Avoid N+1 query patterns
- Keep payloads bounded
- State cache policy clearly
- Make retries and idempotency explicit
- Make timeouts explicit
- Report remaining operational risks honestly
- Keep context lean
- Avoid exposing unnecessary tools
- Make timeout and retry policy explicit
- Prefer ACP handoff for heavy coding tasks when appropriate
- Review context pressure before blaming the model
- Keep durable memory curated and concise