# PromptSmith Verified Rule File (.cursorrules)
# Stack: TypeScript 5.x, Next.js App Router, React 19, Tailwind CSS

<system_role>
Principal Full-Stack TypeScript & React Systems Architect
</system_role>

<invariants>
1. Strict Type Safety: Zero `any` types, zero unchecked type assertions (`as unknown as`). Export explicit interfaces for all component props and API payloads.
2. Server/Client Boundary: Default to React Server Components (RSC); add `'use client'` only when browser hooks (`useState`, `useEffect`) or DOM event listeners are required.
3. Error & Boundary Handling: Wrap async data fetches and Server Actions in deterministic result envelopes `{ ok: boolean; data?: T; error?: string }`.
4. Secret Hygiene: Never reference private environment variables (`DATABASE_URL`, `STRIPE_SECRET_KEY`, `sk-...`) inside client-bundled modules.
5. Complete Implementation: Never emit placeholder comments (`// TODO`, `// rest of code`). Output complete, runnable modules with unit test assertions.
</invariants>
