What problem does it solve? Service layers in T3 Turbo monorepos often accumulate class-based BaseService patterns with this.x! non-null assertions, leaked $inferSelect return types, and silent-swallowed errors that hide bugs from both users and observability tooling. This Skill provides a portable style guide that keeps the packages/api/src/services/** layer typesafe, testable, and observable. ## Core Features & Use Cases - ServiceCtx Invariant: Defines a single context type (db, scoped logger, userId, eventSeriesId, correlationId, abortSignal) threaded as the first argument to every service function, replacing hidden globals and constructor injection. - Four-Style Decision Tree: Guides selection between pure functions, factory + closure, namespace factory families, and type-routed generics based on shared-implementation ratios. - Forbidden Patterns & Migration Checklist: Enumerates anti-patterns (BaseService inheritance, $inferSelect exports, silent catches, as any, double Sentry capture) with a 12-step per-service migration checklist. - Use Case: When reviewing a PR that adds a new checkout service for attendee, vendor, and sponsor flows, use this Skill to decide between a namespace factory family and type-routed generics, then verify the code avoids the anti-exemplar patterns. ## Quick Start Ask the agent to review or scaffold a service in packages/api/src/services following the service-layer-style guide, choosing the appropriate style and threading ServiceCtx as the first argument.