
Platform Apex Generate
A comprehensive Apex authoring skill that enforces production patterns and safety rules across all class types,services, selectors, batches, triggers, REST resources, and more. It walks through an eight-step workflow from discovery to code analysis to test execution, with hard stops for common governor limit violations like SOQL in loops or missing sharing keywords. The built-in validation phase runs the code analyzer and executes tests before letting you move forward, which catches issues early but adds friction if you're just prototyping. Ships with templates and references for each pattern, defaults to API 66.0 and with sharing, and delegates all test work to a separate test-generation skill. Best for teams that want guardrails and consistency baked into the generation process.
- skills.sh installs
- 7.4K
- GitHub stars
- 1.2K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add forcedotcom/sf-skills --skill platform-apex-generate --agent claude-codeInstalls into .claude/skills of the current project.
Files
Generating Apex
Use this skill for production-grade Apex: new classes, selectors, services, async jobs,
invocable methods, and triggers; and for evidence-based review of existing .cls OR .trigger.
Required Inputs
Gather or infer before authoring:
- Class type (service, selector, domain, batch, queueable, schedulable, invocable, trigger, trigger action, DTO, utility, interface, abstract, exception, REST resource)
- Target object(s) and business goal
- Class name (derive using the naming table below)
- Net-new vs refactor/fix; any org/API constraints
- Deployment targets (default to runSpecifiedTests and use generated tests where applicable)
Defaults unless specified:
- Sharing:
with sharing(see sharing rules per type below) - Access:
public(useglobalonly when required by managed packages or@RestResource) - API version:
66.0(minimum version) - ApexDoc comments: yes
If the user provides a clear, complete request, generate immediately without unnecessary back-and-forth.
Workflow
Sponsors
Details
- Repository
- github.com/forcedotcom/sf-skills
- Categories
- Backend & APIs, Git & Pull Requests, Code Review & Quality, Debugging, Automation & Workflows, Design & UI/UX
- First seen
- Jul 14, 2026
More from forcedotcom/sf-skills
All 158- Platform Apex Test Generate7.4K
- Platform Apex Test Run7.2K
- Platform Apex Logs Debug7.1K
- Platform Soql Query7.1K
- Platform Metadata Deploy7K
- Platform Metadata Retrieve6.9K
- Platform Custom Field Generate6.8K
- Platform Docs Get6.8K
- Platform Permission Set Generate6.8K
- Dx Code Analyzer Run6.7K
- Platform Custom Object Generate6.6K
- Automation Flow Generate6.5K
- Experience Lwc Generate6.4K
- Platform Validation Rule Generate6.3K
- Platform Data Manage6.3K
- Dx Org Manage6.2K
- Platform Flexipage Generate6.2K
- Platform Metadata Api Context Get6.2K
- Platform Sharing Rules Generate6.2K
- Design Systems Slds Apply6.1K
- Design Systems Slds Validate6K
- Agentforce Generate6K
- Platform Custom Tab Generate6K
- Dx Code Analyzer Configure5.9K