Python and GitHub Coding Standards

Python and GitHub Coding Standards

Defines Python coding standards as a JSON config: style, naming, error handling, tests, docs, security, GitHub review and how the assistant should respond.


description: "Cursor rules for Python development with GitHub setup integration."
globs: */
alwaysApply: false


{
"general": {
"coding_style": {
"language": "Python",
"use_strict": true,
"indentation": "4 spaces",
"max_line_length": 120,
"comments": {
"style": "# for single-line, ''' for multi-line",
"require_comments": true
}
},

"naming_conventions": {
"variables": "snake_case",
"functions": "snake_case",
"classes": "PascalCase",
"interfaces": "PascalCase",
"files": "snake_case"
},

"error_handling": {
"prefer_try_catch": true,
"log_errors": true
},

"testing": {
"require_tests": true,
"test_coverage": "80%",
"test_types": ["unit", "integration"]
},

"documentation": {
"require_docs": true,
"doc_tool": "docstrings",
"style_guide": "Google Python Style Guide"
},

"security": {
"require_https": true,
"sanitize_inputs": true,
"validate_inputs": true,
"use_env_vars": true
},

"configuration_management": {
"config_files": [".env"],
"env_management": "python-dotenv",
"secrets_management": "environment variables"
},

"code_review": {
"require_reviews": true,
"review_tool": "GitHub Pull Requests",
"review_criteria": ["functionality", "code quality", "security"]
},

"version_control": {
"system": "Git",
"branching_strategy": "GitHub Flow",
"commit_message_format": "Conventional Commits"
},

"logging": {
"logging_tool": "Python logging module",
"log_levels": ["debug", "info", "warn", "error"],
"log_retention_policy": "7 days"
},

"monitoring": {
"monitoring_tool": "Not specified",
"metrics": ["file processing time", "classification accuracy", "error rate"]
},

"dependency_management": {
"package_manager": "pip",
"versioning_strategy": "Semantic Versioning"
},

"accessibility": {
"standards": ["Not applicable"],
"testing_tools": ["Not applicable"]
},

"internationalization": {
"i18n_tool": "Not applicable",
"supported_languages": ["English"],
"default_language": "English"
},

"ci_cd": {
"ci_tool": "GitHub Actions",
"cd_tool": "Not specified",
"pipeline_configuration": ".github/workflows/main.yml"
},

"code_formatting": {
"formatter": "Black",
"linting_tool": "Pylint",
"rules": ["PEP 8", "project-specific rules"]
},

"architecture": {
"patterns": ["Modular design"],
"principles": ["Single Responsibility", "DRY"]
}
},

"project_specific": {
"use_framework": "None",
"styling": "Not applicable",
"testing_framework": "pytest",
"build_tool": "setuptools",

"deployment": {
"environment": "Local machine",
"automation": "Not specified",
"strategy": "Manual deployment"
},

"performance": {
"benchmarking_tool": "Not specified",
"performance_goals": {
"response_time": "< 5 seconds per file",
"throughput": "Not specified",
"error_rate": "< 1%"
}
}
},

"context": {
"codebase_overview": "Python-based file organization tool using AI for content analysis and classification",
"libraries": [
"watchdog", "spacy", "PyPDF2", "python-docx", "pandas", "beautifulsoup4",
"transformers", "scikit-learn", "joblib", "python-dotenv", "torch", "pytest",
"shutil", "logging", "pytest-mock"
],

"coding_practices": {
"modularity": true,
"DRY_principle": true,
"performance_optimization": true
}
},

"behavior": {
"verbosity": {
"level": 2,
"range": [0, 3]
},
"handle_incomplete_tasks": "Provide partial solution and explain limitations",
"ask_for_clarification": true,
"communication_tone": "Professional and concise"
}
}

Public domain (CC0 1.0) · by awesome-cursorrules contributors · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…