kb-python

Guide Python backend design with FastAPI, Django, or Flask and async strategy.

Updated May 19, 2026
One-click install
npx skills add https://github.com/TimeKast/AgendaInteligente --skill kb-python
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kb-python
Source: https://github.com/TimeKast/AgendaInteligente/tree/main/.claude/skills/kb-python
Command: npx skills add https://github.com/TimeKast/AgendaInteligente --skill kb-python

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you quickly choose and implement a clean Python backend approach for APIs, validation, and background work without blindly following defaults.

Core Features & Use Cases

  • Framework selection (FastAPI, Django, Flask): match the framework to whether you’re building API-first services, full-stack admin-heavy apps, or lightweight scripts.
  • Async vs sync endpoint strategy: decide async for I/O-bound concurrency and sync for CPU-bound work while avoiding unsafe mixing.
  • Typing and Pydantic v2 integration: define typed public APIs and use Pydantic for request/response validation and serialization.
  • Background tasks and error handling guidance: pick between in-process background tasks and distributed job queues, and shape consistent domain errors.
  • Testing principles: structure unit/integration/E2E testing with appropriate tools and async test patterns.

Quick Start

Use kb-python to review your proposed Python backend design (framework choice, async strategy, typing, Pydantic v2 schemas, background tasks, and error format) and produce an implementation plan you can follow in your project.

Frequently Asked Questions about kb-python

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

FAQPage Schema
How do I choose between FastAPI, Django, and Flask for a Python backend?

Choose FastAPI for API-first services, Django for full-stack admin-heavy apps, and Flask for lightweight scripts. Framework selection depends on whether your workload prioritizes API design, built-in admin features, or minimal footprint.

When should I use async versus sync execution in Python endpoints?

Use async execution for I/O-bound concurrency to handle multiple waiting requests efficiently, and sync execution for CPU-bound work. Mixing them unsafely causes performance issues, so isolate CPU-heavy tasks to blocking threads or background queues.

How do I validate API requests using Pydantic v2 in FastAPI?

Define typed public APIs with strong type hints and use Pydantic v2 for request/response validation and serialization. This boundary validation ensures consistent data shapes entering and exiting your Python backend services.

What is the best way to handle background tasks and distributed job queues in Python?

Select in-process background tasks for lightweight async workloads and distributed job queues for heavy CPU-bound processing. Structuring background workers properly prevents unsafe async and sync mixing while maintaining consistent domain error shapes.

Does Python 3.11 require specific typing conventions for backend API design?

Python 3.11 requires strong type hints and Pydantic v2 boundary validation for backend API design. These conventions ensure typed public APIs, consistent error response shapes, and structured request/response serialization across endpoints.

How do I structure unit and integration testing for async Python endpoints?

Structure testing with appropriate tools and async test patterns aligned to your execution strategy. Unit tests validate Pydantic schemas and logic, while integration and E2E tests verify endpoint behavior without unsafe async and sync mixing.