Skip to content
Conduit

skill

skill-layered-domain-architecture

Agent Skill for Layered Domain Architecture and TDD workflow across software projects

Set up

Skills are installed by placing their folder where your agent loads skills.

The download comes from github.com/abbasjaber/skill-layered-domain-architecture itself, not from our server, so what you get is exactly what its author published.

Install instructions come from the README

Skills do not use an MCP config. Follow the steps in the README below.

README

synced Nov 1, 2026

Layered Domain Architecture Skill

An Agent Skill providing production-grade guidelines, design patterns, and testing protocols for building backend systems using Layered Domain Architecture and Test-Driven Development (TDD).

Designed for AI coding assistants (Google Antigravity, Claude Code, Cursor, GitHub Copilot CLI, Codex) and human engineering teams.


⚡ Instant One-Line Installation with npx

No cloning or manual copying needed! Anyone can install the skill with one command:

1. Install into Current Project (Recommended)

Run this inside any project root to add the skill to .agents/skills/layered-domain-architecture:

npx github:abbasjaber/skill-layered-domain-architecture

Then commit .agents/skills to Git so your entire team and their AI agents have it automatically.

2. Install Globally (For All Projects on Machine)

Installs into ~/.gemini/config/skills and ~/.agents/skills:

npx github:abbasjaber/skill-layered-domain-architecture --global

3. Install Everywhere (Current Project + Globally)

npx github:abbasjaber/skill-layered-domain-architecture --all

🎯 Architecture Blueprint

[ HTTP / Transport Layer ]      Controllers / Handlers / Resolvers
           │
           ▼
[ Domain / Application Layer ]  Services / Use Cases (Interfaces & Implementations)
           │
           ▼
[ Data Access Layer ]          Repositories / Data Mappers (Interfaces & Implementations)
           │
           ▼
[ Serialization Layer ]        Resources / DTOs / Serializers

Key Principles

  • Separation of Concerns: Controllers handle transport only; Services handle business rules; Repositories handle database persistence; Resources handle API response contracts.
  • Dependency Inversion: Code to interfaces. Services and Repositories expose explicit contracts bound via IoC containers.
  • Strict TDD Verification: Every endpoint must pass tests for 401 (Unauthenticated), 403 (Unauthorized/RBAC), 400/422 (Validation & boundary limits), 200/201/204 (Success), and database transaction rollback integrity.
  • Database Safety: All migrations must be strictly reversible (up and down), use UUID/ULID primary keys, and enforce referential integrity.

🌐 Supported Projects & Frameworks

This skill is designed for any backend API or server-side application that handles business logic, databases, and authentication, regardless of the language or framework.

1. Ideal Project Types

Project TypeWhy It Works Well
SaaS & Enterprise PlatformsKeeps large applications organized with strict domain boundaries (Staff/, Client/, Billing/, Auth/).
REST & GraphQL Web APIsEnsures clean separation between request parsing, business rules, queries, and JSON response envelopes.
B2B / Multi-Audience PortalsNaturally separates different user interfaces (e.g., Client Portal vs. Staff/Admin Portal).
Fintech, Legal & HealthcareEnforces auditability, strict RBAC security tests (401/403), and transactional database rollback guarantees.
Monoliths & MicroservicesWorks equally well inside a modular monolith or inside individual microservices.

2. How the 4 Layers Map Across Frameworks

The pattern (Transport → Service → Repository → Resource) translates seamlessly into any backend stack:

Framework / LanguageTransport LayerDomain Service LayerData Access LayerSerialization Layer
Laravel / PHPControllersServices (*Service.php)Repositories (*Repository.php)API Resources (*Resource.php)
NestJS / TypeScript@Controller()@Injectable() ServicesTypeORM / Prisma RepositoriesDTOs with class-transformer
FastAPI / PythonRouters (@router.get)Domain Services / Use CasesSQLAlchemy / SQLModel RepositoriesPydantic Schemas
GoHTTP Handlers / Gin / FiberUse Case / Service structsStorage / Repository interfacesResponse structs
Spring Boot / Java@RestController@Service classes@Repository (JPA/Hibernate)DTO records
ASP.NET Core / C#ControllerBaseApplication ServicesEF Core RepositoriesViewModels / DTOs

3. When NOT to Use It

  • Pure Frontend Projects: Static websites, simple React/Vue SPA apps without a backend.
  • Micro-Lambdas / Simple Webhooks: A simple 10-line cloud function that just resizes an image or sends an alert doesn't need 4 architectural layers.
  • Data Science / ML Training Pipelines: Jupyter notebooks or Python data processing scripts (Pandas/PyTorch) don't follow web API layer patterns.

💡 How to Use

AI agents will automatically load this skill whenever tasks match triggering conditions such as:

  • Designing or implementing new backend features, APIs, or domain modules.
  • Refactoring fat controllers or extracting repositories.
  • Setting up TDD feature test suites or endpoint verification.
  • Writing reversible database migrations.

You can also prompt your agent explicitly:

/layered-domain-architecture

or

Follow the layered-domain-architecture skill to design the billing module.

📦 Manual Installation (Git Clone Alternative)

Globally

git clone https://github.com/abbasjaber/skill-layered-domain-architecture.git ~/.gemini/config/skills/layered-domain-architecture

Inside a Project

mkdir -p .agents/skills
git clone https://github.com/abbasjaber/skill-layered-domain-architecture.git .agents/skills/layered-domain-architecture

📄 License

MIT License. See LICENSE for details.

↑↓ navigate openesc close