- Notifications
You must be signed in to change notification settings - Fork22
Cursor Custom Slash Commands
License
hamzafer/cursor-commands
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
⭐Featured byCursor
A curated collection of Cursor slash-command prompts that give your teamreusable, version-controlled AI workflows directly inside the Cursor IDE.
🔗 Also check outCursor Hooks - that runs after every file edit
Cursor Commands are reusable AI prompts saved as Markdown files in.cursor/commands/. When you type/ in Cursor's chat input, the IDE listsevery command from your project and your global library so you can insert theprompt instantly. They act like AI-driven shortcuts that automate repetitivetasks, reinforce team standards, and keep feedback consistent.
- 🚀 Quick access: Type
/to surface every command without leaving your flow - 🔄 Reusable: Standardize prompts for common tasks across the whole team
- 👥 Shareable: Store commands in git so they ship with your repository
- 🎯 Focused: Each command targets a specific workflow with clear structure
- 📝 Customizable: Edit or extend the Markdown files to match your processes
Commands can live in two places:
- Project commands: Store Markdown files in
.cursor/commandsinside your repository - Global commands: Store personal commands in
~/.cursor/commandson your machine
Cursor automatically scans both directories when you type/, combines theresults, and inserts the selected command into the chat ready to run.
- Type
/in Cursor's AI chat or agent input - Select from the available commands
- Let the AI execute the prompt with the relevant project context
- Create a
.cursor/commandsdirectory in your project root - Add
.mdfiles with descriptive names (for example,code-review.md,run-all-tests-and-fix.md) - Write clear Markdown instructions describing what the command should accomplish
- Open Cursor, type
/, and choose your new command to execute it immediately
Example structure:
.cursor/└── commands/ ├── accessibility-audit.md ├── add-documentation.md ├── add-error-handling.md ├── address-github-pr-comments.md ├── code-review.md ├── create-pr.md ├── database-migration.md ├── debug-issue.md ├── fix-compile-errors.md ├── fix-git-issues.md ├── generate-api-docs.md ├── generate-pr-description.md ├── light-review-existing-diffs.md ├── lint-fix.md ├── lint-suite.md ├── onboard-new-developer.md ├── optimize-performance.md ├── refactor-code.md ├── run-all-tests-and-fix.md ├── security-audit.md ├── security-review.md ├── setup-new-feature.md └── write-unit-tests.mdlint-fix.md– Automatically analyze and fix linting issues in the current filelint-suite.md– Run project linters, apply fixes, and ensure codebase meets formatting requirementsrefactor-code.md– Improve code quality while maintaining functionalityoptimize-performance.md– Analyze and optimize code performanceadd-error-handling.md– Implement comprehensive error handling across the change set
code-review.md– Comprehensive review checklist with structured steps and focus areasaddress-github-pr-comments.md– Process reviewer feedback and craft thoughtful responseslight-review-existing-diffs.md– Quick pass to highlight risky diffs and cleanup itemscreate-pr.md– Prepare a well-structured pull request with validation checklistgenerate-pr-description.md– Draft detailed pull-request descriptions automatically
run-all-tests-and-fix.md– Execute the full suite, triage failures, and confirm fixeswrite-unit-tests.md– Generate focused unit tests with proper coveragedebug-issue.md– Step-by-step debugging workflow for isolating defectsfix-compile-errors.md– Diagnose and resolve compilation failures quickly
add-documentation.md– Capture comprehensive product or code documentationgenerate-api-docs.md– Produce rich API documentation with schemas and examplesonboard-new-developer.md– Checklist-driven onboarding for new teammatessetup-new-feature.md– Plan requirements, branching, and architecture for new work
security-audit.md– Structured security checklist for code changessecurity-review.md– Broader vulnerability and risk assessment workflowaccessibility-audit.md– Review for WCAG compliance issuesdatabase-migration.md– Plan, create, and validate database migrations with rollbacksfix-git-issues.md– Resolve merge conflicts and repository problems safely
- Clone this repository or copy the
.cursor/commands/directory into your project - Open the project in Cursor IDE
- Type
/in the AI chat to browse available commands - Select a command and let Cursor execute the prompt with your code context
# Option 1: clone the repositorygit clone https://github.com/hamzafer/cursor-commands.gitcd cursor-commands
# Option 2: copy commands into an existing projectcp -r cursor-commands/.cursor /path/to/your/project/Alternatively, create the directory manually:
- Create
.cursor/commands/in your project root - Copy or author the Markdown command files you need
Use the existing files as templates or start from scratch:
touch .cursor/commands/my-custom-command.md
#My Custom CommandBrief description of what this command does.##ObjectiveDetailed explanation of the task and expected outcome.##Requirements- Specific requirements or constraints- Coding standards to follow- Expected formats or structures##OutputDescription of what the AI should produce.Provide clear instructions for the AI to follow.
#Generate API DocumentationCreate comprehensive API documentation for the current code. Include:- Endpoint descriptions and HTTP methods- Request/response schemas with examples- Authentication requirements- Error codes and responses- Rate limiting informationFormat as OpenAPI/Swagger specification.
#Security AuditPerform a security audit of the current code. Check for:- SQL injection vulnerabilities- XSS attack vectors- Authentication and authorization issues- Input validation problems- Sensitive data exposureProvide specific remediation steps for each issue found.
- Be specific: Describe the expected outcome and acceptance criteria
- Provide context: Reference project conventions, architecture, or standards
- Set boundaries: Clarify scope, assumptions, and tooling limits
- Include examples: Show expected formats or responses when helpful
- Stay focused: Keep each command targeted to a single, clear objective
- Review together: Treat command changes like code changes and review in PRs
- Use descriptive names: Make filenames reflect the command's purpose
- Open anissue for feedback or requests
- Refer to this README for the command index that ships with the prompts
This project is open source and available under theMIT License.
About
Cursor Custom Slash Commands
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.