Token导航 LogoToken导航TokenDH.com
前端设计执行命令github未标认证来源可访问许可证需确认审计通过

python-developmentPython 开发

Agent Skill

用于辅助 Python 项目开发、测试、依赖管理和常见框架工作流。它适合让 Agent 阅读 Python 代码、定位测试问题、整理运行命令、生成脚本或分析数据处理逻辑。使用时需要确认项目虚拟环境、依赖版本和测试入口;涉及执行脚本、读写文件、访问数据库或调用外部 API 时,应先明确运行目录和输入输出范围,避免误改生产数据。

总安装

3,026

周安装

130

GitHub Stars

28

下载量

1,061
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:python-development(Python 开发)
来源仓库:https://github.com/laurigates/claude-plugins
仓库路径:skills/python-development
安装命令:
npx skills add https://github.com/laurigates/claude-plugins --skill python-development
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/laurigates/claude-plugins --skill python-development

简介

python-development 用于辅助 Python 项目开发、测试和框架工作流。

  • 适合阅读代码、定位问题、整理命令或生成开发脚本。
  • 使用时需确认项目环境、依赖版本和测试入口。
  • 涉及文件读写或 API 调用时,应先明确运行目录和权限范围。
  • 避免在生产环境中直接修改关键数据。python-development 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Python Development

Core Python language concepts, idioms, and best practices.

When to Use This Skill

Use this skill when...Use a focused sibling instead when...
Writing idiomatic Python 3.10+ code (match statements, structural pattern matching, PEP 604 unions)Running a single script or one-off command — use uv-run
Adding type hints, decorators, or context managers to library codeInitializing a project or adding dependencies — use uv-project-management
Designing async/await flows or refactoring to Pythonic patternsWriting or running pytest tests — use python-testing

Core Expertise

  • Python Language: Modern Python 3.10+ features and idioms
  • Best Practices: Pythonic code, design patterns, SOLID principles
  • Debugging: Interactive debugging and profiling techniques
  • Performance: Optimization strategies and profiling
  • Async Programming: async/await patterns and asyncio

Modern Python Features (3.10+)

Type Hints

# Modern syntax (Python 3.10+)
def process_items(
    items: list[str],                    # Not List[str]
    mapping: dict[str, int],             # Not Dict[str, int]
    optional: str | None = None,         # Not Optional[str]
) -> tuple[bool, str]:                   # Not Tuple[bool, str]
    """Process items with modern type hints."""
    return True, "success"

# Type aliases
type UserId = int
type UserDict = dict[str, str | int]

def get_user(user_id: UserId) -> UserDict:
    return {"id": user_id, "name": "Alice"}

Pattern Matching (3.10+)

def handle_command(command: dict) -> str:
    match command:
        case {"action": "create", "item": item}:
            return f"Creating {item}"
        case {"action": "delete", "item": item}:
            return f"Deleting {item}"
        case {"action": "list"}:
            return "Listing items"
        case _:
            return "Unknown command"

Structural Pattern Matching

def process_response(response):
    match response:
        case {"status": 200, "data": data}:
            return process_success(data)
        case {"status": 404}:
            raise NotFoundError()
        case {"status": code} if code >= 500:
            raise ServerError(code)

Python Idioms

Context Managers

# File handling
with open("file.txt") as f:
    content = f.read()

# Custom context manager
from contextlib import contextmanager

@contextmanager
def database_connection():
    conn = create_connection()
    try:
        yield conn
    finally:
        conn.close()

with database_connection() as conn:
    conn.execute("SELECT * FROM users")

List Comprehensions

# List comprehension
squares = [x**2 for x in range(10)]

# Dict comprehension
word_lengths = {word: len(word) for word in ["hello", "world"]}

# Set comprehension
unique_lengths = {len(word) for word in ["hello", "world", "hi"]}

# Generator expression
sum_of_squares = sum(x**2 for x in range(1000000))  # Memory efficient

Iterators and Generators

def fibonacci():
    a, b = 0, 1
    while True:
        yield a
        a, b = b, a + b

# Use generator
fib = fibonacci()
first_ten = [next(fib) for _ in range(10)]

# Generator expression
even_squares = (x**2 for x in range(10) if x % 2 == 0)

Debugging

Interactive Debugging

import pdb

def problematic_function():
    value = calculate()
    pdb.set_trace()  # Debugger breakpoint
    return process(value)
# Debug on error
python -m pdb script.py

# pytest with debugger
uv run pytest --pdb                     # Drop into pdb on failure
uv run pytest --pdb --pdbcls=IPython.terminal.debugger:TerminalPdb

Performance Profiling

# CPU profiling
uv run python -m cProfile -s cumtime script.py | head -20

# Line-by-line profiling (temporary dependency)
uv run --with line-profiler kernprof -l -v script.py

# Memory profiling (temporary dependency)
uv run --with memory-profiler python -m memory_profiler script.py

# Real-time profiling (ephemeral tool)
uvx py-spy top -- python script.py

# Quick profiling with scalene
uv run --with scalene python -m scalene script.py

Built-in Debugging Tools

# Trace execution
import sys

def trace_calls(frame, event, arg):
    if event == 'call':
        print(f"Calling {frame.f_code.co_name}")
    return trace_calls

sys.settrace(trace_calls)

# Memory tracking
import tracemalloc

tracemalloc.start()
# ... code to profile
snapshot = tracemalloc.take_snapshot()
top_stats = snapshot.statistics('lineno')
for stat in top_stats[:10]:
    print(stat)

Async Programming

Basic async/await

import asyncio

async def fetch_data(url: str) -> dict:
    async with httpx.AsyncClient() as client:
        response = await client.get(url)
        return response.json()

async def main():
    result = await fetch_data("https://api.example.com")
    print(result)

asyncio.run(main())

Concurrent Tasks

async def process_multiple():
    # Run concurrently
    results = await asyncio.gather(
        fetch_data("url1"),
        fetch_data("url2"),
        fetch_data("url3"),
    )
    return results

# With timeout
async def with_timeout():
    try:
        result = await asyncio.wait_for(fetch_data("url"), timeout=5.0)
    except asyncio.TimeoutError:
        print("Request timed out")

Design Patterns

Dependency Injection

from typing import Protocol

class Database(Protocol):
    def query(self, sql: str) -> list: ...

def get_users(db: Database) -> list:
    return db.query("SELECT * FROM users")

Factory Pattern

def create_handler(handler_type: str):
    match handler_type:
        case "json":
            return JSONHandler()
        case "xml":
            return XMLHandler()
        case _:
            raise ValueError(f"Unknown handler: {handler_type}")

Decorator Pattern

from functools import wraps
import time

def timer(func):
    @wraps(func)
    def wrapper(*args, **kwargs):
        start = time.time()
        result = func(*args, **kwargs)
        end = time.time()
        print(f"{func.__name__} took {end - start:.2f}s")
        return result
    return wrapper

@timer
def slow_function():
    time.sleep(1)

Best Practices

SOLID Principles

Single Responsibility:

# Bad: Class does too much
class User:
    def save(self): pass
    def send_email(self): pass
    def generate_report(self): pass

# Good: Separate concerns
class User:
    def save(self): pass

class EmailService:
    def send_email(self, user): pass

class ReportGenerator:
    def generate(self, user): pass

Fail Fast

def process_data(data: dict) -> str:
    # Validate early
    if not data:
        raise ValueError("Data cannot be empty")
    if "required_field" not in data:
        raise KeyError("Missing required field")

    # Process with confidence
    return data["required_field"].upper()

Functional Approach

# Prefer immutable transformations
def process_items(items: list[int]) -> list[int]:
    return [item * 2 for item in items]  # New list

# Over mutations
def process_items_bad(items: list[int]) -> None:
    for i in range(len(items)):
        items[i] *= 2  # Mutates input

Project Structure (src layout)

my-project/
├── pyproject.toml
├── README.md
├── src/
│   └── my_project/
│       ├── __init__.py
│       ├── core.py
│       ├── utils.py
│       └── models.py
└── tests/
    ├── conftest.py
    ├── test_core.py
    └── test_utils.py

See Also

  • uv-run - Running scripts, temporary dependencies, PEP 723
  • uv-project-management - Project setup and dependency management
  • uv-tool-management - Installing CLI tools globally
  • python-testing - Testing with pytest
  • python-code-quality - Linting and type checking with ruff/ty
  • python-packaging - Building and publishing packages
  • uv-python-versions - Managing Python interpreters

References

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.65%
按下载量换算357

Claude

30.71%
按下载量换算326

Cursor

18.78%
按下载量换算199

Gemini CLI

9.96%
按下载量换算106

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/laurigates/claude-plugins --skill python-development 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills