Agent skill

Platform Apex Generate

by forcedotcom in forcedotcom/sf-skills

Primary Apex authoring skill for class generation, refactoring, and review.

Apache-2.0Auto-check passedBackend & APIs

Install Platform Apex Generate

skills CLI
$ npx skills add forcedotcom/sf-skills --skill platform-apex-generate -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install forcedotcom/sf-skills platform-apex-generate --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/forcedotcom/sf-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/platform-apex-generate .claude/skills/platform-apex-generate && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
platform-apex-generate
GitHub stars
1.1k
Token cost
~5.6k tokens
SKILL.md length
2,393 words
Files
18 (incl. references, assets)
Skills in repo
251
Repo updated
First seen
Licence
Apache-2.0

At a glance

Primary Apex authoring skill for class generation, refactoring, and review.

  • Works in 3 steps: Author → Validate (required before reporting) → Report
  • Asks to create/refactor a class (service
  • SKILL.md covers Required Inputs, Workflow, Rules and Async Decision Matrix, plus 1 more section
  • Calls sf; reaches soap.sforce.com

What it does

Platform Apex Generate is an agent skill from forcedotcom/sf-skills. Primary Apex authoring skill for class generation, refactoring, and review. ALWAYS ACTIVATE when the user mentions Apex, .cls, triggers, or asks to create/refactor a class (service, selector, domain, batch, queueable, schedulable, invocable, DTO, utility, interface, abstract, exception, REST resource). Use this skill for requests involving SObject CRUD, mapping collections, fetching related records, scheduled jobs, batch jobs, trigger design, @AuraEnabled controllers, @RestResource endpoints, custom REST APIs, or…

Its SKILL.md is about 5.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 19 other files, including reference files and assets.

It sits in Backend & APIs, covering Background jobs, Refactoring and REST APIs. The repository describes itself as: Salesforce's curated collection of agent skills for building applications. Optimized for Agentforce Vibes, compatible with all AI tools. The licence is Apache-2.0.

When your agent uses it

  • Asks to create/refactor a class (service
  • Requests involving SObject CRUD
  • Mapping collections
  • Fetching related records

Example prompts

  • “/platform-apex-generate”

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Author
  2. Validate (required before reporting)
  3. Report

What it can do on your machine

Read from SKILL.md and the folder at commit e5164d9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • sf

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • soap.sforce.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Platform Apex Generate loads about 5.6k tokens when it runs, and up to ~11k if it reads all its reference files. Until then it costs about 143 tokens; SKILL.md has 2,393 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~143
When it runs · the whole SKILL.md, loaded when a task matches
~5.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~11k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from forcedotcom/sf-skills at commit e5164d9, republished under its Apache-2.0 licence (© forcedotcom). 2,393 words, ~5,616 tokens.

Download SKILL.mdSave it as .claude/skills/platform-apex-generate/SKILL.md (or your agent's skills folder). This skill also uses 17 other files; get the full folder from GitHub.
name
platform-apex-generate
description
Primary Apex authoring skill for class generation, refactoring, and review. ALWAYS ACTIVATE when the user mentions Apex, .cls, triggers, or asks to create/refactor a class (service, selector, domain, batch, queueable, schedulable, invocable, DTO, utility, interface, abstract, exception, REST resource). Use this skill for requests involving SObject CRUD, mapping collections, fetching related records, scheduled jobs, batch jobs, trigger design, @AuraEnabled controllers, @RestResource endpoints, custom REST APIs, or code review of existing Apex.
metadata.version
1.1
metadata.domains
Platform
metadata.minApiVersion
66.0
metadata.relatedSkills
platform-apex-test-generate

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

All steps are sequential. Do not skip, merge, or reorder. If blocked, stop and ask for missing context. If not applicable, mark N/A with a one-line justification in the report.

Phase 1 — Author
  1. Discover project conventions

    • Service-Selector-Domain layering, logging utilities
    • Existing classes/triggers and current trigger framework or handler pattern
    • Whether Trigger Actions Framework (TAF) is already in use
  2. Choose the smallest correct pattern (see Type-Specific Guidance below)

  3. Review templates and assets

    • Read the matching template from assets/ before authoring (see Type-Specific Guidance for the file mapping)
    • When a references/ example exists for the type, read it as a concrete style guide
    • For any test class work, always read and use platform-apex-test-generate skill
  4. Author with guardrails -- apply every rule in the Rules section below

    • Generate {ClassName}.cls with ApexDoc
    • Generate {ClassName}.cls-meta.xml
  5. Generate test classes -- Load the skill platform-apex-test-generate to create {ClassName}Test.cls and {ClassName}Test.cls-meta.xml. Apex tests are always required to be generated to deploy. No test file creation or edits can occur without loading the platform-apex-test-generate skill to generate tests.

Phase 2 — Validate (required before reporting)

Writing files is the midpoint, not the finish line. Steps 6 and 7 each require a tool invocation and produce output that must appear in the Step 8 report. Do not summarize or present the report until both steps have run and their output is captured.

  1. Run code analyzer

    • Invoke MCP run_code_analyzer on all generated/updated .cls files.
    • Remediate all sev0, sev1, and sev2 violations; re-run until clean.
    • Capture the final tool output verbatim for the report.
    • Fallback: sf code-analyzer run --target <target>. If both are unavailable, record run_code_analyzer=unavailable: <error> in the report.
  2. Execute Apex tests

    • Run org tests including {ClassName}Test via sf apex run test or MCP.
    • Delegate all test generation/fixes/coverage work to platform-apex-test-generate; iterate until the tests pass.
    • Capture pass/fail counts and coverage percentage for the report.
    • If unavailable, record test_execution=unavailable: <error> in the report.
Phase 3 — Report
  1. Report -- use the output format at the bottom of this file.
    • The Analyzer line must contain the actual Step 6 tool output (or run_code_analyzer=unavailable: <reason> after attempting invocation).
    • The Testing line must contain the actual Step 7 results (or test_execution=unavailable: <reason> after attempting invocation).
    • A report missing either line is incomplete. Always attempt the tool invocation before recording unavailable.

Rules

Hard-Stop Constraints (Must Enforce)

If any constraint would be violated in generated code, stop and explain the problem before proceeding:

ConstraintRationale
Place all SOQL outside loopsAvoid query governor limits (100 queries)
Place all DML outside loopsAvoid DML governor limits (150 statements)
Declare a sharing keyword on every classPrevent unintended without sharing defaults and data exposure
Use Custom Metadata/Labels/describe calls instead of hardcoded IDsEnsure portability across orgs
Always handle exceptions (log, rethrow, or recover)Prevent silent failures
Use bind variables for all dynamic SOQL with user inputPrevent SOQL injection
Use Apex-native collections (List, Map, Set) rather than Java typesPrevent compile errors
Verify methods exist in Apex before usePrevent reliance on non-existent APIs
Avoid System.debug() in main code pathsDebug statements evaluate even when loggign is not active and consume CPU. Use a logging framework if required on main code paths
Never use @future methodsUse Queueable with System.Finalizer; @future cannot chain, cannot be called from Batch, and cannot accept non-primitive types
Bulkification & Governor Limits
  • All public APIs accept and process collections; single-record overloads delegate to the bulk method
  • In batch/bulk flows, prefer partial-success DML (Database.update(records, false)) and process SaveResult for errors
  • Use Map<Id, SObject> constructor for efficient ID-based lookups from query results
  • Use Map<Id, List<SObject>> to group child records by parent; build the map in a single loop before processing
  • Use Set<Id> for deduplication and membership checks; prefer Set.contains() over List.contains()
  • Use relationship subqueries to fetch parent + child records in a single SOQL when both are needed
  • Use AggregateResult with GROUP BY for rollup calculations instead of querying and counting in Apex
  • Only DML records that actually changed — compare against Trigger.oldMap or prior state before adding to the update list
  • Use Limits.getQueries(), Limits.getDmlStatements(), Limits.getCpuTime() to monitor consumption in complex transactions
SOQL Optimization
  • Use selective queries with proper WHERE clauses; use indexed fields (Id, Name, OwnerId, lookup/master-detail fields, ExternalId fields, custom indexes) in filters when possible
  • SELECT * does not exist in SOQL -- always specify the exact fields needed
  • Apply LIMIT clauses to bound result sets; use ORDER BY for deterministic results
  • When querying Custom Metadata Types (objects ending with __mdt), do NOT use SOQL — use the built-in methods ({CustomMdt__mdt}.getAll().values(), getInstance(), etc.)
  • Queries executed in without sharing keyword classes with API versions 67.0 and up will throw when the running user does not have the proper field or object-level security. If API versions are being updated, ensure queries are safeguarded properly, and that tests are updated accordingly. Only explicitly justified usages of SYSTEM_MODE variants within queries should be allowed by default.
Caching
  • Use Platform Cache (Cache.Org / Cache.Session) for frequently accessed, rarely changed data; set a TTL and always handle cache misses — cache can be evicted at any time
  • Use private static Map fields as transaction-scoped caches to prevent duplicate queries within the same execution context; lazy-initialize on first access
Security
  • Default to with sharing; document justification for without sharing or inherited sharing
  • WITH USER_MODE in SOQL and AccessLevel.USER_MODE for Database DML for CRUD/FLS enforcement — these are the defaults for all Apex classes with API versions of 67.0 or higher
  • Validate dynamic field/operator names via allowlist or Schema.describe
  • Named Credentials for all external credentials/API keys
  • AuraHandledException for @AuraEnabled user-facing errors (no internal details)
  • without sharing requires a Custom Permission check
  • Isolate without sharing logic in dedicated helper classes; call from with sharing entry points to limit elevated-access scope
  • Encrypt PII/sensitive data at rest via Platform Encryption; never expose PII in debug statements, error messages, or API responses
Security Verification

Before finalizing, verify: CRUD/FLS enforced (SOQL + DML) · explicit sharing keyword on every class · no hardcoded secrets or Record IDs · PII excluded from logs and error messages · error messages sanitized for end users.

Error Handling
  • Catch specific exceptions before generic Exception; include context in messages
  • Use try/catch only around code that can throw (DML, callouts, JSON parsing, casts); avoid defensive wrapping of simple assignments/collection ops/arithmetic
  • Preserve exception cause chains: new CustomException('message', cause) (do not replace stack trace with concatenated messages)
  • Provide a custom exception class per service domain when meaningful
  • In @AuraEnabled methods, catch exceptions and rethrow as AuraHandledException
  • Fallback option: when no meaningful domain exception exists, catch generic Exception and either rethrow it or wrap it in a minimal custom exception that preserves the original cause.
Null Safety
  • Add guard clauses for null/empty inputs at the top of every public method; match style to context: return early in private/trigger-handler methods, throw exceptions in public APIs, record.addError() in validation services
  • Return empty collections instead of null
  • Use safe navigation (?.) for chained property access
  • Never dereference map.get(key) inline unless presence is guaranteed; use containsKey, assignment + null check, or safe navigation first
  • Use null coalescing (??) for default values
  • Prefer String.isBlank(value) over manual checks like value == null || value.trim().isEmpty()
Constants & Literals
  • Use enums over string constants whenever possible; enum values follow UPPER_SNAKE_CASE
  • Extract repeated literal strings/numbers into private static final constants or a constants class
  • Use Label. custom labels for user-facing strings
  • Use Custom Metadata for configurable values (thresholds, mappings, feature flags)
  • Never output HTML-escaped entities in code (e.g., &#39;); use literal single quotes ' in Apex string literals
Naming Conventions
TypePatternExample
Service{SObject}ServiceAccountService
Selector{SObject}SelectorAccountSelector
Domain{SObject}DomainOpportunityDomain
Batch{Descriptive}BatchAccountDeduplicationBatch
Queueable{Descriptive}QueueableExternalSyncQueueable
Schedulable{Descriptive}SchedulableDailyCleanupSchedulable
DTO{Descriptive}DTOAccountMergeRequestDTO
Wrapper{Descriptive}WrapperOpportunityLineWrapper
Utility{Descriptive}UtilStringUtil
InterfaceI{Descriptive}INotificationService
AbstractAbstract{Descriptive}AbstractIntegrationService
Exception{Descriptive}ExceptionAccountServiceException
REST Resource{SObject}RestResourceAccountRestResource
Trigger{SObject}TriggerAccountTrigger
Trigger ActionTA_{SObject}_{Action}TA_Account_SetDefaults

Additional naming rules:

  • Classes: PascalCase
  • Methods: camelCase, start with a verb (get, create, process, validate, is, has, can)
  • Variables: camelCase, descriptive nouns; Lists as plural nouns (e.g., accounts, relatedContacts); Maps as {value}By{key} (e.g., accountsById); Sets as {noun}Ids
  • Constants: UPPER_SNAKE_CASE
  • Use full descriptive names instead of abbreviations (acc, tks, rec)
Show full SKILL.md (937 more words)Show less
ApexDoc
  • Required on the class header and every public/global method
  • Include: brief description, @param, @return, @throws, @example where helpful

Class-level format:

apex
/**
 * Provides services for geolocation and address conversion.
 */
public with sharing class GeolocationService { }

Method-level format:

apex
/**
 * @param paramName Description of the parameter
 * @return Description of the return value
 * @example
 * List<Account> results = AccountService.deduplicateAccounts(accountIds);
 */
Code Structure & Architecture
  • Single responsibility per class; max 500 lines -- split when exceeded
  • Return early: validate preconditions at method top, return/throw immediately
  • Extract private helpers for methods over ~40 lines
  • Use Dependency Injection (constructor/method params) for testability
  • Prefer composition and narrow interfaces over deep inheritance; extend via new implementations, not modifications
  • Enforce single-level abstraction per method across layer boundaries:
LayerOwnsMust NOT contain
TriggerEvent routing onlyBusiness logic, orchestration
Handler/ServiceFlow control, coordinationInline SOQL/DML/HTTP/parsing
DomainBusiness rules, validationQueries, callouts, persistence details
Data/IntegrationSOQL, DML, HTTPBusiness decisions
  • Disallowed: methods mixing orchestration with inline SOQL/DML/HTTP; business rules mixed with parsing internals; validation + persistence + cross-system plumbing in one method

Async Decision Matrix

ScenarioDefaultKey Traits
Standard async workQueueableJob ID, chaining, non-primitive types, configurable delay (up to 10 min via AsyncOptions), dedup signatures
Very large datasetsBatch ApexChunked processing, max 5 concurrent; use QueryLocator for large scopes
Modern batch alternativeCursorStep (Database.Cursor)2000-record chunks, higher throughput, no 5-job limit
Recurring scheduleScheduled Flow (preferred) or SchedulableSchedulable has 100-job limit; use only when chaining to Batch or needing complex Apex logic
Post-job cleanupFinalizer (System.Finalizer)Runs regardless of Queueable success/failure
Long-running calloutsContinuationUp to 3 per transaction, 3 parallel
Delays > 10 minutesSystem.scheduleBatch()Schedule a Batch job at a specific future time
Legacy fire-and-forget@futureDo not use in new code — see Hard-Stop Constraints; replace with Queueable + Finalizer

Type-Specific Guidance

Service
  • Template: assets/service.cls · Reference: references/AccountService.cls
  • with sharing; stateless — no public fields or mutable instance state; keep public APIs focused and static where reasonable
  • Delegate all SOQL to Selectors and SObject behavior to Domains
  • Wrap business errors in a custom exception (e.g., AccountServiceException)
Selector
  • Template: assets/selector.cls · Reference: references/AccountSelector.cls
  • inherited sharing; one per SObject or query domain
  • Return List<SObject> or Map<Id, SObject>; use a shared base field list constant (no inline duplication)
  • Accept filter parameters; always include WITH USER_MODE
Domain
  • Template: assets/domain.cls
  • with sharing; encapsulate field defaults, derivations, and validations
  • Operate on in-memory lists only; no SOQL/DML (belongs in Services/Selectors)
Batch
  • Template: assets/batch.cls · Reference: references/AccountDeduplicationBatch.cls
  • with sharing; implement Database.Batchable<SObject> (add Database.Stateful when tracking across chunks)
  • start() = query definition; execute() = business logic; finish() = logging/notification
  • Use QueryLocator for large datasets; handle partial failures via Database.SaveResult
  • Accept filter parameters via constructor for reusability
Queueable
  • Template: assets/queueable.cls
  • with sharing; implement Queueable and optionally Database.AllowsCallouts when HTTP callouts are needed
  • Accept data via constructor
  • Add chain-depth guards to prevent infinite chains
  • Optionally implement Finalizer for recovery/cleanup
  • Use AsyncOptions for configurable delay (up to 10 min) and dedup signatures
Schedulable
  • Template: assets/schedulable.cls
  • with sharing; execute() delegates to Queueable or Batch
  • Provide CRON constants and a convenience scheduleDaily() helper
DTO / Wrapper
  • Template: assets/dto.cls
  • No sharing keyword needed (pure data containers)
  • Simple public properties; no-arg + parameterized constructors; Comparable when ordering matters
  • Use @JsonAccess on private/protected inner DTOs that are serialized/deserialized
Utility
  • Template: assets/utility.cls
  • No sharing keyword needed; all methods public static; private constructor
  • Pure, side-effect-free; no SOQL/DML
Interface
  • Template: assets/interface.cls
  • Define clear contracts with ApexDoc on each method signature
Abstract
  • Template: assets/abstract.cls
  • with sharing; offer default behavior via virtual methods
  • Mark extension points protected virtual or protected abstract
  • Include a concrete example in the ApexDoc showing how to extend the class
Custom Exception
  • Template: assets/exception.cls
  • No sharing keyword; extend Exception with descriptive names
  • Supported constructors: (), ('msg'), (cause), ('msg', cause)
Trigger
  • Template: assets/trigger.cls
  • One trigger per object; delegate all logic to handler/TAF action classes
  • Include all relevant DML contexts; if TAF: new MetadataTriggerHandler().run();
Trigger Action (TAF)
  • One class per concern per context; implement TriggerAction.{Context}
  • Register via Trigger_Action__mdt (actions are inactive without registration)
  • Name: TA_{SObject}_{ActionName}; prefer field-value comparison over static booleans for recursion
Invocable Method (@InvocableMethod)
  • Template: assets/invocable.cls
  • with sharing; inner Request/Response with @InvocableVariable
  • Method must be public static; non-static or single-object signatures will not compile
  • Accept List<Request>, return List<Response>; bulkify (SOQL/DML outside loops)
  • Decorator parameters: label (required — Flow Builder display name), description, category (groups actions in Builder), callout=true (required when method makes HTTP callouts)
  • @InvocableVariable parameters: label (required), description, required=true/false
  • @InvocableVariable supports: primitives, Id, SObject, List<T> only (no Map/Set/Blob); use List<Id> or List<SObject> fields for Flow collection I/O
  • Always include isSuccess, errorMessage, and errorType (e.getTypeName()) in Response
  • Return errors in Response (recommended); throwing an exception triggers the Flow Fault path — reserve for unrecoverable failures only
REST Resource (@RestResource)
  • Template: assets/rest-resource.cls
  • global with sharing; both class and methods must be global
  • Versioned URL: @RestResource(urlMapping='/{resource}/v1/*')
  • Use proper HTTP status codes per branch (200/201/400/404/422/500); never default all errors to 500
  • Validate inputs (Id format: Pattern.matches('[a-zA-Z0-9]{15,18}', value)); bind all user input in SOQL
  • Include LIMIT/ORDER BY in queries; implement pagination (pageSize/offset)
  • Standardized ApiResponse wrapper (success, message, data/records); inner request/response DTOs
  • Thin controller: delegate business logic to Service classes
@AuraEnabled Controller
  • with sharing; use WITH USER_MODE in all SOQL
  • Use @AuraEnabled(cacheable=true) only for read-only queries; leave cacheable unset for DML operations
  • Catch exceptions and rethrow as AuraHandledException with user-friendly messages

Output Expectations

Deliverables per class:

  • {ClassName}.cls
  • {ClassName}.cls-meta.xml (default API version 66.0 or higher unless specified)
  • {ClassName}Test.cls (generated via platform-apex-test-generate skill)
  • {ClassName}Test.cls-meta.xml (generated via platform-apex-test-generate skill)

Deliverables per trigger:

  • {TriggerName}.trigger
  • {TriggerName}.trigger-meta.xml (default API version 66.0 or higher unless specified)

Meta XML template:

xml
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>{API_VERSION}</apiVersion>
    <status>Active</status>
</ApexClass>

Report in this order:

text
Apex work: <summary>
Files: <paths>
Design: <pattern / framework choices>
Workflow: all steps completed (1-8); any N/A justified
Risks: <security, bulkification, async, dependency notes>
Analyzer: <REQUIRED -- paste actual run_code_analyzer output or state "run_code_analyzer=unavailable: <reason>">
Testing: <REQUIRED -- paste actual test execution results (pass/fail, coverage) or state "test_execution=unavailable: <reason>">
Deploy: <dry-run or next step>

Cross-Skill Integration

NeedDelegate to
Apex tests / fix failuresplatform-apex-test-generate skill
Describe objects/fieldsmetadata skill (if available)
Deploy to orgdeploy skill (if available)
Flow calling ApexFlow skill (if available)
LWC calling ApexLWC skill (if available)

Troubleshooting Boundary

This skill handles production .cls/.trigger/.apex issues only: compile/parse failures, deployment dependency errors, runtime governor-limit failures. For test execution, assertions, coverage, or sf apex run test failures, delegate to platform-apex-test-generate.

© forcedotcom, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 17 other files (references, assets) in skills/platform-apex-generate of forcedotcom/sf-skills.

  • SKILL.md
  • assets/abstract.cls
  • assets/batch.cls
  • assets/domain.cls
  • assets/dto.cls
  • assets/exception.cls
  • assets/interface.cls
  • assets/invocable.cls
  • assets/queueable.cls
  • assets/rest-resource.cls
  • assets/schedulable.cls
  • assets/selector.cls
  • assets/service.cls
  • assets/trigger.cls
  • assets/utility.cls
  • references/AccountDeduplicationBatch.cls
  • references/AccountSelector.cls
  • references/AccountService.cls

Open the folder on GitHubat commit e5164d9

Compare with similar skills

Platform Apex Generate next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Platform Apex Generate compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Platform Apex Generate this skillforcedotcom/sf-skills1.1k—~5.6kAutomated safety check: PassApache-2.0
Develop Asc Changerorkai/App-Store-Connect-CLI7.7k—~818Automated safety check: PassMIT
Laravel SpecialistJeffallan/claude-skills12k1 repos~2.1kAutomated safety check: PassMIT
Polylith Base CreationDavidVujic/python-polylith553—~757Automated safety check: PassMIT
Frappe App Devfrappe/skills146—~943Automated safety check: PassNone
Dj Servicesdvf/opinionated-django109—~3kAutomated safety check: NotesMIT

Similar skills

  • Develop Asc Change

    rorkai/App-Store-Connect-CLI

    Design, implement, and verify behavior changes in App-Store-Connect-CLI.

    7.7k GitHub stars~818 tokensUpdated today
    MobileAuto-check passed
  • Laravel Specialist

    Jeffallan/claude-skills

    Builds Laravel 10+ applications with Eloquent models, Sanctum authentication, Horizon queues, API resources and Livewire components, tested with Pest or PHPUnit.

    12k GitHub starsUsed in 1 repo~2.1k tokens
    Backend & APIsAuto-check passed
  • Polylith Base Creation

    DavidVujic/python-polylith

    Create a Polylith base with poly create base — the entry point of a deployable application (HTTP API, CLI, message-queue consumer, AWS Lambda handler, GCP Cloud Function, scheduled job).

    553 GitHub stars~757 tokensUpdated 4 days ago
    Backend & APIsAuto-check passed
  • Frappe App Dev

    frappe/skills

    Builds full-stack Frappe Framework applications end-to-end. An agent skill from frappe/skills.

    146 GitHub stars~943 tokensUpdated 8 days ago
    Backend & APIsAuto-check passed
  • Dj Services

    dvf/opinionated-django

    Structure Django business logic as plain services that receive their dependencies via constructor injection, and wire them through an svcs registry so they can be resolved anywhere — views, Celery…

    109 GitHub stars~3k tokensUpdated 1 mo ago
    Backend & APIsAuto-check: notes
  • Function Dev

    butterbase-ai/butterbase-skills

    A skill your agent uses when developing, deploying, or debugging Butterbase serverless functions, or when the user needs to add backend logic like webhooks, scheduled jobs, or custom API endpoints

    534 GitHub stars~2.8k tokensUpdated 3 days ago
    Backend & APIsAuto-check passed

More from forcedotcom/sf-skills

All 251 skills in this repo
  • Agentforce Architecture Analyze

    forcedotcom/sf-skills

    Declared architecture snapshot for one Agentforce agent: planner, topics, actions, flows, Apex, prompt templates, and NGA plugins.

    1.1k GitHub stars~4.5k tokensUpdated yesterday
    Auto-check passed
  • Agentforce D360 Analyze

    forcedotcom/sf-skills

    Data Cloud 360° view of a single Agentforce session. An agent skill from forcedotcom/sf-skills.

    1.1k GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed
  • Apply a Salesforce sandbox post-copy automation JSON config against a target org.

    1.1k GitHub stars~5.3k tokensUpdated yesterday
    Auto-check: notes
  • Apply a Salesforce sandbox post-copy automation JSON config against a target org.

    1.1k GitHub stars~5.4k tokensUpdated yesterday
    Auto-check: notes
  • Design Systems Slds Apply

    forcedotcom/sf-skills

    Apply SLDS-compliant UI using the correct blueprints, styling hooks, utility classes, and icons.

    1.1k GitHub stars~3.7k tokensUpdated yesterday
    Auto-check passed
  • Experience Lwc Generate

    forcedotcom/sf-skills

    Lightning Web Components with PICKLES methodology and 165-point scoring.

    1.1k GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed

Questions about Platform Apex Generate

What does Platform Apex Generate do?

Primary Apex authoring skill for class generation, refactoring, and review. Platform Apex Generate is an agent skill from forcedotcom/sf-skills. Primary Apex authoring skill for class generation, refactoring, and review.

When should I use Platform Apex Generate?

Platform Apex Generate fits situations like: asks to create/refactor a class (service; requests involving SObject CRUD; mapping collections; fetching related records.

How do I install Platform Apex Generate in Claude Code?

Run `npx skills add forcedotcom/sf-skills --skill platform-apex-generate -a claude-code`. Or copy the skill folder (skills/platform-apex-generate in forcedotcom/sf-skills) into .claude/skills/platform-apex-generate in your project. Claude Code loads it when a task matches its description.

How do I install Platform Apex Generate in Codex?

Run `npx skills add forcedotcom/sf-skills --skill platform-apex-generate -a codex`. Or copy the skill folder (skills/platform-apex-generate in forcedotcom/sf-skills) into .agents/skills/platform-apex-generate in your project. Codex loads it when a task matches its description.

Can I use Platform Apex Generate in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add forcedotcom/sf-skills --skill platform-apex-generate -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/platform-apex-generate, .gemini/skills/platform-apex-generate, .github/skills/platform-apex-generate and .opencode/skills/platform-apex-generate in your project.

What does Platform Apex Generate need to run?

Going by SKILL.md and its folder, Platform Apex Generate needs the command-line tools its instructions call (sf).

Does Platform Apex Generate access the network?

SKILL.md names 1 domain. In commands or code: soap.sforce.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Platform Apex Generate safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Platform Apex Generate use?

Platform Apex Generate is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Platform Apex Generate use?

About 5.6k tokens (SKILL.md is roughly 22k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.1k tokens, read only when the agent opens those files.

What are the alternatives to Platform Apex Generate?

Skills that share tags, products or a category with Platform Apex Generate: Develop Asc Change (rorkai/App-Store-Connect-CLI, 7.7k stars), Laravel Specialist (Jeffallan/claude-skills, 12k stars), Polylith Base Creation (DavidVujic/python-polylith, 553 stars) and Frappe App Dev (frappe/skills, 146 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Platform Apex Generate?

forcedotcom (a GitHub organization) maintains it in forcedotcom/sf-skills, which has 1,060 GitHub stars. The repository holds 251 skills in this directory. The repository was last updated on October 7, 2026.

Source: forcedotcom/sf-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.