Loading...
Loading...
Generate Python FastAPI code following project design patterns. Use when creating models, schemas, repositories, services, controllers, database migrations, authentication, or tests. Enforces layered architecture, async patterns, OWASP security, and Alembic migration naming conventions (yyyymmdd_HHmm_feature).
npx skill4agent add lct1407/sidcorp-skills python-backend-developmentRouter/Controller → Service → Repository → Database
↓ ↓ ↓
Schemas Business SQLAlchemy
(Pydantic) Logic Models| Layer | Location | Purpose |
|---|---|---|
| Models | | SQLAlchemy ORM, database schema |
| Schemas | | Pydantic DTOs (request/response) |
| Repositories | | Database CRUD operations |
| Services | | Business logic orchestration |
| Controllers | | FastAPI routes, thin handlers |
| Migrations | | Database migrations |
user_profile.pyuser.pyclass UserUserBlogPostUserCreateUserResponseUserUpdateUserRepositoryUserServiceusersblog_postscreated_atuser_idyyyymmdd_HHmm_<feature>.py20260117_0930_create_users_table.py20260117_1045_add_email_to_users.py20260117_1400_create_api_keys_table.py# Generate with autogenerate
alembic revision --autogenerate -m "description"
# Then rename the file to follow convention:
# FROM: xxxx_description.py
# TO: yyyymmdd_HHmm_description.pyasync defawaitDepends()app/core/exceptions.py