A skill in Cursor is a powerful way to extend your coding agent's capabilities by defining a set of instructions packaged inside a SKILL.md file. Unlike the native .cursorrules, which rely on regex and code patterns, SKILL.md files describe workflows in natural language that the AI can interpret and execute. Combining SKILL.md skills with .cursorrules allows you to create a more intelligent and context-aware coding assistant tailored to your project’s needs.
A SKILL.md file is essentially a markdown document that outlines a particular workflow or procedure your AI agent should learn. It includes descriptions, examples, and instructions that enable the AI to understand when and how to apply that skill. For instance, a skill might teach the agent how to perform a code review, generate documentation, or refactor a specific design pattern.
To start using SKILL.md files, you need to organize them properly within your project so Cursor can detect and load them. Follow these steps to set up your skills environment:
1. Navigate to your project root where your code resides.
2. Create the directory `.cursor/skills` if it doesn't already exist:
```bash
mkdir -p .cursor/skills
```
3. Place each skill inside its own folder within `.cursor/skills`. Each folder should contain a SKILL.md file describing the skill.
4. To add a skill you’ve downloaded (for example, from an AI prompt marketplace like Agensi), unzip it directly into the skills folder:
```bash
unzip code-reviewer.zip -d .cursor/skills/
```
5. Reload your Cursor workspace, either by restarting Cursor or using its reload command, to have it pick up the new skills.
Tip: Keep your skills organized by naming folders descriptively, e.g., `code-review`, `doc-generator`, or `refactor-patterns`. This improves maintainability and clarity.
How Cursor Loads and Activates Skills
Cursor continuously monitors the `.cursor/skills` directory. When you invoke the AI agent in your editor, it scans the available skills and matches them against your current context based on the descriptions and triggers in the SKILL.md files.
Skills activate on demand, meaning the AI will only apply them when you ask for a relevant action or when the skill’s description indicates it is appropriate. This prevents unwanted or irrelevant suggestions and keeps your workflow smooth.
Practical example: If you have a SKILL.md that teaches how to perform a unit test generation workflow, Cursor will offer that skill only when you’re working on a test file or tell it to generate tests.
While SKILL.md files describe workflows in natural language, `.cursorrules` files define pattern-based triggers and responses using regex. Using both together enhances Cursor’s capabilities:
- `.cursorrules` can quickly catch well-defined syntax or code patterns.
- SKILL.md can handle higher-level workflows that require reasoning, such as multi-step refactoring or code review procedures.
For best results, maintain both in your project. For example, your `.cursor` folder might look like this:
```
.cursor/
cursorrules/
js-patterns.cursorrule
skills/
code-review/
SKILL.md
doc-generator/
SKILL.md
```
Cursor intelligently merges these inputs to provide comprehensive assistance.
Resolving Conflicts Between Skills and Rules
Sometimes, a SKILL.md and a `.cursorrule` might overlap—both targeting similar scenarios. To resolve conflicts:
1. Prioritize `.cursorrules` for simple syntactic triggers.
2. Use SKILL.md for complex workflows.
3. Explicitly scope your skills by adding clear context descriptions in SKILL.md files.
4. Use Cursor’s configuration to disable or enable specific skills or rules as needed.
This approach ensures the AI agent selects the most appropriate procedure without confusion.
Let’s walk through setting up a practical code review skill:
1. Create a folder: `.cursor/skills/code-review`
2. Inside it, add a SKILL.md file with the following content:
```
# Code Review Skill
This skill guides the AI to perform a detailed code review. It checks for code quality, adherence to style guides, and potential bugs.
Invoke this skill when you want the AI to review the current file or a set of files.
1. Scan the code for common anti-patterns.
2. Suggest improvements in variable naming and function modularity.
3. Highlight possible runtime errors.
4. Provide an overall summary with actionable feedback.
```
3. Reload Cursor.
4. When working on a file, prompt the AI: “Perform a code review using the code-review skill.”
The AI will then follow the instructions, providing a structured review report.
- Write clear, concise instructions with numbered steps.
- Include examples or sample inputs and expected outputs.
- Use headings to structure the skill document.
- Specify in the description when and how the skill should be triggered.
- Test your skills iteratively by reloading Cursor and running tasks.
If your project layout is unconventional, you can configure Cursor to look for skills in different paths by adjusting its settings. Check Cursor’s configuration files or documentation to add alternate skill directories.
SKILL.md skills are a versatile way to teach your Cursor AI agent new workflows beyond simple pattern matching. By organizing skills inside `.cursor/skills/` and combining them with `.cursorrules`, you unlock a powerful, context-aware coding assistant that can automate complex tasks. Start by adding a few practical skills like code review or documentation generation, and expand your skillset as your project grows. With proper setup and management, SKILL.md skills will become an indispensable part of your developer toolkit.