separating-business-logic

Installation
SKILL.md

Separating Business Logic

When to use

  • Designing a new feature from scratch
  • Splitting a god service into layers
  • Moving business rules out of controllers or infrastructure

Core rules

  1. Domain layer: Pure business rules, no framework, no I/O, no console.log
  2. Application layer: Use-cases orchestrate domain + ports, no HTTP/DB direct
  3. Infrastructure layer: Adapters for HTTP, DB, 3rd-party, implements ports
  4. Controllers/handlers: only parse input, call one use-case, map Result to response
  5. Domain entities contain invariants (rules that must always hold) and behavior

Reference shape (TypeScript)

Installs
2
GitHub Stars
1
First Seen
Aug 22, 2026
separating-business-logic — j4flmao/agent_skills_nodejs_nestjs