Token导航 LogoToken导航TokenDH.com
AI 工具需要联网github未标认证来源可访问clear审计提醒

fastapiFastAPI 开发

Agent Skill

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

总安装

849

周安装

34

GitHub Stars

11

下载量

275
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/lobbi-docs/claude --skill fastapi

简介

用于辅助 Python 项目开发、测试、依赖管理和常见框架工作流。

  • 适合阅读 Python 代码、定位测试问题、整理运行命令或生成脚本。
  • 使用时需确认项目虚拟环境、依赖版本和测试入口。
  • 涉及执行脚本、读写文件或调用外部 API 时,应明确运行目录和输入输出范围。
  • 安装方式:通过 npx 从 GitHub 仓库添加技能。

SKILL.md

FastAPI Skill

Provides comprehensive FastAPI development capabilities for the Golden Armada AI Agent Fleet Platform.

When to Use This Skill

Activate this skill when working with:

  • FastAPI application development
  • Async endpoint implementation
  • Pydantic model definitions
  • Dependency injection patterns
  • OpenAPI/Swagger documentation

Quick Reference

Run Commands


# Development

uvicorn main:app --reload --host 0.0.0.0 --port 8000

# Production

uvicorn main:app --host 0.0.0.0 --port 8000 --workers 4

# With Gunicorn

gunicorn main:app -w 4 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000 ```

## Application Structure

Basic Application


# main.py

from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from contextlib import asynccontextmanager

from app.routers import agents, tasks from app.config import settings

@asynccontextmanager async def lifespan(app: FastAPI): # Startup print("Starting up...") yield # Shutdown print("Shutting down...")

app = FastAPI(title="Golden Armada Agent API", version="1.0.0", lifespan=lifespan)

app.add_middleware(CORSMiddleware, allow_origins=settings.allowed_origins, allow_credentials=True, allow_methods=["*"], allow_headers=["*"],)

app.include_router(agents.router, prefix="/api/v1/agents", tags=["agents"]) app.include_router(tasks.router, prefix="/api/v1/tasks", tags=["tasks"])

@app.get("/health") async def health_check(): return {"status": "healthy", "service": "golden-armada"} ```

## Pydantic Schemas

schemas/agent.py

from pydantic import BaseModel, Field from typing import Optional from enum import Enum

class AgentType(str, Enum): CLAUDE = "claude" GPT = "gpt" GEMINI = "gemini"

class AgentBase(BaseModel): name: str = Field(..., min_length=1, max_length=100) type: AgentType description: Optional[str] = None

class AgentCreate(AgentBase): pass

class AgentResponse(AgentBase): id: str status: str created_at: datetime

model_config = ConfigDict(from_attributes=True)

## Router Example

routers/agents.py

from fastapi import APIRouter, HTTPException, Depends, status from typing import List

from app.schemas.agent import AgentCreate, AgentResponse from app.services.agent_service import AgentService from app.dependencies import get_agent_service

router = APIRouter()

@router.post("/", response_model=AgentResponse, status_code=status.HTTP_201_CREATED) async def create_agent(agent: AgentCreate, service: AgentService = Depends(get_agent_service)): """Create a new agent.""" return await service.create(agent)

@router.get("/", response_model=List[AgentResponse]) async def list_agents(skip: int = 0, limit: int = 100, service: AgentService = Depends(get_agent_service)): """List all agents.""" return await service.list(skip=skip, limit=limit)

@router.get("/{agent_id}", response_model=AgentResponse) async def get_agent(agent_id: str, service: AgentService = Depends(get_agent_service)): """Get agent by ID.""" agent = await service.get(agent_id) if not agent: raise HTTPException(status_code=404, detail="Agent not found") return agent ```

Dependency Injection


# dependencies.py

from functools import lru_cache from typing import Annotated from fastapi import Depends

from app.config import Settings from app.services.agent_service import AgentService from app.services.llm_service import LLMService

@lru_cache def get_settings(): return Settings()

async def get_llm_service(settings: Annotated[Settings, Depends(get_settings)]) -> LLMService: return LLMService(api_key=settings.anthropic_api_key)

async def get_agent_service(llm_service: Annotated[LLMService, Depends(get_llm_service)]) -> AgentService: return AgentService(llm_service=llm_service) ```

## Background Tasks

@router.post("/tasks/{task_id}/execute") async def execute_task(task_id: str, background_tasks: BackgroundTasks, service: TaskService = Depends(get_task_service)): background_tasks.add_task(service.execute_async, task_id) return {"status": "accepted", "task_id": task_id} ```

WebSocket Support


@router.websocket("/ws/{agent_id}") async def agent_websocket(websocket: WebSocket, agent_id: str): await websocket.accept() try: while True: data = await websocket.receive_text() response = await process_message(agent_id, data) await websocket.send_text(response) except WebSocketDisconnect: print(f"Agent {agent_id} disconnected") ```

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

能力 5

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

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

平台分布

Claude Code

28.62%
按下载量换算79

Gemini CLI

24.18%
按下载量换算66

Antigravity

15.91%
按下载量换算44

OpenCode

11.29%
按下载量换算31

trae

8.12%
按下载量换算22

windsurf

3.02%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills