python-fastapi-coding-conventionslisted
Install: claude install-skill aishajv/claude-everything
# Coding Conventions
Style, naming, error handling, logging, configuration, database, and API conventions for Python/FastAPI backends.
---
## Core Development Philosophy
**Choose the simplest solution that works.** Complexity is a liability — every abstraction, extra class, and indirection must justify itself. Apply these principles in order:
- **KISS** — Choose the straightforward path. Don't split functionality into multiple classes when one handles it. Don't create abstractions speculatively.
- **YAGNI** — Implement only what's needed now. Resist "we might need this later."
- **Single Responsibility** — Each function, class, and module has one clear purpose.
- **Dependency Inversion** — Inner layers must not depend on outer layers. Domain logic never imports from API or persistence.
- **Open/Closed** — Extend behaviour by adding code, not by modifying existing code.
---
## Layered Architecture
Every feature touches four layers. Know which layer owns which responsibility:
```
API (routes, schemas, middleware)
↓
Services (business logic, orchestration)
↓
Repositories (data access only)
↓
Domain (entities, exceptions, business rules)
```
**API layer** — HTTP in, HTTP out. Routes call services. Middleware handles cross-cutting concerns (auth, logging). No business logic here.
**Service layer** — Orchestrates repositories and domain logic. Raises domain exceptions. Never touches the DB directly.
**Repository layer** — Thin data access. No business logic. Retur