amanah-backend

Define Amanah backend services, repositories, permissions, jobs, notifications, storage, validation, auditing, and errors.

SKILL.md

GitHub

Purpose

Centralize business rules and infrastructure boundaries.

Scope

Use-case services, repositories, permissions, jobs, storage, notification adapters, validation, audit, and error mapping.

Rules

Keep controllers thin; authorize in services; pass actor context; use transactions for mutations; emit audit/outbox events; return typed domain errors.

Required patterns

Separate domain logic from adapters; enforce ownership in repository queries; make jobs idempotent; apply least privilege to credentials.

Forbidden patterns

Business rules must not live only in UI components. Never bypass services for sensitive writes or leak infrastructure exceptions.

Relevant modules

All server features and integrations.

Testing

Test services with real permission policies, repository integration, transaction rollback, job retries, storage, and error mapping.

Definition of done

Each use case has one authoritative, tested, auditable server-side implementation.