add-endpoint-python

Scaffold FastAPI endpoints with routers, services, repositories, and models.

1|Updated Apr 21, 2026
One-click install
npx skills add https://github.com/sswapnil2/ai-config-fintech --skill add-endpoint-python
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-endpoint-python
Source: https://github.com/sswapnil2/ai-config-fintech/tree/main/skills/add-endpoint-python
Command: npx skills add https://github.com/sswapnil2/ai-config-fintech --skill add-endpoint-python

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Building backend endpoints often requires wiring routers, services, repositories, data models, migrations, and tests. This Skill eliminates manual boilerplate by generating a ready-to-use Python FastAPI endpoint scaffold that includes a router, a service layer, a repository, Pydantic v2 models, SQLAlchemy 2.x models, Alembic migrations, and pytest + testcontainers tests.

Core Features & Use Cases

  • End-to-end scaffold: router, service, repository, models, and migrations for a new feature.
  • Strong typing & validation: Pydantic v2 models for requests and responses; typed router handlers; money types with Decimal; PII protection with EncryptedStr.
  • Testability & observability: unit tests for service logic and integration tests with testcontainers; audit log on mutations; idempotency support for safe retries.
  • Use Case: Quickly prototyping a new API feature like creating a product or user action with complete persistence and auditing.

Quick Start

Provide the feature name and data model to generate a ready-to-use FastAPI endpoint scaffold.

Frequently Asked Questions about add-endpoint-python

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold a FastAPI endpoint with SQLAlchemy and Alembic migrations?

To scaffold a FastAPI endpoint with SQLAlchemy and Alembic, you provide a feature name and data model to generate the full stack. This creates typed router handlers, async database integration, and migration files, eliminating manual boilerplate for complete persistence.

What is the best way to structure a production-ready FastAPI backend?

The best way to structure a production-ready FastAPI backend is using router, service, and repository layers. This scaffold generates that architecture automatically, adding Pydantic v2 schemas, async SQLAlchemy 2.x models, audit logging, and idempotency support for safe retries.

Can I use Pydantic v2 and async SQLAlchemy 2.x for FastAPI endpoint creation?

Yes, you can use Pydantic v2 and async SQLAlchemy 2.x together for FastAPI endpoint creation. The scaffold enforces strong typing and validation with Pydantic v2 models and handles async database operations through SQLAlchemy 2.x, including Decimal money types and EncryptedStr for PII protection.

How do I add idempotency and audit logging to a FastAPI service layer?

To add idempotency and audit logging to a FastAPI service layer, you implement mutation tracking and request state validation. This scaffold includes an audit-logging workflow for mutations and built-in idempotency support for safe retries directly within the generated service layer.

Does FastAPI scaffolding work with pytest and testcontainers for integration tests?

Yes, FastAPI scaffolding works with pytest and testcontainers for integration tests. The generated endpoint scaffold includes unit tests for service logic alongside integration tests using testcontainers, ensuring both business logic and database interactions are fully testable.

Why do I need Alembic migrations when building a new FastAPI API feature?

You need Alembic migrations when building a new FastAPI API feature to manage database schema changes alongside code updates. The scaffold generates Alembic migration files automatically, ensuring your async SQLAlchemy 2.x models are synchronized with the database schema for complete feature persistence.