.cursor/skills-cursor/create-rule/SKILL.md
Create Cursor rules for persistent AI guidance. Use when you want to create a rule, add coding standards, set up project conventions, configure file-specific patterns, create RULE.md files, or asks about .cursor/rules/ or AGENTS.md.
npx skillsauth add brujack/dotfiles create-ruleInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create project rules in .cursor/rules/ to provide persistent context for the AI agent.
Before creating a rule, determine:
If you have previous conversation context, infer rules from what was discussed. You can create multiple rules if the conversation covers distinct topics or patterns. Don't ask redundant questions if the context already provides the answers.
If the user hasn't specified scope, ask:
If they mentioned specific files and haven't provided concrete patterns, ask:
**/*.ts, backend/**/*.py)It's very important that we get clarity on the file patterns.
Use the AskQuestion tool when available to gather this efficiently.
Rules are .mdc files in .cursor/rules/ with YAML frontmatter:
.cursor/rules/
typescript-standards.mdc
react-patterns.mdc
api-conventions.mdc
---
description: Brief description of what this rule does
globs: **/*.ts # File pattern for file-specific rules
alwaysApply: false # Set to true if rule should always apply
---
# Rule Title
Your rule content here...
| Field | Type | Description |
|-------|------|-------------|
| description | string | What the rule does (shown in rule picker) |
| globs | string | File pattern - rule applies when matching files are open |
| alwaysApply | boolean | If true, applies to every session |
For universal standards that should apply to every conversation:
---
description: Core coding standards for the project
alwaysApply: true
---
For rules that apply when working with certain file types:
---
description: TypeScript conventions for this project
globs: **/*.ts
alwaysApply: false
---
---
description: TypeScript coding standards
globs: **/*.ts
alwaysApply: false
---
# Error Handling
\`\`\`typescript
// ❌ BAD
try {
await fetchData();
} catch (e) {}
// ✅ GOOD
try {
await fetchData();
} catch (e) {
logger.error('Failed to fetch', { error: e });
throw new DataFetchError('Unable to retrieve data', { cause: e });
}
\`\`\`
---
description: React component patterns
globs: **/*.tsx
alwaysApply: false
---
# React Patterns
- Use functional components
- Extract custom hooks for reusable logic
- Colocate styles with components
.mdc format in .cursor/rules/development
Modify Cursor/VSCode user settings in settings.json. Use when you want to change editor settings, preferences, configuration, themes, font size, tab size, format on save, auto save, keybindings, or any settings.json values.
tools
View and modify Cursor CLI configuration settings in ~/.cursor/cli-config.json. Use when the user wants to change CLI settings, configure permissions, switch approval mode, enable vim mode, toggle display options, configure sandbox, or manage any CLI preferences.
tools
Configure a custom status line in the CLI. Use when the user mentions status line, statusline, statusLine, CLI status bar, prompt footer customization, or wants to add session context above the prompt.
testing
Runs the rest of a /shell request as a literal shell command. Use only when the user explicitly invokes /shell and wants the following text executed directly in the terminal.