- Home
- Skills
- Vudovn
- Antigravity Kit
- Python Patterns
python-patterns_skill
- TypeScript
5.7k
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill vudovn/antigravity-kit --skill python-patterns- SKILL.md9.3 KB
Overview
This skill teaches Python development principles and decision-making for modern projects, focusing on framework selection, async vs sync, type hints, and project structure. It emphasizes reasoning over copying code and guides you to choose patterns that fit your context. Practical checklists and anti-pattern warnings help avoid common mistakes.
How this skill works
It asks the right questions about your project (API vs full-stack, concurrency needs, team familiarity) and maps answers to recommended frameworks and patterns. It explains when to prefer async or sync, which libraries to pick for async I/O, how to apply type hints and Pydantic, and how to structure projects by size. It also covers background task choices, error-handling patterns, and testing strategies to validate design decisions.
When to use it
- Choosing a framework for a new project (FastAPI, Django, Flask)
- Deciding between async and sync for I/O-heavy or CPU-bound workloads
- Designing project layout for small, medium, or large codebases
- Selecting background task/queue technology for short vs long-running work
- Establishing typing and validation practices for public APIs
Best practices
- Ask about framework preference and deployment constraints before defaulting to one option
- Use async for I/O-bound workloads and many concurrent connections; use sync or multiprocessing for CPU-heavy tasks
- Type public APIs, function parameters, and return values; use Pydantic for validation and config
- Organize code by feature or by layer (routes, services, models, schemas) depending on team scale
- Keep business logic out of routes/views and centralize error translation into handlers
Example use cases
- API-first microservice using FastAPI with async DB drivers and httpx for external calls
- Full-stack CMS or admin app using Django with built-in admin and ORM
- Small script or prototype using Flask for quick iteration
- AI/ML model serving with FastAPI and Pydantic for request validation
- Background processing: use in-process BackgroundTasks for fire-and-forget, Celery/ARQ for durable distributed workloads
FAQ
Don’t force async globally. Choose async for components that benefit from concurrency (I/O-bound). Keep CPU-bound parts synchronous and isolate with multiprocessing or worker services.
How strict should I be with type hints?
Be strict on public APIs, services, and class attributes. You can be pragmatic for local variables and one-off scripts to keep developer velocity.