Streamline Your Development Workflow with Cursor Slash Commands
Cursor just dropped a feature that’s about to change how you and your team handle repetitive coding tasks. Slash Commands let you create reusable AI prompts that live right in your project—no more typing the same instructions over and over, no more forgetting complex workflows, and no more inconsistent approaches across your team.
The concept is brilliantly simple: store custom prompts as Markdown files in .cursor/commands/
, then access them instantly by typing /
in Cursor’s Agent input. What makes this powerful isn’t just the convenience—it’s how these commands scale your team’s expertise and maintain consistency at the codebase level.
How It Actually Works
Here’s the beautiful simplicity of it: each command is just one Markdown file. That’s it. You create a .cursor/commands/
directory in your project root, add .md
files with descriptive names, and Cursor handles the rest.
When you type /
in the Agent input, Cursor scans both your project-level commands (.cursor/commands/
) and your global commands (~/.cursor/commands/
) and presents them in a dropdown. Select one, and the entire content of that Markdown file becomes your prompt—with full project context.
Let’s look at some real examples to see how this works in practice.
Real Command Examples You Can Use Today
Code Review Command (.cursor/commands/review-code.md
)
# Code Review
You are a senior software engineer conducting a thorough code review.
## Review Checklist:
- Check for security vulnerabilities
- Verify error handling and edge cases
- Ensure code follows project conventions
- Look for performance issues
- Validate input sanitization
- Check for proper logging
- Verify tests exist and are comprehensive
## Output Format:
Provide specific, actionable feedback with:
- File and line references
- Severity level (Critical/Major/Minor)
- Suggested fixes with code examples
- Explanation of potential impact
Focus on maintainability, security, and performance.
TypeScript Error Fixer (.cursor/commands/fix-ts-errors.md
)
# Fix TypeScript Errors
Run `npm run type-check` or `tsc --noEmit` to identify TypeScript errors.
Then systematically fix each error by:
1. Reading the error message carefully
2. Understanding the root cause
3. Implementing the most appropriate fix
4. Ensuring the fix doesn't break other parts of the codebase
Continue running type checks until all errors are resolved.
Re-run the build process to confirm everything compiles successfully.
Prioritize fixes that maintain type safety and don't use `any` unless absolutely necessary.
Component Generator (.cursor/commands/component.md
)
# React Component Generator
Create a new React functional component following our project standards:
## Requirements:
- Use TypeScript with proper prop interfaces
- Include JSDoc comments for props
- Add basic CSS module if styling is needed
- Create a simple test file using our testing framework
- Export as both named and default export
- Follow our naming conventions (PascalCase for components)
## File Structure:
- `ComponentName.tsx` - Main component
- `ComponentName.module.css` - Styles (if needed)
- `ComponentName.test.tsx` - Tests
- `index.ts` - Barrel export
Ask for the component name and basic requirements before generating.
Pull Request Command (.cursor/commands/create-pr.md
)
# Create Pull Request
Generate a comprehensive PR description using GitHub CLI.
## PR Template:
### What Changed
[Brief description of changes]
### Why
[Reason for the change]
### Testing
- [ ] Unit tests added/updated
- [ ] Manual testing completed
- [ ] Edge cases considered
### Checklist
- [ ] Code follows project conventions
- [ ] Documentation updated if needed
- [ ] No console.logs or debug code
- [ ] TypeScript errors resolved
Use conventional commit format for the title.
Run `gh pr create` with the generated description.
Include relevant issue numbers with "Closes #123" format.
Advanced Command Strategies
Context-Aware Commands
The real power emerges when commands reference specific project files. A command might include @components/Button.tsx
to ensure new components follow your existing patterns, or reference your project’s README.md
to understand the current architecture.
Workflow Chaining Commands can reference other commands or build workflows. Your PR command might first run your code review command, then generate commit messages, then create the actual pull request—all automated but reviewable at each step.
Team-Specific Libraries Different teams can maintain specialized command sets. Frontend teams might have commands for component generation and Storybook setup, while backend teams focus on API endpoint creation and database migrations.
Setting Up Your First Commands
Start with these high-impact commands that address common pain points:
debug.md
- Systematic debugging workflow that checks logs, analyzes stack traces, and suggests fixestest-gen.md
- Generates comprehensive test suites for new featuresdoc-update.md
- Updates README files, API documentation, and inline commentspre-commit.md
- Runs linting, formatting, and quick tests before committing
Each command should be focused and include clear success criteria. Start simple, then expand as your team gets comfortable with the system.
Why This Changes Everything
Traditional AI-assisted coding is personal—each developer maintains their own collection of prompts and approaches. Slash Commands make AI assistance a team capability. Your senior developers’ expertise gets encoded into commands that junior developers can access instantly.
The workflow becomes: encounter a problem, check if there’s a command for it, run the command, review the results. No context switching, no prompt crafting, no remembering complex workflows.
Teams using this approach report significant improvements in code consistency and development velocity. The feature eliminates the mental overhead of crafting prompts while preserving institutional knowledge in version-controlled files that evolve with your project.
What’s particularly clever is how commands live in your repository alongside your code. They’re versioned, reviewed, and shared automatically. When someone improves a command, the entire team benefits immediately.
This isn’t just about automation—it’s about scaling expertise and maintaining quality at the team level. As AI-assisted development becomes standard, teams that master collaborative AI tools like Slash Commands will have a significant competitive advantage.
The future of coding isn’t just AI-assisted—it’s AI-coordinated at the team level. Cursor’s Slash Commands are a big step in that direction.