Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A comprehensive, open-source collection of rules and prompts designed to guide Cursor AI in generating better, more consistent code. Enhance code quality, enforce coding standards, and streamline development workflows automatically.

License

Notifications You must be signed in to change notification settings

thehimel/cursor-rules-and-prompts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

80 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฏ Cursor Rules & Prompts

๐Ÿ’ก Stop repeating yourself. Make Cursor AI follow your coding standards automatically.

License Maintained

A comprehensive collection of rules and prompts that transform Cursor from a helpful assistant into a team member who knows your codebase conventions. These rules enforce best practices, maintain code quality, and ensure consistencyโ€”without you having to explain the same things over and over.

๐Ÿ“– What This Is

Ever find yourself constantly reminding Cursor to "use @/ instead of relative paths" or "don't add inline styles"? This repository solves that. ๐Ÿคฏ

Instead of manually correcting the AI every time, these rules ensure it follows your standards automatically. Think of it as a coding style guide that the AI actually reads, understands, and applies consistently across your entire project.

๐Ÿ’ผ It's like having a senior developer review every AI-generated change before it hits your codebase.

Key Features

โœจ Automatic Enforcement - Rules apply automatically, no manual intervention needed
๐ŸŽฏ Project-Agnostic - Works with any tech stack, easily customizable
๐Ÿ“š Comprehensive - Covers code style, organization, documentation, and more
๐Ÿ”„ Maintainable - Well-organized, easy to understand and modify
๐Ÿš€ Time-Saving - Stop repeating the same instructions to AI

๐ŸŽ Why Use This

  • โœ… Consistency: Your codebase stays consistent even when multiple people (or AI) work on it
  • โšก Less Review Time: Fewer style issues means faster code reviews
  • ๐Ÿš€ Better Onboarding: New team members (and AI) understand your patterns immediately
  • ๐Ÿ›ก๏ธ Quality by Default: Best practices are enforced automatically, not by memory
  • โฑ๏ธ Time Savings: Stop explaining the same conventions repeatedly

๐Ÿ’ก Real-World Example

โŒ Before: You ask Cursor to create a component, and it generates:

import { Button } from '../../../components/ui/button';
import { MyType } from '../types';

โœ… After: With these rules, Cursor automatically generates:

import { Button } from '@/components/ui/button';
import { MyType } from '@/components/quiz/types';

๐ŸŽ‰ The AI knows your conventions and follows them without being told!

๐Ÿš€ Quick Start

Option 1: Manual Setup

  1. ๐Ÿ“ฅ Clone or copy this repository into your project
  2. ๐Ÿ“ Place the .cursor folder in your project root
  3. โœจ That's it - Cursor will automatically use these rules

Option 2: Automatic Sync (Recommended)

Use the sync script to automatically keep your .cursor directory updated across all your projects:

# Add alias to ~/.zshrc (or ~/.bashrc)
alias sync-cursor="~/PycharmProjects/cursor-rules-and-prompts/sync-cursor.sh"

# Reload shell configuration
source ~/.zshrc

# Run sync from any directory
sync-cursor

๐Ÿ“Œ Sync Script: sync-cursor.sh

โš ๏ธ Important: The script requires a .include file in each destination's .cursor/ directory to specify what to sync. See sync-cursor.md for detailed documentation.

The script will:

  • ๐Ÿ”„ Sync files from source to all destinations in ~/PycharmProjects/
  • ๐Ÿ†” Use ID-based matching to handle file renames and updates
  • ๐Ÿ“ Support path-based syncing via .include file
  • ๐Ÿ—‘๏ธ Automatically clean up orphaned files
  • ๐Ÿ“Š Show progress for each destination

๐Ÿ’ก Note: The old fetch-cursor-rules.sh script is deprecated. Use sync-cursor.sh instead. See sync-cursor.md for full documentation.

๐Ÿ’ฌ The rules are organized by category and apply automatically when you're working in Cursor. No configuration needed.

๐Ÿ“ฆ What's Included

This repository contains a growing collection of rules and prompts organized by category. The rules cover areas like:

  • ๐ŸŽจ Code Style: Import patterns, component structure, styling conventions
  • ๐Ÿ“‚ Organization: File structure, feature organization, code migration
  • ๐Ÿ“ Documentation: Writing standards, comment style, documentation patterns
  • ๐Ÿ—๏ธ Infrastructure: Route management, configuration patterns
  • ๐Ÿšซ Constraints: What to avoid, best practices
  • ๐Ÿ“š Dependencies: Library selection, component usage

๐Ÿ“ Rules are stored in .cursor/rules/ organized by category, and reusable prompts are in .cursor/prompts/. The collection continues to grow as new patterns and best practices are identified. ๐ŸŒฑ

๐Ÿ“‹ Rule Format

All rules follow a consistent format:

---
alwaysApply: true | false
description: Brief description of what the rule does
author: Himel Das
---

# Rule Title

## Section
- Rule content
- More rules

Rules are:

  • โœ‚๏ธ Concise and generic - work across projects
  • ๐ŸŒ Language independent - not tied to specific tech stacks
  • ๐ŸŽฏ Action-oriented - explain what to do, not just how
  • ๐Ÿ“ Well-organized - categorized for easy navigation

๐ŸŽฏ Use Cases

๐Ÿ‘ฅ For Teams

  • ๐ŸŽ“ Onboarding: New developers (and AI) understand your patterns immediately
  • ๐Ÿ” Code Reviews: Fewer style discussions, more focus on logic
  • ๐Ÿค Consistency: Multiple developers produce code that looks like one person wrote it

๐Ÿง‘โ€๐Ÿ’ป For Solo Developers

  • โญ Quality: Best practices enforced automatically
  • โšก Speed: Less time fixing style issues, more time building features
  • ๐Ÿ”ฎ Future-Proofing: When you add team members, they'll follow the same patterns

๐ŸŒ For Open Source Projects

  • ๐Ÿค Contributor Experience: Clear, consistent rules for everyone
  • ๐Ÿ”ง Maintainability: Easier to maintain when code follows patterns
  • ๐Ÿ“– Documentation: Rules serve as living documentation of your standards

๐Ÿ› ๏ธ Customization

These rules are designed to be:

  • ๐Ÿ”„ Generic enough to work in most projects
  • ๐ŸŽฏ Specific enough to be useful
  • โœ๏ธ Easy to modify for your needs

Feel free to:

  • โž• Add your own rules
  • โœ๏ธ Modify existing ones
  • โž– Remove rules that don't fit your project
  • ๐Ÿ“ Create new categories as needed

๐Ÿ“– See the rule creation guidelines in .cursor/rules/organization/rule-creation.mdc for details on creating new rules.

๐Ÿค Contributing

This is a proprietary project. For permissions or inquiries, please contact Himel Das.

๐Ÿ“„ License

PROPRIETARY LICENSE - All Rights Reserved

Copyright (c) 2025 Himel Das

This software is proprietary and confidential. You are NOT permitted to:

  • โŒ Share, distribute, or publish this software
  • โŒ Modify or create derivative works
  • โŒ Use this software for commercial purposes

If you are granted explicit permission to share, you must provide attribution to Himel Das.

See LICENSE file for full terms and conditions.

๐Ÿ‘ค Author

Himel Das

Created to help developers leverage Cursor AI more effectively and maintain high code quality standards.


๐ŸŽฌ Getting Started Today

  1. ๐Ÿด Fork or clone this repository
  2. ๐Ÿ“ Copy the .cursor folder to your project root
  3. ๐Ÿ’ป Start coding - the rules work automatically

โœจ No setup, no configuration, no hassle. Just better code, automatically.

โš ๏ธ Note: These rules work with Cursor's AI features. Make sure you have Cursor installed and the .cursor folder in your project root for them to take effect.


Made with โค๏ธ for the developer community

If this helps you write better code, consider giving it a โญ and sharing it with your team!

โฌ† Back to Top

About

A comprehensive, open-source collection of rules and prompts designed to guide Cursor AI in generating better, more consistent code. Enhance code quality, enforce coding standards, and streamline development workflows automatically.

Topics

Resources

License

Stars

Watchers

Forks