create-apex

create-apex is a command for Claude Code from karkranikhil/sf-ai-toolkit. It costs 0 tokens per session (183 once invoked), scanned A, original, MIT.

A command for creating a Salesforce Apex service class and its test class. Apex is Salesforce’s programming language; the generated structure is designed for reusable business logic and security checks.

In plain words
What is it for?
Use it when adding code that queries or changes Salesforce data, makes callouts, or needs positive, negative, bulk, and security tests.
Why use it?
It gives new server-side Salesforce code a consistent starting point and helps avoid common problems such as database operations inside loops or missing permission checks.

Command for Claude Code

Written for Claude Code: installed under .claude/.

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.

agentmods
npx agentmods add commands/karkranikhil/sf-ai-toolkit/create-apex
Clone the repo
git clone --depth 1 https://github.com/karkranikhil/sf-ai-toolkit

Made for: Claude Code.

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 create-apex

README.md
[![agentmods](https://agentmods.dev/badge/commands/karkranikhil/sf-ai-toolkit/create-apex.svg)](https://agentmods.dev/commands/karkranikhil/sf-ai-toolkit/create-apex)
Your own site
<a href="https://agentmods.dev/commands/karkranikhil/sf-ai-toolkit/create-apex"><img src="https://agentmods.dev/badge/commands/karkranikhil/sf-ai-toolkit/create-apex.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 183 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00000 $0.00183
Opus 5 $0.00000 $0.00092
Sonnet 5 $0.00000 $0.00037
Haiku 4.5 $0.00000 $0.00018

Measured 6d ago against content hash bb14cd3fdc63, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

create-apex 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 6d 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.

examples/existing-project-after/.claude/commands/create-apex.md · 30 lines

What it actually says

/create-apex

Create a new Apex class with service/test structure and security checks.

Required input

  • Class purpose and name
  • Object(s) involved
  • Operations needed (query, insert, update, delete, callout, etc.)
  • Sharing model requirement

What to create

  1. Service class (ClassName.cls) — bulkified business logic
  2. Test class (ClassNameTest.cls) — positive, negative, bulk, security tests

Rules

  • Use with sharing unless told otherwise
  • No SOQL or DML inside loops
  • Use Collections and Maps for bulk handling
  • Enforce CRUD/FLS where needed
  • Use Custom Metadata for any configurable values
  • Use Named Credentials for any callouts
  • Add class-level Javadoc comment explaining purpose

Output

Provide both files. Explain the design choices made.

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. 6d ago First seen · 30 lines · 0 tokens per session scan A bb14cd3fdc63

Subscribe to this mod's changes

create-apex is a command published in the GitHub repository karkranikhil/sf-ai-toolkit (2 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 183 tokens. 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-08-31.

Related

Other commands, from other repositories

init

Initialize configurations for Supabase local development.

fcakyon/claude-codex-settings · 0 tokens

http-service

Build, review or debug a Bun HTTP service. Loads the http-service skill, then works the task through its workflow.

MadAppGang/magus · 27 tokens

start-10-1

Command "start-10-1" from minicoohei/ai-agent-camp, covering 🎓 lesson 10-1: clasp基本・gasプロジェクト管理, 📍 このセッションでやること, 🎯 準備チェック, 🚀 step 1: claspのインストールと apps script api の確認 and 🚀 step 2: google認証.

minicoohei/ai-agent-camp · 2 tokens

api-contract-review

Review an API contract (endpoints, request/response shapes, error codes, auth model) BEFORE implementation for naming consistency, versioning, pagination, idempotency, and alignment with existing endpoints. Distinct from review-hard (post-implementation risk) and repo-consistency-sweep (pattern matching on written…

Mozurok/fhorja.dev · 100 tokens

build

Discover an AI Gateway's models and MCP tools, retrieve a credential, and integrate them into your app — call a model, connect MCP tools, or scaffold a runnable agent.

Azure/ai-gateway · 35 tokens

fastapi

FastAPI application design and implementation conventions. Use this skill when building, updating, or reviewing FastAPI services, routers, dependencies, request/response schemas, streaming endpoints, or API tests. Trigger on FastAPI-specific work such as path operation design, dependency injection, response models…

mfmezger/ai_agent_dotfiles · 84 tokens