with one click
modular-architecture
Modular Domain Architecture & Clean Code Standards
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Modular Domain Architecture & Clean Code Standards
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | modular-architecture |
| description | Modular Domain Architecture & Clean Code Standards |
This document defines the project's directory structure, naming conventions, and core engineering principles to ensure a maintainable and scalable codebase.
data or item; be specific (e.g., userProfile).Each feature or domain is contained within its own directory in src/:
src/
[domain]/
[domain].route.ts # Framework Entry (SRP: Fastify config)
[domain].schema.ts # Validation Contract (SRP: TypeBox schemas)
[domain].controller.ts # Request Handling (SRP: HTTP Orchestration)
[domain].service.ts # Business Logic (SRP: Pure Logic/DB)
[domain].model.ts # Data Definition (SRP: Drizzle table)
[domain].relation.ts # Data Relationships (SRP: Drizzle relations)
[domain].interface.ts # Entities & Abstractions (SRP: Types)
index.ts # Public API / Barrel file
Always prefix files with their domain name (singular).
[domain].route.ts (Correct: user.route.ts | Incorrect: routes.ts)[domain].schema.ts (Correct: catalog.schema.ts | Incorrect: schema.ts)[!TIP] Search-First Naming: Prefixed filenames allow you to find exactly what you need in global search and differentiate between multiple open
routeorschematabs in your IDE.
Dependencies must always flow downwards to maintain separation: Route → Controller → Service → Model