A comprehensive collection of Cursor AI editor settings, commands, and rules designed for professional development workflows. This repository contains reusable configurations that can be shared across teams and projects.
.cursor/
βββ commands/ # Custom Cursor commands (10 commands)
β βββ commit.md # Git commit automation
β βββ git-branch.md # Safe branch creation
β βββ git-reset.md # Safe git reset with backup
β βββ git-status.md # Multi-repository status check
β βββ k8s-check.md # Safe Kubernetes resource inspection
β βββ k8s-diff.md # Kubernetes deployment diff preview
β βββ k8s-validate.md # Kubernetes manifest validation
β βββ plan.md # Project planning and task breakdown
β βββ pr.md # Pull request management (consolidated)
β βββ workspace-status.md # Multi-repository workspace overview
βββ hooks/ # Safety hooks (5 hooks)
β βββ block-dangerous-kubectl.sh # Block dangerous kubectl commands
β βββ block-git-push-main.sh # Block direct pushes to main/master
β βββ block-git-reset-hard.sh # Block destructive git reset
β βββ check-branch-protection.sh # Warn about edits on main/master
β βββ suggest-safe-commands.sh # Suggest safe command alternatives
βββ rules/ # Development rules (4 rule files)
β βββ safety.md # Safety rules and protections
β βββ quality.md # Code quality standards
β βββ workflow.md # Development workflow rules
β βββ integration.md # Linear/GitHub/MCP integration rules
βββ docs/ # Detailed documentation
βββ examples/ # Usage examples and templates
βββ backups/ # Backup of original rules
βββ .cursor/plans/ # Migration plans and documentation
βββ .gitignore # Git ignore rules for Cursor files
βββ CHANGELOG.md # Recent changes and updates
βββ README.md # This file
NOTE: The .cursor/rules folder is not loaded automatically by Cursor.
To load the .cursor/rules, you need to manually add it to the Cursor settings.
Cursor Settings -> Rules & Memories -> User Rules -> Click on "+ Add Rule"
# Clone this repository to your home directory
git clone https://github.com/gullitmiranda/.cursor
# Navigate to your project directory
cd .cursor
# make a backup of the existing .cursor directory
mv ~/.cursor ~/.cursor.backup
# Create symbolic link to .cursor
ln -s $PWD/.cursor ~/.cursor- Open Cursor in your project directory
- The settings will be automatically detected from the
.cursor/folder - Customize the commands and rules as needed for your project
# In Cursor chat, try these commands:
# Git workflow
/git-branch feature/user-auth # Create feature branch
/git-status # Check repository status
/commit # Smart commit with conventional format
/commit --all # Stage and commit all changes
/commit --main # Emergency fix to main branch
/pr # Create pull request
# Kubernetes operations
/k8s-check pods # Safe resource inspection
/k8s-validate deployment.yaml # Validate manifests
/k8s-diff deployment.yaml # Preview changes
# Planning and workspace
/plan "Add authentication" # Create project plan
/workspace-status # Check multi-repo workspace| Command | Description | Usage |
|---|---|---|
/commit |
Smart git commit with auto-branch creation | /commit, /commit --all, /commit --main |
/git-branch |
Safe branch creation with naming conventions | /git-branch feature/auth |
/git-reset |
Safe git reset with automatic backup | /git-reset --soft HEAD~1 |
/git-status |
Multi-repository status check | /git-status |
| Command | Description | Usage |
|---|---|---|
/pr |
Create pull request with auto-detection | /pr or /pr "custom title" |
/pr check |
Validate PR quality and completeness | /pr check |
/pr validate |
Alternative to /pr check |
/pr validate |
/pr review |
Alternative to /pr check |
/pr review |
/pr ready |
Mark PR ready for review | /pr ready |
| Command | Description | Usage |
|---|---|---|
/k8s-check |
Safe Kubernetes resource inspection | /k8s-check pods |
/k8s-validate |
Kubernetes manifest validation | /k8s-validate deployment.yaml |
/k8s-diff |
Kubernetes deployment diff preview | /k8s-diff deployment.yaml |
| Command | Description | Usage |
|---|---|---|
/plan |
Create project plan with task breakdown | /plan "Add auth system" |
/workspace-status |
Multi-repository workspace overview | /workspace-status |
This repository includes 5 safety hooks that automatically protect against dangerous operations:
| Hook | Event | Protection |
|---|---|---|
block-dangerous-kubectl.sh |
beforeShellExecution |
Blocks kubectl delete and kubectl apply |
block-git-push-main.sh |
beforeShellExecution |
Blocks direct pushes to main/master branches |
block-git-reset-hard.sh |
beforeShellExecution |
Blocks destructive git reset --hard |
check-branch-protection.sh |
afterFileEdit |
Warns about edits on main/master branches |
suggest-safe-commands.sh |
beforeSubmitPrompt |
Suggests safe alternatives for dangerous commands |
The repository includes 4 comprehensive rule files:
rules/safety.md- Git safety, command safety, and data safety rulesrules/quality.md- Code quality, quality gates, and documentation standardsrules/workflow.md- Language, terminal, workspace, and branch management rulesrules/integration.md- Linear, GitHub, and MCP integration guidelines
- Create a new
.mdfile in thecommands/directory - Follow the existing command format with proper sections:
<task>- Command description<context>- Rules and constraints<workflow>- Step-by-step process<safety_checks>- Safety validations<example_usage>- Usage examples
For more details on Cursor agent capabilities, see:
- Edit the relevant
.mdfile incommands/ - Test your changes in a development environment
- Update documentation if needed
- Commit changes with conventional commit format
Create a .cursor/rules.md file in your project to add project-specific rules that complement the base commands.
- Commands Documentation - Detailed command reference
- Rules Documentation - Rules and guidelines
- Hooks Documentation - Safety hooks and automation
- Examples - Usage examples and templates
- Changelog - Recent changes and updates
- Contributing - How to contribute to this repository
Excludes Cursor-specific files that shouldn't be shared:
- Local extensions
- Interpreter notebooks
- IDE state files
- Personal configuration files
Each command is defined in a separate .md file with structured sections for:
- Task definition
- Context and rules
- Workflow steps
- Safety checks
- Usage examples
- Conventional Commits: Automatic detection and formatting
- Branch Safety: Prevents commits to main/master
- Linear Integration: Auto-linking with Linear issues
- Quality Gates: Pre-commit validation
- Auto-Detection: Analyzes changes to generate PR titles
- Quality Checks: Runs tests, linting, and build validation
- Template Support: Uses GitHub PR templates
- Reviewer Assignment: Smart reviewer suggestions
- Destructive Operation Prevention: Blocks dangerous git operations
- Validation Gates: Multiple quality checkpoints
- Backup Creation: Automatic backups before risky operations
- Clear Feedback: Detailed status reports
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes
- Test thoroughly
- Commit with conventional format:
feat: add new command - Create a pull request
- Cursor Agent Overview
- Cursor Rules Documentation
- Cursor Commands Documentation
- Cursor Agent Hooks
- Conventional Commits
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter issues or have questions:
- Check the documentation
- Look at examples
- Search existing issues
- Create a new issue with detailed information
Happy Coding! π