create-rule

Create Cursor rules with YAML frontmatter stored as .mdc files.

Updated May 18, 2025
One-click install
npx skills add https://github.com/nthpaul/dotfiles --skill create-rule-nthpaul
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-rule
Source: https://github.com/nthpaul/dotfiles/tree/main/cursor/.cursor/skills-cursor/create-rule
Command: npx skills add https://github.com/nthpaul/dotfiles --skill create-rule-nthpaul

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Cursor users often lack persistent, project-specific guidance, leading to inconsistent AI answers and repeated clarification about coding standards, conventions, and file-specific expectations.

Core Features & Use Cases

  • Creates persistent rule files: Produces .mdc rule documents under .cursor/rules/ with clear YAML frontmatter for discovery and enforcement.
  • Supports universal and file-scoped standards: Lets you choose between alwaysApply: true for global conventions or globs + alwaysApply: false for targeted patterns.
  • Guides rule authoring with structure: Ensures rules stay concise, actionable, and include concrete examples and required clarifying questions when scope or patterns are missing.

Quick Start

Ask the AI to create a Cursor rule for your project conventions, including the rule description and the file glob patterns it should apply to.

Frequently Asked Questions about create-rule

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

FAQPage Schema
How do I create Cursor rules for consistent AI coding assistance?

Cursor rule files require YAML frontmatter containing a `name`, `description`, optional `globs` for file-pattern targeting, and an `alwaysApply` boolean. This frontmatter structure ensures rules are properly discovered and enforced across your project.

How do I apply Cursor rules to specific file patterns instead of globally?

Before creating Cursor rules, define your project's coding standards, conventions, and file-specific expectations. You need a Cursor project environment configured with a `.cursor/rules/` directory to store the generated `.mdc` rule files for persistent AI guidance.

What's the difference between global and file-scoped Cursor rules?

Global rules use `alwaysApply: true` to enforce universal behavioral constraints across all files. File-scoped rules combine `alwaysApply: false` with `globs` to target specific file patterns, providing contextual instructions only where needed.

Why does my Cursor AI keep ignoring my project's coding conventions?

Cursor AI ignores conventions when rules lack proper YAML frontmatter or concise, example-driven content. Creating `.mdc` files in `.cursor/rules/` with `name`, `description`, and `alwaysApply` fields ensures persistent, project-specific guidance for reliable agent behavior.