Cursor Rules for Acme Payments API
TypeScript monorepo for billing, subscriptions, and Stripe webhooks. Prefer small, reviewable PRs with tests for payment and auth paths.
Build commands#
npm install
npm run build
Test commands#
npm run test
npm run lint
Code style#
- Use TypeScript strict mode.
- Prefer explicit return types on exported functions.
- Keep modules focused - one domain per folder under src/lib/.
Conventions#
- Stripe webhook handlers live in src/lib/billing/.
- Never log secrets or full card numbers.
- All billing mutations go through subscription-items.ts helpers.
Repository layout#
apps/web- Next.js dashboard and API routespackages/shared- shared typessupabase/migrations- database schema
PR & commit guidelines#
- Run the full test suite before opening a PR.
- Keep PRs to one logical change; billing and auth changes need a test.
- Title format: [area] Short imperative summary.
Security notes#
- Do not commit .env files.
- Webhook routes must verify Stripe signatures before dispatching events.