Airsc miễn phí cho tất cả. Nếu nó giúp bạn, hãy ủng hộ $2–$20.

Ủng hộ
Cursor ruleAn toànQuy trình & bộ nhớ agentDễ cho người mới

cursorrules-collection

nedcodes-ok · nedcodes-ok/cursorrules-collection

Bộ sưu tập này cung cấp hơn 110 quy tắc đã được kiểm tra (.mdc và .cursorrules) cho Cursor AI và các tác nhân lập trình khác để cải thiện chất lượng đầu ra.

Hơn 110 tệp .mdc và .cursorrules đã được kiểm thử cho Cursor AI. Xác thực bằng cursor-doctor, tạo bằng rule-gen, chuyển đổi bằng rule-porter.

37 sao5Giấy phép: MITCập nhật 8 tháng trước0 lượt mở

Xem kết quả thực tế

So sánh việc tạo React component khi có và không có các quy tắc tùy chỉnh

Ảnh từ README của tác giảSo sánh việc tạo React component khi có và không có các quy tắc tùy chỉnh

1/3

Ảnh từ README của tác giả nedcodes-ok ·Nguồn

Bạn có thể làm gì với nó

  • Nhanh chóng thêm các hướng dẫn lập trình cụ thể cho TypeScript vào tác nhân Cursor của bạn.
  • Sử dụng cursor-doctor để xác thực thiết lập quy tắc hiện tại của tác nhân và xác định các xung đột.
  • Nhập một quy tắc để thực thi các quy ước đặt tên tệp cụ thể trên toàn bộ dự án.

Kiểm tra an toàn

An toàn

Không thấy dấu hiệu rủi ro trong các file đã quét.

Quét tự động các file trong repo. Luôn xem lại code trước khi chạy.

Trích từ README

cursorrules-collection

110+ tested rules for AI coding tools — Cursor, Claude Code, Copilot, Windsurf, Gemini CLI, and Codex. Every rule contains something you can't get from a generic LLM prompt. Copy to your project and start getting better output.

⚠️ Using Cursor agent mode? Use the .mdc files in rules-mdc/. Both .cursorrules and .mdc are loaded, but .mdc takes precedence on conflicts and gives you frontmatter (alwaysApply, globs). More details.

🔧 Check your setup first

Before adding new rules, see if your current setup has issues:

npx cursor-doctor scan

Catches broken frontmatter, conflicting rules, token budget problems, and missing coverage. Takes about 2 seconds.

→ cursor-doctor on GitHub · → cursor-doctor on npm


Quick Start (manual)

For agent mode (recommended):

# Copy the .mdc file into your project's .cursor/rules/ directory
mkdir -p .cursor/rules
curl -o .cursor/rules/typescript.mdc https://raw.githubusercontent.com/nedcodes-ok/cursorrules-collection/main/rules-mdc/languages/typescript.mdc

For regular Cursor sessions (composer, chat):

curl -o .cursorrules https://raw.githubusercontent.com/nedcodes-ok/cursorrules-collection/main/rules/languages/typescript.cursorrules

Each .mdc file includes:

  • alwaysApply: true (required for agent mode)
  • globs for file-type scoping where applicable (e.g. Python rules only apply to *.py)
  • description for Cursor's context

🔧 Make It Yours

These rules are starting points, not finished configs. The more specific they are to YOUR project, the better they work.

Step 1: Grab the rule for your stack (e.g. react.mdc)

Step 2: Open it and delete anything that doesn't match your patterns. Using Redux instead of Context? Zustand instead of TanStack Query? Edit the rule.

Step 3: Add your project-specific conventions:

## Our Conventions
- All API calls go through src/lib/api.ts
- Use date-fns, not moment
- Component files are PascalCase, utilities are camelCase
- Tests live next to the file they test (Button.test.tsx)

Step 4: Validate with npx cursor-doctor lint to make sure the frontmatter is correct.

The generic version gets you 70% there. The last 30% is what makes the rule actually useful for your codebase.

📝 Articles & Guides

Before / After

Same prompts, different output. Left side is vanilla Cursor, right side is with rules applied.

React component:

Python API endpoint:

TypeScript function:

Rules

Languages

Deep coverage: Python, JavaScript, TypeScript, Go, Rust, Java — version-specific gotchas, tested patterns, real traps. Starter templates: C#, Ruby, PHP, Swift, Kotlin, Elixir, Scala, C++ — solid foundations, customize for your project.

Rule.mdc (agent mode).cursorrules (legacy)
Pythonpython.mdcpython.cursorrules
JavaScriptjavascript.mdcjavascript.cursorrules
TypeScripttypescript.mdctypescript.cursorrules
Gogo.mdcgo.cursorrules
Rustrust.mdcrust.cursorrules
Javajava.mdcjava.cursorrules
C#csharp.mdccsharp.cursorrules
Rubyruby.mdcruby.cursorrules
PHPphp.mdcphp.cursorrules
Swiftswift.mdcswift.cursorrules
Kotlinkotlin.mdckotlin.cursorrules
Elixirelixir.mdcelixir.cursorrules
Scalascala.mdcscala.cursorrules
C++cpp.mdccpp.cursorrules

Frameworks

Deep coverage: React, Next.js, Vue, Angular, Django, FastAPI, Express, Tailwind CSS, shadcn/ui — version-specific, gotcha-heavy, opinionated. Solid coverage: Everything else — good patterns and conventions, ready to customize.

Rule.mdc (agent mode).cursorrules (legacy)
Reactreact.mdcreact.cursorrules
Next.jsnextjs.mdcnextjs.cursorrules
Vuevue.mdcvue.cursorrules
Sveltesvelte.mdc[svelte.cursorrul
Xem mã nguồn trên GitHub