sf-apex

Provide Apex patterns for triggers, classes, and async processing.

Updated Apr 27, 2026
One-click install
npx skills add https://github.com/tomz/agent-skills --skill sf-apex-tomz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sf-apex
Source: https://github.com/tomz/agent-skills/tree/main/sf-apex
Command: npx skills add https://github.com/tomz/agent-skills --skill sf-apex-tomz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Apex pattern guidance to help developers write scalable, governor-limit-respecting code for Salesforce.

Core Features & Use Cases

  • Trigger and class patterns for bulkification and testability
  • Batch, queueable, and schedulable patterns for async processing
  • Guidance on governor limits, recursion prevention, and error handling
  • Real-world examples and anti-patterns to avoid common mistakes

Quick Start

Read the examples and apply the patterns to your Apex triggers and services in your Salesforce org.

Frequently Asked Questions about sf-apex

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

FAQPage Schema
How do I bulkify Apex triggers to avoid hitting Salesforce governor limits?

To bulkify Apex triggers and avoid governor limits, apply battle-tested trigger frameworks that process records in collections, ensuring scalable, bulk-safe operations across large Salesforce orgs without exceeding SOQL or DML boundaries.

What is the best way to structure batch Apex and queueable jobs for async processing?

The best way to structure async processing is using battle-tested batch, queueable, and schedulable Apex patterns, which provide scalable, governor-limit-conscious execution for long-running or complex asynchronous Salesforce operations.

When do I need a trigger framework for Salesforce Apex classes?

You need a trigger framework for Salesforce Apex when building scalable, testable applications, as it enforces bulkification, prevents recursion, and standardizes error handling across complex orgs with multiple triggers.

How do I write test classes for scalable Apex code that respect governor limits?

Write test classes for scalable Apex code by following patterns that validate bulkified logic, governor-limit compliance, and robust error handling, ensuring your Salesforce triggers and services execute safely under bulk record conditions.

Why does my Apex code fail with governor limit exceptions in bulk operations?

Apex code fails with governor limit exceptions during bulk operations when it lacks proper bulkification and scalable patterns, often performing SOQL queries or DML statements inside loops, which this Skill prevents through battle-tested trigger frameworks.

Can I use these Apex patterns for both small and large Salesforce orgs?

Yes, you can use these Apex patterns for both small and large Salesforce orgs, as they provide scalable, governor-limit-respecting solutions for triggers, classes, and async processing tailored to varied operational scales.