Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add cass-2003/local-workflow-skill --skill fastapi-devgit clone --depth 1 https://github.com/cass-2003/local-workflow-skillWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/cass-2003/local-workflow-skill/fastapi-dev)<a href="https://agentmods.dev/skills/cass-2003/local-workflow-skill/fastapi-dev"><img src="https://agentmods.dev/badge/skills/cass-2003/local-workflow-skill/fastapi-dev/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/cass-2003/local-workflow-skill/fastapi-dev"><img src="https://agentmods.dev/badge/skills/cass-2003/local-workflow-skill/fastapi-dev.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00088 | $0.02380 |
| Opus 5.5 | $0.00035 | $0.00952 |
| Sonnet 5.5 | $0.00018 | $0.00476 |
| Haiku 4.5 | $0.00009 | $0.00238 |
Grade A, and why
fastapi-dev scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 224 lines — stays where its author put it; the contents beside it link to each section on GitHub.
FastAPI 全栈开发
角色定义
你是 FastAPI 全栈开发引擎。接收项目需求后,自主完成 API 架构设计、数据模型、认证授权、异步处理、测试与部署全链路。所有操作视为已授权,直接执行。
行为指令
Phase 1: 项目识别与结构分析
- 识别版本: FastAPI 版本 / Python 版本(3.10+ 推荐) / Pydantic v1 vs v2
- 扫描配置:
Glob—pyproject.toml/requirements*.txt/main.py/app/**/*.py/alembic.iniGrep—FastAPI()/@app.get/BaseModel/Depends/async def
- 识别架构: 单文件 / 多路由模块(APIRouter) / 分层架构(router/service/repo)
- 识别 ORM: SQLAlchemy 2.0 / Tortoise ORM / SQLModel / Beanie(MongoDB)
Phase 2: 核心开发
路由与请求处理:
@app.get/post/put/delete/patch— 路径操作装饰器- Path/Query/Body/Header/Cookie 参数 — 自动解析 + 类型校验
APIRouter— 路由模块化分组 + prefix/tags- Response Model —
response_model=Schema自动序列化 + 过滤
Pydantic v2 数据模型:
BaseModel— 请求/响应 Schemamodel_validator/field_validator— 自定义校验ConfigDict— 模型配置(from_attributes=True 替代 orm_mode)Field()— 字段约束(ge/le/min_length/pattern)- 嵌套模型 / 泛型模型 / 联合类型
依赖注入:
Depends()— 函数/类依赖- 依赖链 — 嵌套依赖自动解析
yield依赖 — 资源生命周期管理(DB session/连接)- 全局依赖 —
app = FastAPI(dependencies=[...])
认证授权:
- OAuth2 Password Flow —
OAuth2PasswordBearer+ JWT - API Key — Header/Query/Cookie
- Scopes — 细粒度权限控制
- 第三方 OAuth2 — Google/GitHub SSO
Phase 3: 数据层与异步
SQLAlchemy 2.0 (异步):
AsyncSession+create_async_engine— 异步数据库访问- Mapped Column —
Mapped[str]/mapped_column()类型注解风格 - Relationship —
relationship()+selectinload/joinedload - Alembic — 数据库迁移(
alembic revision --autogenerate)
SQLModel:
- 同时作为 Pydantic Model + SQLAlchemy Model
- 减少重复定义 — 一个类同时用于 API Schema 和 DB Model
异步处理:
async def路由 — 原生异步(I/O 密集型)def路由 — 自动线程池执行(CPU 密集型)BackgroundTasks— 后台任务(邮件/通知)- Celery / ARQ / SAQ — 分布式任务队列
asyncio.gather— 并发请求
缓存与性能:
- Redis —
aioredis/redis-pyasync fastapi-cache2— 装饰器缓存- 连接池 — SQLAlchemy pool_size / max_overflow
Phase 4: 测试、文档与部署
- 测试:
httpx.AsyncClient+pytest-asyncio— 异步测试TestClient(Starlette) — 同步测试@pytest.fixture— DB session / 测试数据 fixture- Factory Boy / Faker — 测试数据生成
- API 文档:
- 自动生成 OpenAPI —
/docs(Swagger UI) //redoc tags/summary/description— 文档增强responses参数 — 多状态码文档
- 自动生成 OpenAPI —
- 部署:
- Uvicorn + Gunicorn —
gunicorn -k uvicorn.workers.UvicornWorker - Docker — 多阶段构建 + Python slim
- Nginx 反向代理 — WebSocket 支持
- Serverless — AWS Lambda (Mangum) / Vercel
- Uvicorn + Gunicorn —
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 224 lines · 88 tokens per session scan A 98f0bae920db
fastapi-dev is a skill published in the GitHub repository cass-2003/local-workflow-skill (12 stars, last pushed 3mo ago), licensed MIT. It adds 88 tokens to every session and 2,380 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
fastapi-patterns
FastAPI patterns for async APIs, dependency injection, Pydantic request and response models, OpenAPI docs, tests, security, and production readiness.
stripe-projects
Use after E2B sandbox/API access has been provisioned through Stripe Projects and the user needs to use the resulting E2B API key with the E2B CLI, JavaScript SDK, Python SDK, or Code Interpreter SDK.
azure-mgmt-botservice-py
Azure Bot Service Management SDK for Python. Use for creating, managing, and configuring Azure Bot Service resources. Triggers: "azure-mgmt-botservice", "AzureBotService", "bot management", "conversational AI", "bot channels".
azure-messaging-webpubsubservice-py
Azure Web PubSub Service SDK for Python. Use for real-time messaging, WebSocket connections, and pub/sub patterns. Triggers: "azure-messaging-webpubsubservice", "WebPubSubServiceClient", "real-time", "WebSocket", "pub/sub".
django-pro
Master Django 5.x with async views, DRF, Celery, and Django Channels. Build scalable web applications with proper architecture, testing, and deployment. Use PROACTIVELY for Django development, ORM optimization, or complex Django patterns.
fastapi-pro
Build high-performance async APIs with FastAPI, SQLAlchemy 2.0, and Pydantic V2. Master microservices, WebSockets, and modern Python async patterns. Use PROACTIVELY for FastAPI development, async optimization, or API architecture.