# Backend Implementation

> Implement business logic cleanly: keep the framework at the edges with logic in testable use-cases, model errors explicitly (expected vs bug), validate inputs into domain types at the boundary, add idempotency keys for retried operations, and use the outbox for write-then-publish.

- Skill: `mcorbett51090/backend-implementation` (Agent Skill)
- Install (CLI): `npx get-skill add mcorbett51090/backend-implementation`
- Raw SKILL.md: https://api.skillmd.com/api/skills/mcorbett51090/backend-implementation/raw
- Safety review: pending (external: skill-scanner PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: mcorbett51090 (https://skillmd.com/u/mcorbett51090)
- Updated: 2026-11-19
- Page: https://skillmd.com/skills/mcorbett51090/backend-implementation

---


# Backend Implementation

## Framework at the edges
Logic in plain testable use-cases; HTTP/ORM/framework in thin adapters. A controller full of rules is untestable.

## Errors
Distinguish expected failures (validation/not-found/conflict) from bugs; typed results mapped to status at the edge. No bare catch-all.

## Validate at the boundary
Parse-and-validate inputs into domain types; the core works with valid data.

## Idempotency + outbox
Dedup key for retried work (webhooks/payments/async). **Outbox**: write the event in the same transaction as the state change so you never publish for a rolled-back write.

