agentskills.codes
PY

python-pro

>-

Install

mkdir -p .claude/skills/python-pro-pikakit && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/13829" && unzip -o skill.zip -d .claude/skills/python-pro-pikakit && rm skill.zip

Installs to .claude/skills/python-pro-pikakit

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Python development with FastAPI, Django, or Flask. Async patterns, type hints, project structure. Use when building Python backends, scripts, or choosing Python frameworks. NOT for Node.js projects (use nodejs-pro) or general AI agents (use google-adk-python).
260 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)

About this skill

Python Pro — Framework Selection & Architecture

Decision-making principles. Not patterns to copy. Ask, classify, decide.


5 Must-Ask Questions (Before Decision)

#QuestionOptions
1Target Scope?Single Script / API / Full-Stack / Workers
2Project Scale?MVP / Production / FAANG Scale
3Current Framework?Green field vs Legacy modification?
4Async Requirements?High I/O throughput vs CPU heavy?
5DB Dependencies?Relational vs NoSQL, Async DB drivers?

When to Use

SituationApproach
Choosing Python frameworkUse decision tree
API-first / microservicesConsider FastAPI
Full-stack web / CMSConsider Django
Async vs sync decisionCheck I/O vs CPU classification

System Boundaries

Owned by This SkillNOT Owned
Framework selection (5 branches)API design (→ api-architect)
Async/sync classificationTesting strategy (→ test-architect)
Type hint rulesDatabase schema (→ data-modeler)
Architecture layeringCode implementation

Expert decision skill: Produces recommendations. Does not write code.


Framework Decision Tree (Deterministic)

What are you building?
│
├── API-first / Microservices  → FastAPI
├── Full-stack web / CMS       → Django
├── Simple / Script / Learning → Flask
├── AI/ML API serving          → FastAPI
└── Background workers         → Celery + any

If user has explicit preference → respect it. Ask when unclear.


Async vs Sync (Deterministic)

WorkloadDecisionRationale
I/O-bound (HTTP, DB, file)asyncWaiting for external
CPU-bound (compute)sync + multiprocessingNumber crunching
MixedAsync with sync offloadrun_in_executor

Constraints: Never use sync libraries in async code. Never force async for CPU work.


Architecture Layering (Fixed)

Routes (HTTP handlers)
  └→ Services (business logic)
      └→ Repositories (data access)

Rule: No business logic in routes/views. Routes delegate to services.


Type Hints & Validation (Mandatory)

RuleScope
Type hints on all public APIsFunctions, methods, return types
Pydantic for validationAll input/output boundaries
No Any in public signaturesUse specific types or generics

Decision Checklist

  • Asked user about framework preference?
  • Chosen framework for THIS context?
  • Decided async vs sync?
  • Planned type hint strategy?
  • Defined project structure?
  • Considered background tasks (Celery)?

Error Taxonomy

CodeRecoverableTrigger
ERR_INVALID_REQUEST_TYPENoRequest type not supported
ERR_UNKNOWN_PROJECT_TYPEYesProject type not one of 5
ERR_UNKNOWN_FRAMEWORKYesFramework not fastapi/django/flask

Zero internal retries. Same context = same recommendation.


Audit Logging (OpenTelemetry)

EventMetadata PayloadSeverity
decision_started{"project_type": "...", "scale": "..."}INFO
framework_selected{"framework": "fastapi", "rationale": "..."}INFO
async_sync_classified{"mode": "async", "mix_workload": false}WARN
arch_recommendation_provided{"layer_complexity": "high"}INFO

All architectural decision outputs MUST emit a decision_started and arch_recommendation_provided event.


Anti-Patterns

❌ Don't✅ Do
Default to Django for simple APIsChoose framework per context
Use sync libraries in async codeUse async-compatible libraries
Skip type hints on public APIsAnnotate all public functions
Put business logic in routes/viewsSeparate: routes → services → repos
Always pick the same frameworkAsk user, evaluate context

📑 Content Map

FileDescriptionWhen to Read
framework-selection.mdFramework comparisonChoosing framework
async-patterns.mdAsync/sync patternsConcurrency decisions
type-hints.mdType annotation rulesType strategy
project-structure.mdDirectory layoutsNew project
fastapi-patterns.mdFastAPI specificsFastAPI project
django-patterns.mdDjango specificsDjango project
testing-patterns.mdPython testingWriting tests
engineering-spec.mdFull specArchitecture review

Selective reading: Load ONLY the reference file matching your current decision.


🔗 Related

ItemTypePurpose
api-architectSkillAPI design
test-architectSkillTesting
data-modelerSkillDatabase

⚡ PikaKit v3.9.206

Search skills

Search the agent skills registry