From ai-toolkit
Creates FastAPI endpoints with layered architecture (Router → Service → Repository), Pydantic schemas, SQLAlchemy models, async CRUD, soft deletes, and tests. Use for new API endpoints, CRUD ops, or domain scaffolding.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ai-toolkit:python-api-endpoint-creatorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Creates complete FastAPI endpoints following strict layered architecture patterns.
Creates complete FastAPI endpoints following strict layered architecture patterns.
schemas.pymodels.pyrepository.pyservice.pyget_db, get_service in dependencies.pyrouter.pytests/See code-patterns.md for complete templates for each file.
Router (APIRouter) → Service → Repository → Database
↓ ↓ ↓
Depends() Business logic SQLAlchemy
Pydantic schemas HTTPException AsyncSession
Status codes Validation Soft delete
?id=xxx, never path params /{id}deleted_at.is_(None) in all queriesasync def for all endpoints — unless CPU-boundForgetting response_model makes your API leak internal fields. Always set response_model=YourSchema on endpoints. Without it, FastAPI serializes the raw return value, which may include hashed_password, deleted_at, or other internal fields from your SQLAlchemy model.
Depends() creates a new instance per request — not a singleton. If your service holds state, it will be lost between requests. Services should be stateless. If you need shared state, use app state or a cache.
await db.commit() in the dependency, not in the repository. The get_db dependency handles commit/rollback. If you also commit inside the repository, you get double-commit bugs or premature commits before all operations complete.
422 errors from Pydantic are opaque by default. Override the RequestValidationError handler to return field-level errors. The default just says "validation error" with no useful detail for the frontend.
Missing status_code=201 on create endpoints. FastAPI defaults to 200. Explicitly set status_code=status.HTTP_201_CREATED on POST create routes and status_code=status.HTTP_204_NO_CONTENT on delete routes.
npx claudepluginhub c0x12c/ai-toolkit --plugin ai-toolkitProvides production-ready FastAPI patterns for async APIs: domain-driven project structure, application factory, routers, dependencies, middleware, CRUD endpoints, and integrations like Beanie, Redis.
Provides FastAPI patterns for async web APIs: lifespan events, Pydantic models, path/query parameters, dependency injection. Triggers on FastAPI keywords.
Builds FastAPI REST APIs with Pydantic validation, OpenAPI docs, routing, dependency injection, and error handling.