create-rule

Create Cursor rules as .mdc files with YAML frontmatter for persistent AI guidance.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams need a consistent way to give the AI agent persistent, project-specific guidance such as coding standards and conventions, instead of repeating instructions in every conversation. ## Core Features & Use Cases - Rule File Generation: Creates .mdc rule files in .cursor/rules/ with correct YAML frontmatter fields (description, globs, alwaysApply). - Scope Configuration: Supports always-apply rules for universal standards and glob-based rules that activate only for matching file patterns like **/*.ts. - Requirement Gathering: Infers rule content from conversation context and asks targeted questions about scope and file patterns when details are missing. - Use Case: After discussing error-handling conventions in a TypeScript project, ask the agent to codify them into a rule file that automatically applies whenever .ts files are open. ## Quick Start Ask the agent to create a Cursor rule enforcing your TypeScript error-handling standards for all files matching **/*.ts.

Frequently Asked Questions about create-rule

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

FAQPage Schema
How do I create a Cursor rule for my project?▼

Create a .mdc file in the .cursor/rules/ directory with YAML frontmatter containing a description, optional globs pattern, and alwaysApply flag. The Markdown body below the frontmatter holds the actual rule content the AI follows.

What is the difference between alwaysApply and globs in Cursor rules?▼

alwaysApply: true makes the rule active in every conversation regardless of context. globs restricts the rule so it only applies when files matching the pattern, such as **/*.ts, are open in the editor.

Where are Cursor rule files stored?▼

Cursor rules are stored as .mdc files inside the .cursor/rules/ directory at the project root. Each file represents one focused rule with its own frontmatter configuration.

How long should a Cursor rule file be?▼

Rules should stay concise, ideally under 50 lines and never exceeding 500 lines. Keep one concern per rule, write actionable guidance like internal docs, and include concrete examples showing correct and incorrect patterns.

Can Cursor rules apply only to specific file types?▼

Yes, set the globs field in the frontmatter to a file pattern like **/*.tsx or backend/**/*.py. The rule then activates only when matching files are being edited, keeping unrelated sessions unaffected.