python-patterns

Guide Python architectural decisions for framework, async, typing, and structure.

Updated Jan 24, 2026
One-click install
npx skills add https://github.com/lehoangphuc747/anki-lms-demo --skill python-patterns-lehoangphuc747
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-patterns
Source: https://github.com/lehoangphuc747/anki-lms-demo/tree/main/.agent/skills/python-patterns
Command: npx skills add https://github.com/lehoangphuc747/anki-lms-demo --skill python-patterns-lehoangphuc747

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Python developers need a principled approach to architectural decisions in Python projects, avoiding ad-hoc choices and scattered best practices by providing a decision-oriented framework.

Core Features & Use Cases

  • Decision frameworks for selecting FastAPI, Django, or Flask based on project needs and constraints.
  • Async vs Sync guidance with concrete criteria and guardrails for I/O-bound vs CPU-bound tasks.
  • Typing strategy guidance using Optional, Union, and practical validation patterns, plus project-structure recommendations.
  • Real-world scenario: starting a small API service and scaling to a larger backend with clear separation of concerns.

Quick Start

Ask your project context and I will apply the Python patterns framework to pick a framework, async strategy, typing approach, and structure.

Frequently Asked Questions about python-patterns

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 new Python project?

Choosing between FastAPI, Django, and Flask depends on project constraints. Apply a decision framework evaluating project size, async needs, and typing strictness to select the right Python framework for robust architectural decisions.

When should I use async vs sync Python for I/O-bound and CPU-bound tasks?

Use async Python for I/O-bound tasks and sync for CPU-bound tasks. Apply concrete criteria and guardrails to your architectural decisions to correctly implement async vs sync strategies in your Python services.

What is the best way to structure a Python project scaling from a small script to a large service?

The best way to structure a scaling Python project is applying separation of concerns principles. Use project-structure recommendations and pragmatic guardrails to evolve small API scripts into large backend services.

How do I implement typing strategies using Optional and Union in Python?

Implement typing strategies using Optional and Union in Python through practical validation patterns. Apply type hint guidance to enforce robust code and contextual architectural decisions across your Python project.

What are the limitations of applying ad-hoc best practices to Python architectural decisions?

Ad-hoc Python best practices create scattered architectural decisions. Avoid limitations by using a principled, decision-oriented framework that provides decision trees and pragmatic guardrails for robust project development.