/engineering-paved-path:onion-architecturefrom engineering-paved-path
Onion / ports-and-adapters layering for a backend codebase (domain core + ports + application services + adapters + composition root). Use when adding or reviewing a backend module — placing routes/services/repositories/adapters, deciding where a DB query or an external SDK call (LLM, GitHub, git, any vendor API) may live, wiring DI in the composition root, defining a new port in the shared contracts module, or keeping the domain core pure. Enforces the dependency rule (imports point inward) and ships a dependency-cruiser gate. NOT for React/frontend code (use frontend-architecture).
Ships in engineering-paved-path. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Onion / ports-and-adapters layering for a backend of any shape. One rule governs it: all imports point inward. Files may depend on more central layers, never on outer ones. Inner layers declare interfaces (ports); outer layers implement them; a composition root wires the two together.
layer-map.mdenforcement.mdREADME.mdThe adopting repo's own module READMEs and architecture docs own the request & DI flows and the API map — this skill owns only the dependency rule and its enforcement.
Innermost → outermost. Each ring lives wherever the adopting repo maps it —
record this repo's actual mapping in layer-map.md before
relying on these names, and keep that file current:
| Ring | Where | Contract |
|---|---|---|
| Domain core | wherever the repo maps it (document in layer-map.md) | Pure logic, no I/O. Functions over data; effects only through injected ports. |
| Ports | the shared contracts module | Interfaces only — one per external need. No implementations, no SDK imports. |
| Application services | the per-module service layer | Orchestration. Reaches adapters only via the container. |
| Adapters | the adapters + persistence layer | DB drivers, HTTP clients, external SDKs live here; never feature modules. |
| Composition root | the one wiring file (e.g. a container.ts) | The only place binding ports to concrete adapters. Tests swap implementations via an overrides seam. |
| Transport | the per-module route layer | Request validation, call the service, map the reply. No logic. |
container.llm(id), container.git, …).container.<port> — nothing else news up adapters.dependency-cruiser (config: .dependency-cruiser.cjs at the package root —
see enforcement.md) fails the build on error-severity
violations. Warnings are a tracked burn-down baseline, never permission to add
violations: never grow the warning count; shrink it, then promote the rule to
error. If the domain core is its own package, cruise it as a root too so its
purity rule gates it.
AppError hierarchy); routes and
services never shape the error envelope themselves.frontend-architecture / react-best-practices.drizzle-orm-patterns; endpoint/API design →
fastify-best-practices.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub neronasee/dev-digest-ai-marketplace --plugin engineering-paved-path12 skills in this plugin
/drizzle-orm-patternsProvides comprehensive Drizzle ORM patterns for schema definition, CRUD operations, relations, queries, transactions, and migrations. Proactively use for any Drizzle ORM development including defining database schemas, writing type-safe queries, implementing relations, managing transactions, and setting up migrations with Drizzle Kit. Supports PostgreSQL, MySQL, SQLite, MSSQL, and CockroachDB./fastify-best-practicesGuides development of Fastify Node.js backend servers and REST APIs using TypeScript or JavaScript. Use when building, configuring, or debugging a Fastify application — including defining routes, implementing plugins, setting up JSON Schema validation, handling errors, optimising performance, managing authentication, configuring CORS and security headers, integrating databases, working with WebSockets, and deploying to production. Covers the full Fastify request lifecycle (hooks, serialization, logging with Pino) and TypeScript integration via strip types. Trigger terms: Fastify, Node.js server, REST API, API routes, backend framework, fastify.config, server.ts, app.ts./frontend-architectureReact + Next.js App Router code architecture and organization ONLY (not performance). Use when deciding where components, hooks, constants, utils, types, or business logic live, how or when to split components, choosing flat/type-based/feature-based folder structure, import boundaries, promoting feature code to shared code, file naming, or planning a project-layout refactor. For React state/effect/render/perf patterns use react-best-practices; for RSC boundaries and file conventions use next-best-practices.Other plugins' skills for the same job