create-rule

Create Cursor rule files with YAML frontmatter for persistent AI coding guidance.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It removes the guesswork of configuring persistent AI guidance in Cursor by generating properly formatted .mdc rule files in .cursor/rules/ with correct frontmatter, scope, and file patterns. ## Core Features & Use Cases - Rule File Generation: Produces .mdc files with description, globs, and alwaysApply frontmatter fields placed in .cursor/rules/. - Scope Configuration: Supports always-apply rules for universal standards and glob-based rules that activate only for matching file patterns like **/.ts. - Use Case: After discussing TypeScript error-handling conventions in a session, ask the assistant to codify them into a rule file so every future conversation follows the same try/catch logging pattern. ## Quick Start Ask the assistant to create a Cursor rule that applies TypeScript error-handling standards to 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 inside .cursor/rules/ with YAML frontmatter containing a description, optional globs pattern, and alwaysApply flag. The Markdown body below the frontmatter holds the actual guidance the AI follows.

How do I make a Cursor rule apply only to specific files?

Set the globs field in the frontmatter to a file pattern such as **/*.ts and set alwaysApply to false. The rule then activates only when matching files are part of the working context.

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

alwaysApply: true attaches the rule to every conversation regardless of context. globs restricts the rule to sessions involving files matching the pattern, keeping guidance targeted and reducing irrelevant context.

How long should a Cursor rule file be?

Keep rules concise, ideally under 50 lines and focused on one concern per file. Split large standards documents into multiple focused .mdc files and include concrete good-versus-bad code examples.

Where are Cursor rules stored in a repository?

Cursor rules live as .mdc files in the .cursor/rules/ directory at the project root. Each file is an independent rule with its own frontmatter controlling when it applies.