backend-api
Build FastAPI REST APIs with CORS, JWT auth, Pydantic validation, async endpoints, and proper error handling. Use when creating API endpoints, middleware, or backend services.
npx skills add majiayu000/claude-skill-registry --skill backend-api-jawad-chaudhary-hackathone-2-todo-sp --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# FastAPI Backend API Development ## Core Pattern ```python from fastapi import FastAPI, HTTPException, Depends from fastapi.middleware.cors import CORSMiddleware from pydantic import BaseModel, Field import os app = FastAPI(title="API") # CORS from environment app.add_middleware( CORSMiddleware, allow_origins=os.getenv("CORS_ORIGINS", "").split(","), allow_credentials=os.getenv("CORS_ALLOW_CREDENTIALS") == "true", allow_methods=["*"], allow_headers=["*"], ) class Request(BaseModel): field: str = Field(..., min_length=1) @app.post("/api/{user_id}/endpoint") async def endpoint(user_id: str, req: Request, current_user: str = Depends(verify_jwt)): if user_id != current_user: raise HTTPException(status_code=403, detail="User ID mismatch") return {"status": "ok"} ``` ## Error Handling - Use `HTTPException` with proper status codes (401, 403, 404, 500) - Provide user-friendly error messages - Always use async for I/O operations ## Testing ```python from fastapi.testclient import TestClient client = TestClient(app) response = client.post("/api/user123/endpoint", json={"field": "value"}) assert response.status_code == 200 ```
- Core Pattern
- Error Handling
- Testing
What does the backend-api skill do?
Build FastAPI REST APIs with CORS, JWT auth, Pydantic validation, async endpoints, and proper error handling. Use when creating API endpoints, middleware, or backend services.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill backend-api-jawad-chaudhary-hackathone-2-todo-sp --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
