trigger-framework

Enforce Salesforce one-trigger-per-object pattern with a shared TriggerHandler base class.

2|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/bhanu91221/claude-sfdx-iq --skill trigger-framework
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: trigger-framework
Source: https://github.com/bhanu91221/claude-sfdx-iq/tree/main/skills/trigger-framework
Command: npx skills add https://github.com/bhanu91221/claude-sfdx-iq --skill trigger-framework

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing multiple triggers across objects leads to duplication, inconsistent behavior, and recursion issues. A central TriggerHandler pattern enforces a single-trigger-per-object approach, preventing re-entrancy and improving maintainability.

Core Features & Use Cases

  • One Trigger per SObject pattern: Trigger delegates to a handler class.
  • Recursion prevention via processed tracking and bypass controls.
  • Centralized execution routing for before/after events to simplify testing and governance.
  • Use Case: A Salesforce org with many objects can implement consistent validation, defaults, and business rules without scattering logic in triggers.

Quick Start

Define a TriggerHandler base class and a per-object Trigger that delegates to a corresponding Handler to enforce the one-trigger-per-object pattern.

Frequently Asked Questions about trigger-framework

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent recursion in Salesforce Apex triggers?▼

A one-trigger-per-object design pattern prevents Apex recursion by routing all trigger events through a shared TriggerHandler base class with processed tracking and bypass controls. This centralizes execution and eliminates scattered logic.

What is the one trigger per object pattern in Salesforce?▼

The one trigger per object pattern delegates all trigger events to a single handler class per SObject, ensuring zero-logic triggers. It centralizes execution routing for before and after events to simplify testing and maintenance.

How do I set up a TriggerHandler base class for multiple SObjects?▼

You define a shared TriggerHandler base class and create a per-object trigger that delegates to a corresponding handler. This applies Apex logic across multiple objects consistently while maintaining a clear handler interface.

Why should I centralize execution routing for before and after trigger events?▼

Centralizing execution routing for before and after trigger events simplifies governance and maintenance. It enforces a clear handler interface and consistent execution order, preventing duplicate logic across multiple triggers.

Does this trigger handler pattern help with Salesforce governor limits?▼

Yes, centralizing trigger execution through a handler pattern helps manage Salesforce governor limits by preventing recursive calls and redundant queries. It ensures Apex logic runs efficiently within system boundaries.