Agent skill

Creating Cursor Commands

by pr-pm in pr-pm/prpm

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

MITAuto-check passedAgent Workflows

Install Creating Cursor Commands

skills CLI
$ npx skills add pr-pm/prpm --skill creating-cursor-commands -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pr-pm/prpm creating-cursor-commands --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/pr-pm/prpm.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/creating-cursor-commands .claude/skills/creating-cursor-commands && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
creating-cursor-commands
GitHub stars
122
Token cost
~3.3k tokens
SKILL.md length
725 words
Files
1
Skills in repo
35
Repo updated
First seen
Licence
MIT

At a glance

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

  • Works in 5 steps: Be Specific and Actionable → Include Expected Output Format → Provide Step-by-Step Instructions → …
  • Tasks that involve Hooks and plugins
  • SKILL.md covers When to Use This Skill, Quick Reference, Format Requirements and Schema Validation, plus 7 more sections
  • Reaches json-schema.org and prpm.dev

What it does

Creating Cursor Commands is an agent skill from pr-pm/prpm. Expert guidance for creating effective Cursor slash commands with best practices, format requirements, and schema validation

Its SKILL.md is about 3.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering Hooks and plugins, Forms and validation and Agent instruction files. The repository describes itself as: The universal registry for AI coding tools. The licence is MIT.

When your agent uses it

  • Tasks that involve Hooks and plugins
  • Tasks that involve Forms and validation
  • Tasks that involve Agent instruction files

Example prompts

  • “/creating-cursor-commands”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Be Specific and Actionable
  2. Include Expected Output Format
  3. Provide Step-by-Step Instructions
  4. Reference Project Context
  5. Focus on One Task

What it can do on your machine

Read from SKILL.md and the folder at commit 5f993e6. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown and json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • json-schema.org
    • prpm.dev

    Also links to:

    • cursor.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Creating Cursor Commands loads about 3.3k tokens when it runs. Until then it costs about 37 tokens; SKILL.md has 725 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~37
When it runs · the whole SKILL.md, loaded when a task matches
~3.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from pr-pm/prpm at commit 5f993e6, republished under its MIT licence (© pr-pm). 725 words, ~3,265 tokens.

Download SKILL.mdSave it as .claude/skills/creating-cursor-commands/SKILL.md (or your agent's skills folder).
name
creating-cursor-commands
description
Expert guidance for creating effective Cursor slash commands with best practices, format requirements, and schema validation

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

AspectRequirement
File Location.cursor/commands/*.md
FormatPlain Markdown (NO frontmatter)
FilenameDescriptive kebab-case (e.g., review-code.md, generate-tests.md)
Invocation/command-name in chat
ContentClear, 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
json
{
  "$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

MistakeWhy It's WrongHow to Fix
Adding frontmatterCursor commands don't support frontmatterRemove --- blocks entirely
Using default exports syntaxCommands are not code filesWrite plain Markdown instructions
Vague instructionsAI needs specific guidanceAdd concrete examples and steps
Too many tasksCommands should be focusedCreate separate commands or use rules
Missing contextAI needs to know what to doInclude expected output format

Best Practices

1. Be Specific and Actionable

❌ Bad - Vague:

markdown
# Review Code

Review the code for issues.

✅ Good - Specific:

markdown
# 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:

markdown
# Generate Tests

Generate tests for this code.

✅ Good - Clear format:

markdown
# 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:

markdown
# 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:

markdown
# 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:

markdown
# Full Stack Feature

Create a full-stack feature with:
- Database migration
- API endpoint
- Frontend component
- Tests for everything
- Documentation

✅ Good - Focused:

markdown
# Create API Endpoint

Create a new API endpoint following our conventions.

Include:
- Input validation with Zod
- Error handling with try/catch
- TypeScript types for request/response
- Follow patterns in existing endpoints

Examples

Code Review Command

.cursor/commands/review-code.md:

markdown
# Review Code

Review the selected code for:

1. **Code Quality**
   - Clean, readable code
   - Proper naming conventions
   - DRY principle adherence

2. **Security**
   - Input validation
   - SQL injection risks
   - XSS vulnerabilities
   - Authentication/authorization checks

3. **Performance**
   - Inefficient algorithms
   - Unnecessary computations
   - Memory leaks
   - Database query optimization

4. **Best Practices**
   - Error handling
   - Type safety
   - Test coverage
   - Documentation

Provide specific file and line references for all issues found.
Format findings as a numbered list with severity (Critical/High/Medium/Low).
Test Generation Command

.cursor/commands/generate-tests.md:

markdown
# Generate Tests

Generate comprehensive unit tests for the selected code.

Test Coverage:
- Happy path scenarios
- Edge cases
- Error conditions
- Boundary values
- Invalid inputs

Requirements:
- Use existing test framework (Jest/Vitest/etc.)
- Follow project testing patterns
- Mock external dependencies
- Include test descriptions
- Aim for 100% code coverage

Format tests in the same style as existing test files in the project.
Documentation Generator

.cursor/commands/document-function.md:

markdown
# Document Function

Generate comprehensive documentation for the selected function.

Include:

**Function signature:**
- Parameter types and descriptions
- Return type and description
- Generic types if applicable

**Description:**
- What the function does (one-line summary)
- Why it exists (use case)
- How it works (implementation details if non-obvious)

**Examples:**
- Basic usage example
- Edge case example if relevant

**Notes:**
- Any side effects
- Performance considerations
- Related functions

Use JSDoc/TSDoc format for TypeScript/JavaScript.
Optimization Command

.cursor/commands/optimize-performance.md:

markdown
# Optimize Performance

Analyze the selected code for performance improvements.

Look for:

**Algorithmic Issues:**
- O(n²) or worse time complexity
- Unnecessary nested loops
- Inefficient data structures

**React-Specific:**
- Unnecessary re-renders
- Missing useMemo/useCallback
- Large component trees
- Props drilling

**General:**
- Redundant computations
- Memory leaks
- Synchronous blocking operations
- Large bundle size contributors

Suggest specific optimizations with code examples.
Estimate performance impact of each suggestion.
Refactoring Command

.cursor/commands/refactor-clean.md:

markdown
# Refactor for Clean Code

Refactor the selected code to improve maintainability.

Apply these principles:

**Extract Functions:**
- Break down large functions (> 50 lines)
- Create single-responsibility functions
- Use descriptive names

**Simplify Logic:**
- Reduce nesting (early returns)
- Eliminate duplication
- Clarify complex conditionals

**Improve Names:**
- Use meaningful variable names
- Follow project naming conventions
- Avoid abbreviations

**Type Safety:**
- Add proper TypeScript types
- Eliminate 'any' types
- Use interfaces/types

Preserve all existing functionality and tests.
Bug Fix Command

.cursor/commands/fix-bug.md:

markdown
# Fix Bug

Analyze and fix the bug in the selected code.

Investigation steps:
1. Identify the root cause
2. Explain why the bug occurs
3. Propose a fix
4. Consider edge cases
5. Suggest tests to prevent regression

Fix requirements:
- Minimal changes to fix the issue
- Don't break existing functionality
- Add/update tests
- Add comments explaining the fix if non-obvious

Explain the fix clearly with before/after code examples.

Storage Locations

Commands can be stored in multiple locations (in order of precedence):

  1. Project commands: .cursor/commands/ directory in your project (shared with team)
  2. Global commands: ~/.cursor/commands/ directory (personal, all projects)
  3. Team commands: Created via Cursor Dashboard (enterprise teams)

Best practice: Store team-wide commands in .cursor/commands/ and commit to version control.

Show full SKILL.md (307 more words)Show less

Testing Your Commands

After creating a command:

  1. Save to .cursor/commands/command-name.md
  2. Invoke with /command-name in Cursor chat
  3. Verify AI follows instructions correctly
  4. Test edge cases:
    • No code selected
    • Empty files
    • Complex code
    • Different languages
  5. Iterate based on results

Commands vs. Cursor Rules

Use Commands When:
  • ✅ Simple, focused task
  • ✅ Explicit user invocation desired
  • ✅ Personal productivity shortcuts
  • ✅ One-time operations
Use Cursor Rules When:
  • ✅ Context-aware automatic activation
  • ✅ File-type specific guidance
  • ✅ Team standardization
  • ✅ Always-on conventions

Example:

  • Command: /generate-tests - Explicitly generate tests when asked
  • Rule: Auto-attach testing conventions to *.test.ts files

Validation Checklist

Before finalizing a command:

  • Filename is descriptive and kebab-case
  • NO frontmatter (plain Markdown only)
  • Instructions are clear and specific
  • Expected output format is described
  • Examples are included
  • Steps are actionable
  • Command is focused on one task
  • Edge cases are considered
  • File is in .cursor/commands/ directory
  • Command has been tested

Converting from Other Formats

From Claude Code Slash Commands

Claude Code commands use frontmatter - remove it for Cursor:

Claude Code:

markdown
---
description: Review code
allowed-tools: Read, Grep
---

Review the code...

Cursor:

markdown
# Review Code

Review the code...
From Cursor Rules

Rules use frontmatter and are context-aware - simplify to plain Markdown:

Cursor Rule:

markdown
---
description: Testing conventions
globs: ["**/*.test.ts"]
---

# Testing Standards

Always write tests...

Cursor Command:

markdown
# Generate Tests

Generate comprehensive tests...

Common Use Cases

Code Quality
  • /review-code - Code review
  • /refactor-clean - Clean code refactoring
  • /fix-lint - Fix linting issues
  • /improve-types - Improve TypeScript types
Testing
  • /generate-tests - Generate unit tests
  • /test-edge-cases - Add edge case tests
  • /test-coverage - Check test coverage
Documentation
  • /document-function - Document function
  • /add-comments - Add code comments
  • /explain-code - Explain complex code
Performance
  • /optimize-performance - Performance optimization
  • /analyze-complexity - Analyze time complexity
  • /reduce-bundle - Reduce bundle size
Security
  • /security-audit - Security vulnerability check
  • /sanitize-input - Add input validation
  • /check-auth - Review authentication

References

  • Schema: https://github.com/pr-pm/prpm/blob/main/packages/converters/schemas/cursor-command.schema.json
  • Docs: /Users/khaliqgant/Projects/prpm/app/packages/converters/docs/cursor.md
  • Official Docs: https://cursor.com/docs/agent/chat/commands

Remember

Golden Rules:

  1. NO frontmatter - plain Markdown only
  2. Descriptive filenames - they become command names
  3. Clear instructions - AI needs specific guidance
  4. Include examples - show desired output
  5. One task per command - keep it focused

Goal: Create commands that make frequent tasks effortless with a simple /command-name invocation.

© pr-pm, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/creating-cursor-commands of pr-pm/prpm.

Open the folder on GitHubat commit 5f993e6

Compare with similar skills

Creating Cursor Commands next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Creating Cursor Commands compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Creating Cursor Commands this skillpr-pm/prpm122—~3.3kAutomated safety check: PassMIT
Agent Setup Health Audittw93/Waza7.2k—~5.2kAutomated safety check: NotesMIT
Working With Claude Code Docsobra/superpowers-developing-for-claude-code142—~1.5kAutomated safety check: PassNone
Directional Promptingkingbootoshi/directional-prompting143—~2.3kAutomated safety check: PassMIT
Agenticashibing624/agentica352—~1.8kAutomated safety check: NotesApache-2.0
Claude Code Mastery Squadohmyjahh/xquads-squads276—~1.1kAutomated safety check: PassMIT

Similar skills

  • Audits a project's agent configuration, instruction drift, hooks, MCP and AI maintainability, then reports prioritized findings with evidence and next actions.

    7.2k GitHub stars~5.2k tokensUpdated yesterday
    Agent WorkflowsAuto-check: notes
  • Working With Claude Code Docs

    obra/superpowers-developing-for-claude-code

    Looks up official Claude Code documentation stored as reference files instead of guessing about CLI commands, configuration, or plugin APIs.

    142 GitHub stars~1.5k tokensUpdated 10 mo ago
    Agent WorkflowsAuto-check passed
  • Directional Prompting

    kingbootoshi/directional-prompting

    Write prompts, system instructions, agent directives, slash commands, and skill descriptions using two stacked layers — outcome-first (define the destination, success criteria, stopping condition)…

    143 GitHub stars~2.3k tokensUpdated 4 mo ago
    Agent WorkflowsAuto-check passed
  • Agentica

    shibing624/agentica

    How to answer questions about the agentica product you are running inside — CLI flags, config.yaml profiles, API keys, models, sessions, resume, workspace, AGENTS.md standing rules, skills, logs…

    352 GitHub stars~1.8k tokensUpdated 14 days ago
    Agent WorkflowsAuto-check: notes
  • Claude Code Mastery Squad

    ohmyjahh/xquads-squads

    Routes a request to one of eight specialist agents covering hooks, skills, subagents, MCP integration and context engineering for Claude Code.

    276 GitHub stars~1.1k tokensUpdated 8 days ago
    Agent WorkflowsAuto-check passed
  • Vault Setup

    earlyaidopters/second-brain

    Interactive Obsidian vault configurator. An agent skill from earlyaidopters/second-brain.

    193 GitHub stars~1.4k tokensUpdated 6 mo ago
    Agent WorkflowsAuto-check passed

More from pr-pm/prpm

All 35 skills in this repo
  • Reference for writing Claude Code agent files: location, frontmatter fields, validation limits, tool and model choices, and the required content format.

    122 GitHub starsUsed in 3 repos~4k tokens
    Auto-check passed
  • Covers how to build, configure and publish Claude Code hooks: event types, exit codes, JSON I/O, and PRPM packaging.

    122 GitHub starsUsed in 2 repos~3.9k tokens
    Auto-check: notes
  • Shows how to write .claude/rules/ files correctly: paths frontmatter instead of globs, quoted glob patterns, global rules and conversion of Cursor rules.

    122 GitHub starsUsed in 2 repos~551 tokens
    Auto-check passed
  • Reference for writing portable Agent Skills packages, covering SKILL.md frontmatter limits, name rules, directory layout and where Codex CLI, GitHub Copilot and Amp look for skills.

    122 GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • A skill your agent uses when building custom Kiro AI agents or when user asks for agent configurations - provides JSON structure, tool configuration, prompt patterns, and security best practices for…

    122 GitHub starsUsed in 1 repo~1.9k tokens
    Auto-check passed
  • A skill your agent uses when creating OpenCode agents - provides markdown format with YAML frontmatter, mode/tools/permission configuration, and best practices for specialized AI assistants

    122 GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed

Categories

Questions about Creating Cursor Commands

What does Creating Cursor Commands do?

Expert guidance for creating effective Cursor slash commands with best practices, format requirements, and schema validation. Creating Cursor Commands is an agent skill from pr-pm/prpm.

When should I use Creating Cursor Commands?

Creating Cursor Commands fits situations like: tasks that involve Hooks and plugins; tasks that involve Forms and validation; tasks that involve Agent instruction files.

How do I install Creating Cursor Commands in Claude Code?

Run `npx skills add pr-pm/prpm --skill creating-cursor-commands -a claude-code`. Or copy the skill folder (.claude/skills/creating-cursor-commands in pr-pm/prpm) into .claude/skills/creating-cursor-commands in your project. Claude Code loads it when a task matches its description.

How do I install Creating Cursor Commands in Codex?

Run `npx skills add pr-pm/prpm --skill creating-cursor-commands -a codex`. Or copy the skill folder (.claude/skills/creating-cursor-commands in pr-pm/prpm) into .agents/skills/creating-cursor-commands in your project. Codex loads it when a task matches its description.

Can I use Creating Cursor Commands in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pr-pm/prpm --skill creating-cursor-commands -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/creating-cursor-commands, .gemini/skills/creating-cursor-commands, .github/skills/creating-cursor-commands and .opencode/skills/creating-cursor-commands in your project.

What does Creating Cursor Commands need to run?

SKILL.md names no scripts, command-line tools or credentials: Creating Cursor Commands is instructions for the agent only.

Does Creating Cursor Commands access the network?

SKILL.md names 3 domains. In commands or code: json-schema.org and prpm.dev; the agent is likely to contact these when it follows the instructions. As links in the text: cursor.com. This is read from the text; nothing was executed.

Is Creating Cursor Commands safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Creating Cursor Commands use?

Creating Cursor Commands is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Creating Cursor Commands use?

About 3.3k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Creating Cursor Commands?

Skills that share tags, products or a category with Creating Cursor Commands: Agent Setup Health Audit (tw93/Waza, 7.2k stars), Working With Claude Code Docs (obra/superpowers-developing-for-claude-code, 142 stars), Directional Prompting (kingbootoshi/directional-prompting, 143 stars) and Agentica (shibing624/agentica, 352 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Creating Cursor Commands?

pr-pm (a GitHub organization) maintains it in pr-pm/prpm, which has 122 GitHub stars. The repository holds 35 skills in this directory. The repository was last updated on October 6, 2026.

Source: pr-pm/prpm on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.