Instruction file imported from md-ahr/next-commerce (
.cursor/rules/project-core.mdc). Copyright stays with the author.
Next Commerce — Core
Frontend-only ecommerce storefront. Third-party REST APIs. Feature-based architecture.
Stack
Next.js 16 · shadcn/ui · Tailwind v4 · TanStack Query · Zustand · Zod · Pino · Sentry · Vitest
Hard Rules
- shadcn primitives —
pnpm dlx shadcn@latest add <name>forcomponents/ui/ - Shadcn Space blocks/pages — MCP
user-shadcnspace-mcpthenpnpm dlx shadcn@latest add @shadcn-space/<name>— never hand-roll sections - Feature folders — business logic in
features/<name>/, thin routes inapp/ - Validate — run
pnpm validatebefore marking work complete - Tests — unit tests for all business logic in
features/*/ - Static images — Unsplash via
@/lib/images; product images from DummyJSON - Color — 60-30-10 (
background/card/primary) perdocs/04-design-system.md - Section gaps —
page-shell+page-stack+section-stackon every page - Responsive —
sm576 /md768 /lg1024 /xl1200 only - Logging — Pino via
@/lib/logger;console.*is forbidden - Sentry —
captureExceptionfrom@/lib/sentryfor unexpected errors (no-op until DSN)
Docs
| Topic | Path |
|---|---|
| Requirements | docs/01-requirements.md |
| Features | docs/02-feature-analysis.md |
| Architecture | docs/03-architecture.md |
| Design | docs/04-design-system.md |
| Workflow | docs/05-development-workflow.md |
| Sentry | docs/08-sentry.md |
Patterns
Copy from features/_reference/ — do not invent new patterns.