python-patterns

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

Updated Feb 12, 2026
One-click install
npx skills add https://github.com/AnvinX1/med-rag --skill python-patterns-anvinx1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-patterns
Source: https://github.com/AnvinX1/med-rag/tree/main/medical_genai_app/.agent/skills/python-patterns
Command: npx skills add https://github.com/AnvinX1/med-rag --skill python-patterns-anvinx1

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill teaches developers to think through Python development decisions (framework selection, async patterns, type hints, and project structure) rather than memorizing fixed templates, enabling flexible, context-aware choices.

Core Features & Use Cases

  • Decision trees for framework selection across FastAPI, Django, Flask, and related patterns.
  • Async vs Sync guidance based on I/O, concurrency, and context.
  • Type hints strategy and clean project structure recommendations.
  • Guardrails for choosing patterns and avoiding common missteps.
  • Real-world scenarios illustrating framework-choose-then-implement workflows.

Use cases include selecting an API pattern for a new service, refactoring a monolith, or prototyping a modular backend architecture.

Quick Start

Ask for framework preference and context, then apply the decision rules to select the appropriate pattern.

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 backend?

Choosing between FastAPI, Django, and Flask requires evaluating your project's I/O needs, concurrency requirements, and typing strategy through structured decision trees. This approach applies context-aware rules to match your specific API patterns and architectural constraints with the appropriate framework.

When should I use async versus sync patterns in Python?

Use async versus sync patterns in Python based on your application's I/O density, concurrency model, and execution context. The guidance provides decision rules to evaluate whether asynchronous operations will genuinely benefit your specific workload or introduce unnecessary complexity.

What is the best way to structure a Python project with type hints?

The best way to structure a Python project with type hints involves applying a clean project layout strategy alongside strict typing guidance. This ensures your codebase maintains best-practice organization while leveraging type annotations for robust decision-making and framework compatibility.

Can I use decision trees to refactor a Python monolith into a modular architecture?

Yes, you can use decision trees to refactor a Python monolith into a modular architecture by applying framework-choose-then-implement workflows. This process guides your pattern selection and structural reorganization using real-world scenarios and established guardrails.

Why does my Python framework selection process keep resulting in architectural missteps?

Your Python framework selection process results in architectural missteps when relying on fixed templates rather than context-aware choices. Applying structured decision rules and guardrails helps avoid common errors by evaluating framework options against your specific async, typing, and structural requirements.