python-expert

Python gotchas and decision criteria. Covers async pitfalls, FastAPI/Django patterns, and type hint traps.

Best use case

python-expert is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Python gotchas and decision criteria. Covers async pitfalls, FastAPI/Django patterns, and type hint traps.

Teams using python-expert should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/python-expert/SKILL.md --create-dirs "https://raw.githubusercontent.com/nguyenthienthanh/aura-frog/main/aura-frog/skills/python-expert/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/python-expert/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How python-expert Compares

Feature / Agentpython-expertStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Python gotchas and decision criteria. Covers async pitfalls, FastAPI/Django patterns, and type hint traps.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

> **AI-consumed reference.** Optimized for Claude to read during execution.
> Human-readable explanation: see [docs/architecture/HIERARCHICAL_PLANNING.md](../../../docs/architecture/HIERARCHICAL_PLANNING.md)
> or [docs/getting-started/](../../../docs/getting-started/) depending on topic.


# Python Expert — Gotchas & Decisions

Use Context7 for FastAPI/Django/Flask docs.

## Key Decisions

```toon
decisions[4]{choice,use_when}:
  FastAPI vs Django vs Flask,"FastAPI: async APIs + auto-docs. Django: full-featured + ORM + admin. Flask: minimal/micro"
  Pydantic vs dataclass,"Pydantic for validation/serialization (API boundaries). dataclass for internal structs"
  SQLAlchemy vs Django ORM,"SQLAlchemy: standalone/FastAPI. Django ORM: Django projects only"
  sync vs async,"async for I/O-bound (HTTP/DB). sync for CPU-bound. Don't mix blocking calls in async"
```

## Gotchas

- Mutable default args: `def f(items=[])` shares list across calls — use `def f(items=None): items = items or []`
- `asyncio.run()` creates new event loop — can't nest. Use `await` inside existing async context
- FastAPI `Depends()`: new instance per request by default. Use `@lru_cache` for singletons
- Django N+1: use `select_related` (FK/OneToOne) and `prefetch_related` (M2M/reverse FK)
- `isinstance(x, int)` catches `bool` too — `bool` is subclass of `int`. Check `type(x) is int` if needed
- Type hints are NOT enforced at runtime — use Pydantic or `beartype` for runtime validation
- `dict.get('key')` returns `None` silently — use `dict['key']` when key must exist
- `requirements.txt` vs `pyproject.toml`: prefer pyproject.toml (PEP 621) for modern projects
- `with` statement for resource cleanup (files, DB connections) — never rely on `__del__`

Related Skills

vue-expert

14
from nguyenthienthanh/aura-frog

Vue 3 gotchas and decision criteria. Covers reactivity traps, Composition API pitfalls, and Pinia patterns.

typescript-expert

14
from nguyenthienthanh/aura-frog

TypeScript gotchas and decision criteria covering nullish coalescing pitfalls (|| vs ??), strict tsconfig settings (noUncheckedIndexedAccess, exactOptionalPropertyTypes), type guard patterns, discriminated unions, and as const vs enum. Use when writing TypeScript, configuring tsconfig, implementing type guards, or debugging null/undefined errors.

refactor-expert

14
from nguyenthienthanh/aura-frog

Guide safe, incremental refactoring that improves code quality without changing behavior.

react-native-expert

14
from nguyenthienthanh/aura-frog

React Native gotchas and decision criteria. Covers FlatList optimization, storage hierarchy, and platform-specific pitfalls.

react-expert

14
from nguyenthienthanh/aura-frog

React gotchas and decision criteria covering stale closure bugs in useEffect, conditional rendering traps (falsy 0/empty string), state management selection (useState vs Context vs Zustand vs TanStack Query), and hooks rules. Use when writing React components, debugging re-renders, choosing state management, or encountering useEffect infinite loops.

nodejs-expert

14
from nguyenthienthanh/aura-frog

Node.js gotchas and decision criteria. Covers async pitfalls, Express/NestJS patterns, and common mistakes.

nextjs-expert

14
from nguyenthienthanh/aura-frog

Next.js 14+ gotchas and decision criteria. Covers server/client boundary, caching strategy, and data fetching patterns Claude commonly gets wrong.

laravel-expert

14
from nguyenthienthanh/aura-frog

Laravel/PHP gotchas and decision criteria. Covers N+1 prevention, Eloquent traps, and migration safety.

go-expert

14
from nguyenthienthanh/aura-frog

Go gotchas and decision criteria. Covers error handling patterns, concurrency pitfalls, and interface design.

design-expert

14
from nguyenthienthanh/aura-frog

UI/UX design expertise — component design, design system selection, responsive layout. Includes auto-detection from package.json and Context7 integration for library docs.

angular-expert

14
from nguyenthienthanh/aura-frog

Angular 17+ gotchas and decision criteria. Covers signals vs observables, standalone patterns, and common pitfalls Claude gets wrong.

tree-of-thoughts

14
from nguyenthienthanh/aura-frog

Branch, evaluate, prune, expand — structured search over solution space. Use for architecture with multi-step decisions, refactor planning, or complex debug hypothesis trees. Paper: Yao et al. 2023.