據 AlphaMoat 統計,截至 2026-10,Python Coding Guidelines 累計下載 33,442 次、獲 21 個星標,按累計下載量在本次參與排名的 10,914 個 AI 技能中排名第 806 位,在「開發程式設計」分類(1,069 個)中排名第 51 位。
列表預設按累計下載量排序,也可按星標排序;詳情頁排名按累計下載量計算。
| 平台 | 累計下載 | 星標 | 評論 |
|---|---|---|---|
| ClawHub ↗ | 1.5萬 | 14 | - |
| SkillHub ↗ | 3.3萬 | 21 | — |
各平台的計數口徑不同,統計時間不一致。
在編寫、評審和重構 Python 程式碼時套用 PEP 8 風格與慣用寫法,給出縮排、行長、命名與空行規則,並用 py_compile 做語法校驗、執行單元測試,有 uv 時用它管理依賴。它只適用於仍受支援的 Python 版本,明確禁止 Python 2 語法。
資料釋出於 2026-10-27
以下是根據技能文件生成的示例,不代表實際執行結果。
2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。
| 月份 | 累計下載 | 環比 | 星標 |
|---|---|---|---|
| 2026-10 | 3.3萬 | — | 21 |
| 2026-09 | 2.1萬 | — | 22 |
| 2026-08 | 1.8萬 | +36.0% | 22 |
| 2026-07 | 1.3萬 | -13.2% | 14 |
| 2026-06 | 1.5萬 | +8.6% | 18 |
| 2026-05 | 1.4萬 | — | 15 |
| 2026-03 | 1萬 | — | 9 |
以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。
--- name: python description: Python coding guidelines and best practices. Use when writing, reviewing, or refactoring Python code. Enforces PEP 8 style, syntax validation via py_compile, unit test execution, modern Python versions only (no EOL), uv for dependency management when available, and idiomatic Pythonic patterns. --- # Python Coding Guidelines ## Code Style (PEP 8) - 4 spaces for indentation (never tabs)
- Max line length: 88 chars (Black default) or 79 (strict PEP 8)
- Two blank lines before top-level definitions, one within classes
- Imports: stdlib → third-party → local, alphabetized within groups
- Snake_case for functions/variables, PascalCase for classes, UPPER_CASE for constants
## Before Committing
```bash
# Syntax check (always)
python -m py_compile *.py
# Run tests if present
python -m pytest tests/ -v 2>/dev/null || python -m unittest discover -v 2>/dev/null || echo "No tests found"
# Format check (if available)
ruff check . --fix 2>/dev/null || python -m black --check . 2>/dev/null
```
## Python Version
- **Minimum:** Python 3.10+ (3.9 EOL Oct 2025)
- **Target:** Python 3.11-3.13 for new projects
- Never use Python 2 syntax or patterns
- Use modern features: match statements, walrus operator, type hints
## Dependency Management
Check for uv first, fall back to pip:
```bash
# Prefer uv if available
if command -v uv &>/dev/null; then
uv pip install <package>
uv pip compile requirements.in -o requirements.txt
else
pip install <package>
fi
```
For new projects with uv: `uv init` or `uv venv && source .venv/bin/activate`
## Pythonic Patterns
```python
# ✅ List/dict comprehensions over loops
squares = [x**2 for x in range(10)]
lookup = {item.id: item for item in items}
# ✅ Context managers for resources
with open("file.txt") as f:
data = f.read()
# ✅ Unpacking
first, *rest = items
a, b = b, a # swap
# ✅ EAFP over LBYL
try:
value = d[key]
except KeyError:
value = default
# ✅ f-strings for formatting
msg = f"Hello {name}, you have {count} items"
# ✅ Type hints
def process(items: list[str]) -> dict[str, int]:
...
# ✅ dataclasses/attrs for data containers
from dataclasses import dataclass
@dataclass
class User:
name: str
email: str
active: bool = True
# ✅ pathlib over os.path
from pathlib import Path
config = Path.home() / ".config" / "app.json"
# ✅ enumerate, zip, itertools
for i, item in enumerate(items):
...
for a, b in zip(list1, list2, strict=True):
...
```
## Anti-patterns to Avoid
```python
# ❌ Mutable default arguments
def bad(items=[]): # Bug: shared across calls
...
def good(items=None):
items = items or []
# ❌ Bare except
try:
...
except: # Catches SystemExit, KeyboardInterrupt
...
except Exception: # Better
...
# ❌ Global state
# ❌ from module import *
# ❌ String concatenation in loops (use join)
# ❌ == None (use `is None`)
# ❌ len(x) == 0 (use `not x`)
```
## Testing
- Use pytest (preferred) or unittest
- Name test files `test_*.py`, test functions `test_*`
- Aim for focused unit tests, mock external dependencies
- Run before every commit: `python -m pytest -v`
## Docstrings
```python
def fetch_user(user_id: int, include_deleted: bool = False) -> User | None:
"""Fetch a user by ID from the database.
Args:
user_id: The unique user identifier.
include_deleted: If True, include soft-deleted users.
Returns:
User object if found, None otherwise.
Raises:
DatabaseError: If connection fails.
"""
```
## Quick Checklist
- [ ] Syntax valid (`py_compile`)
- [ ] Tests pass (`pytest`)
- [ ] Type hints on public functions
- [ ] No hardcoded secrets
- [ ] f-strings, not `.format()` or `%`
- [ ] `pathlib` for file paths
- [ ] Context managers for I/O
- [ ] No mutable default args
【全棧能力】程式設計大神.Skill:面向複雜真實專案的高階全棧程式設計助手。不止生成程式碼,而是從一句目標接手陌生程式碼庫,拆解需求、補齊實現、追到根因、完成重構、聯調前後端,並把結果推進到能執行、能驗證、能交付。覆蓋 Web、後端、指令碼、iOS、安卓、鴻蒙 ArkUI、微信小程式及其他技術棧,支援中英文工程、疑難 Bug、跨模組任務和長任務續做;用構建、日誌、真實入口、裝置或介面證據說明結果。僅問概念時直接回答,要求落地時持續推進到驗收或明確阻塞。
程式設計專家 Pro:融合程式設計專家 2.0.3 工程專題與程式設計大神的鴻蒙 ArkTS/ArkUI、微信小程式和小遊戲開發資料。用於專案實現、根因除錯、審查、重構、測試、架構效能分析及多端開發驗證。支援自然語言和 @專題標識,按任務讀取包內知識;只問概念時直接回答。
程式設計專家.Skill P8級程式設計助手,25年實戰經驗技能Skill,全棧:Java/Php網站/軟體專案、API設計、Bug診斷、程式碼生成、程式碼審查、重構、測試用例、效能基準、技術選型、文件生成、任務拆解、Spec驅動、Karpathy規範、CMS二次開發、前端設計、MySQL/Mariadb、專案知識圖譜,以及工程紀律層(根因除錯硬閉環、階段導航、事故復盤/SLO、威脅建模/供應鏈安全、生產就緒/漸進式釋出、AI編碼治理、面向Agent程式碼可讀性、LLM應用安全)。支援 @標識 顯式呼叫跳過路由。
程式設計專家.Skill P8級程式設計助手,25年實戰經驗技能Skill,全棧:Java/Php網站/軟體專案、API設計、Bug診斷、程式碼生成、程式碼審查、重構、測試用例、效能基準、技術選型、文件生成、任務拆解、Spec驅動、Karpathy規範、CMS二次開發、前端設計、MySQL/Mariadb、專案知識圖譜,以及工程紀律層(根因除錯硬閉環、階段導航、事故復盤/SLO、威脅建模/供應鏈安全、生產就緒/漸進式釋出、AI編碼治理、面向Agent程式碼可讀性、LLM應用安全)。支援 @標識 顯式呼叫跳過路由。
程式設計專家 Pro:融合程式設計專家 2.0.3 工程專題與程式設計大神的鴻蒙 ArkTS/ArkUI、微信小程式和小遊戲開發資料。用於專案實現、根因除錯、審查、重構、測試、架構效能分析及多端開發驗證。支援自然語言和 @專題標識,按任務讀取包內知識;只問概念時直接回答。
程式設計專家 Pro:融合程式設計專家 2.0.3 工程專題與程式設計大神的鴻蒙 ArkTS/ArkUI、微信小程式和小遊戲開發資料。用於專案實現、根因除錯、審查、重構、測試、架構效能分析及多端開發驗證。支援自然語言和 @專題標識,按任務讀取包內知識;只問概念時直接回答。
程式設計專家.Skill P8級程式設計助手,25年實戰經驗技能Skill,全棧:Java/Php網站/軟體專案、API設計、Bug診斷、程式碼生成、程式碼審查、重構、測試用例、效能基準、技術選型、文件生成、任務拆解、Spec驅動、Karpathy規範、CMS二次開發、前端設計、MySQL/Mariadb、專案知識圖譜,以及工程紀律層(根因除錯硬閉環、階段導航、事故復盤/SLO、威脅建模/供應鏈安全、生產就緒/漸進式釋出、AI編碼治理、面向Agent程式碼可讀性、LLM應用安全)。支援 @標識 顯式呼叫跳過路由。
用 gh 命令列工具檢視 GitHub 上的 PR 檢查、工作流執行與 API 查詢的技能。
資料月份:2026-10 · 下載/星標數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。