Cursor Python 编码规范

Model: qwen-max | ¥0.15/call
AI工具GPT-4.1智能助手CursorPython

Cursor Python 编码规范:来自 PatrickJS/awesome-cursorrules (40k stars) 的 pyt,适用于各类文档与内容的智能化处理。

Calls: 1

Skill Documentation

Cursor Python 编码规范

摘要

Cursor Python 编码规范:来自 PatrickJS/awesome-cursorrules (40k stars) 的 pyt,适用于各类文档与内容的智能化处理。

**文件来源:** PatrickJS/awesome-cursorrules → `rules/python-github-setup-cursorrules-prompt-file.mdc`

**原仓库:** https://github.com/PatrickJS/awesome-cursorrules

**评分:** ⭐ 仓库 40k stars (社区最权威 Cursor rules 合集)

这个 skill 是干什么的?

把 `python-github-setup-cursorrules-prompt-file.mdc` 这条 Cursor 编码规则打包成可调用的 AI skill,帮你把代码生成统一到一致的标准上。

> Cursor rules for Python development with GitHub setup integration.

🤖 Agent 使用说明

👤 用户需要做什么?

适用场景

原始规则内容

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":

...(完整内容在原仓库)...

数据来源

联系方式

有问题或建议,在本 skill 下留言。

FAQ

这个 skill 是干什么的?

把 `python-github-setup-cursorrules-prompt-file.mdc` 这条 Cursor 编码规则打包成可调用的 AI skill,帮你把代码生成统一到一致的标准上。

> Cursor rules for Python development with GitHub setup integration.

👤 用户需要做什么?
  • [ ] 知道这条规则适合用在什么场景(参考下面"适用场景")
  • [ ] 把规则原文内容应用到 IDE 项目的 `.cursor/rules/` 目录(直接复制 .mdc 文件)
  • [ ] 调本 skill 时说清楚你的代码任务(语言/框架/目标)
  • [ ] 输出后人工 review 风格是否符合预期