platform-apex-generate

platform-apex-generate is a skill for Claude Code from forcedotcom/sf-skills. It costs 122 tokens per session (6,485 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: allowed-tools in frontmatter. Also seen: mentions Claude Code.

Part of the salesforce-development plugin — 37 skills, 13 commands, 2 agents, 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
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, 13 commands, 2 agents, 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 6,485 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.06485
Opus 5 $0.00061 $0.03243
Sonnet 5 $0.00024 $0.01297
Haiku 4.5 $0.00012 $0.00649

Measured 5d ago against content hash 47b7b046e560, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 5d 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 · 449 lines

How it starts

The opening of the file, as written. The whole thing — 449 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
    • When refactoring or reviewing an existing .cls, call mcp__plugin_salesforce-development_salesforce-lsp__apex_documentSymbol with {filePath: "<absolute-path>"} to map the class's methods, properties, and inner types before editing, and call mcp__plugin_salesforce-development_salesforce-lsp__apex_hover with {filePath, line, character} (one-based line/character) to resolve the type or signature of a symbol you are unsure about. On error envelope or unavailable ({error: <code>} / tool not registered), fall back to reading the source directly.

Read the full file on GitHub · 449 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. 5d 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 (978 stars, last pushed yesterday), licensed Apache-2.0. It adds 122 tokens to every session and 6,485 once invoked, about $0.0006 per session on Opus 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

api-reviewer

A review of an API contract, the agreed description of how software systems exchange requests, responses, events, or files.

TestAny-io/testany-agent-skills · 64 tokens

principle-model-the-domain

Apply when writing stateful logic, or when code branches a lot or repeats a shape assumption across files. Encode the domain in a structure instead of scattered conditionals.

cursor/plugins · 39 tokens

code-review-nodejs

Applies Node.js-specific code review patterns for async I/O, streams, security, process management, and dependency hygiene. Use when reviewing Node.js server code, route handlers, middleware, or any JavaScript file alongside package.json without TypeScript. Triggers on sync I/O in request paths, missing stream…

Jamie-BitFlight/claude_skills · 100 tokens