Python api endpoint creator

From c0x12c/ai-toolkit · View interactive version

Python api endpoint creator is an AI agent skill from the GitHub repository c0x12c/ai-toolkit. Creates FastAPI endpoints with layered architecture (Router → Service → Repository). Use when creating new API endpoints, CRUD operations, or scaffolding a new domain module in a FastAPI project.

How to use this skill

Skill file

Python API Endpoint Creator

Creates complete FastAPI endpoints following strict layered architecture patterns.

When to Use

Process

  1. Pydantic Schemas — Create/Update/Response in schemas.py
  2. SQLAlchemy Model — with SoftDeleteMixin in models.py
  3. Repository — async CRUD with soft delete in repository.py
  4. Service — business logic, HTTPException for errors in service.py
  5. Dependencies — get_db, get_service in dependencies.py
  6. Router — thin endpoints, Depends() for everything in router.py
  7. Tests — httpx AsyncClient tests in tests/

See code-patterns.md for complete templates for each file.

Architecture

Router (APIRouter)  →  Service  →  Repository  →  Database
      ↓                  ↓            ↓
  Depends()        Business logic  SQLAlchemy
  Pydantic schemas HTTPException   AsyncSession
  Status codes     Validation      Soft delete

Hard Rules

Gotchas

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.