apex-trigger

Installation
SKILL.md

Apex Trigger

Preferred structure

Use a thin trigger that delegates to a handler/service/domain layer. Keep business rules out of the trigger body.

Typical flow:

Trigger -> Handler -> Domain/Service -> Selector/Repository -> DML

Do not introduce every layer automatically. Use the smallest structure that keeps responsibilities clear.

Decision tree

  • One simple invariant with no reuse -> a small handler may be enough.
  • Multiple business rules or reusable operations -> service/domain layer.
  • Complex read patterns -> selector/data-access layer.
  • Cross-object side effects -> explicit service orchestration and transaction analysis.
  • External callout required -> do not call out directly from a normal synchronous trigger; choose an async/event-based design where appropriate.
Installs
1
GitHub Stars
1
First Seen
6 days ago
Security Audits