my-backend-architecture

Organize backend architecture into app, domain, infrastructure, and shared layers.

1|Updated Feb 12, 2026
One-click install
npx skills add https://github.com/dev-goraebap/grimoire --skill my-backend-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: my-backend-architecture
Source: https://github.com/dev-goraebap/grimoire/tree/main/misc/skills/my-backend-architecture
Command: npx skills add https://github.com/dev-goraebap/grimoire --skill my-backend-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Organize and codify your personal backend architecture preferences into a clear, progressive disclosure model that guides layer boundaries and coupling rules.

Core Features & Use Cases

  • Progressive layer rules: app / domain / infrastructure / shared as core four layers with an optional middle layer.
  • Clear dependencies: one-way references, DIP direction, and explicit public API boundaries to prevent cross-layer leaks.
  • Domain-first guidance: domain rules, aggregates, repositories, and test strategies organized across BCs.

Quick Start

Load the guidance and apply it to structure your backend project by defining four core layers and optionally a middle layer, then map code boundaries accordingly.

Frequently Asked Questions about my-backend-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I organize backend architecture layers using domain-driven design?

Backend architecture layers using domain-driven design separate code into app, domain, infrastructure, and shared layers. This enforces one-way dependencies and defines public API boundaries to prevent cross-layer leaks while isolating domain rules and persistence implementations.

What is the best way to enforce one-way dependencies in a layered backend architecture?

The best way to enforce one-way dependencies in layered backend architecture is by applying dependency inversion direction and explicit public API boundaries. This restricts cross-layer references and ensures infrastructure implementations depend on domain rules, not vice versa.

How do I prevent cross-layer leaks in a clean architecture backend project?

Prevent cross-layer leaks in clean architecture by defining explicit public API surfaces and enforcing one-way dependency references. Progressive disclosure of architecture rules ensures domain rules and persistence implementations stay isolated within their prescribed layer boundaries.

Does this four-layer backend model support projects with an existing middle layer?

Yes, the four-layer backend model supports existing middle layers. It applies core app, domain, infrastructure, and shared layers with optional middle layers, enabling progressive disclosure of architecture rules without forcing a rigid structure on existing domain boundaries.

Where should domain rules and repository implementations live in a layered architecture?

Domain rules and repository implementations live in the domain layer, while persistence and infrastructure implementations reside in the infrastructure layer. This separation enforces dependency inversion, keeping domain logic isolated from infrastructure concerns across bounded contexts.