Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

creating-cursor-commands

FreeNo executable scriptsNot checked

Expert guidance for creating effective Cursor slash commands with best practices, format requirements, and schema validation

pr-pmby pr-pm★ 125 GitHub stars19 installs in other catalogs

About this skill

Creating Cursor Slash Commands

You are an expert at creating effective Cursor slash commands (.cursor/commands/*.md) that provide clear, actionable instructions for AI assistants.

When to Use This Skill

Use when:

  • User wants to create a new Cursor slash command
  • User asks to improve existing slash commands
  • User needs help understanding Cursor command format
  • User wants to convert prompts to slash commands
  • User asks about Cursor command validation

Don't use for:

  • Cursor rules (.cursor/rules/) - use creating-cursor-rules-skill instead
  • Claude Code slash commands - those use different format with frontmatter
  • Complex multi-step workflows - those should be Cursor rules

Quick Reference

Aspect Requirement
File Location .cursor/commands/*.md
Format Plain Markdown (NO frontmatter)
Filename Descriptive kebab-case (e.g., review-code.md, generate-tests.md)
Invocation /command-name in chat
Content Clear, actionable instructions with examples

Format Requirements

Critical Rules

  1. NO frontmatter allowed - Cursor commands are plain Markdown only
  2. Descriptive filenames - The filename becomes the command name
  3. Clear instructions - Tell AI exactly what to do
  4. Include examples - Show desired output format

File Naming

Good filenames:

  • review-code.md → /review-code
  • generate-tests.md → /generate-tests
  • explain-code.md → /explain-code
  • optimize-performance.md → /optimize-performance

Bad filenames:

  • rc.md - Too cryptic
  • review_code.md - Use hyphens, not underscores
  • ReviewCode.md - Use lowercase
  • review-code-thoroughly-with-security-checks.md - Too verbose

Schema Validation

Schema Location

https://github.com/pr-pm/prpm/blob/main/packages/converters/schemas/cursor-command.schema.json

Schema Structure

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://prpm.dev/schemas/cursor-command.schema.json",
  "title": "Cursor Command Format",
  "description": "JSON Schema for Cursor commands (slash commands) - plain Markdown files in .cursor/commands/",
  "type": "object",
  "required": ["content"],
  "properties": {
    "content": {
      "type": "string",
      "description": "Plain Markdown content describing what the command should do. No frontmatter supported."
    }
  },
  "additionalProperties": false
}

Key Validations

  1. Must be plain Markdown - No YAML frontmatter
  2. Content-only structure - Single content field
  3. No metadata - Unlike Cursor rules, commands have no configuration

Common Mistakes

Mistake Why It's Wrong How to Fix
Adding frontmatter Cursor commands don't support frontmatter Remove --- blocks entirely
Using default exports syntax Commands are not code files Write plain Markdown instructions
Vague instructions AI needs specific guidance Add concrete examples and steps
Too many tasks Commands should be focused Create separate commands or use rules
Missing context AI needs to know what to do Include expected output format

Best Practices

1. Be Specific and Actionable

❌ Bad - Vague:

# Review Code

Review the code for issues.

✅ Good - Specific:

# Review Code

Review the selected code for:
- Code quality and best practices
- Potential bugs or edge cases
- Performance improvements
- Security vulnerabilities

Provide specific, actionable feedback with code examples where appropriate.

2. Include Expected Output Format

❌ Bad - No guidance:

# Generate Tests

Generate tests for this code.

✅ Good - Clear format:

# Generate Tests

Generate comprehensive unit tests for the selected code.

Include:
- Happy path test cases
- Edge cases and error handling
- Mock external dependencies
- Follow existing test patterns in the project

Use the testing framework already configured in the project.

3. Provide Step-by-Step Instructions

✅ Good - Structured approach:

# Explain Code

Provide a clear explanation of what the selected code does.

Include:
- High-level purpose and goals
- Step-by-step breakdown of logic
- Any non-obvious behavior or edge cases
- Dependencies and side effects
- How it fits into the larger codebase

4. Reference Project Context

✅ Good - Context-aware:

# Add Component

Create a new React component following our project conventions.

Structure:
- Functional component with TypeScript
- Props interface defined separately
- Export as named export (not default)
- Co-locate styles if needed
- Follow existing component patterns in components/ directory

Use the same testing approach as existing components.

5. Focus on One Task

Each command should do ONE thing well.

❌ Bad - Too broad:

# Full St
Full SKILL.md on GitHub

Install creating-cursor-commands in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

FAQ

What does the creating-cursor-commands skill do?

Expert guidance for creating effective Cursor slash commands with best practices, format requirements, and schema validation

How do I install the creating-cursor-commands skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the creating-cursor-commands skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare creating-cursor-commands with