prpm / rules
Cursor rule122 starsChanged 9 months agoMITView on GitHub
Guidelines for creating Claude Code slash commands with correct frontmatter, file location, and structure
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository64 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- beanstalk-deployCursor rule
- .cursor/rules/core-principles.mdcCursor rule
- .cursor/rules/creating-agents-md.mdcCursor rule
- .cursor/rules/creating-claude-agents.mdCursor rule
- .cursor/rules/creating-claude-hooks.mdCursor rule
- .cursor/rules/creating-continue-packages.mdCursor rule
- .cursor/rules/creating-copilot-packages.mdCursor rule
- .cursor/rules/creating-cursor-commands.mdCursor rule
- .cursor/rules/creating-cursor-rules.mdcCursor rule
- .cursor/rules/creating-kiro-agents.mdcCursor rule
- .cursor/rules/creating-kiro-packages.mdCursor rule
- .cursor/rules/creating-skills.mdcCursor rule
- .cursor/rules/creating-windsurf-packages.mdCursor rule
- .cursor/rules/elastic-beanstalk-deployment.mdCursor rule
- .cursor/rules/format-conversion.mdcCursor rule
- .cursor/rules/github-actions-testing.mdcCursor rule
- .cursor/rules/karen-repo-reviewer.mdcCursor rule
- .cursor/rules/prpm-json-best-practices.mdcCursor rule
- .cursor/rules/self-improve-cursor.mdcCursor rule
- .cursor/rules/testing-patterns.mdcCursor rule
- .cursor/rules/typescript-type-safety.mdcCursor rule
- .cursor/rules/typescript-type-specialist.mdcCursor rule
- creating-agent-skillsSkill
- adding-new-ai-formatSkill
- agent-builderSkill
- aws-beanstalk-expertSkill
- beanstalk-deploySkill
- claude-hook-writerSkill
- creating-agents-mdSkill
- creating-claude-agentsSkill
- creating-claude-commandsSkill
- creating-claude-hooksSkill
- creating-claude-rulesSkill
- creating-continue-packagesSkill
- creating-copilot-packagesSkill
- creating-cursor-commandsSkill
- creating-cursor-rules-skillSkill
- creating-kiro-agentsSkill
- creating-kiro-packagesSkill
- creating-opencode-agentsSkill
- creating-opencode-pluginsSkill
- creating-skillsSkill
- creating-windsurf-packagesSkill
- creating-zed-extensionsSkill
- documentation-standardsSkill
- elastic-beanstalk-deploymentSkill
- github-actions-testingSkill
- human-writingSkill
- integrating-stripe-webhooksSkill
- karen-repo-reviewerSkill
- npm-trusted-publishingSkill
- osgrepSkill
- postgres-migrationsSkill
- prpm-developmentSkill
- prpm-json-best-practicesSkill
- pulumi-troubleshootingSkill
- self-improvingSkill
- slash-command-builderSkill
- The first 60 shown.
The file
We split this creating-claude-commands.md into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
ALL fields are optional. If no frontmatter is needed, you can omit the --- delimiters entirely.
- Distinctive: line 48
Important: Must be comma-separated STRING, not array.
- Distinctive: line 313
Before finalizing a slash command:
- Distinctive: line 469
Minimal tool permissions: - Only request tools actually needed
- Very specific: line 470
Document arguments: - Use argument-hint for expected args
- Distinctive: line 473
Add icons to H1: - Use emoji in heading for visual identification
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Creating Claude Code Slash Commands
Guidelines for creating Claude Code slash commands - quick actions triggered by /command-name.
Overview
Slash commands are quick, single-purpose actions stored as Markdown files with optional YAML frontmatter.
File Location: .claude/commands/command-name.md
Format: Markdown with optional YAML frontmatter
Frontmatter Fields
ALL fields are optional. If no frontmatter is needed, you can omit the --- delimiters entirely.
description (string)
Brief description shown in autocomplete. Defaults to first line from prompt if not specified.
---
description: Generate comprehensive documentation for selected code
---allowed-tools (string)
Comma-separated list of tools the command can use. Inherits from conversation if not specified.
Valid tools: Read, Write, Edit, Grep, Glob, Bash, WebSearch, WebFetch, Task, Skill, SlashCommand, TodoWrite, AskUserQuestion
---
allowed-tools: Read, Edit, Grep
---Important: Must be comma-separated STRING, not array.
argument-hint (string)
Expected arguments for the command. Shown when auto-completing.
---
argument-hint: [file-path]
------
argument-hint: add [tagId] | remove [tagId] | list
---model (string)
Specific model to use for this command. Inherits from conversation if not specified.
Valid values: sonnet, opus, haiku, inherit
---
model: sonnet
---disable-model-invocation (boolean)
Set to true to prevent Claude from automatically invoking this command via the SlashCommand tool.
---
disable-model-invocation: true
---commandType (string)
Set to "slash-command" for explicit type preservation in round-trip conversion (PRPM extension).
---
commandType: slash-command
---Format Requirements
Basic Structure
---
description: Generate documentation for code
allowed-tools: Read, Edit
model: sonnet
---
# 📝 Documentation Generator
Generate comprehensive documentation for the selected code.
## Instructions
- Analyze code structure and purpose
- Generate clear, concise documentation
- Include parameter descriptions
- Add usage examplesMinimal Command (No Frontmatter)
Review the current file for:
- Code quality issues
- Security vulnerabilities
- Performance bottlenecksWith Arguments
---
description: Manage tags for files
argument-hint: add [tagId] | remove [tagId] | list
allowed-tools: Read, Write
---
# Tag Manager
Manage tags for project files.
## Usage
- `/tags add <tagId>` - Add a tag
- `/tags remove <tagId>` - Remove a tag
- `/tags list` - List all tagsContent Guidelines
H1 Title (Optional)
Can include emoji icon for visual identification:
# 📝 Documentation GeneratorIcons go in the H1 heading, NOT in frontmatter.
Instructions
Provide clear, actionable guidance:
## Instructions
- Analyze code structure and purpose
- Generate clear, concise documentation
- Follow JSDoc/TSDoc format for TypeScriptOutput Format
Specify expected output:
## Output Format
Return formatted documentation ready to paste above the code.Examples
Show Claude what good output looks like:
## Example
```typescript
/**
* Calculates total price with tax
* @param price - Base price before tax
* @returns Total price including tax
*/
function calculateTotal(price: number, taxRate: number): number {
return price * (1 + taxRate);
}
## Schema Reference
Commands are validated against the JSON Schema:
**Schema URL:** https://github.com/pr-pm/prpm/blob/main/packages/converters/schemas/claude-slash-command.schema.json
**Schema Structure:**
```json
{
"frontmatter": {
"description": "string (optional)",
"allowed-tools": "string (optional)",
"argument-hint": "string (optional)",
"model": "string (optional)",
"disable-model-invocation": "boolean (optional)",
"commandType": "slash-command (optional)"
},
"content": "string (markdown content)"
}Common Mistakes to Avoid
1. Array for allowed-tools
Wrong:
---
allowed-tools: [Read, Write, Edit]
---Correct:
---
allowed-tools: Read, Write, Edit
---2. Wrong Field Names
Wrong:
---
tools: Read, Write
arguments: [file-path]
---Correct:
---
allowed-tools: Read, Write
argument-hint: [file-path]
---3. Invalid Tool Names
Wrong:
---
allowed-tools: bash, grep, read
---Correct:
---
allowed-tools: Bash, Grep, Read
---4. Invalid Model Values
Wrong:
---
model: claude-sonnet-4-6
---Correct:
---
model: sonnet
---5. Icon in Frontmatter
Wrong:
---
icon: 📝
description: Generate docs
---Correct:
---
description: Generate docs
---
# 📝 Documentation GeneratorValidation Checklist
Before finalizing a slash command:
- File saved to
.claude/commands/*.md - Frontmatter uses correct field names
allowed-toolsis comma-separated string (not array)modeluses short values (sonnet, notclaude-sonnet-4-6)- Icon (if used) is in H1 heading, not frontmatter
- Description is specific and actionable
- Tool permissions are minimal
- Arguments documented in
argument-hintif needed - Instructions are clear
- Expected output format specified
- Examples included in prompt
Examples
Documentation Generator
---
description: Generate comprehensive documentation for selected code
allowed-tools: Read, Edit
model: sonnet
---
# 📝 Documentation Generator
Generate comprehensive documentation for the selected code.
## Instructions
- Analyze code structure and purpose
- Generate clear, concise documentation
- Include parameter descriptions with types
- Add usage examples
- Follow JSDoc/TSDoc format for TypeScript
## Output Format
Return formatted documentation ready to paste above the code:
/**
* Function description
* @param {Type} paramName - Parameter description
* @returns {ReturnType} Return value description
*/Code Reviewer
---
description: Review code for quality, security, and performance
allowed-tools: Read, Grep
---
# 🔍 Code Reviewer
Review the selected code or current file for:
## Code Quality
- Clean, readable code
- Proper naming conventions
- DRY principle
## Security
- Input validation
- SQL injection risks
- XSS vulnerabilities
## Performance
- Inefficient algorithms
- Unnecessary computations
- Memory leaks
Provide specific file:line references for all issues.Test Generator
---
description: Generate test cases for selected code
allowed-tools: Read, Write
---
# 🧪 Test Generator
Generate comprehensive test cases for the selected code.
## Test Coverage
- Happy path scenarios
- Edge cases
- Error conditions
- Boundary values
## Structure
Follow the project's testing conventions and match existing patterns.
## Example
```typescript
describe('calculateTotal', () => {
it('should calculate total with valid inputs', () => {
expect(calculateTotal(100, 0.08)).toBe(108);
});
it('should throw for negative price', () => {
expect(() => calculateTotal(-100, 0.08)).toThrow();
});
});
### Git Workflow with Arguments
```markdown
---
description: Create and push feature branch
argument-hint: <feature-name>
allowed-tools: Bash(git *)
---
# 🌿 Feature Branch Creator
Create and push a new feature branch.
## Usage
```bash
/feature user-authentication
/feature api-optimizationCreates branch: feature/<feature-name>
### Minimal Command
```markdown
---
description: Quick code quality check
---
Review this code for:
- Naming issues
- Code smells
- Quick wins for improvementBest Practices
- Keep commands focused - One command, one purpose
- Use clear descriptions - Make them specific and actionable
- Minimal tool permissions - Only request tools actually needed
- Document arguments - Use
argument-hintfor expected args - Include examples - Show Claude what good output looks like
- Specify output format - Be explicit about what you want
- Add icons to H1 - Use emoji in heading for visual identification
- Test before committing - Invoke and verify it works
Related Documentation
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

