PluginBench
Rule

python projects guide

via PatrickJS/awesome-cursorrules

Structured Python development guide emphasizing modular design, testing, and AI-friendly coding practices.

What is python projects guide?

This rule guides Python development with emphasis on clear project structure, modular design, comprehensive testing with pytest, and AI-friendly coding practices. Use it when setting up new Python projects or refactoring existing ones to follow best practices.

  • Enforces modular project structure with separate directories for source, tests, docs, and config
  • Promotes type hints, descriptive naming, and detailed comments for AI-assisted development
  • Recommends pytest for testing and Ruff for code style consistency
  • Guides configuration management via environment variables and dependency management with Rye
  • Emphasizes robust error handling, logging with context capture, and comprehensive docstrings
  • Supports CI/CD setup with GitHub Actions or GitLab CI

Applies to

File patterns this rule matches.

**/*
Rule definition (reference)

Source of truth, from the repository.

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 debugging

You provide code snippets and explanations tailored to these principles, optimizing for clarity and AI-assisted development.

Related rules

PyTorch and scikit-learn for chemistry ML with best practices for molecular data.

**/*
41k
via PatrickJS/awesome-cursorrules

Standardized QA bug report template with reproduction steps and environmental context.

**/*
41k
via PatrickJS/awesome-cursorrules

TypeScript and Vite setup guide for Qwik functional component development.

**/*
41k
via PatrickJS/awesome-cursorrules

Qwik development with Tailwind CSS, TypeScript, and Vite integration.

**/*
41k
via PatrickJS/awesome-cursorrules

R development best practices guide covering project structure, coding style, testing, and package development.

**/*
41k
via PatrickJS/awesome-cursorrules

Rails 8 development conventions and best practices for generators, architecture, and tooling.

**/*
41k
via PatrickJS/awesome-cursorrules