python-github-setup-cursorrules-prompt-file — правило для Cursor
Задаёт Cursor единый стиль Python-кода, тесты, ревью через GitHub Pull Requests и CI на GitHub Actions. Пригодится, когда в команде нет общего свода правил.
.cursor/rules/python-github-setup-cursorrules-prompt-file.mdcЧто делает python-github-setup-cursorrules-prompt-file
Правило описывает, как Cursor должен писать и проверять Python-код в вашем проекте. Внутри — набор требований: отступ в 4 пробела, длина строки до 120 знаков, обязательные комментарии и докстринги в стиле Google Python Style Guide. Имена переменных и функций — snake_case, классов — PascalCase.
Отдельно прописаны процессы. Тесты обязательны, целевое покрытие — 80%, типы — unit и integration, фреймворк pytest. Ревью идёт через GitHub Pull Requests, ветвление — GitHub Flow, сообщения коммитов — Conventional Commits. Форматирование на Black, линтинг на Pylint по PEP 8. CI настроен на GitHub Actions с конфигом .github/workflows/main.yml.
Есть и привязка к конкретному проекту: правило описывает Python-инструмент для организации файлов с анализом содержимого через ИИ. Среди библиотек названы watchdog, spacy, PyPDF2, python-docx, pandas, transformers, torch и scikit-learn. Если ваш проект устроен иначе, эти пункты придётся переписать — иначе Cursor будет тянуть чужие зависимости в подсказки. Секреты хранятся в переменных окружения, конфиг — в .env через python-dotenv.
Какие задачи решает
- задать единый стиль Python-кода для всей команды
- прописать обязательные тесты и целевое покрытие
- настроить ревью через GitHub Pull Requests
- зафиксировать формат коммитов и стратегию ветвления
- описать работу с секретами через переменные окружения
Примеры запросов агенту
- Добавь новый модуль для классификации документов по правилам проекта
- Проверь этот файл на соответствие PEP 8 и нашим правилам именования
- Настрой GitHub Actions workflow по нашему конфигу
Как установить python-github-setup-cursorrules-prompt-file
Вручную: положить файлы
.cursor/rules/python-github-setup-cursorrules-prompt-file.mdcВо frontmatter: description, globs, alwaysApply
Вручную: положить файлы
.claude/rules/python-github-setup-cursorrules-prompt-file.mdПоле paths во frontmatter ограничивает файлы: globs из источника → paths
AGENTS.md
Codex читает AGENTS.md: вставьте текст правила туда
Вручную: положить файлы
.github/instructions/python-github-setup-cursorrules-prompt-file.instructions.mdПоле applyTo задаёт, к каким файлам применять: globs из источника → applyTo
Вручную: положить файлы
.devin/rules/python-github-setup-cursorrules-prompt-file.mdВручную: положить файлы
.clinerules/python-github-setup-cursorrules-prompt-file.mdПо шагам, с командами для каждой платформы: Cursor rules: файлы .mdc, четыре режима и замена .cursorrules
Из того же набора68
Похожие
Рядом в теме «Языки программирования»
Все правила IDE по теме «Языки программирования» →Вопросы о python-github-setup-cursorrules-prompt-file
Как установить python-github-setup-cursorrules-prompt-file в Cursor?
Создайте файл .cursor/rules/python-github-setup-cursorrules-prompt-file.mdc в корне проекта и вставьте в него содержимое правила.
Что делает это правило?
Описывает стандарты Python-разработки для Cursor: стиль кода, именование, тесты, ревью, CI и работу с секретами.
Какие инструменты предполагает правило?
Black для форматирования, Pylint для линтинга, pytest для тестов, GitHub Actions для CI и python-dotenv для конфигурации.
Исходный текст
python-github-setup-cursorrules-prompt-file.mdc · CC0-1.0
---
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"
}
}
© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules