create-rule

Create and manage custom AI agent rules in the `.cursor/rules/` directory.

Updated Mar 7, 2026
One-click install
npx skills add https://github.com/StarksJohn/CursorUserDir --skill create-rule-starksjohn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-rule
Source: https://github.com/StarksJohn/CursorUserDir/tree/main/skills-cursor/create-rule
Command: npx skills add https://github.com/StarksJohn/CursorUserDir --skill create-rule-starksjohn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill allows users to create custom rules for the AI agent, ensuring consistent coding standards, project conventions, and file-specific guidance across sessions.

Core Features & Use Cases

  • Persistent Guidance: Define rules that the AI will consistently follow.
  • Scope Control: Apply rules globally or to specific file patterns.
  • Structured Rules: Create .mdc files with YAML frontmatter for easy management.
  • Use Case: Set up a rule to enforce a specific error-handling pattern in all TypeScript files within a project.

Quick Start

Create a new rule for TypeScript files that enforces specific error handling patterns.

Frequently Asked Questions about create-rule

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

FAQPage Schema
How do I create custom rules for consistent AI coding standards in Cursor?

To create custom rules for consistent AI coding standards in Cursor, you define rules with descriptions, file globs for scope, and an alwaysApply flag within the `.cursor/rules/` directory. This establishes persistent, project-specific conventions across sessions.

How do I apply AI guidance to specific file patterns in my project?

You apply AI guidance to specific file patterns by using file globs to define the scope of a rule. This ensures the AI agent only enforces your defined coding conventions when working within those targeted file paths.

Can I enforce persistent AI guidance across all sessions?

You can enforce persistent AI guidance across all sessions by setting the `alwaysApply` flag to true. This ensures the AI agent consistently follows your defined rules globally without requiring manual context injection.

What format are custom AI rules stored in?

Custom AI rules are stored as `.mdc` files with YAML frontmatter. This structured format facilitates easy management of descriptions, file globs, and scope flags within the `.cursor/rules/` directory.

Why do I need project-specific conventions for AI agents?

You need project-specific conventions for AI agents to prevent inconsistent code generation and ensure specific error-handling patterns or styling rules are automatically followed, maintaining codebase quality across collaborative sessions.