forcedotcom avatar

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-code

Installs 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 (use global only 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
1starchild-ai-agent avatarorderly-onboardingstarchild-ai-agent/official-skillsOrderly Network onboarding: omnichain perps infra, MCP server, SDK and CLI quickstart. Also indexes executed Orderly fills into Starchild trade analytics. Use w7.1Kskills.sh installs
2claude-office-skills avataroffice-mcpclaude-office-skills/skillsMCP server with 39 tools for Word, Excel, PowerPoint, PDF, OCR operations7Kskills.sh installs
3affaan-m avatarcoding-standardsaffaan-m/eccBaseline cross-project coding conventions for naming, readability, immutability, and code-quality review. Use detailed frontend or backend skills for framework-7Kskills.sh installs
4github avatarmcp-configuregithub/awesome-copilotConfigure an MCP server for GitHub Copilot with your Dataverse environment.7Kskills.sh installs
5aws avataraws-amplifyaws/agent-toolkit-for-awsBuild and deploy full-stack web and mobile apps with AWS Amplify Gen2 (TypeScript code-first). Covers auth (Cognito), data (AppSync/DynamoDB), storage (S3), fun7Kskills.sh installs
6aws avatarcreating-data-lake-tableaws/agent-toolkit-for-awsCreate managed Iceberg tables using Amazon S3 Tables (s3tables API namespace) with automatic compaction and snapshot management. Sets up table bucket, namespace7Kskills.sh installs