fastapi-python
하는 일
이 스킬은 Python 웹 프레임워크인 FastAPI로 웹 API를 만드는 모범 사례를 AI에게 가르칩니다. 깔끔하고 구조화된 백엔드 코드를 원하는 개발자를 위한 것입니다.
사용하는 경우
- ✓FastAPI로 Python 웹 API를 만들 때.
- ✓API의 요청과 응답 모델을 타입 검사하고 싶을 때.
- ✓많은 요청을 효율적으로 처리하는 비동기 엔드포인트가 필요할 때.
스킬 링크
https://github.com/debpalash/VoiceStudio/blob/main/.agents/skills/fastapi-python/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“사용자가 작업을 만들고 목록을 볼 수 있는 FastAPI 엔드포인트를 만들어 주세요. 입력은 검증되어야 합니다.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 작은 함수들을 작성하고 Pydantic 모델로 데이터를 검증합니다. 오류 상황은 일찍 처리하고, 각 함수의 주요 로직은 끝부분에 둡니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
FastAPI Python
You are an expert in FastAPI and Python backend development.
Key Principles
- Write concise, technical responses with accurate Python examples
- Favor functional, declarative programming over class-based approaches
- Prioritize modularization to eliminate code duplication
- Use descriptive variable names with auxiliary verbs (e.g.,
is_active,has_permission) - Employ lowercase with underscores for file/directory naming (e.g.,
routers/user_routes.py) - Export routes and utilities explicitly
- Follow the RORO (Receive an Object, Return an Object) pattern
Python/FastAPI Standards
- Use
deffor pure functions,async deffor asynchronous operations - Use type hints for all function signatures. Prefer Pydantic models over raw dictionaries
- Structure: exported router, sub-routes, utilities, static content, types (models, schemas)
- Use ordinary Python control flow; prefer readability over compressed one-line conditionals
Error Handling
- Handle edge cases at function entry points
- Employ early returns for error conditions
- Place happy path logic last
- Avoid unnecessary else statements; use if-return patterns
- Implement guard clauses for preconditions
- Provide proper error logging and user-friendly messaging
FastAPI-Specific Guidelines
- Use functional components (plain functions) and Pydantic models for input validation
- Declare routes with clear return type annotations
- Prefer lifespan context managers for managing startup and shutdown events
- Leverage middleware for logging, error monitoring, and optimization
- Use HTTPException for expected errors and model them as specific HTTP responses
- Apply Pydantic's BaseModel consistently for validation
Performance Optimization
- Minimize blocking I/O. In
async defhandlers, use awaitable database/API clients; put synchronous SQLite or other blocking work in synchronous routes or explicitly offload it - Implement caching with Redis or in-memory stores
- Optimize Pydantic serialization/deserialization
- Use lazy loading for large datasets
Key Conventions
- Rely on FastAPI's dependency injection system
- Prioritize API performance metrics (response time, latency, throughput)
- Structure routes and dependencies for readability and maintainability
Dependencies
FastAPI, Pydantic v2, asyncpg/aiomysql, SQLAlchemy 2.0
자주 묻는 질문
FastAPI는 무엇인가요?
웹 API를 만드는 Python 프레임워크입니다.
여기서 Pydantic은 무엇에 쓰나요?
스킬은 입력과 출력을 검증하기 위해 원시 딕셔너리보다 Pydantic 모델을 선호합니다.
파일 이름은 어떻게 짓나요?
스킬은 user_routes.py처럼 소문자와 밑줄을 사용합니다.
상세 정보
작성자의 원본 설명
Expert in FastAPI Python development with best practices for APIs and async operations
repo: debpalash/VoiceStudio
인기도
- GitHub 스타
- 99k
- 순위
- #1287
- 라이선스
- AGPL-3.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
vite
99k빠른 웹 앱 빌드 도구인 Vite에 대해 설정, 환경 변수, 성능을 다루는 전문 안내를 에이전트에게 제공합니다.
voicestudio
99k저장된 목소리로 음성을 생성하고, 오디오를 전사하며, 로컬 VoiceStudio 앱을 통해 더빙이나 내레이션 단계를 실행하도록 에이전트를 돕습니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.