Skip to content

gullitmiranda/.cursor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

My ~/.cursor settings

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.

πŸ“ Repository Structure

.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"

πŸš€ Quick Start

1. Clone and Setup

# 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

2. Configure Cursor

  1. Open Cursor in your project directory
  2. The settings will be automatically detected from the .cursor/ folder
  3. Customize the commands and rules as needed for your project

3. Start Using Commands

# 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

πŸ“‹ Available Commands

Git Commands

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

Pull Request Commands

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

Kubernetes Commands

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

Planning Commands

Command Description Usage
/plan Create project plan with task breakdown /plan "Add auth system"
/workspace-status Multi-repository workspace overview /workspace-status

πŸ›‘οΈ Safety Hooks

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

πŸ“‹ Development Rules

The repository includes 4 comprehensive rule files:

  • rules/safety.md - Git safety, command safety, and data safety rules
  • rules/quality.md - Code quality, quality gates, and documentation standards
  • rules/workflow.md - Language, terminal, workspace, and branch management rules
  • rules/integration.md - Linear, GitHub, and MCP integration guidelines

πŸ› οΈ Customization

Adding New Commands

  1. Create a new .md file in the commands/ directory
  2. 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:

Modifying Existing Commands

  1. Edit the relevant .md file in commands/
  2. Test your changes in a development environment
  3. Update documentation if needed
  4. Commit changes with conventional commit format

Project-Specific Rules

Create a .cursor/rules.md file in your project to add project-specific rules that complement the base commands.

πŸ“š Documentation

πŸ”§ Configuration Files

.gitignore

Excludes Cursor-specific files that shouldn't be shared:

  • Local extensions
  • Interpreter notebooks
  • IDE state files
  • Personal configuration files

Command 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

🎯 Features

Smart Git Integration

  • 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

Pull Request Automation

  • 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

Safety First

  • Destructive Operation Prevention: Blocks dangerous git operations
  • Validation Gates: Multiple quality checkpoints
  • Backup Creation: Automatic backups before risky operations
  • Clear Feedback: Detailed status reports

🀝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Development Workflow

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature
  3. Make your changes
  4. Test thoroughly
  5. Commit with conventional format: feat: add new command
  6. Create a pull request

πŸ“– References

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

If you encounter issues or have questions:

  1. Check the documentation
  2. Look at examples
  3. Search existing issues
  4. Create a new issue with detailed information

Happy Coding! πŸš€

About

My ~/.cursor/ configuration

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages