ask-fastapi-architect
2
总安装量
2
周安装量
#66720
全站排名
安装命令
npx skills add https://github.com/navanithans/agent-skill-kit --skill ask-fastapi-architect
Agent 安装分布
gemini-cli
2
qoder
2
replit
2
antigravity
2
codebuddy
2
qwen-code
2
Skill 文档
<critical_constraints> â NO global DB sessions â use Depends(get_db) â NO manually instantiating services in routes â use Depends â NO routes without response_model â prevents data leaks â MUST use Pydantic V2 (model_config, ConfigDict) â MUST use AsyncSession with select() â MUST use alembic for migrations </critical_constraints>
<pydantic_v2>
from pydantic import BaseModel, ConfigDict, Field
class UserCreate(BaseModel):
model_config = ConfigDict(from_attributes=True)
username: str = Field(..., min_length=3)
email: str
</pydantic_v2>
<dependency_injection>
@router.post("/", response_model=ShowUser)
async def create_user(
user_in: UserCreate,
db: AsyncSession = Depends(get_db),
current_user: User = Depends(get_current_active_user)
):
return await UserService.create(db, user_in)
</dependency_injection>
<async_db>
result = await db.execute(select(User).where(User.id == user_id))
user = result.scalars().first()
</async_db>