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.
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.
- AI Context: Cursor's AI reads these rules before processing any development request
- Decision Framework: Rules provide a framework for making architectural and coding decisions
- Consistency: Ensures all AI-generated code follows the same standards and patterns
- Best Practices: Embeds years of development experience into automated workflows
- Project Alignment: Keeps all development activities aligned with project goals and standards
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.
This rule set consists of six interconnected files, each covering specific aspects of Docker-based development:
| 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 |
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)
- 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
- 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
- Mandatory documentation updates with every code change
- Pre-deployment validation with security scanning
- Automated testing in containerized environments
- Performance optimization for resource-constrained containers
- Secret management with external systems integration
- Least privilege container execution
- Network segmentation and policy enforcement
- Vulnerability scanning integrated into CI/CD pipelines
Place all .mdc files in your project's .cursor-rules directory or reference them in your Cursor IDE configuration.
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
The AI will guide you through:
Code Change β Documentation Update β Testing β Version Control β Deployment
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)
- Development: Hot reloading, debug ports, verbose logging
- Staging: Production parity, full testing, security scanning
- Production: High availability, resource limits, comprehensive monitoring
- Development: Local files or dummy values
- Staging: Staging-specific secrets with limited scope
- Production: Enterprise secret management (Vault, AWS Secrets Manager)
- Default values in code
- Configuration files
- Environment variables
- Secret management systems
- Runtime overrides
- 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
- 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
- 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
- Docker Architecture (02): Multi-stage build, health checks, resource limits
- Documentation (05): Service architecture, API documentation, deployment guide
- Deployment Standards (06): Security scanning, testing pipeline, rollback procedures
- Coding Standards (01): Error handling, logging, performance considerations
- Coding Standards (01): Code quality, security, testing
- Documentation (05): Update relevant documentation
- Version Control (03): Conventional commits, semantic versioning
- Docker Considerations (02): Container compatibility, service communication
- Deployment Standards (06): Pre-deployment validation, health checks, monitoring
- Docker Architecture (02): Container orchestration, networking, security
- Documentation (05): Deployment procedures, rollback plans
- Environment Management (04): Configuration validation, secret management
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
To improve these rules:
- Identify Gaps: Areas where current rules don't provide sufficient guidance
- Propose Changes: Updates that improve consistency or effectiveness
- Test Changes: Validate that rule changes improve development outcomes
- Document Updates: Ensure all changes are properly documented
- 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
- Docker Best Practices
- Conventional Commits
- Semantic Versioning
- 12-Factor App Methodology
- Container Security Best Practices
Built for modern, container-first development workflows. Designed to scale from startup to enterprise.