backend-best-practices

Enforce layered architecture and validation standards for backend services.

Updated Mar 29, 2026
One-click install
npx skills add https://github.com/marquesfelip/agents-and-skills --skill backend-best-practices
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-best-practices
Source: https://github.com/marquesfelip/agents-and-skills/tree/main/skills/backend-best-practices
Command: npx skills add https://github.com/marquesfelip/agents-and-skills --skill backend-best-practices

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps backend teams enforce clean architecture, proper boundaries, and maintainable code, reducing technical debt and enabling faster, safer changes.

Core Features & Use Cases

  • Layered architecture guidance: API, usecases, domain, infrastructure, config, and middleware.
  • Validation and error-handling patterns: input validation at boundaries, domain errors, and HTTP mapping at the API boundary.
  • Dependency injection and modularization: constructor injection, interface-based design, and testability.
  • Use-case: Refactor a monolith into clear service boundaries to improve maintainability and testability.

Quick Start

Apply these guidelines to your backend project by mapping modules into the prescribed layered structure and validating inputs, errors, and dependencies.

Frequently Asked Questions about backend-best-practices

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

FAQPage Schema
How do I enforce clean architecture boundaries when refactoring a backend monolith?

Clean architecture boundaries are enforced by mapping modules into prescribed layers spanning API, usecases, domain, and infrastructure. This refactoring approach reduces technical debt by ensuring clear service boundaries, improving overall maintainability and testability.

What is the best way to handle input validation and domain errors in backend services?

Input validation and error handling are managed by validating inputs at boundaries, throwing domain errors, and mapping them to HTTP responses at the API boundary. This deterministic error-handling pattern ensures reliable backend service execution and clearer client feedback.

How do I structure dependency injection for better testability in backend modules?

Dependency injection is structured using constructor injection and interface-based design within modularized backend layers. This pattern decouples infrastructure from usecases and domain logic, yielding highly testable modules that enable faster, safer code changes.

Does this backend governance approach require specific frameworks or external dependencies?

No specific frameworks or external dependencies are required to apply this backend governance approach. The guidelines focus on architectural patterns like layered boundaries and maintainability standards, making them adaptable across any backend technology stack.

When should I apply these backend architecture guidelines during development?

These backend architecture guidelines should be applied during refactoring, new module design, and code reviews. Implementing them early ensures proper structure from API to infrastructure, establishing maintainability standards and deterministic error handling before technical debt accumulates.