platform-apex-generate

platform-apex-generate is a skill for Claude Code from forcedotcom/sf-skills. It costs 122 tokens per session (5,289 once invoked), scanned A, original, Apache-2.0.

A Salesforce tool for writing, refactoring, and reviewing Apex classes and triggers. Apex is Salesforce’s programming language for business logic and automated actions.

In plain words
What is it for?
Use it to create or revise services, selectors, triggers, batch jobs, queueable jobs, scheduled jobs, APIs, data objects, and utility classes.
Why use it?
It gives developers a defined approach for changing Salesforce code while accounting for sharing, permissions, deployment, and platform limits.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the salesforce-development plugin — 37 skills, 14 commands, 1 agent, 3 MCP servers shipped together

Good fit Use it to create or revise services, selectors, triggers, batch jobs, queueable jobs, scheduled jobs, APIs, data objects, and utility classes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/forcedotcom/sf-skills/platform-apex-generate
About the project

forcedotcom/sf-skills is a collection of reusable instructions that help AI coding agents build and work with Salesforce applications and platform features. Developers use it for Agentforce agents, Lightning apps, Flow, Apex, SOQL, Lightning Web Components, and related Salesforce configuration. The catalogue entries are the repository’s skills, plugins, commands, MCP servers, and agents for AI tools that support skills.

forcedotcom/sf-skills · 1,111 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add forcedotcom/sf-skills --skill platform-apex-generate
Clone the repo
git clone --depth 1 https://github.com/forcedotcom/sf-skills

Made for: Claude Code.

Or install salesforce-development, the plugin that ships this one along with the rest of its 37 skills, 14 commands, 1 agent, 3 MCP servers.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for platform-apex-generate

README.md
[![agentmods](https://agentmods.dev/badge/skills/forcedotcom/sf-skills/platform-apex-generate/github.svg)](https://agentmods.dev/skills/forcedotcom/sf-skills/platform-apex-generate)
Your own site
<a href="https://agentmods.dev/skills/forcedotcom/sf-skills/platform-apex-generate"><img src="https://agentmods.dev/badge/skills/forcedotcom/sf-skills/platform-apex-generate/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for platform-apex-generate

Your own site · 80×15
<a href="https://agentmods.dev/skills/forcedotcom/sf-skills/platform-apex-generate"><img src="https://agentmods.dev/badge/skills/forcedotcom/sf-skills/platform-apex-generate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 122 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,289 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 19 Aug 2026
  • Snyk pass 19 Aug 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00122 $0.05289
Opus 5.5 $0.00049 $0.02116
Sonnet 5.5 $0.00024 $0.01058
Haiku 4.5 $0.00012 $0.00529

Measured 21d ago against content hash 3075f9847399, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

platform-apex-generate scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 21d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/builder/salesforce-development/skills/platform-apex-generate/SKILL.md · 417 lines

How it starts

The opening of the file, as written. The whole thing — 417 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

Read the full file on GitHub · 417 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 21d ago Changed · -32 lines 3075f9847399
  2. 1mo ago First seen · 449 lines · 122 tokens per session scan A 47b7b046e560

Subscribe to this mod's changes

platform-apex-generate is a skill published in the GitHub repository forcedotcom/sf-skills (1,111 stars, last pushed yesterday), licensed Apache-2.0. It adds 122 tokens to every session and 5,289 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

flow-next-impl-review

Carmack-level implementation review of changes via the configured backend. Use when asked to review code or a diff in a flow-next repo.

gmickel/flow-next · 34 tokens

flow-next-resolve-pr

Resolve PR review feedback. Fetches unresolved threads, triages, fixes, replies and resolves via GraphQL. Use when asked to address review comments.

gmickel/flow-next · 36 tokens

api-contract-review

Use when auditing CloudBase cloud API wrappers, MCP tools, generated action metadata, or related docs for outdated or incorrect action names, parameters, casing, request shapes, or missing contract tests, especially during periodic quality review or before preparing corrective PRs.

TencentCloudBase/CloudBase-AI-Toolkit · 54 tokens

ring:migrating-to-lib-observability

Migrating a Lerian Go app off lib-commons observability imports (deprecated shims or removed APIs) to lib-observability via a fixed mapping table, then bumps go.mod and validates the build; ring:backend-go applies the edits. Covers log/zap/runtime/assert, opentelemetry/tracing, HTTP middleware, context helpers, and…

LerianStudio/ring · 104 tokens

ring:mapping-streaming-events

Mapping the eventable points in a Lerian Go service where lib-streaming should emit past-tense, durable, tenant-scoped business events, producing a PM-validated event catalog and instrumentation-map.json for ring:instrumenting-streaming-events. Three-pass discovery (Survey, Slice, Mark) with a scope fence and delivery…

LerianStudio/ring · 95 tokens

ring:instrumenting-streaming-events

Instrumenting streaming events: wires lib-streaming event emission end-to-end into a Lerian Go service via a 13-gate cycle (catalog, Builder bootstrap, Emit sites, outbox, HTTP manifest, NoopEmitter fallback, integration and chaos tests), dispatching ring:backend-go under TDD. Consumes the validated…

LerianStudio/ring · 102 tokens