What problem does it solve? Writing or modifying FastAPI backend code across the VSmartwatch services (health_system/backend, healthguard-model-api, Iot_Simulator_clean/api_server) risks inconsistent layering, leaked error details, and security mistakes like hardcoded secrets or wildcard CORS. This Skill enforces a single, consistent architecture so every endpoint follows the same router/service/repository pattern. ## Core Features & Use Cases - Layered Architecture Templates: Provides ready-to-use code for routers, services, repositories, Pydantic v2 schemas, dependencies, and pydantic-settings config. - Security Guardrails: Enforces internal-secret and JWT auth dependencies, sanitized error responses that never leak exception details, explicit CORS allowlists, and parameterized SQL queries. - Anti-Pattern Detection: Auto-flags mutable default arguments, swallowed exceptions, sync I/O in async functions, Pydantic v1 syntax, and PHI in logs. - Use Case: When adding a new fall-detection prediction endpoint to healthguard-model-api, use this Skill to scaffold the router with response_model validation, inject the service via Depends, and wire custom exception handlers that return sanitized error payloads. ## Quick Start Use the fastapi-patterns skill to add a new vitals endpoint to the health_system backend following the router, service, and repository layering.