Note: This README was generated by AI to provide an overview of the Cursor rules and commands in this repository.
This repository contains examples of Cursor rules and commands actively used by the Green Project product team. These examples demonstrate best practices for creating AI-optimized development workflows using Cursor's rule system.
Cursor rules and commands enable teams to codify their development standards, coding patterns, and workflows in a way that AI assistants can understand and apply consistently. This collection showcases real-world implementations that have proven effective in production environments.
.cursor/
├── rules/ # Cursor rules for automated guidance
│ ├── cursor-rule-format.mdc
│ ├── react-general-rules.mdc
│ ├── typescript-rules.mdc
│ └── use-cursor-rules-not-memories.mdc
└── commands/ # Cursor commands for complex workflows
├── create-component.md
└── pre-pr-checks.md
Purpose: Establishes standards for creating consistent, AI-optimized rule documentation.
Key Features:
- Defines the 4 types of Cursor rules (Always, File-Specific, Agent Requested, Manual)
- Provides templates and examples for proper rule structure
- Optimizes for AI context efficiency with token-conscious formatting
- Includes comprehensive glob pattern examples
When Applied: Used when creating or modifying other Cursor rules to ensure consistency.
Purpose: Enforces the principle of using Cursor rules instead of AI memories for persistent guidance.
Key Features:
- Always applied (
alwaysApply: true) to ensure consistent behavior - Prevents creation of AI memories in favor of discoverable, maintainable rules
- Establishes clear guidelines for when to use rules vs. TODO functionality
- Promotes team-wide visibility of coding standards
When Applied: Always active to guide AI behavior throughout all sessions.
Purpose: Enforces TypeScript coding standards for maintainable, consistent code.
Key Features:
- Eliminates repetitive patterns through configuration-driven approaches
- Prefers named exports over default exports for better IDE support
- Promotes direct imports over barrel files to improve tree-shaking
- Establishes one-way import flow for types to prevent circular dependencies
- Includes refactoring best practices and testing guidelines
When Applied: Automatically applied to all .ts and .tsx files.
Purpose: Maintains clean React architecture and separation of concerns.
Key Features:
- Guidelines for when to extract vs. inline components
- Complex prop logic extraction patterns
- Pre-computation of data before JSX rendering
- Auto-animate integration best practices
- Semantic HTML usage standards
When Applied: Automatically applied to all .tsx files.
Purpose: Streamlines creation of new React components in the design system with proper structure and tooling integration.
Key Features:
- Generates complete component structure with TypeScript, SCSS, Storybook, and tests
- Integrates with Figma MCP for design-driven development
- Enforces design system standards and naming conventions
- Includes comprehensive Storybook documentation requirements
- Handles proper export patterns and dependency management
Usage: @create-component ComponentName [category] [figmaUrl]
Benefits:
- Reduces component creation time from 30+ minutes to 2-3 minutes
- Ensures consistency across all design system components
- Eliminates boilerplate setup errors
- Integrates design specifications directly into implementation
Purpose: Executes systematic code review process before pull request creation to ensure production readiness.
Key Features:
- Batched rule loading strategy for optimal context management
- Domain-specific rule application (Frontend, Backend, Testing, etc.)
- Automated compliance checking and fixing
- Branch size analysis with splitting recommendations
- Cross-batch consistency validation
Usage: Run before creating any pull request to validate code against all applicable rules.
Benefits:
- Reduces PR review cycles by catching issues early
- Ensures consistent application of all coding standards
- Provides actionable feedback for manual improvements
- Optimizes AI context usage with 60-70% reduction vs. loading all rules simultaneously
These rules are always loaded in the AI's context and apply to all interactions:
use-cursor-rules-not-memories.mdc- Ensures consistent behavior patterns
These rules are automatically applied when working with matching file types:
typescript-rules.mdc- Applied to.tsand.tsxfilesreact-general-rules.mdc- Applied to.tsxfiles
These rules are available for the AI to request when relevant:
cursor-rule-format.mdc- Loaded when creating or modifying rules
- Consistency: All team members follow the same standards automatically
- Onboarding: New developers learn patterns through AI guidance
- Knowledge Retention: Standards persist beyond individual team members
- Discoverability: Rules are visible and searchable in the codebase
- Context Efficiency: Rules are loaded only when relevant
- Deterministic Behavior: Clear, actionable instructions reduce ambiguity
- Scalability: New rules can be added without affecting existing workflows
- Maintainability: Rules can be updated centrally and apply immediately
- Automated Enforcement: Standards are applied consistently without manual oversight
- Reduced Review Time: Common issues are caught and fixed automatically
- Pattern Consistency: Similar problems are solved in similar ways across the codebase
- Documentation: Rules serve as living documentation of team decisions
For comprehensive documentation on Cursor's rule and command systems:
- Cursor Rules Documentation - Official guide to creating and using Cursor rules
- Cursor Commands Documentation - Official guide to creating and using Cursor commands
- Copy relevant rules to your project's
.cursor/rules/directory - Adapt glob patterns to match your project structure
- Customize standards to reflect your team's preferences
- Test with AI assistant to ensure rules are applied correctly
- Iterate and refine based on team feedback
- Start small: Begin with 2-3 core rules and expand gradually
- Be specific: Provide concrete examples and counter-examples
- Optimize for AI: Use clear, deterministic language in rule descriptions
- Regular review: Update rules as team practices evolve
- Team alignment: Ensure all team members understand and agree with the rules
This project is licensed under the MIT License - see the LICENSE file for details.
Green Project - Demonstrating practical AI-assisted development workflows through real-world examples.