Python dev

From doccker/cc-use-exp · View interactive version

Python dev is an AI agent skill from the GitHub repository doccker/cc-use-exp. Python 开发规范,包含 PEP 8 风格、类型注解、异步编程、性能优化等。当操作 .py, pyproject.toml, requirements.txt 文件时自动激活。

How to use this skill

Skill file

<instructions>

Python 开发规范

参考来源: PEP 8、Google Python Style Guide


🛠️ 工具链与格式化


命名约定

| 类型 | 规则 | 示例 |

|------|------|------|

| 模块/包 | 小写下划线 | user_service.py |

| 类名 | 大驼峰 | UserService |

| 函数/变量 | 小写下划线 | get_user_by_id |

| 私有方法 | 单下划线前缀 | _internal_logic |


🐍 Pythonic 特色


异步编程原则


异常处理

# ✅ 捕获具体异常并记录堆栈
try:
    user = repository.find(id)
except DatabaseError as e:
    logger.error("Failed to find user %s", id, exc_info=True)
    raise ServiceError(f"DB error: {e}") from e

📋 本回复遵循:python-dev - [章节]

</instructions>

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.