platform-apex-generate

Generates production-grade Salesforce Apex classes, triggers, and async jobs with validation and testing.

Updated Jul 2, 2026
One-click install
npx skills add https://github.com/padjei/SF_Build --skill platform-apex-generate-padjei
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: platform-apex-generate
Source: https://github.com/padjei/SF_Build/tree/main/.claude/skills/platform-apex-generate
Command: npx skills add https://github.com/padjei/SF_Build --skill platform-apex-generate-padjei

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes assets (resource) and references (resource) components.

What problem does it solve? Writing Salesforce Apex that passes code analysis, respects governor limits, and deploys cleanly requires deep knowledge of bulkification, sharing rules, and async patterns. This Skill automates the authoring, validation, and testing of Apex classes and triggers so generated code meets production standards on the first pass. ## Core Features & Use Cases - Type-Specific Class Generation: Authors services, selectors, domains, batch, queueable, schedulable, invocable, DTO, utility, interface, abstract, exception, and REST resource classes using templates and naming conventions. - Enforced Guardrails: Applies hard-stop rules for SOQL/DML outside loops, sharing keywords, CRUD/FLS enforcement, null safety, and governor-limit monitoring. - Validation & Test Loop: Runs the code analyzer on generated files, remediates severity violations, and delegates test generation to the platform-apex-test-generate skill until tests pass. - Use Case: Ask for an AccountService class that deduplicates accounts; the Skill generates the class, its meta XML, and a passing test class, then reports analyzer output and coverage. ## Quick Start Ask the assistant to create an Apex service class for Account deduplication with tests and code analyzer validation.

Frequently Asked Questions about platform-apex-generate

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

FAQPage Schema
How do I generate an Apex class with tests in Salesforce?▼

Request the class type (service, selector, batch, etc.) and target object; the Skill authors the .cls and .cls-meta.xml files, then delegates test creation to the platform-apex-test-generate skill. It runs the code analyzer and executes tests before reporting results.

What Apex design patterns does this skill support?▼

It supports Service-Selector-Domain layering, Trigger Actions Framework, DTOs, wrappers, interfaces, abstract classes, custom exceptions, and REST resources. Each type has a dedicated template and reference example with naming conventions like AccountService or AccountSelector.

Should I use Batch, Queueable, or Schedulable Apex for async jobs?▼

Use Queueable for standard async work with chaining and non-primitive types, Batch for very large datasets with QueryLocator, and Schedulable only for recurring jobs needing complex Apex logic. The Skill's async decision matrix selects the pattern; @future is prohibited in new code.

Does generated Apex enforce CRUD/FLS and sharing rules?▼

Yes, every class declares an explicit sharing keyword defaulting to with sharing, SOQL uses WITH USER_MODE, and DML uses AccessLevel.USER_MODE. The Skill verifies CRUD/FLS enforcement, no hardcoded IDs, and sanitized error messages before finalizing.

Why does Apex hit governor limits and how is it prevented?▼

Governor limit failures come from SOQL or DML inside loops and non-bulkified logic. The Skill enforces hard-stop constraints placing all queries and DML outside loops, bulkifies public APIs to accept collections, and uses Limits methods to monitor consumption.

When should I not use this Apex generation skill?▼

Do not use it for test execution, assertion fixes, or coverage work; those are delegated to the platform-apex-test-generate skill. It also does not handle deployments, Flow building, or LWC development, which belong to their respective skills.