Skip to content

shall-boomstick/CursorRules

Repository files navigation

Cursor Rules for Docker-Based Development

A comprehensive set of AI-driven development rules designed to guide Cursor IDE's AI assistant in following modern Docker containerization best practices and enterprise-grade development standards.

🎯 What Are Cursor Rules?

Cursor Rules are structured guidelines that instruct Cursor IDE's AI assistant on how to approach coding tasks, architectural decisions, and development workflows. They act as a "constitution" for AI-assisted development, ensuring consistent, high-quality output that follows industry best practices.

How Cursor Rules Work

  1. AI Context: Cursor's AI reads these rules before processing any development request
  2. Decision Framework: Rules provide a framework for making architectural and coding decisions
  3. Consistency: Ensures all AI-generated code follows the same standards and patterns
  4. Best Practices: Embeds years of development experience into automated workflows
  5. Project Alignment: Keeps all development activities aligned with project goals and standards

🐳 Why Docker-Focused Rules?

Modern software development increasingly relies on containerization for:

  • Environment Consistency: Identical development, staging, and production environments
  • Scalability: Easy horizontal scaling of microservices
  • Deployment Reliability: Reproducible deployments across any infrastructure
  • Development Efficiency: Isolated, reproducible development environments
  • Cloud Readiness: Seamless deployment to any cloud platform

These rules ensure that all AI-assisted development follows container-first principles from day one.

πŸ“ Rule Structure

This rule set consists of six interconnected files, each covering specific aspects of Docker-based development:

Core Rule Files

File Purpose When Applied
00-rules-overview.mdc Master index and rule priority guide Every development session
01-coding-standards.mdc Code quality and development workflow standards All coding tasks
02-docker-architecture.mdc Container architecture and orchestration patterns Container/service work
03-version-control-git.mdc Git workflow and semantic release management Version control operations
04-environment-application.mdc Configuration and environment management Environment setup/config
05-documentation-requirements.mdc Mandatory documentation standards After every change
06-deployment-standards.mdc Production deployment procedures All deployments

Rule Priority System

High Priority (Always Applied)
β”œβ”€β”€ 06-deployment-standards.mdc (Safety first)
β”œβ”€β”€ 05-documentation-requirements.mdc (Mandatory updates)
β”œβ”€β”€ 02-docker-architecture.mdc (Container-first development)
└── 01-coding-standards.mdc (Code quality)

Medium Priority (Context-Dependent)
β”œβ”€β”€ 03-version-control-git.mdc (Version management)
└── 04-environment-application.mdc (Configuration management)

πŸš€ Key Features

Container-First Development

  • Multi-stage Docker builds for optimized production images
  • Service mesh ready microservice patterns
  • Internal networking with proper service discovery
  • Security hardening with non-root containers and vulnerability scanning

Modern DevOps Practices

  • Semantic versioning with automated container tagging
  • Conventional commits with Docker-specific scoping
  • Zero-downtime deployments with health checks and rollback procedures
  • Environment parity across development, staging, and production

Quality Assurance

  • Mandatory documentation updates with every code change
  • Pre-deployment validation with security scanning
  • Automated testing in containerized environments
  • Performance optimization for resource-constrained containers

Enterprise-Grade Security

  • Secret management with external systems integration
  • Least privilege container execution
  • Network segmentation and policy enforcement
  • Vulnerability scanning integrated into CI/CD pipelines

πŸ’‘ How to Use These Rules

1. Installation

Place all .mdc files in your project's .cursor-rules directory or reference them in your Cursor IDE configuration.

2. AI Integration

Cursor's AI will automatically:

  • Read these rules before processing any request
  • Apply appropriate standards based on the task type
  • Ensure consistency across all generated code
  • Follow deployment and documentation requirements

3. Development Workflow

The AI will guide you through:

Code Change β†’ Documentation Update β†’ Testing β†’ Version Control β†’ Deployment

4. Task-Specific Guidance

For New Services:

  • Apply rules 02, 05, 06 (Docker architecture, documentation, deployment)
  • Secondary: 01, 04 (coding standards, environment setup)

For Code Changes:

  • Apply rules 01, 05 (coding standards, documentation)
  • Secondary: 03, 02 (version control, Docker considerations)

For Deployments:

  • Apply rules 06, 02 (deployment standards, Docker architecture)
  • Secondary: 05, 01, 04 (documentation, coding standards, environment)

πŸ”§ Configuration Management

Environment Separation

  • Development: Hot reloading, debug ports, verbose logging
  • Staging: Production parity, full testing, security scanning
  • Production: High availability, resource limits, comprehensive monitoring

Secret Management

  • Development: Local files or dummy values
  • Staging: Staging-specific secrets with limited scope
  • Production: Enterprise secret management (Vault, AWS Secrets Manager)

Configuration Hierarchy

  1. Default values in code
  2. Configuration files
  3. Environment variables
  4. Secret management systems
  5. Runtime overrides

πŸ“Š Benefits

For Development Teams

  • Consistency: All team members follow the same standards
  • Efficiency: Reduced decision fatigue and architectural debates
  • Quality: Built-in best practices prevent common mistakes
  • Scalability: Patterns that scale from prototype to enterprise

For Projects

  • Reliability: Proven deployment and architecture patterns
  • Security: Security-first approach embedded in all decisions
  • Maintainability: Well-documented, standardized code
  • Cloud-Ready: Built for modern cloud-native deployments

For Organizations

  • Standards Compliance: Consistent application of enterprise standards
  • Risk Reduction: Proven patterns reduce deployment failures
  • Talent Mobility: Developers can work across projects with consistent patterns
  • Audit Trail: Comprehensive documentation and version control

🎯 Rule Application Examples

When Creating a New Microservice

  1. Docker Architecture (02): Multi-stage build, health checks, resource limits
  2. Documentation (05): Service architecture, API documentation, deployment guide
  3. Deployment Standards (06): Security scanning, testing pipeline, rollback procedures
  4. Coding Standards (01): Error handling, logging, performance considerations

When Making Code Changes

  1. Coding Standards (01): Code quality, security, testing
  2. Documentation (05): Update relevant documentation
  3. Version Control (03): Conventional commits, semantic versioning
  4. Docker Considerations (02): Container compatibility, service communication

When Deploying to Production

  1. Deployment Standards (06): Pre-deployment validation, health checks, monitoring
  2. Docker Architecture (02): Container orchestration, networking, security
  3. Documentation (05): Deployment procedures, rollback plans
  4. Environment Management (04): Configuration validation, secret management

πŸ”„ Continuous Improvement

These rules are designed to evolve with:

  • Technology Changes: Updates for new Docker features and best practices
  • Team Learning: Incorporation of lessons learned from real deployments
  • Industry Standards: Adaptation to emerging containerization patterns
  • Security Requirements: Updates for new security threats and mitigations

πŸ“ Contributing

To improve these rules:

  1. Identify Gaps: Areas where current rules don't provide sufficient guidance
  2. Propose Changes: Updates that improve consistency or effectiveness
  3. Test Changes: Validate that rule changes improve development outcomes
  4. Document Updates: Ensure all changes are properly documented

🏷️ Version Information

  • Current Version: 2.0.0
  • Breaking Changes: Transformation from project-specific to generic Docker-focused rules
  • Compatibility: Designed for modern containerization platforms (Docker, Kubernetes, etc.)
  • Last Updated: 2025-01-25

πŸ“š Additional Resources


Built for modern, container-first development workflows. Designed to scale from startup to enterprise.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors