Skip to content

Add Next.js AI SaaS stack cursor rules (.mdc Edition)#323

Open
irsyad-aulia wants to merge 2 commits into
PatrickJS:mainfrom
irsyad-aulia:main
Open

Add Next.js AI SaaS stack cursor rules (.mdc Edition)#323
irsyad-aulia wants to merge 2 commits into
PatrickJS:mainfrom
irsyad-aulia:main

Conversation

@irsyad-aulia

@irsyad-aulia irsyad-aulia commented Jun 26, 2026

Copy link
Copy Markdown

What this adds

A new cursor rules file for Next.js AI SaaS stack covering:

  • Next.js 15 App Router conventions
  • TypeScript strict mode patterns
  • Supabase, Clerk, Stripe, Vercel AI SDK integration
  • shadcn/ui + Tailwind CSS patterns

Notes

  • Compatible with Agent Mode (uses .mdc format in full pack)
  • Full .mdc version available at the linked GitHub repo
  • One-time submission, no spam

Summary by CodeRabbit

  • Documentation
    • Added a new project configuration guide defining the recommended Next.js (App Router) + TypeScript strict-mode stack and baseline tooling for an AI SaaS setup.
    • Documented implementation standards for server-first React, when to use client components, validation-first data handling, and explicit error management.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2da87fa8-c777-4fe8-9b1f-b9b6c8a4e966

📥 Commits

Reviewing files that changed from the base of the PR and between 03cd7fc and 36b97c3.

📒 Files selected for processing (1)
  • rules/rules/nextjs-ai-saas/.cursorrules
✅ Files skipped from review due to trivial changes (1)
  • rules/rules/nextjs-ai-saas/.cursorrules

📝 Walkthrough

Walkthrough

Adds a new .cursorrules file for the Next.js AI SaaS stack, documenting the expected technology baseline and implementation rules for App Router, server components, Zod validation, any usage, and error handling.

Changes

Next.js AI SaaS rules

Layer / File(s) Summary
Stack rules file
rules/rules/nextjs-ai-saas/.cursorrules
Defines the Next.js 15, TypeScript strict mode, Supabase, Clerk, Stripe, Vercel AI SDK, shadcn/ui, Tailwind, Resend, and Vercel baseline, plus absolute implementation rules.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested reviewers

  • PatrickJS

Poem

🐰 I found a ruleset neat and new,
With App Router paths and Zod in view.
No any hops across the lawn,
Server-first from dusk till dawn.
Bink! The stack now knows what to do.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is missing most required template sections, including Contribution Type, Value To Cursor Users, Added or Changed Files, and Quality Checklist. Rewrite the PR description to match the template and fill in all required sections, especially Contribution Type, Value To Cursor Users, Added or Changed Files, and Quality Checklist.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is specific and matches the main change, though it incorrectly says .mdc while the added file is .cursorrules.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
rules/rules/nextjs-ai-saas/.cursorrules (1)

23-23: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Clarify what "handle errors explicitly" entails.

This rule is vague for an absolute directive. "Explicitly" could mean try/catch blocks, error boundaries, logging, user-facing messages, or all of the above. Without specificity, AI agents may apply inconsistent patterns. Consider enumerating the expected error handling layers (e.g., Zod validation errors → 400 responses; unexpected errors → 500 with structured logging; client boundaries for render errors).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rules/rules/nextjs-ai-saas/.cursorrules` at line 23, Clarify the “ALWAYS
handle errors explicitly” rule in the .cursorrules entry by replacing the vague
directive with specific error-handling expectations. Update the rule text near
the existing error-handling guidance to enumerate the intended patterns, such as
validation failures returning 400 responses, unexpected server errors returning
500 responses with structured logging, and client-side render failures being
caught by error boundaries. Keep the wording actionable so agents can apply
consistent behavior across the repo.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@rules/rules/nextjs-ai-saas/.cursorrules`:
- Line 23: Clarify the “ALWAYS handle errors explicitly” rule in the
.cursorrules entry by replacing the vague directive with specific error-handling
expectations. Update the rule text near the existing error-handling guidance to
enumerate the intended patterns, such as validation failures returning 400
responses, unexpected server errors returning 500 responses with structured
logging, and client-side render failures being caught by error boundaries. Keep
the wording actionable so agents can apply consistent behavior across the repo.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7cc35221-8868-4d10-9cff-5b3758ddc06e

📥 Commits

Reviewing files that changed from the base of the PR and between b044f95 and 03cd7fc.

📒 Files selected for processing (1)
  • rules/rules/nextjs-ai-saas/.cursorrules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant