Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计异常

python-backend-expertPython backend expert 测试

Agent Skill

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

总安装

2,112

周安装

88

GitHub Stars

25

下载量

704
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/oimiragieo/agent-studio --skill python-backend-expert

简介

提供 Python 后端开发的专家级支持与测试能力。

  • 适用于代码审查、依赖管理和常见框架工作流的处理。python-backend-expert 属于开发类 Skill,可作为该场景下的辅助能力补充。
  • 可协助 Agent 阅读代码、生成脚本或分析数据处理逻辑。
  • 安装方式:通过 GitHub 仓库添加,兼容主流 AI 编程工具。
  • 执行脚本或访问外部资源前,需确认运行目录和权限范围。

SKILL.md

Python Backend Expert

alembic database migrations

When reviewing or writing code, apply these guidelines:

  • Use alembic for database migrations.

django class based views for htmx

When reviewing or writing code, apply these guidelines:

  • Use Django's class-based views for HTMX responses

django form handling

When reviewing or writing code, apply these guidelines:

  • Implement Django forms for form handling
  • Use Django's form validation for HTMX requests

django forms

When reviewing or writing code, apply these guidelines:

  • Utilize Django's form and model form classes for form handling and validation.
  • Use Django's validation framework to validate form and model data.
  • Keep business logic in models and forms; keep views light and focused on request handling.

django framework rules

When reviewing or writing code, apply these guidelines:

  • You always use the latest stable version of Django, and you are familiar with the latest features and best practices.

django middleware

When reviewing or writing code, apply these guidelines:

  • Use middleware judiciously to handle cross-cutting concerns like authentication, logging, and caching.
  • Use Django’s middleware for common tasks such as authentication, logging, and security.

django middleware for request response

When reviewing or writing code, apply these guidelines:

  • Utilize Django's middleware for request/response processing

django models

When reviewing or writing code, apply these guidelines:

  • Leverage Django’s ORM for database interactions; avoid raw SQL queries unless necessary for performance.
  • Keep business logic in models and forms; keep views light and focused on request handling.

django orm for database operations

When reviewing or writing code, apply these guidelines:

  • Implement Django ORM for database operations

django rest framework

When reviewing or writing code, apply these guidelines:

  • Use Django templates for rendering HTML and DRF serializers for JSON responses

django 5.x features (2025+)

When reviewing or writing code, apply these guidelines:

  • Django 5.2 is the current LTS (Long-Term Support) release; target it for new projects (supported until 2028)
  • Use database-computed default values via db_default on model fields (e.g., db_default=Now()) instead of Python-side defaults where the database should own the value
  • Use facet filters in the Django admin (ModelAdmin.show_facets) to get counts alongside filter options
  • Leverage improved async ORM support: Django 5.x expands async-native queryset methods — prefer await qs.acount(), await qs.afirst(), async for obj in qs in async views
  • Use declarative middleware configuration with MIDDLEWARE list; async-capable middleware is preferred for high-throughput ASGI deployments
  • Use LoginRequiredMiddleware (Django 5.1+) instead of decorating every view when all views require authentication
  • Use GeneratedField for database-generated columns (computed from other columns at the DB level)

fastapi patterns (2025+)

When reviewing or writing code, apply these guidelines:

  • Use the lifespan context manager (not deprecated @app.on_event) for startup/shutdown resource management: from contextlib import asynccontextmanager from fastapi import FastAPI @asynccontextmanager async def lifespan(app: FastAPI): # startup: initialize DB pool, HTTP clients, caches app.state.db_pool = await create_pool() yield # shutdown: close resources await app.state.db_pool.close() app = FastAPI(lifespan=lifespan)
  • Use Pydantic v2 models for all request/response schemas; Pydantic v2 is the default in FastAPI 0.100+. Use model_config = ConfigDict(...) instead of the inner class Config
  • Use pydantic-settings (BaseSettings) with lru_cache for config management: from functools import lru_cache from pydantic_settings import BaseSettings class Settings(BaseSettings): database_url: str model_config = ConfigDict(env_prefix="APP_") @lru_cache def get_settings() -> Settings: return Settings()
  • Scope dependencies correctly: per-request (DB sessions, auth), router-level (audit logging, namespace caches), application lifespan (Kafka producers, feature flag SDKs, tracing exporters)
  • Use Annotated type hints with Depends for cleaner dependency signatures: from typing import Annotated from fastapi import Depends DbSession = Annotated[AsyncSession, Depends(get_db)] CurrentUser = Annotated[User, Depends(get_current_user)]
  • Structure projects by domain: routers/, services/, repositories/, schemas/, models/ — avoid flat single-file apps beyond prototypes
  • Prefer async def path operations for I/O-bound routes; use def (sync) only for CPU-bound work that should run in a thread pool
  • Use APIRouter with prefix, tags, and dependencies to group related routes and apply shared middleware

sqlalchemy 2.0 async patterns (2025+)

When reviewing or writing code, apply these guidelines:

  • Use create_async_engine + async_sessionmaker (not the deprecated AsyncSession factory directly); create one engine per service at application startup
  • Use the new Mapped + mapped_column declarative style (SQLAlchemy 2.0+) instead of the legacy Column style: from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column from sqlalchemy import String class Base(DeclarativeBase): pass class User(Base): __tablename__ = "users" id: Mapped[int] = mapped_column(primary_key=True) email: Mapped[str] = mapped_column(String(255), unique=True) is_active: Mapped[bool] = mapped_column(default=True)
  • Provide the DB session via FastAPI dependency injection using async with session scope: from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker async_session = async_sessionmaker(engine, expire_on_commit=False) async def get_db() -> AsyncGenerator[AsyncSession, None]: async with async_session() as session: yield session
  • Use select() (not the legacy session.query()) for all queries in SQLAlchemy 2.0+
  • Use selectinload / joinedload explicitly to avoid implicit lazy-load I/O in async contexts (lazy loading raises MissingGreenlet in async)
  • For upserts, use insert().on_conflict_do_update() (PostgreSQL) or the dialect-specific equivalent rather than separate select + update round trips
  • Use connection pool sizing appropriate for async: async drivers (asyncpg, aiomysql) need smaller pools than sync drivers; pool_size=5, max_overflow=10 is a safe default for moderate load

python 3.13 / 3.14 features (2025+)

When reviewing or writing code, apply these guidelines:

  • Python 3.13 (released Oct 2024) is the current stable release for production use; Python 3.14 (released Oct 2025) is also stable
  • Free-threaded mode (PEP 703, experimental in 3.13, maturing in 3.14): The GIL can be disabled with python3.13t (free-threaded build). Avoid assuming GIL protection for shared mutable state in new code targeting 3.13+; use explicit locks or thread-safe data structures. Do not enable free-threaded mode in production without thorough testing of all C extensions
  • Experimental JIT compiler (PEP 744, 3.13+): Opt-in with PYTHON_JIT=1. Provides measurable speedups for tight loops and numeric code. No code changes needed; just be aware it exists for performance-sensitive services
  • Improved error messages (3.13+): Tracebacks are now syntax-highlighted in color by default. Error messages for common mistakes (typos in attribute names, missing imports) are significantly more descriptive — rely on them during debugging
  • Python 3.14 — Template strings / T-strings (PEP 750): New t"..." string literals that defer interpolation, useful for safe SQL/HTML construction without injection risk. Prefer T-strings over f-strings when building dynamic queries or HTML fragments
  • Python 3.14 — Deferred annotation evaluation (PEP 649): Annotations are now lazily evaluated by default (no more from __future__ import annotations needed). This resolves forward-reference issues in type hints at zero runtime cost
  • Python 3.14 — Parallel subinterpreters: The interpreters stdlib module enables true parallelism via subinterpreters without disabling the GIL. Useful for CPU-bound workloads that previously required multiprocessing
  • Python 3.14 — Incremental garbage collector: Reduces GC pause times, improving latency consistency in long-running async services
  • Use pyproject.toml (not setup.py / requirements.txt alone) for all new projects; use uv or pip with pyproject.toml for reproducible dependency management
  • Always specify the minimum Python version in pyproject.toml requires-python field

Consolidated Skills

This expert skill consolidates 1 individual skills:

  • python-backend-expert

Iron Laws

  1. ALWAYS use the lifespan context manager for FastAPI startup/shutdown resource management — @app.on_event is deprecated and will be removed in a future release.
  2. NEVER use session.query() in SQLAlchemy 2.0+ — use select() with the 2.0-style API; legacy query API will be removed.
  3. ALWAYS use parameterized queries or the ORM for all database operations — never construct SQL with string interpolation or f-strings (SQL injection vector).
  4. NEVER perform blocking I/O in async FastAPI routes — use async def with awaitable drivers or run_in_executor for blocking operations to avoid event loop starvation.
  5. ALWAYS validate all request data at the boundary using Pydantic v2 models — never pass raw request dicts into business logic layers.

Anti-Patterns

Anti-PatternWhy It FailsCorrect Approach
Using @app.on_event for startup/shutdownDeprecated in FastAPI; will break on version upgradeUse @asynccontextmanager with lifespan parameter
Using session.query() in SQLAlchemy 2.0+Legacy query API is deprecated and will be removedUse select() statements with session.execute()
Building SQL strings with f-strings or % formattingSQL injection vulnerability; critical security flawUse parameterized queries via ORM or text() with bound params
Calling blocking I/O directly in async def routesBlocks the entire event loop; causes cascading latencyUse awaitable async drivers; loop.run_in_executor() for sync code
Putting business logic in FastAPI path functionsCouples routing to logic; makes unit testing impossibleExtract logic to service/repository layer; inject via Depends()

Memory Protocol (MANDATORY)

Before starting:

cat .claude/context/memory/learnings.md

After completing: Record any new patterns or exceptions discovered.

ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

37.87%
按下载量换算267

Claude

29.77%
按下载量换算210

Cursor

18.06%
按下载量换算127

Gemini CLI

9.58%
按下载量换算67

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

来源信息

继续浏览同类 Skills