sf-trigger-frameworks

Community

Make Apex triggers maintainable and safe

Authorjiten-singh-shahi
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Centralizes trigger logic and prevents common failure modes in Salesforce Apex triggers such as recursion, uncontrolled side-effects, and scattered business logic across multiple triggers, making triggers predictable and maintainable during development, refactoring, and data migrations.

Core Features & Use Cases

  • Pragmatic TriggerHandler Pattern: A dependency-free base class with context-aware routing, bypass registry, and execution depth control to avoid recursion.
  • FFLIB Domain Layer Support: Guidance for adopting fflib_SObjectDomain patterns where the org uses Apex Commons.
  • TDTM / CMDT Dispatcher: Table-driven registration of handlers using Custom Metadata for runtime enable/disable and ordered execution.
  • Bypass & Migration Strategies: Static, framework-level, and declarative bypass options for migrations and bulk data loads plus a migration checklist for converting bare triggers to handler-based frameworks.
  • Recursion Prevention & Testing: Static processed-id sets and depth counters, with testing notes on static variable lifetime and example test patterns.

Quick Start

Analyze the Account trigger and provide a migration plan to a handler-based framework including bypass and recursion controls.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: sf-trigger-frameworks
Download link: https://github.com/jiten-singh-shahi/salesforce-claude-code/archive/main.zip#sf-trigger-frameworks

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.