Create FastAPI routers with CRUD operations, authentication dependencies, and proper response models. Use when building REST API endpoints, creating new routes, implementing CRUD operations, or adding consistent authentication and HTTP semantics across resources. The generated scaffold includes replaceable placeholders ({{ResourceName}} in PascalCase, {{resource_name}} in snake_case, {{resource_plural}} for plurals), common CRUD endpoints, examples of optional vs. required auth (Depends(get_current_user) vs. Depends(get_current_user_required)), response_model annotations (e.g., Item and list[Item]), and correct status_code usage (HTTP_201_CREATED for POST, HTTP_204_NO_CONTENT for DELETE). It integrates Pydantic models and a service layer to reduce boilerplate, speed development, and improve maintainability while simplifying router mounting and frontend integration.
Create FastAPI routers following established patterns with proper authentication, response models, and HTTP status codes.
Copy the template from assets/template.py and replace placeholders:
{{ResourceName}} → PascalCase name (e.g., Project){{resource_name}} → snake_case name (e.g., project){{resource_plural}} → plural form (e.g., projects)# Optional auth - returns None if not authenticated
current_user: Optional[User] = Depends(get_current_user)
# Required auth - raises 401 if not authenticated
current_user: User = Depends(get_current_user_required)
@router.get("/items/{item_id}", response_model=Item)
async def get_item(item_id: str) -> Item:
...
@router.get("/items", response_model=list[Item])
async def list_items() -> list[Item]:
...
@router.post("/items", status_code=status.HTTP_201_CREATED)
@router.delete("/items/{id}", status_code=status.HTTP_204_NO_CONTENT)
src/backend/app/routers/src/backend/app/main.pyThis skill is applicable to execute the workflow or actions described in the overview.
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer