$29
I want this!

AI Dev Config Kit: Python/FastAPI Edition

$29

Instructions: Select all text below this yellow box (Cmd+A) then copy (Cmd+C) and paste (Cmd+V) into the Gumroad Description field.

Note: You do not need to select this yellow instruction box. Only copy the content starting from "Stop wasting tokens..." below.

Stop wasting tokens on bad Python AI output. Ship your FastAPI SaaS 10x faster.

You're building a SaaS with Cursor or Claude Code, and your AI keeps generating synchronous SQLAlchemy 1.x code when you need async 2.0, Pydantic v1 patterns with orm_mode instead of v2's model_config, untyped route handlers, and Stripe webhook handlers without signature verification. You spend more time fixing AI output than you would writing the code yourself.

The AI Dev Config Kit: Python/FastAPI Edition fixes this permanently. It's 39 configuration files -- rules, commands, snippets, and templates -- that teach your AI IDE exactly how to write production-quality code for your Python 3.12 + FastAPI + SQLAlchemy 2.0 + Stripe project. Configure once. Get correct output every time.


What's Inside

39 files. 16,356+ lines of production-quality configuration. Everything organized and ready to drop into your project.

CategoryFilesDescriptionCursor Rules8 files.cursorrules + 7 .mdc rules (FastAPI, SQLAlchemy 2.0, Stripe, Pydantic v2, pytest, typing, Docker)Cursor Snippets2 files38 code snippets for FastAPI and SQLAlchemy patternsClaude Code Config9 filesCLAUDE.md (2,527 lines) + 7 slash commands + project memoryShared Templates14 filesProduction models, auth middleware, Stripe webhooks, Docker, Alembic, pytest configDocumentation4 filesQuickstart, Cursor setup, Claude Code setup, customization guideTotal39 files16,356+ lines


Before vs. After

Without the kit, AI assistants produce code like this:

WITHOUT the kit (Bad AI Output)

# Synchronous SQLAlchemy 1.x pattern
from sqlalchemy import create_engine
from sqlalchemy.orm import Session

engine = create_engine(DATABASE_URL)

def get_user(user_id: int):
    with Session(engine) as session:
        return session.query(User).filter(
            User.id == user_id
        ).first()

# Pydantic v1 pattern
class UserSchema(BaseModel):
    class Config:
        orm_mode = True

# Untyped FastAPI route
@app.post("/webhook")
def stripe_webhook(request: Request):
    payload = await request.body()
    event = json.loads(payload)  # No verification!
    ...

WITH the kit (Correct AI Output)

# Async SQLAlchemy 2.0 pattern
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy import select

async def get_user(
    session: AsyncSession,
    user_id: uuid.UUID,
) -> User | None:
    stmt = select(User).where(User.id == user_id)
    result = await session.execute(stmt)
    return result.scalar_one_or_none()

# Pydantic v2 pattern
class UserRead(BaseModel):
    model_config = ConfigDict(from_attributes=True)

# Typed, verified Stripe webhook
@router.post("/webhook", status_code=200)
async def stripe_webhook(
    request: Request,
    stripe_service: StripeDep,
) -> dict[str, str]:
    payload = await request.body()
    sig = request.headers["stripe-signature"]
    event = stripe.Webhook.construct_event(
        payload, sig, settings.stripe_webhook_secret
    )
    ...

Cursor Rules (8 files)

  • .cursorrules -- Master configuration file defining your full Python tech stack, coding conventions, architecture rules, naming patterns, anti-patterns to avoid, and performance guidelines. This is the brain of your Cursor setup.
  • fastapi.mdc -- Routers, dependency injection, middleware, WebSocket handlers, lifespan events, background tasks, streaming responses, and exception handlers. Includes correct patterns for async route handlers with proper type annotations.
  • sqlalchemy.mdc -- Async engine and session configuration, SQLAlchemy 2.0 query syntax with select(), mapped columns, relationship loading strategies, transaction management, and Alembic migration patterns. No more 1.x session.query() output.
  • stripe-python.mdc -- Checkout Sessions, subscription lifecycle, webhook event handling with signature verification, Customer Portal integration, idempotency keys, and proper error handling with stripe.error types. Every Stripe pattern your SaaS needs.
  • pydantic.mdc -- Pydantic v2 model definitions with ConfigDict, field validators, computed fields, generic models, discriminated unions, custom serializers, and settings management with pydantic-settings. Zero v1 patterns.
  • pytest.mdc -- Async test fixtures with pytest-asyncio, factory patterns, database test isolation, Stripe mocking, httpx test client usage, parametrized tests, and coverage configuration.
  • python-typing.mdc -- Modern Python type annotations with Protocol, TypeVar, ParamSpec, TypeGuard, @overload, generic types, and PEP 695 type aliases. Enforces strict typing throughout your codebase.
  • docker-deploy.mdc -- Multi-stage Docker builds with uv for fast installs, health checks, non-root users, CI/CD pipeline configuration, and deployment patterns for Railway and Fly.io.

Cursor Snippets (2 files)

  • fastapi-snippets.json -- 20+ ready-to-use code snippets for FastAPI: route handlers, dependency injection, middleware, exception handlers, WebSocket endpoints, background tasks, and response models.
  • sqlalchemy-snippets.json -- 18+ ready-to-use code snippets for SQLAlchemy 2.0: model definitions, async queries, relationships, CRUD operations, pagination, and Alembic migration scripts.

Claude Code Config (9 files)

  • CLAUDE.md -- Comprehensive project context file (2,527 lines) covering your entire tech stack, architecture principles, folder structure, coding standards, naming conventions, FastAPI patterns, SQLAlchemy models, Pydantic schemas, Supabase auth, Stripe integration, testing standards, Docker configuration, and anti-patterns. This is the most thorough Python/FastAPI CLAUDE.md you will find.
  • /setup-project -- Scaffolds a complete FastAPI project from scratch with the correct folder structure, pyproject.toml, Docker configuration, Alembic setup, and initial boilerplate using uv as the package manager.
  • /add-auth -- Adds Supabase JWT authentication with RBAC: JWT verification middleware, role-based access control, protected route dependencies, and user management endpoints.
  • /add-payments -- Adds Stripe payments: checkout session creation, subscription management, webhook handler with signature verification, Customer Portal redirect, and pricing endpoint.
  • /add-crud -- Generates full CRUD operations for any resource: SQLAlchemy model, Pydantic schemas, async repository, FastAPI router, and pytest test suite with factories and fixtures.
  • /add-api-route -- Scaffolds a single typed API endpoint with Pydantic input/output schemas, dependency injection, proper error responses, and a matching test file.
  • /run-tests -- Runs pytest + mypy + ruff in sequence, reports coverage metrics, and identifies untested code paths.
  • /deploy -- Runs pre-deployment checks (type checking, linting, tests) and builds the Docker image for deployment.
  • project-conventions.md -- Memory file where Claude Code persists your project-specific decisions, patterns, and preferences across sessions. The AI remembers what you decided last Tuesday.

Production Templates (14 files)

  • SQLAlchemy 2.0 async models -- User, Subscription, and base models with timestamp mixins, UUID primary keys, and properly configured relationships using Mapped and mapped_column.
  • JWT auth middleware -- Supabase JWT verification with FastAPI dependency injection, role-based access control, and proper error responses for expired or invalid tokens.
  • Stripe webhook handler -- Complete handler covering 8 event types: checkout.session.completed, customer.subscription.created, customer.subscription.updated, customer.subscription.deleted, invoice.payment_succeeded, invoice.payment_failed, customer.created, and customer.updated. Includes signature verification and idempotent processing.
  • Pydantic v2 schemas -- Generic response models, paginated list schemas, error response schemas, and base schemas with ConfigDict(from_attributes=True) for ORM integration.
  • pytest conftest -- Async test fixtures with database isolation, httpx AsyncClient setup, Stripe mock fixtures, factory functions, and authenticated test client helpers.
  • Docker multi-stage build -- Production Dockerfile with uv for fast dependency installation, non-root user, health check endpoint, and optimized layer caching.
  • Alembic async migrations -- env.py configured for async SQLAlchemy, auto-generation support, and migration template with proper upgrade/downgrade functions.
  • pyproject.toml -- Complete project configuration with ruff (linting and formatting), mypy (strict mode), pytest (asyncio auto mode), and all dependency groups organized.

Documentation (4 files)

  • QUICKSTART.md -- Get running in 5 minutes. Prerequisites, step-by-step installation, environment setup, and example prompts to verify everything works.
  • CURSOR-SETUP.md -- Detailed Cursor configuration guide: where to place files, how to import snippets, how to verify rules are loaded, and troubleshooting common issues.
  • CLAUDE-CODE-SETUP.md -- Detailed Claude Code configuration guide: CLAUDE.md placement, custom command setup, memory file initialization, and workflow examples.
  • CUSTOMIZATION.md -- How to adapt the kit to your specific needs: removing unused rules, adding new technologies, customizing conventions, and extending commands.

Who Is This For?

  • Python developers building SaaS products with FastAPI who want their AI IDE to generate correct, async, fully-typed code on the first try instead of requiring constant corrections.
  • Developers using Cursor or Claude Code for AI-assisted coding who are tired of the AI defaulting to synchronous SQLAlchemy 1.x, Pydantic v1 patterns, and missing type annotations.
  • Anyone who has wasted hours fixing AI-generated Python code -- rewriting session.query() to select(), adding missing async/await, replacing orm_mode with from_attributes, and adding type hints the AI should have included from the start.
  • Teams (2-10 developers) who need a shared standard for how AI assistants write Python code, so every team member's AI output follows the same patterns and conventions.
  • Freelancers and agency developers who build multiple FastAPI projects for clients and want a reusable configuration they can drop into every new project to hit the ground running.

Who Is This NOT For?

Transparency matters. This kit is not the right fit for everyone:

  • You are not using FastAPI, SQLAlchemy, or Stripe. The rules and templates are deeply specific to this stack. If you are using Django, Flask, or a different ORM like Tortoise or Peewee, the majority of the content will not apply.
  • You want a complete boilerplate or starter template. This is not a codebase you clone and build on top of. It is a set of configuration files that make your AI assistant smarter. You still write (or prompt) the actual application code.
  • You are not using Cursor or Claude Code. The configuration files are formatted specifically for these two tools. While some AI IDEs can interpret .cursorrules files, full compatibility is only guaranteed with Cursor and Claude Code CLI.
  • You expect the AI to build your entire app without guidance. This kit dramatically improves AI output quality, but you still need to understand your tech stack and provide meaningful prompts. It makes the AI a better partner, not a replacement for your judgment.

Tech Stack Covered

Python 3.12+Modern syntax, type annotations, pattern matching, asyncio, PEP 695 type aliasesFastAPIAsync routers, dependency injection, middleware, WebSocket, lifespan, background tasksSQLAlchemy 2.0Async engine/session, Mapped columns, select() queries, relationship loading, transactionsPydantic v2ConfigDict, field validators, computed fields, generics, pydantic-settingsSupabaseJWT authentication, Row Level Security, user management, RBACStripeCheckout, Subscriptions, Webhooks, Customer Portal, idempotencypytestAsync fixtures, factories, mocking, parametrized tests, coverageDockerMulti-stage builds, uv installs, health checks, Railway/Fly.io deploymentuvFast package management, dependency resolution, virtual environments, lockfilesruff + mypyLinting, formatting, strict type checking, zero Any typesAlembicAsync migrations, auto-generation, upgrade/downgrade management


What Makes This Different?

vs. Free .cursorrules Files from GitHub

FeatureFree GitHub RulesAI Dev Config KitStack specificityGeneric Python rules, one-size-fits-allTailored for FastAPI + SQLAlchemy 2.0 + StripeRule integrationIndividual files, untested together39 files tested as a complete, coherent systemCode examplesMinimal or noneGood and bad examples for every rule and patternClaude Code supportNoneFull CLAUDE.md (2,527 lines) + 7 slash commands + memoryCode templatesNone14 production templates (models, auth, webhooks, Docker, Alembic)SnippetsNone38 ready-to-use FastAPI and SQLAlchemy snippetsDocumentationREADME at best4 detailed guides (quickstart, setup, customization)UpdatesSporadic, if everLifetime updates with every major version bump

vs. SaaS Boilerplates ($199+)

Boilerplates give you a codebase to start from. This kit gives you an AI assistant that understands your patterns. Here is why that matters:

  • Boilerplates lock you into their architecture. This kit adapts to yours. You build what you need instead of ripping out what you don't.
  • Boilerplates become outdated. AI-generated code uses the latest APIs because the rules teach current best practices -- not last year's patterns frozen in a starter repo.
  • Boilerplates are a one-time starting point. This kit helps you throughout the entire development lifecycle -- from project setup to deployment, from adding auth to writing tests.
  • Boilerplates cost 7-10x more. At $29, this kit costs less than a single hour of developer time and saves you hundreds of hours over the life of your project.

Frequently Asked Questions

Does this work with Windsurf or other AI IDEs?

The Cursor rule files (.cursorrules and .mdc files) follow standard formats that several AI IDEs can interpret. Windsurf, in particular, can read .cursorrules files. However, the kit is tested and optimized specifically for Cursor and Claude Code CLI. The Claude Code configuration (CLAUDE.md, custom commands, memory) is specific to Claude Code and will not work in other tools.

Will this work with my existing project?

Yes. The configuration files are purely additive -- you copy them into your project and they take effect immediately. No code changes required. No dependencies to install. No build step. If your existing project uses FastAPI + SQLAlchemy + Stripe (or any subset of that stack), the relevant rules will apply right away.

What if I'm not using all three technologies (FastAPI + SQLAlchemy + Stripe)?

Each technology has its own dedicated rule file. If you are not using Stripe, simply do not copy the stripe-python.mdc file and the Stripe snippets. The remaining rules work independently. The Customization Guide explains exactly which files to include for your specific stack.

I already have a .cursorrules file. Will this conflict?

The kit's .cursorrules replaces your existing one. However, the Customization Guide walks you through merging your existing rules with the kit's rules so you keep your custom conventions while gaining the kit's stack-specific intelligence.

How is this different from just writing my own CLAUDE.md or .cursorrules?

You absolutely can write your own, and many developers do. The difference is time and depth. This kit represents hundreds of hours of iteration: testing which rule phrasings actually change AI behavior, discovering which anti-patterns the AI needs to be explicitly told to avoid, and structuring the rules so they work together as a system rather than conflicting with each other. You could build this yourself, but it would take weeks of experimentation to reach the same level of effectiveness.

I already bought the Next.js Edition. Do I need this too?

If you are building with FastAPI, yes. The Python/FastAPI Edition is an entirely separate product written from scratch for the Python ecosystem. The rules, templates, snippets, and commands are completely different. There is no overlap between the two editions -- each is purpose-built for its respective stack.

Do I get updates?

Yes, free lifetime updates. When Python 3.13 ships, when SQLAlchemy releases new features, when Pydantic or FastAPI introduce breaking changes -- the kit is updated accordingly and you receive the update through Gumroad at no additional cost. You paid once. You benefit forever.

What if it doesn't work for me?

30-day money-back guarantee, no questions asked. If the kit does not improve your AI development workflow, request a full refund through Gumroad. You will receive your money back promptly. There is zero risk.

Can I use this for client projects?

Yes. The license permits use in unlimited personal and commercial projects, including client work and freelance projects. The only restriction is that you cannot redistribute or resell the configuration kit itself. A single license covers up to 10 developers on the same team.


Money-Back Guarantee

30 days. No questions asked.

Try the AI Dev Config Kit in your project. If it does not noticeably improve the quality and consistency of your AI-generated code, request a full refund through Gumroad within 30 days. You will receive your money back -- no justification needed, no hoops to jump through. The risk is entirely on us, not on you.


Lifetime Updates

Buy once. Benefit forever.

The Python ecosystem moves fast. FastAPI, SQLAlchemy, Pydantic, and Stripe all release major updates regularly. When they do, the AI Dev Config Kit is updated to reflect the latest APIs, patterns, and best practices. Every update is delivered to you through Gumroad at no additional cost. Your $29 investment today keeps paying dividends for years to come.


What Developers Are Saying

"My AI kept generating synchronous SQLAlchemy with session.query(). Dropped in the config kit and every query is now async with select(). No more rewriting. That alone saved me hours."

"The Claude Code slash commands are incredible. /add-crud gave me a complete async CRUD module with Pydantic schemas, tests, and factories in minutes. Would have taken me half a day to write."

"I was constantly fighting Pydantic v1 output -- orm_mode, validator decorators, the old schema_extra. With the kit, everything is v2 from the start. ConfigDict, field_validator, model_json_schema. Finally."


What You Get

  • 39 files, 16,356+ lines of production-quality configuration
  • One-time purchase -- $29, no subscription
  • Lifetime free updates -- every major version bump, delivered through Gumroad
  • 30-day money-back guarantee -- no questions asked
  • Works with any FastAPI project -- new or existing
  • Commercial license -- unlimited personal and client projects, up to 10 developers

Stop fighting your AI assistant.
Start shipping your FastAPI SaaS.

39 files · 16,356+ lines · Cursor + Claude Code · Python 3.12 + FastAPI + SQLAlchemy 2.0 + Stripe
One-time payment · Lifetime updates · 30-day money-back guarantee

I want this!
Size
160 KB
Powered by