一键导入
python
Write Python code following best practices. Use when developing Python applications. Covers type hints, async, and modern tooling.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Write Python code following best practices. Use when developing Python applications. Covers type hints, async, and modern tooling.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Render a self-contained HTML "tab-bar" presentation from a markdown PRD, Spec, ADR, or implementation Plan. Use when the user asks to "make a presentation", "render slides", "turn this prd/spec/adr/plan into a deck", "present this doc", "export to html", or "show this on screen". INPUT is ONE markdown file (a PRD, Spec, ADR, or Plan). OUTPUT is ONE .html slideshow that opens directly in a browser. Render only — do not invent content.
Design scalable, reliable software systems. Use when planning new systems, major features, or architecture changes. Covers C4 diagrams, trade-off analysis, and system decomposition.
Create execution roadmaps for projects. Use when planning multi-phase projects or feature rollouts. Covers phased delivery and milestone planning.
Create Product Requirements Documents. Use when defining new features, projects, or initiatives. Covers user stories, acceptance criteria, and scope definition.
Apply cloud-native architecture patterns. Use when designing for scalability, resilience, or cloud deployment. Covers microservices, containers, and distributed systems.
Apply Domain-Driven Design patterns. Use when modeling complex business domains, defining bounded contexts, or designing aggregates. Covers entities, value objects, and repositories.
| name | python |
| description | Write Python code following best practices. Use when developing Python applications. Covers type hints, async, and modern tooling. |
| allowed-tools | Read, Write, Edit, Bash, Glob, Grep |
# Create project with uv
uv init my-project
cd my-project
# Add dependencies
uv add litestar
uv add --dev pytest ruff mypy
[project]
name = "my-project"
version = "0.1.0"
requires-python = ">=3.13"
dependencies = ["litestar>=2.0"]
[tool.ruff]
line-length = 88
target-version = "py313"
[tool.mypy]
strict = true
python_version = "3.13"
from typing import TypeVar, Generic
from collections.abc import Sequence
T = TypeVar('T')
class Repository(Generic[T]):
async def find_by_id(self, id: str) -> T | None:
...
async def save(self, entity: T) -> T:
...
def process_items(items: Sequence[str]) -> list[str]:
return [item.upper() for item in items]
import asyncio
from collections.abc import AsyncIterator
async def fetch_all(urls: list[str]) -> list[Response]:
async with aiohttp.ClientSession() as session:
tasks = [fetch_one(session, url) for url in urls]
return await asyncio.gather(*tasks)
async def stream_data() -> AsyncIterator[bytes]:
async with aiofiles.open('large.csv', 'rb') as f:
async for chunk in f:
yield chunk
from dataclasses import dataclass
from typing import TypeVar, Generic
T = TypeVar('T')
E = TypeVar('E')
@dataclass
class Ok(Generic[T]):
value: T
@dataclass
class Err(Generic[E]):
error: E
Result = Ok[T] | Err[E]
def divide(a: int, b: int) -> Result[float, str]:
if b == 0:
return Err("Division by zero")
return Ok(a / b)
import pytest
from unittest.mock import AsyncMock
@pytest.mark.asyncio
async def test_create_user():
repo = AsyncMock()
service = UserService(repo)
user = await service.create("test@example.com")
assert user.email == "test@example.com"
repo.save.assert_called_once()
@pytest.fixture
def mock_database():
with patch('app.database') as mock:
yield mock
# Ruff (linting + formatting)
ruff check --fix .
ruff format .
# MyPy (type checking)
mypy --strict .
# pytest
pytest -v --cov=src