Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

python-backend-fastapiPython backend FastAPI 搜索

Agent Skill

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

总安装

188

周安装

8

GitHub Stars

公开资料未说明

下载量

66
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/janjaszczak/cursor --skill python-backend-fastapi

简介

专注于 FastAPI 框架的 Python 后端开发辅助技能。

  • 适用于 API 设计、路由配置和异步请求处理场景。
  • 可帮助生成代码片段、调试接口或优化性能逻辑。python-backend-fastapi 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 安装方式:从指定 GitHub 仓库获取并集成到宿主环境。
  • 使用时应注意项目路径和依赖版本,防止环境冲突。

SKILL.md

Python backend (FastAPI + Pydantic v2 + Alembic)

Activation cues

Use this skill when the task involves:

  1. new or modified FastAPI endpoints, routers, dependencies, middleware
  2. request/response validation, schema design, OpenAPI correctness (Pydantic v2)
  3. database schema changes (Alembic revisions)
  4. backend logging and request tracing
  5. ETL / parsers / import pipelines with memory constraints and “bad rows” reporting

Operating principles (agent workflow)

  1. Start with a short plan before editing code. Prefer file-path-specific steps and repository-aligned patterns.
  2. Ask up to 1–3 clarifying questions only if truly blocking.
  3. Prefer verifiable goals: tests, migrations, reproducible API calls, and deterministic outputs.
  4. For complex/high-risk changes, run an internal Chain-of-Verification (CoVe): draft → 3–5 verification questions → answer independently → revise; surface only final result + (optional) UNCERTAIN items and how to verify them.

Standard implementation workflow

1) Context discovery (do not invent patterns)

  • Locate existing routers, dependency injection conventions, error handling, and response schema patterns.
  • Identify service layer boundaries (or create them if missing).
  • Find existing migration conventions and logging format.

2) API contract first (Pydantic v2)

  • Define/extend request & response models with Pydantic v2.
  • Ensure OpenAPI reflects reality (status codes, response shapes, optional fields).
  • Keep handlers thin: parse/validate, delegate to service, map service result to response.

Definition of “thin handler”:

  • No business rules in the endpoint function beyond wiring + basic validation.
  • No direct DB logic in the handler unless the codebase already standardizes it there.

3) Service layer + tests (pytest)

  • Move business logic to a service module with unit tests.
  • Prefer tests that encode behavior and edge cases (happy path, validation, not found, conflicts).
  • Add/extend fixtures in line with repo conventions.

4) Dependency Injection (FastAPI Depends)

  • Use Depends for DI and request-scoped dependencies.
  • If a request-id is used in the project, propagate it through dependencies/services.

5) Alembic migrations (every schema change)

  • Create a new revision for each schema change.
  • Make migrations idempotent and safe:

- avoid non-deterministic operations - provide both upgrade and downgrade - ensure ordering is correct with dependencies

  • If the change is data-destructive, clearly annotate risk and required operator steps.

6) Logging (stdlib logging)

  • Use Python stdlib logging.
  • Include request id (if available) and key fields relevant to the operation.
  • Avoid logging secrets/PII; log identifiers and high-level state transitions instead.

7) ETL / parsers (streaming, error CSV)

When implementing ingestion/parsing:

  • Process input file-by-file (and ideally row-by-row) to avoid loading all data into memory.
  • For invalid records:

- write a CSV containing: timestamp, file, line, error, original_row - keep original_row as close to raw input as possible (avoid “fixing” it before logging)

  • Logging must allow operators to reproduce and patch upstream data.

Definition of done (backend changes)

A change is “done” only if:

  1. endpoint behavior matches contract (schemas + status codes)
  2. tests exist and pass for new/changed logic
  3. migrations exist for schema changes (upgrade + downgrade)
  4. logging is present for operationally relevant paths
  5. for new endpoints: provide example curl or httpie calls + expected responses

Examples (template snippets)

Example: endpoint acceptance checklist

  • Request model defined (Pydantic v2)
  • Response model defined (Pydantic v2)
  • Handler delegates to service
  • Tests cover core behavior + edge case
  • Example curl included in PR/plan notes

Example: ETL error row

  • timestamp: ISO-8601
  • file: input filename
  • line: input line number (1-based)
  • error: short human-readable description
  • original_row: raw row payload

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

37.03%
按下载量换算24

Claude

27.31%
按下载量换算18

Cursor

17.83%
按下载量换算12

Gemini CLI

8.88%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills