Token导航 LogoToken导航

Agent Skill · 运维和基础设施

fastapi-expert(FastAPI expert 测试)

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

fastapi-expert 是运维和基础设施类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描已通过,按安装量在运维和基础设施类的 2,449 个 Skill 里排第 1,915。

总安装 349周安装 15GitHub Stars 1下载 122核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/bilalmk/todo_correct --skill fastapi-expert

这个 Skill 是做什么的

运维和基础设施类 Skill 处理部署、监控、日志和云资源,多数需要较高的执行权限。

用于辅助 Python 项目开发、测试与依赖管理。适合阅读代码、定位测试问题或生成运行脚本。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。使用时需确认虚拟环境与依赖版本,避免误改生产数据。涉及执行脚本或访问数据库时应明确输入输出范围。

fastapi-expert 属于运维和基础设施类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/fastapi-expert

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/bilalmk/todo_correct --skill fastapi-expert;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

fastapi-expert 怎么安装?

在终端执行 npx skills add https://github.com/bilalmk/todo_correct --skill fastapi-expert。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

fastapi-expert 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

fastapi-expert 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

fastapi-expert 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

fastapi-expert 用的人多吗?

公开数据是累计安装 349 次,近一周安装 15 次,下载 122 次,GitHub 1 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

fastapi-expert 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理运维和基础设施类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

运维和基础设施类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
brainstorming

头脑风暴 · Codex、Claude

3,148,776173,131操作浏览器MIT通过
copywriting

文案写作 · Codex、Claude

1,996,72425,583需要联网MIT通过
openclaw-secure-linux-cloud

OpenClaw secure linux cloud 命令行 · Codex、Claude

1,853,08840接触敏感数据未明确未通过
xget

xget 命令行 · Codex、Claude

1,799,28040执行命令未明确未通过
requesting-code-review

代码审查请求 · Codex、Claude

1,590,144173,103权限未标注MIT通过
fastapi-expert

FastAPI expert 测试 · 本页

3491接触敏感数据MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

FastAPI Expert

Production-ready FastAPI knowledge covering basic API development to planet-scale deployment.

Quick Start

Create a basic FastAPI application:

from fastapi import FastAPI

app = FastAPI()

@app.get("/")
async def root():
    return {"message": "Hello World"}

# Run with: uvicorn main:app --reload

Core Topics

1. Database Operations

See: references/database.md

  • SQLModel integration (recommended ORM)
  • CRUD operations with dependency injection
  • Async database operations
  • Connection pooling
  • Migrations with Alembic
  • Neon Serverless PostgreSQL setup

2. Security & Authentication

See: references/security.md

  • OAuth2 with password flow
  • JWT token-based authentication
  • Password hashing with Argon2
  • OAuth2 scopes for permissions
  • CORS configuration
  • Rate limiting
  • API key authentication
  • Security best practices

3. Deployment & Scalability

See: references/deployment.md

  • Docker containerization
  • Kubernetes deployment
  • Production server configuration (Uvicorn + Gunicorn)
  • Horizontal pod autoscaling
  • Performance monitoring with Prometheus
  • Caching strategies with Redis
  • Platform-specific guides (Vercel, AWS, GCP)

4. Advanced Features

See: references/advanced.md

  • Dependency injection patterns
  • Custom middleware
  • WebSocket support
  • Background tasks
  • Request/response models with validation
  • Streaming responses
  • File uploads
  • Testing strategies
  • Event handlers

Project Templates

Use the provided production-ready templates in assets/:

FastAPI Project Structure

assets/project-template/
├── main.py           # Application entry point
├── config.py         # Settings management
├── database.py       # Database setup
├── models.py         # SQLModel models
└── auth.py           # Authentication logic

Copy the template to start a new project:

cp -r assets/project-template/* your-project/

Docker Deployment

Use assets/Dockerfile for containerizing your application with multi-stage builds and security best practices.

Kubernetes Deployment

Use assets/kubernetes-deployment.yaml for deploying to Kubernetes with:

  • Deployment with 3 replicas
  • Service with LoadBalancer
  • Horizontal Pod Autoscaler
  • Health and readiness probes

Common Patterns

Database CRUD with Session Dependency

from typing import Annotated
from fastapi import Depends
from sqlmodel import Session, select

SessionDep = Annotated[Session, Depends(get_session)]

@app.get("/users/{user_id}")
def get_user(user_id: int, session: SessionDep):
    user = session.get(User, user_id)
    if not user:
        raise HTTPException(status_code=404, detail="User not found")
    return user

Protected Routes with Authentication

from typing import Annotated
from fastapi import Depends

CurrentUser = Annotated[User, Depends(get_current_active_user)]

@app.get("/users/me")
async def read_users_me(current_user: CurrentUser):
    return current_user

Background Tasks

from fastapi import BackgroundTasks

@app.post("/send-email/")
async def send_email(email: str, background_tasks: BackgroundTasks):
    background_tasks.add_task(send_email_task, email)
    return {"message": "Email queued"}

Best Practices Checklist

Development

  • Use type hints everywhere
  • Implement request/response models with Pydantic
  • Use dependency injection for shared logic
  • Add proper error handling with HTTPException
  • Use async/await for I/O operations

Security

  • Hash passwords with Argon2
  • Use JWT for authentication
  • Implement OAuth2 scopes for authorization
  • Configure CORS properly
  • Store secrets in environment variables
  • Enable HTTPS in production

Database

  • Use SQLModel for ORM
  • Implement connection pooling
  • Use migrations (Alembic)
  • Leverage dependency injection for sessions
  • Add database indexes for performance

Deployment

  • Multi-stage Dockerfile
  • Non-root container user
  • Health check endpoints
  • Resource limits in Kubernetes
  • Horizontal pod autoscaling
  • Prometheus metrics
  • Structured logging

Scalability Strategies

Async Operations

Always use async def for endpoints that perform I/O:

@app.get("/users/")
async def get_users():
    users = await fetch_from_db()
    return users

Caching

Implement Redis caching for frequently accessed data:

@cache(expire=600)
async def expensive_operation():
    # Heavy computation
    return result

Background Processing

Offload long-running tasks:

background_tasks.add_task(process_data, data)

Connection Pooling

Configure database connection pools:

engine = create_engine(
    DATABASE_URL,
    pool_size=20,
    max_overflow=10,
    pool_timeout=30
)

Troubleshooting

Performance Issues

  1. Enable Prometheus metrics to identify bottlenecks
  2. Use async operations for all I/O
  3. Implement caching with Redis
  4. Optimize database queries (indexes, eager loading)
  5. Enable GZip compression

Authentication Errors

  1. Verify JWT secret key matches
  2. Check token expiration time
  3. Ensure password hashing is consistent
  4. Validate CORS configuration

Database Connection Issues

  1. Check connection string format
  2. Verify connection pool settings
  3. Test database reachability
  4. Review firewall rules

Production Deployment Flow

  1. Develop locally with auto-reload
  2. Test with TestClient and pytest
  3. Build Docker image
  4. Push to container registry
  5. Deploy to Kubernetes cluster
  6. Monitor with Prometheus/Grafana
  7. Scale with HPA based on metrics

Example: Complete CRUD API

from fastapi import FastAPI, Depends, HTTPException
from sqlmodel import Field, Session, SQLModel, create_engine, select
from typing import Annotated

# Database setup
engine = create_engine("sqlite:///database.db")

def get_session():
    with Session(engine) as session:
        yield session

SessionDep = Annotated[Session, Depends(get_session)]

# Model
class Item(SQLModel, table=True):
    id: int | None = Field(default=None, primary_key=True)
    title: str
    description: str | None = None

# App
app = FastAPI()

@app.on_event("startup")
def on_startup():
    SQLModel.metadata.create_all(engine)

# CRUD endpoints
@app.post("/items/", response_model=Item)
def create_item(item: Item, session: SessionDep):
    session.add(item)
    session.commit()
    session.refresh(item)
    return item

@app.get("/items/", response_model=list[Item])
def read_items(session: SessionDep, skip: int = 0, limit: int = 100):
    items = session.exec(select(Item).offset(skip).limit(limit)).all()
    return items

@app.get("/items/{item_id}", response_model=Item)
def read_item(item_id: int, session: SessionDep):
    item = session.get(Item, item_id)
    if not item:
        raise HTTPException(status_code=404, detail="Item not found")
    return item

@app.patch("/items/{item_id}", response_model=Item)
def update_item(item_id: int, item_update: Item, session: SessionDep):
    db_item = session.get(Item, item_id)
    if not db_item:
        raise HTTPException(status_code=404, detail="Item not found")

    item_data = item_update.model_dump(exclude_unset=True)
    for key, value in item_data.items():
        setattr(db_item, key, value)

    session.add(db_item)
    session.commit()
    session.refresh(db_item)
    return db_item

@app.delete("/items/{item_id}")
def delete_item(item_id: int, session: SessionDep):
    item = session.get(Item, item_id)
    if not item:
        raise HTTPException(status_code=404, detail="Item not found")

    session.delete(item)
    session.commit()
    return {"ok": True}

This skill provides everything needed to build production-ready FastAPI applications from basic CRUD to planet-scale deployments.

平台分布

Claude Code

27.95%
按下载量换算34

OpenCode

24.39%
按下载量换算30

Codex

18.7%
按下载量换算23

Antigravity

11.8%
按下载量换算14

Gemini CLI

7.1%
按下载量换算9

windsurf

3.26%
按下载量换算4

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills