skills/navanithans/agent-skill-kit/ask-fastapi-architect

ask-fastapi-architect

SKILL.md

<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>

Weekly Installs
10
GitHub Stars
1
First Seen
Feb 16, 2026
Installed on
gemini-cli10
qoder10
replit10
antigravity10
codebuddy10
qwen-code10