# Architecting Backend

> Guides backend development with hexagonal architecture, DDD, SOLID principles, and clean code practices. Use when user says "review my backend", "check architecture", "refactor this service", "design a new feature", or asks about dependency injection, code smells, or SOLID violations. Do NOT use for frontend code, React components, or infrastructure/DevOps tasks.

- Skill: `bikach/architecting-backend` (Agent Skill, multi-file: 20 files)
- Install (CLI): `npx skillmds@latest add bikach/architecting-backend`
- Raw SKILL.md: https://api.skillmd.com/api/skills/bikach/architecting-backend/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: Bikach (https://skillmd.com/u/bikach)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/bikach/architecting-backend

---


# Backend Architecture Guide

## Workflow

### 1. Analyze context
- Identify modified files with `git diff`
- Understand the scope of changes

### 2. Check architecture compliance
- [architecture/hexagonal.md](architecture/hexagonal.md) - Project structure rules
- [architecture/ddd-patterns.md](architecture/ddd-patterns.md) - DDD patterns
- [architecture/dependency-injection.md](architecture/dependency-injection.md) - DI rules

### 3. Detect code smells
- [code-smells/god-class.md](code-smells/god-class.md) - Large class detection
- [code-smells/feature-envy.md](code-smells/feature-envy.md)
- [code-smells/primitive-obsession.md](code-smells/primitive-obsession.md)
- [code-smells/shotgun-surgery.md](code-smells/shotgun-surgery.md)
- [code-smells/data-clumps.md](code-smells/data-clumps.md)
- [code-smells/long-method.md](code-smells/long-method.md)

### 4. Validate SOLID principles
- [solid-principles/single-responsibility.md](solid-principles/single-responsibility.md)
- [solid-principles/open-closed.md](solid-principles/open-closed.md)
- [solid-principles/liskov-substitution.md](solid-principles/liskov-substitution.md)
- [solid-principles/interface-segregation.md](solid-principles/interface-segregation.md)
- [solid-principles/dependency-inversion.md](solid-principles/dependency-inversion.md)

### 5. Apply checklists
- [checklists/clean-code-checklist.md](checklists/clean-code-checklist.md)
- [checklists/testing-checklist.md](checklists/testing-checklist.md)
- [checklists/performance-checklist.md](checklists/performance-checklist.md)

### 6. Reference examples
- [examples/good-hexagonal-structure.md](examples/good-hexagonal-structure.md)
- [examples/bad-vs-good-refactoring.md](examples/bad-vs-good-refactoring.md)

## Output Format

Organize feedback by priority:

**P0 - Blocking**: Critical architecture violations, major bugs
**P1 - Important**: SOLID violations, serious code smells
**P2 - Improvement**: Optimization suggestions

For each issue:
- Location: `file:line`
- Problem description
- Impact
- Recommended fix with code example if relevant

