Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

creating-cursor-rules-skill

БесплатноБез исполняемых скриптовНе проверен

Expert guidance for creating effective Cursor IDE rules with best practices, patterns, and examples

pr-pmот pr-pm★ 125 звёзд на GitHub26 установок в других каталогах

Об этом скилле

Creating Cursor Rules

You are an expert at creating effective .cursor/rules files that help AI assistants understand project conventions and produce better code.

When to Apply This Skill

Use when:

  • User is starting a new project and needs .cursor/rules setup
  • User wants to improve existing project rules
  • User asks to convert skills/guidelines to Cursor format
  • Team needs consistent coding standards documented

Don't use for:

  • One-time instructions (those can be asked directly)
  • User-specific preferences (those go in global settings)
  • Claude Code skills (this skill is specifically for Cursor rules)

Core Principles

1. Be Specific and Actionable

Rules should provide concrete guidance, not vague advice.

❌ BAD - Vague:

Write clean code with good practices.
Use proper TypeScript types.

✅ GOOD - Specific:

Use functional components with TypeScript.
Define prop types with interfaces, not inline types.
Extract custom hooks when logic exceeds 10 lines.

2. Focus on Decisions, Not Basics

Don't document what linters handle. Document architectural decisions.

❌ BAD - Linter territory:

Use semicolons in JavaScript.
Indent with 2 spaces.
Add trailing commas.

✅ GOOD - Decision guidance:

Choose Zustand for global state, React Context for component trees.
Use Zod for runtime validation at API boundaries only.
Prefer server components except for: forms, client-only APIs, animations.

3. Organize by Concern

Group related rules into clear sections:

## Tech Stack
- Next.js 14 with App Router
- TypeScript strict mode
- Tailwind CSS for styling

## Code Style
- Functional components only
- Named exports (no default exports)
- Co-locate tests with source files

## Patterns
- Use React Server Components by default
- Client components: mark with "use client" directive
- Error handling: try/catch + toast notification

## Project Conventions
- API routes in app/api/
- Components in components/ (flat structure)
- Types in types/ (shared), components/*/types.ts (local)

Rule Anatomy

MDC Format and Metadata

Cursor rules are written in MDC (.mdc) format, which supports YAML frontmatter metadata and markdown content. The metadata controls how and when rules are applied.

Required YAML Frontmatter

Every Cursor rule MUST start with YAML frontmatter between --- markers:

---
description: Brief description of when and how to use this rule
globs: ["**/*.ts", "**/*.tsx"]
alwaysApply: false
---

Frontmatter Properties

Property Type Required Description
description string Yes Brief description of the rule's purpose. Used by AI to decide relevance. Never use placeholders like --- or empty strings.
globs array No File patterns that trigger auto-attachment (e.g., ["**/*.ts"]). Leave empty or omit if not using Auto Attached type.
alwaysApply boolean No If true, rule is always included in context. If false or omitted, behavior depends on Rule Type.

Rule Types

Control how rules are applied using the type dropdown in Cursor:

Rule Type Description When to Use
Always Always included in model context Core project conventions, tech stack, universal patterns that apply everywhere
Auto Attached Included when files matching globs pattern are referenced File-type specific rules (e.g., React components, API routes, test files)
Agent Requested Available to AI, which decides whether to include it based on description Contextual patterns, specialized workflows, optional conventions
Manual Only included when explicitly mentioned using @ruleName Rarely-used patterns, experimental conventions, legacy documentation

Examples by Rule Type

Always Rule (Core conventions):

---
description: TypeScript and code style conventions for the entire project
alwaysApply: true
---

Auto Attached Rule (File pattern-specific):

---
description: React component patterns and conventions
globs: ["**/components/**/*.tsx", "**/app/**/*.tsx"]
alwaysApply: false
---

Agent Requested Rule (Contextual):

---
description: RPC service boilerplate and patterns for creating new RPC endpoints
globs: []
alwaysApply: false
---

Manual Rule (Explicit invocation):

---
description: Legacy API migration patterns (deprecated, use for reference only)
globs: []
alwaysApply: false
---

Best Practices for Frontmatter

  1. Description is mandatory - AI uses this to determine relevance. Be specific:

    • ❌ Bad: Backend code
    • ✅ Good: Fastify API route patterns, error handling, and validation using Zod
  2. Use globs strategically - Auto-attach to relevant file types:

    • React components: ["**/*.tsx", "**/*.jsx"]
    • API routes: `["*
Полный SKILL.md на GitHub

Установить creating-cursor-rules-skill в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл creating-cursor-rules-skill?

Expert guidance for creating effective Cursor IDE rules with best practices, patterns, and examples

Как установить скилл creating-cursor-rules-skill?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл creating-cursor-rules-skill запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить creating-cursor-rules-skill с