Skip to content

Python Projects Guide .cursorrules prompt file

Author: bossjones

What you can build

AI-Powered Python Project Boilerplate Generator: A web-based tool that generates a complete Python project structure adhering to best practices. Users can specify project details, and the tool outputs a zip file with directories for source code, tests, docs, and config, with pre-generated boilerplate code including models, services, controllers, utilities, and configuration files.Python Code Quality Dashboard: An app that integrates Ruff for style checks, pytest for testing, and includes CI/CD visualization. It provides insights into the health of a Python project by analyzing code structure, style, and testing results through a user-friendly dashboard interface.Automatic Environment Configuration Manager: A service for managing and deploying environment variables for Python applications. Users can securely store, update, and access environment configurations, which are automatically integrated into their development and CI/CD workflows.AI-Assisted Documentation Generator: A tool that automatically generates detailed documentation from Python code. It uses docstrings and AI to create comprehensive README files and rich documentation with clear explanations and examples suitable for both developers and AI models.Python Error Handling and Logging Framework: A library that provides robust error handling utilities, capturing context and enabling detailed logging. It can be integrated into any project to enhance error management and debugging capabilities, making it easier to trace issues across modules.Virtual Environment Dependency Visualizer: A web app that visualizes dependency trees of Python projects managed with Rye and virtual environments. It allows developers to understand dependencies and potential conflicts visually, aiding in more effective dependency management.CI/CD Template Repository: A GitHub repository template that includes pre-configured YAML files for GitHub Actions or GitLab CI. This service helps in setting up continuous integration and deployment pipelines with best practices out of the box.AI-Powered Code Review Assistant: An integration tool for GitHub or GitLab that uses AI to provide feedback on code quality, adherence to style guides, type hints, and descriptive naming conventions. It assists teams in maintaining high code standards and reduces the manual effort in code review processes.Comprehensive Logging and Error Monitoring Tool: A service similar to Sentry or LogRocket, but focused on Python applications. It offers real-time error tracking, context capture, and detailed insights into exceptions, with recommendations on how to resolve them.Python Modular Design Template Library: A collection of ready-made templates for common modular design patterns in Python, including MVC architecture, utilities organization, and more. It serves as a quick-start library for developers looking to implement robust project structures.

Benefits

Synopsis

Developers can use this prompt to build well-structured, maintainable Python applications with robust CI/CD, testing, and AI-friendly coding practices.

Overview of .cursorrules prompt

The .cursorrules file defines the behavior of an AI assistant that specializes in Python development. It is designed to guide developers in organizing projects with a clear structure by using separate directories for source code, tests, documentation, and configurations. It promotes modular design through distinct files for various components like models and services, and emphasizes configuration management via environment variables. The assistant advocates for strong error handling, comprehensive testing with pytest, and thorough documentation. It encourages dependency management using rye and virtual environments, while ensuring code style consistency with Ruff. Additionally, it supports CI/CD implementation using GitHub Actions or GitLab CI. The assistant aims to provide AI-friendly coding practices with descriptive names, type hints, detailed comments, and rich error context. Code snippets and explanations are tailored to these principles, optimizing for clarity and leveraging AI for development tasks.

.cursorrules Content

json
You are an AI assistant specialized in Python development. Your approach emphasizes:1. Clear project structure with separate directories for source code, tests, docs, and config.2. Modular design with distinct files for models, services, controllers, and utilities.3. Configuration management using environment variables.4. Robust error handling and logging, including context capture.5. Comprehensive testing with pytest.6. Detailed documentation using docstrings and README files.7. Dependency management via https://github.com/astral-sh/rye and virtual environments.8. Code style consistency using Ruff.9. CI/CD implementation with GitHub Actions or GitLab CI.10. AI-friendly coding practices:  - Descriptive variable and function names  - Type hints  - Detailed comments for complex logic  - Rich error context for debuggingYou provide code snippets and explanations tailored to these principles, optimizing for clarity and AI-assisted development.

Released under the MIT License.