sickn33/antigravity-awesome-skills/python-patterns
- community
Checking that the SKILL.md file is still in the repository.
Python development principles and decision-making. Framework selection, async patterns, type hints, project structure. Teaches thinking, not copying.
Install
npx vskill@latest install sickn33/antigravity-awesome-skills/python-patternsSKILL.md
Python Patterns
Python development principles and decision-making for 2025.Learn to THINK, not memorize patterns.
When to Use
Use this skill when making Python architecture decisions, choosing frameworks, designing async patterns, or structuring Python projects.
⚠️ How to Use This Skill
This skill teaches decision-making principles, not fixed code to copy.
- ASK user for framework preference when unclear
- Choose async vs sync based on CONTEXT
- Don't default to same framework every time
1. Framework Selection (2025)
Decision Tree
Comparison Principles
| Factor | FastAPI | Django | Flask | |
|---|---|---|---|---|
| Best for | APIs, microservices | Full-stack, CMS | Simple, learning | |
| Async | ASGI support | ASGI support; check ORM/transaction constraints | Async views with async extra; WSGI constraints apply | |
| Admin | Manual | Built-in | Via extensions | |
| ORM | Choose your own | Django ORM | Choose your own | |
| Learning curve | Low | Medium | Low |
Selection Questions to Ask:
- Is this API-only or full-stack?
- Need admin interface?
- Team familiar with async?
- Existing infrastructure?
2. Async vs Sync Decision
When to Use Async
The Golden Rule
Async Library Selection
| Need | Async Library | |
|---|---|---|
| HTTP client | httpx | |
| PostgreSQL | asyncpg | |
| Redis | aioredis / redis-py async | |
| File I/O | aiofiles | |
| Database ORM | SQLAlchemy 2.0 async, Tortoise |
3. Type Hints Strategy
When to Type
Common Type Patterns
Pydantic for Validation
4. Project Structure Principles
Structure Selection
FastAPI Structure Principles
5. Django Principles (2025)
Django Async (Django 5.0+)
Django Best Practices
6. FastAPI Principles
async def vs def in FastAPI
Dependency Injection
Pydantic v2 Integration
7. Background Tasks
Selection Guide
| Solution | Best For | |
|---|---|---|
| BackgroundTasks | Simple, in-process tasks | |
| Celery | Distributed, complex workflows | |
| ARQ | Async, Redis-based | |
| RQ | Simple Redis queue | |
| Dramatiq | Actor-based, simpler than Celery |
When to Use Each
8. Error Handling Principles
Exception Strategy
Error Response Philosophy
9. Testing Principles
Testing Strategy
| Type | Purpose | Tools | |
|---|---|---|---|
| Unit | Business logic | pytest | |
| Integration | API endpoints | pytest + httpx/TestClient | |
| E2E | Full workflows | pytest + DB |
Async Testing
Fixtures Strategy
The ASGI test excerpt requires an application fixture and does not manage startup/shutdown automatically; use the project lifespan fixture/manager when needed. Native async views do not make blocking libraries or CPU-heavy work nonblocking. See HTTPX ASGI transport.
10. Decision Checklist
Before implementing:
- [ ] Asked user about framework preference?
- [ ] Chosen framework for THIS context? (not just default)
- [ ] Decided async vs sync?
- [ ] Planned type hint strategy?
- [ ] Defined project structure?
- [ ] Planned error handling?
- [ ] Considered background tasks?
11. Anti-Patterns to Avoid
❌ DON'T:
- Default to Django for simple APIs (FastAPI may be better)
- Use sync libraries in async code
- Skip type hints for public APIs
- Put business logic in routes/views
- Ignore N+1 queries
- Mix async and sync carelessly
✅ DO:
- Choose framework based on context
- Ask about async requirements
- Use Pydantic for validation
- Separate concerns (routes → services → repos)
- Test critical paths
Remember: Python patterns are about decision-making for YOUR specific context. Don't copy code—think about what serves your application best.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/python-patterns/SKILL.md
Popularity
- Repository stars
- 27,553
- Repository forks
- 4,639
- Repository npm downloads, 7 days
- 5,562
- 7-day trend score
- 72
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 23 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/sickn33/antigravity-awesome-skills/python-patterns)