sf-trigger-constraints

Enforce one-trigger-per-object, handler delegation, bulkification, and recursion prevention for Apex triggers.

13|2|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/jiten-singh-shahi/salesforce-claude-code --skill sf-trigger-constraints
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sf-trigger-constraints
Source: https://github.com/jiten-singh-shahi/salesforce-claude-code/tree/main/.cursor/skills/sf-trigger-constraints
Command: npx skills add https://github.com/jiten-singh-shahi/salesforce-claude-code --skill sf-trigger-constraints

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforce one-trigger-per-object, handler delegation, bulkification, and recursion prevention for Apex triggers to ensure safe, scalable, and maintainable code.

Core Features & Use Cases

  • Enforces a single trigger file per sObject to guarantee consistent deployment and ordering.
  • Delegates trigger logic to handler classes to keep triggers thin and promote testable service code.
  • Applies bulkification and recursion safeguards to prevent governor-limit violations and unintended re-entries.
  • Provides a centralized set of rules and anti-pattern detections used by code reviews and PR checks.

Quick Start

Review and enforce trigger constraints during development by invoking the sf-trigger-constraints workflow in your Salesforce codebase.

Frequently Asked Questions about sf-trigger-constraints

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

FAQPage Schema
How do I enforce one trigger per object in Salesforce Apex?

Enforcing one trigger per object in Salesforce Apex requires a constraint framework that delegates logic to handler classes. This keeps triggers thin, guarantees consistent deployment ordering, and maintains unified event registration across the codebase.

How do I prevent recursion in Apex triggers?

Preventing recursion in Apex triggers involves applying bulkification and recursion safeguards within delegated handler classes. A centralized constraint framework detects anti-patterns and stops unintended re-entries during code reviews and PR checks.

What is the best way to bulkify Apex triggers for governor limits?

The best way to bulkify Apex triggers is using a handler delegation architecture that processes records in bulk. Enforcing trigger constraints ensures safe, scalable code and prevents governor-limit violations across your Salesforce environment.

Can I bypass Apex trigger constraints using metadata?

Yes, you can bypass Apex trigger constraints using a metadata-driven bypass mechanism. This allows administrators to selectively disable specific trigger logic or recursion safeguards without modifying the underlying Apex codebase.

Does this Apex trigger constraint framework detect anti-patterns in code reviews?

Yes, the trigger constraint framework provides a centralized set of rules and anti-pattern detections used by code reviews and PR checks. It enforces single trigger files per sObject and bulkification to ensure scalable Salesforce code.