Awesome Cursor Rules — AI Coding Standards for 30+ Stacks
Curated .cursorrules files for 30+ tech stacks. Drop into your project root so Cursor AI follows your coding standards automatically.
Ready-to-run agent install
This asset can be installed after the agent chooses its runtime, checks the plan, and runs the matching command.
npx -y tokrepo@latest install ca000374-f5d8-4d75-a30c-460fda0b6b0e --target codexRun after dry-run confirms the install plan.
What it is
Awesome Cursor Rules is a curated library of Cursor Project Rules you can reuse as a starting point for real projects — especially when you want your AI editor to consistently follow the same conventions without repeating instructions in every chat.
Upstream, the repository describes Cursor Project Rules as Markdown-based .mdc files that live under .cursor/rules/. TokRepo editorial note: the workflow you’re viewing may mention older “.cursorrules” conventions, but the upstream repo itself is organized around .mdc rule files — treat the upstream README as the source of truth for current layout and naming.
Think of this library as a menu. You don’t “install the repo”; you borrow a ruleset, paste it into your project, and then tune it until it reflects how your codebase actually works.
Repository signal (verified): 39,509 GitHub stars, license CC0-1.0, last updated 2026-05-14T00:09:14Z (fetched 2026-05-14T00:38:29.999279+00:00).
How it saves time or tokens
Rules aren’t “magic prompts.” They’re a consistency layer that turns repeated corrections into a one-time edit:
- They reduce back-and-forth by telling the model what your project expects (structure, naming, testing, error-handling).
- They prevent “policy drift” when multiple people (or multiple agent runs) touch the same codebase.
- They make review faster because generated code is closer to your norms on the first pass.
The highest-ROI use case is team work: once a rule file matches your repo, you stop spending tokens re-explaining the basics (“use App Router”, “prefer Zod”, “don’t touch auth helpers”, “tests must be deterministic”).
TokRepo editorial heuristic: rules pay for themselves when you can answer “yes” to at least one of these:
- You work in a repo with established conventions that matter in review.
- Multiple people (or multiple agents) contribute to the same codebase.
- Mistakes are costly (auth, payments, data migrations, security).
- You’ve noticed the AI repeatedly making the same class of error.
How to use
- Pick a rule that matches your stack. Start with the closest
.mdcfile in the upstreamrules/directory; don’t optimize too early. - Install it in your repo. Follow the upstream convention (Cursor Project Rules in
.cursor/rules/). If your toolchain still expects a different filename, adapt intentionally and document the choice in your repo. - Make it yours (this is the real work). Replace generic statements with your realities:
- framework versions and router style,
- directory conventions and module boundaries,
- “allowed” vs “banned” dependencies,
- error-handling and logging expectations,
- test commands and what a passing run looks like.
- Add one explicit “proof step.” A good rule file doesn’t just say what to do; it says how to verify it:
- “run
pnpm testbefore finishing,” - “no changes without updating snapshots,”
- “typecheck must pass.”
- Validate on one real task. Use a small change request (fix a failing test, add one endpoint, refactor one file) and check if the agent behavior matches the rule.
- Version it. Keep rule files in git and review them like code. A rules change can be a behavior change.
A practical “rules tuning” checklist
When you paste in a ruleset, do these edits before you call it “done”:
- Replace placeholders with your actual commands (
pnpmvsnpm,uvvspip,go test ./..., etc.). - Specify code style where it matters (file naming, component patterns, imports).
- Add a section for security constraints relevant to your app (secrets handling, auth boundaries).
- Add a section for what not to change (public API, migrations, config files).
- Add a short “if unsure, ask” rule (better a question than a confident wrong change).
How .mdc rules are typically scoped (why it matters)
Many Cursor Project Rules use a small YAML frontmatter block to control where a rule applies. You’ll commonly see fields like:
description: a human-readable summary of what the rule set is trying to enforce.globs: which files the rule applies to (for example*/).alwaysApply: whether the rule should always be active or only in specific contexts.
TokRepo editorial take: scoping is the difference between “helpful guardrails” and “noise.” If you apply a very strict framework rule to every file, the agent can become rigid and less helpful for unrelated tasks (scripts, docs, ops).
A practical pattern that works well:
- One small, always-on baseline rule for safety and repo conventions (no secrets, run tests, don’t refactor).
- Stack-specific rules (Next.js, Django, Go services) scoped to the folders where they apply.
- Task-specific rules for high-risk operations (migrations, auth, payments) that only apply when you’re working in those areas.
This layering keeps agent behavior predictable without turning every interaction into a compliance exercise.
What to include in a high-signal ruleset
If you’re editing a ruleset from this library, prioritize information the agent can use operationally:
- Project boundaries: “don’t import from X layer into Y layer”, “UI cannot call database directly”.
- Verification loop: the one command that proves correctness (tests/build/typecheck).
- Security invariants: “never log tokens”, “don’t change auth flows without tests”.
- Output expectations: “prefer small diffs”, “keep changes reviewable”, “avoid unrelated refactors”.
Avoid dumping huge style guides into rules. If a rule is too long to maintain, it won’t survive.
Making rules play nicely with other “instruction layers”
Most teams have more than one place where conventions live: linters, formatter configs, framework docs, README notes, and sometimes other agent instructions. A good Cursor ruleset should not fight those sources.
TokRepo editorial approach:
- If a linter/formatter exists, treat it as the authority (the rules should tell the agent to obey it, not redefine it).
- If the repo has a CONTRIBUTING.md or architecture doc, link to it and summarize only the parts the agent needs to follow consistently.
- If you have other agent tooling (terminal agents, CI bots), align on the same “proof step” so agents don’t produce “it works on my machine” patches.
Example
This repo contains many rules; the excerpt below (from a Next.js + Supabase rules file) shows what “high-signal” constraints look like: a clear DO/DON’T plus the reason.
RULE 1: NEVER use getSession() on the server
SECURITY CRITICAL. getSession() reads the JWT from cookies WITHOUT verifying it.
ALWAYS use getUser() for server-side auth.
TokRepo editorial take: even if you don’t use Supabase, the style is transferable — “explicit DO/DON’T + why” beats vague guidance every time. The goal is not to micromanage the model; it’s to remove entire categories of mistakes.
Related on TokRepo
- Agent Skills Standard — package repeatable agent behaviors as shareable skills.
- OpenAI Codex CLI — a terminal-first agent where tight constraints and verification matter.
- AI tools for coding — explore more coding workflows and standards.
TokRepo editorial rollout suggestion: treat rules like you’d treat a lint rule. Start with one repo, validate that rules reduce review time, then reuse the same baseline ruleset across other repos. If a rule causes friction, tighten its scope rather than deleting it outright.
Common pitfalls
- Treating rules as “set and forget.” Your repo changes; your rules should evolve too.
- Overfitting to a toy example. Validate rules with a real bugfix or feature, not a demo prompt.
- Mixing incompatible rule sources. If you combine multiple rulesets, resolve conflicts explicitly.
- Writing rules that can’t be checked. Prefer concrete, testable constraints over abstractions.
- Skipping review. A rules change is a behavior change — review it like code.
- Trying to encode everything. Keep the rules focused on high-cost mistakes and high-frequency conventions; let normal code review handle the rest.
Frequently Asked Questions
Cursor Project Rules are project-scoped instruction files (commonly organized under `.cursor/rules/`) that tell the Cursor AI editor how to behave for a specific repository: conventions, constraints, and workflow expectations.
Not always. The TokRepo workflow may mention legacy `.cursorrules` conventions, but the upstream Awesome Cursor Rules repo documents a modern `.mdc` Project Rules format. Follow the upstream README and Cursor’s current docs for the canonical structure.
Start with the closest match to your stack (framework + language + tooling). Then edit it to reflect your repo’s actual constraints (versions, folder layout, test commands, security rules).
Commit the rules to git, review changes like code, and validate on one real task before making the rules your default in new repos.
No, but they can make outputs more consistent and more aligned with your repo conventions, which reduces review time and repeated corrections.
Citations (3)
- PatrickJS/awesome-cursorrules (GitHub README)— Awesome Cursor Rules is a curated repository of Cursor Project Rules organized a…
- Rule file: Next.js 15 + Supabase Architecture Rules (raw)— Example rules snippet shown is from a published `.mdc` rule file in the reposito…
- GitHub REST API: PatrickJS/awesome-cursorrules— Repository metadata used here (stars=39509, license=CC0-1.0, updated_at=2026-05-…
Related on TokRepo
Source & Thanks
Created by PatrickJS. Licensed under CC0 (Public Domain). awesome-cursorrules — ⭐ 38,700+
Thanks to PatrickJS and 200+ contributors for building the largest open-source .cursorrules collection. Star the original repo to get updates as new rules are added weekly.
Discussion
Related Assets
Cursor Rules Generator — AI Coding Config Builder
Generate optimized .cursorrules files for any tech stack. Automate Cursor IDE configuration with project-specific AI coding instructions and best practices.
Awesome Cursor Rules MDC — Auto-Generated .mdc Files
Collection of auto-generated Cursor .mdc rule files for 800+ libraries using Exa search and LLM. Drop into .cursor/rules/ for AI-aware coding standards. CC0, 3,400+ stars.
Awesome Cursor Rules (ZH) — .cursorrules Library
Awesome Cursor Rules (ZH) is a bilingual .cursorrules library that helps Cursor users enforce architecture, security, and style constraints across a repo.
Awesome DESIGN.md — UI Specs for Coding Agents
Awesome DESIGN.md is a curated set of design-system docs; copy one into your repo so coding agents generate UI that matches a real style.