fastapi-development — скилл для Claude Code: FastAPI с async
Скилл для ИИ-агента, который помогает писать Python-API на FastAPI: асинхронные роуты, валидация через Pydantic, JWT и автодокументация OpenAPI.
npx skills add aj-geddes/useful-ai-prompts --skill fastapi-development -a claude-codeЧто делает fastapi-development
Скилл задаёт агенту набор правил и примеров для разработки FastAPI-приложений. Внутри — быстрый старт с созданием экземпляра FastAPI, подключением CORS-мидлвари и логирования, а дальше шесть справочных файлов в каталоге references/: настройка приложения, модели Pydantic, асинхронные запросы к базе через SQLAlchemy, безопасность и JWT, сервисный слой и роуты с async-эндпоинтами.
Отдельный блок — список того, чего делать не стоит. Агент получает прямые запреты: не использовать синхронные операции с базой, не возвращать модели базы в ответах, не хранить секреты в коде, не реализовывать аутентификацию прямо в обработчиках роутов. Это заметно меняет то, что агент сгенерирует по умолчанию, поэтому скилл стоит подключать до того, как в проекте появится первый роут.
Скилл распространяется под MIT и работает в Claude, Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode. Для установки нужен npx или gh — в зависимости от платформы.
Какие задачи решает
- поднять каркас FastAPI-приложения с CORS и логированием
- описать схемы запросов и ответов на Pydantic
- сделать асинхронные запросы к базе через SQLAlchemy
- закрыть роуты JWT-аутентификацией
- вынести бизнес-логику в сервисный слой
Примеры запросов агенту
- создай FastAPI-приложение с async-роутами и подключи CORS
- опиши Pydantic-модели для эндпоинта создания пользователя
- добавь JWT-аутентификацию на защищённые роуты
Как установить fastapi-development
1Через Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill fastapi-development -a claude-code2Вручную: положить файлы
~/.claude/skills/fastapi-development/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/fastapi-development/
1Через Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill fastapi-development -a codex2Вручную: положить файлы
.agents/skills/fastapi-development/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill fastapi-development -a cursor2Вручную: положить файлы
.cursor/skills/fastapi-development/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install aj-geddes/useful-ai-prompts fastapi-development2Вручную: положить файлы
.github/skills/fastapi-development/SKILL.md1Через Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill fastapi-development -a gemini-cli2Командой платформы
gemini skills install https://github.com/aj-geddes/useful-ai-prompts --path skills/fastapi-developmentВручную: положить файлы
.devin/skills/fastapi-development/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill fastapi-development -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Из того же набора110
Похожие
Рядом в теме «Бэкенд и API»
Всё по теме «Бэкенд и API» →Вопросы о fastapi-development
Как установить fastapi-development в Claude?
Выполните npx skills add aj-geddes/useful-ai-prompts --skill fastapi-development -a claude-code. Скилл появится в ~/.claude/skills/fastapi-development/SKILL.md.
Что делает fastapi-development?
Даёт агенту инструкции и примеры для разработки FastAPI-приложений: асинхронные роуты, валидация Pydantic, внедрение зависимостей, JWT и автоматическая документация OpenAPI.
Какие платформы поддерживает скилл?
Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode. Для каждой платформы своя команда установки, а файл скилла кладётся в отдельный каталог.
Исходный текст
SKILL.md · MIT
---
name: fastapi-development
description: >
Build high-performance FastAPI applications with async routes, validation,
dependency injection, security, and automatic API documentation. Use when
developing modern Python APIs with async support, automatic OpenAPI
documentation, and high performance requirements.
---
# FastAPI Development
## Table of Contents
- [Overview](#overview)
- [When to Use](#when-to-use)
- [Quick Start](#quick-start)
- [Reference Guides](#reference-guides)
- [Best Practices](#best-practices)
## Overview
Create fast, modern Python APIs using FastAPI with async/await support, automatic API documentation, type validation using Pydantic, dependency injection, JWT authentication, and SQLAlchemy ORM integration.
## When to Use
- Building high-performance Python REST APIs
- Creating async API endpoints
- Implementing automatic OpenAPI/Swagger documentation
- Leveraging Python type hints for validation
- Building microservices with async support
- Integrating Pydantic for data validation
## Quick Start
Minimal working example:
```python
# main.py
from fastapi import FastAPI, HTTPException, status
from fastapi.middleware.cors import CORSMiddleware
from contextlib import asynccontextmanager
import logging
# Setup logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
# Create FastAPI instance
app = FastAPI(
title="API Service",
description="A modern FastAPI application",
version="1.0.0",
docs_url="/api/docs",
openapi_url="/api/openapi.json"
)
# Add CORS middleware
app.add_middleware(
CORSMiddleware,
allow_origins=["http://localhost:3000"],
allow_credentials=True,
allow_methods=["*"],
// ... (see reference guides for full implementation)
```
## Reference Guides
Detailed implementations in the `references/` directory:
| Guide | Contents |
|---|---|
| [FastAPI Application Setup](references/fastapi-application-setup.md) | FastAPI Application Setup |
| [Pydantic Models for Validation](references/pydantic-models-for-validation.md) | Pydantic Models for Validation |
| [Async Database Models and Queries](references/async-database-models-and-queries.md) | Async Database Models and Queries |
| [Security and JWT Authentication](references/security-and-jwt-authentication.md) | Security and JWT Authentication |
| [Service Layer for Business Logic](references/service-layer-for-business-logic.md) | Service Layer for Business Logic |
| [API Routes with Async Endpoints](references/api-routes-with-async-endpoints.md) | API Routes with Async Endpoints |
## Best Practices
### ✅ DO
- Use async/await for I/O operations
- Leverage Pydantic for validation
- Use dependency injection for services
- Implement proper error handling with HTTPException
- Use type hints for automatic OpenAPI documentation
- Create service layers for business logic
- Implement authentication on protected routes
- Use environment variables for configuration
- Return appropriate HTTP status codes
- Document endpoints with docstrings and tags
### ❌ DON'T
- Use synchronous database operations
- Trust user input without validation
- Store secrets in code
- Ignore type hints
- Return database models in responses
- Implement authentication in route handlers
- Use mutable default arguments
- Forget to validate query parameters
- Expose stack traces in production
© aj-geddes · MIT · aj-geddes/useful-ai-prompts