backend-architecture-guidelines

Define a 7-layer Laravel architecture with Deptrac dependency rules.

Updated Dec 29, 2025
One-click install
npx skills add https://github.com/asakuno/template-repository --skill backend-architecture-guidelines
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-architecture-guidelines
Source: https://github.com/asakuno/template-repository/tree/main/.claude/skills/backend-architecture-guidelines
Command: npx skills add https://github.com/asakuno/template-repository --skill backend-architecture-guidelines

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Establishes a disciplined 7-layer Laravel-native architecture to enforce clear separation of concerns and consistent organization across codebases.

Core Features & Use Cases

  • Layered Architecture Blueprint: defines the seven layers (Presentation, Request, UseCase, Service, Repository, Model, Resource) and their responsibilities.
  • Dependency Rules & Static Analysis: provides downward-only dependencies rules and Deptrac configuration to enforce boundaries.
  • Project Scaffolding & Best Practices: includes a comprehensive structure, decision checklists, and reference docs to guide planning and reviews during Phase 1 (Planning & Review).

Quick Start

Apply these guidelines to start planning a Laravel backend architecture in Phase 1 by mapping project modules to the seven layers and setting up Deptrac rules.

Frequently Asked Questions about backend-architecture-guidelines

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

FAQPage Schema
What is a 7-layer Laravel architecture and how does it separate concerns?

A 7-layer Laravel architecture separates concerns across Presentation, Request, UseCase, Service, Repository, Model, and Resource layers to ensure testable and maintainable applications. It establishes clear boundaries for specific backend logic responsibilities.

How do I enforce dependency rules in a layered Laravel backend?

You can enforce dependency rules in a layered Laravel backend by applying downward-only dependencies and configuring Deptrac static analysis. This validates layer boundaries during code reviews and prevents unauthorized upward references.

How do I start planning a Laravel backend architecture with these guidelines?

To start planning a Laravel backend architecture, map your project modules to the seven defined layers and set up Deptrac rules during Phase 1. Use the provided decision checklists and structure templates to guide scaffolding.

Can I use this layered design with existing Laravel projects?

You can apply this layered design to existing Laravel projects by mapping current modules to the seven layers and enforcing downward-only dependencies. Use the reference docs and decision checklists to guide progressive code reviews.

Does this architecture approach require specific Laravel design patterns?

This architecture approach utilizes design patterns within its UseCase and Service layers to organize business logic. It provides a structured blueprint that defines specific responsibilities for each layer to maintain scalable backend code.

What is the best way to organize UseCases and Services in Laravel?

The best way to organize UseCases and Services in Laravel is assigning specific responsibilities within a 7-layer architecture. UseCases handle application workflows while Services manage domain logic, ensuring clear separation of concerns.