Creating Cursor Rules

Generate MDC-formatted Cursor rule files with YAML frontmatter.

1|1|Updated Oct 30, 2025
One-click install
npx skills add https://github.com/NangoHQ/ai-ide-prompts --skill creating-cursor-rules-nangohq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Creating Cursor Rules
Source: https://github.com/NangoHQ/ai-ide-prompts/tree/main/.claude/skills/creating-cursor-rules-skill
Command: npx skills add https://github.com/NangoHQ/ai-ide-prompts --skill creating-cursor-rules-nangohq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Maintaining consistent coding standards and architectural patterns across a project can be challenging, especially with AI assistants. This Skill provides expert guidance for creating effective Cursor IDE rules, ensuring AI-generated code aligns perfectly with project conventions and reduces the need for constant manual correction.

Core Features & Use Cases

  • Rule Design Principles: Learn to write specific, actionable rules that focus on architectural decisions rather than basic linting.
  • Rule Application Types: Understand always, auto-attached (with globs), and manual rules to apply guidance precisely when needed.
  • Structured Rule Content: Master the inclusion of essential sections like Tech Stack, Code Style, Patterns (with code examples), and Anti-Patterns.
  • Use Case: A team wants to enforce a specific React component pattern (e.g., functional components, named exports) and error handling strategy. This Skill helps them create an auto-attached Cursor rule that automatically applies these guidelines to all .tsx files, ensuring new code adheres to team standards.

Quick Start

Use the Creating Cursor Rules skill to help me set up a new .cursor/rules file for my Next.js project. Focus on defining the tech stack and common React patterns.

Frequently Asked Questions about Creating Cursor Rules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create Cursor rules to enforce coding standards in my project?

Cursor rules codify project conventions into .cursor/rules files with YAML frontmatter. Define your tech stack, code style, architectural patterns, and anti-patterns in structured MDC format, then apply rule types—always, auto-attached (with file globs), or manual—to ensure AI-generated code aligns with team standards automatically.

What should I include in a Cursor rule for consistent TypeScript and React patterns?

Include mandatory YAML frontmatter (description, globs, alwaysApply), then structure content into Tech Stack, Code Style, Patterns with code examples, and Project Conventions sections. For React, specify functional components, named exports, error handling strategy, and file-type-specific guidance to guide AI assistance on .tsx files.

Can I apply Cursor rules automatically to specific file types?

Yes, use auto-attached rules with glob patterns to target specific files. Define globs in your rule's frontmatter to apply guidance automatically to matching files like *.tsx or src/components/**, reducing manual enforcement overhead across your codebase.

What's the difference between always, auto-attached, and manual Cursor rules?

Always rules apply universally; auto-attached rules trigger on matching file globs; manual rules require explicit activation. Choose always for foundational principles, auto-attached for file-specific conventions, and manual for context-dependent guidance that users invoke on demand.

How do I convert existing team coding guidelines into Cursor rule format?

Extract your guidelines into the four standard sections: Tech Stack, Code Style, Patterns, and Project Conventions. Add YAML frontmatter with description and file globs, format code examples in MDC, and specify the rule type (always or auto-attached) based on scope and enforcement need.

Do I need existing project conventions documented before creating Cursor rules?

Having documented conventions—style guides, architecture decisions, naming patterns—accelerates rule creation. If informal, inventory your tech choices, code patterns, and error handling approaches first; Cursor rules formalize what you already practice, reducing setup friction.