cursor-rules

Create and edit Cursor rules files with MDC frontmatter and globs.

2|Updated Jul 6, 2025
One-click install
npx skills add https://github.com/amhuppert/my-ai-resources --skill cursor-rules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cursor-rules
Source: https://github.com/amhuppert/my-ai-resources/tree/main/claude/ai-resources-plugin/skills/cursor-rules
Command: npx skills add https://github.com/amhuppert/my-ai-resources --skill cursor-rules

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides guidance for creating and editing Cursor rules files (.mdc) in the .cursor/rules directory, helping teams write clear, effective AI instructions and manage rule lifecycle.

Core Features & Use Cases

  • Frontmatter templates with description, globs, and alwaysApply options.
  • Clear guidance on rule types (Always, Auto Attached, Agent Requested, Manual).
  • Best practices for structuring MDC content to maximize AI comprehension.

Quick Start

Create a new Cursor MDC file under .cursor/rules, include a concise frontmatter description and relevant globs, and write the instruction content.

Frequently Asked Questions about cursor-rules

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

FAQPage Schema
How do I create Cursor rules files with MDC frontmatter?

Cursor rules files (.mdc) combine YAML frontmatter with markdown content in the .cursor/rules directory. Include frontmatter fields like description, globs for file matching, and alwaysApply to control when rules attach to your project, then write actionable instructions below.

What are the different Cursor rule types and when should I use each?

Cursor supports four rule types: Always (applies universally), Auto Attached (triggers based on glob patterns), Agent Requested (invoked by the user), and Manual (attached explicitly). Choose based on whether rules should auto-trigger, require user action, or apply globally to your codebase.

How do I structure MDC content to guide AI behavior effectively in Cursor?

Write concise, actionable instructions in markdown after the frontmatter. Focus on specific standards and practices you want the AI to follow. Clear, direct language maximizes comprehension and ensures the AI applies your project's conventions consistently.

Can I use glob patterns to automatically attach rules to specific files?

Yes. Define glob patterns in the frontmatter's globs field to automatically attach rules to matching files. This enables Auto Attached rule types that apply your standards only to relevant file types and directories without manual intervention.

What should I include in the frontmatter description for a Cursor rule?

The frontmatter description should concisely explain the rule's purpose and which project standards or AI behaviors it enforces. This helps you and your team quickly identify what each rule does when browsing the .cursor/rules directory.

Do I need to manually attach Cursor rules or can they be automatic?

Rules can be automatic or manual depending on type. Set alwaysApply to true or use Auto Attached with glob patterns for automatic triggering. Manual or Agent Requested rules require explicit user action, giving you fine-grained control over when rules activate.