Cursor Rules for Next.js Supabase

Recommended Cursor rules for Next.js Supabase and LLMs context generator

These rules for Cursor were kindly shared by the community member "@fractalFinance".

type ProjectConfig = {
persona: {
expertise: ["React", "TypeScript", "Next.js 15", "Shadcn UI", "Tailwind CSS"];
focus: ["Code clarity", "Readability", "Best practices", "Modularity"];
style: "Expert level, factual, solution-focused";
};
stack: {
framework: "Next.js 15 App Router with Turbopack";
database: "Supabase";
ui: ["Shadcn UI", "Tailwind CSS"];
core: [
"TypeScript",
"Prettier",
"ESLint",
"Stripe",
"React Hook Form",
"React Query",
"Zod",
"Lucide React",
"Nodemailer/Resend"
];
};
structure: {
root: {
apps: {
web: {
app: "Next.js routes",
components: "Shared components",
config: "App configuration",
lib: "Shared libraries",
content: "Keystatic Markdoc files",
styles: "Global styles",
supabase: "DB config & migrations"
}
},
packages: {
prefix: "@kit",
core: [
"ui",
"shared",
"supabase",
"i18n",
"billing",
"billing-gateway",
"email-templates",
"mailers",
"monitoring",
"database-webhooks",
"cms",
"next"
],
features: [
"auth",
"accounts",
"team-accounts",
"admin",
"notifications"
],
billing: ["stripe"],
cms: ["keystatic"],
planned: ["plugins", "analytics"]
}
}
};
routing: {
base: "/",
marketing: "(marketing)",
auth: "auth",
join: "join",
admin: "admin",
home: {
user: "home/(user)",
account: "home/[account]"
}
};
conventions: {
imports: {
packages: "@kit/{package-name}",
app: "~/"
},
nonRoutePrefix: "_",
serverCode: {
location: "_lib/server",
requirement: "server-only package import"
}
};
config: {
location: "apps/web/config",
files: [
"app.config.ts",
"auth.config.ts",
"billing.config.ts",
"feature-flags.config.ts",
"paths.config.ts",
"personal-account-sidebar.config.ts",
"team-account-sidebar.config.ts"
]
};
};

Additional context for LLMs

You can generate a set of Markdown files using our little script and the open source Makerkit documentation.

You can then use the Markdown files as a knowledge base for your LLMs, such as Cursor, ChatGPT or Claude.

Clone the repository, then run the following command:

node index.js kits/next-supabase-turbo

To ensure a more precise context, always scope the generation for the kit you are interested in. For example, to generate the markdown files for the Remix Supabase Kit, run the following command:

node index.js kits/remix-supabase-turbo

You can also do it for the courses by running the following command:

node index.js courses

This will generate markdown files in the dist folder.

You can configure how many words per file by passing a second argument to the script, e.g.:

node index.js kits 4000

By default, it will generate 5000 words per file.