Cursor Rules Library
Drop-in `.mdc` rule packs for Cursor — Python, React, Devin-style engineer mode, and an MDC generator that auto-builds rules from your docs.
What's in this pack
Cursor's Project Rules (.mdc files in .cursor/rules/) are the highest-leverage way to lock in style, architecture, and process expectations for a codebase. The default Cursor setup ships with no rules; teams either write theirs from scratch (slow, drifting) or paste the same boilerplate across every project (no shared maintenance). This pack collects the nine .mdc packs that cover 80% of what most teams actually want, plus an MDC generator that builds custom rules from your existing docs.
| # | Asset | Type | What it covers |
|---|---|---|---|
| 1 | Python rules | language | typing, ruff, pytest, async patterns |
| 2 | React rules | language | hooks, TypeScript, accessibility, file layout |
| 3 | Devin engineer mode | meta | the operating manual: plan-first, surgical edits, no-overreach |
| 4 | MDC generator | tooling | reads your docs/, emits a tailored .mdc |
| 5 | Next.js patterns | framework | App Router, server actions, data fetching |
| 6 | Tailwind / shadcn rules | UI | utility-first conventions, component composition |
| 7 | API design rules | backend | REST/GraphQL conventions, error envelopes |
| 8 | Test discipline rules | quality | golden-file, snapshot, mutation testing |
| 9 | Security review rules | quality | OWASP top-10 patterns to flag in every diff |
Why this matters
The Cursor agent without rules is a generalist. With rules, it's an opinionated teammate that already knows your stack, your idioms, and your guardrails. Three concrete wins teams report after installing this pack:
- Onboarding goes from days to hours. A new engineer's
Cmd-Kproduces code that already looks like the rest of the codebase, because Cursor is reading the same conventions doc the human reads on day one. - Review fatigue drops. Reviewers stop catching the same five style/architecture nits on every PR — the rules catch them at generation time. Reviews focus on logic and trade-offs, where humans add the most value.
- AI overreach is bounded. The Devin engineer-mode rules establish "plan first, edit minimally, don't refactor unrelated code." This single rule prevents the most common Cursor failure: a one-line bug fix that turns into 200 lines of unsolicited "improvements."
Install in one command
# Install the entire pack into the current project
tokrepo install pack/cursor-rules-library
# Or pick a single language/framework
tokrepo install python-cursor-rules
tokrepo install react-cursor-rules
tokrepo install devin-engineer-mode
The TokRepo CLI writes the .mdc files to .cursor/rules/ in your repo. Cursor picks them up on the next prompt — no restart required. To regenerate rules from your existing docs:
tokrepo run mdc-generator --input ./docs --output ./.cursor/rules/project.mdc
Common pitfalls
- One mega-rule that covers everything. Cursor loads matching rules per request based on glob scoping. A single 2000-line
.mdcblows your context budget on every prompt. Split by domain: language rules in one file, architecture in another, security in a third. - No glob scoping. A backend rule that fires on every frontend file wastes tokens and confuses the agent. Use
globs:in the frontmatter to scope rules to**/*.py,app/**/*.tsx, etc. - Forgetting Devin engineer-mode for non-Devin tools. This rule isn't actually Devin-specific — it's a generic "behave like a senior engineer" operating manual. It works just as well in Cursor, Claude Code, Codex CLI, and Cline (use the converter from the Skills Ecosystem pack).
- Treating rules as static. When your stack evolves, the rules need to evolve. Version-control the
.cursor/rules/directory and review changes in PR like any other code. The MDC generator can re-emit rules when your docs change. - Pasting code examples that drift from reality. A rule that says "use
fooBar()for X" and your code usesbar_foo()is worse than no rule. Either keep examples minimal and abstract, or generate them from real code via the MDC generator.
When this pack alone isn't enough
If you use both Cursor and another AI tool (Claude Code, Codex CLI, etc.), authoring .mdc directly locks you into Cursor. The Skills Ecosystem pack lets you author once in the canonical skill format and emit .mdc for Cursor plus AGENTS.md for Codex CLI, subagents for Claude Code, etc. Use this Cursor Rules Library pack if you're Cursor-only; switch to skills if you're multi-tool.
For pure Cursor power-users: pair this pack with the AI Code Editor Showdown comparison to understand where Cursor wins and loses against Zed, Cody, Continue, Morphic, and OpenCode — useful for advocating Cursor internally or deciding when to switch.
9 assets in this pack
Frequently asked questions
Are these .mdc rules free?
Yes — all nine packs are MIT-licensed and live in TokRepo's open registry. The MDC generator is a TokRepo CLI command, also free. The only thing you pay for is your Cursor subscription, which is independent of these rules. No registration needed; tokrepo install works without an account for public assets.
How do these compare to writing rules myself?
If you already have project-specific conventions documented somewhere, the MDC generator can produce a tailored .mdc from your existing docs in one command — usually better than starting from a blank file. For language and framework defaults (Python, React, Next.js), starting from this pack and editing is faster than writing from scratch. The pack rules are battle-tested on real codebases; your tweaks layer on top.
Will this work with Codex CLI or Claude Code?
Cursor .mdc is Cursor-specific by file format. The same content can be ported to AGENTS.md (Codex CLI), CLAUDE.md or subagents (Claude Code), .clinerules (Cline), etc. Two paths: (1) install this pack for Cursor and rewrite for other tools, or (2) use the Skills Ecosystem pack to author in skill format and auto-emit .mdc plus all the others. Path 2 is the right answer for multi-tool teams.
What's the difference vs Skills Ecosystem?
This pack ships ready-to-use Cursor rules — install and they work in Cursor. Skills Ecosystem ships the meta tooling: write a portable skill once and the converter emits Cursor .mdc, Codex AGENTS.md, and 12 other targets. If you're Cursor-only, this pack is faster. If you might add another AI tool later, start with Skills Ecosystem and never have to re-port your conventions.
Operational gotcha: will rules slow Cursor down?
Rules add tokens to every prompt that matches their glob, which adds a few hundred milliseconds and a few cents per session. The fix is glob scoping: don't load a Python rule on TypeScript files. Cursor's rule UI shows which rules fired for a given prompt — use it to spot rules with too-broad globs. A well-scoped 9-rule library typically adds <2% to per-prompt token cost.
12 packs · 80+ hand-picked assets
Browse every curated bundle on the home page
Back to all packs