Генерация и проверка Apex-кода с оценкой по 150 пунктам: классы, триггеры, тесты.

Звёзды423
Форки96
Авторjaganpro
Обновлёнапр 27 2026

Установка

SKILL.md

sf-apex: Salesforce Apex Code Generation and Review

Use this skill when the user needs production Apex: new classes, triggers, selectors, services, async jobs, invocable methods, test classes, or evidence-based review of existing .cls / .trigger code.

When This Skill Owns the Task

Use sf-apex when the work involves:

  • Apex class generation or refactoring
  • trigger design and trigger-framework decisions
  • @InvocableMethod, Queueable, Batch, Schedulable, or test-class work
  • review of bulkification, sharing, security, testing, or maintainability

Delegate elsewhere when the user is:

  • editing LWC JavaScript / HTML / CSS → sf-lwc
  • building Flow XML or Flow orchestration → sf-flow
  • writing SOQL only → sf-soql
  • deploying or validating metadata to orgs → sf-deploy

Required Context to Gather First

Ask for or infer:

  • class type: trigger, service, selector, batch, queueable, schedulable, invocable, test
  • target object(s) and business goal
  • whether code is net-new, refactor, or fix
  • org / API constraints if known
  • expected test coverage or deployment target

Before authoring, inspect the project shape:

  • existing classes / triggers
  • current trigger framework or handler pattern
  • related tests, flows, and selectors
  • whether TAF is already in use

Recommended Workflow

1. Discover local architecture

Check for:

  • existing trigger handlers / frameworks
  • service-selector-domain conventions
  • related tests and data factories
  • invocable or async patterns already used in the repo

2. Choose the smallest correct pattern

NeedPreferred pattern
simple reusable logicservice class
query-heavy data accessselector
single object trigger behaviorone trigger + handler / TAF action
Flow needs complex logic@InvocableMethod
background processingQueueable by default
very large datasetsBatch Apex or Database.Cursor patterns
repeatable verificationdedicated test class + test data factory

3. Author with guardrails

Generate code that is:

  • bulk-safe
  • sharing-aware
  • CRUD/FLS-safe where applicable
  • testable in isolation
  • consistent with project naming and layering

4. Validate and score

Evaluate against the 150-point rubric before handoff.

5. Hand off deploy/test next steps

When org validation is needed, hand off to:

  • sf-testing for test execution loops
  • sf-deploy for deploy / dry-run / verification

Generation Guardrails

Never generate these without explicitly stopping and explaining the problem:

Anti-patternWhy it blocks
SOQL in loopsgovernor-limit failure
DML in loopsgovernor-limit failure
missing sharing modelsecurity / data exposure risk
hardcoded IDsdeployment and portability failure
empty catch blockssilent failure / poor observability
string-built SOQL with user inputinjection risk
tests without assertionsfalse-positive test suite

Default fix direction:

  • query once, operate on collections
  • use with sharing unless justified otherwise
  • use bind variables and WITH USER_MODE where appropriate
  • create assertions for positive, negative, and bulk cases

See references/anti-patterns.md and references/security-guide.md.


High-Signal Build Rules

Trigger architecture

  • Prefer one trigger per object.
  • If TAF is already installed and used, extend it instead of inventing a second trigger pattern.
  • Triggers should delegate logic; avoid heavy business logic directly in trigger bodies.

Async choice

ScenarioDefault
standard async workQueueable
very large record processingBatch Apex
recurring scheduleScheduled Flow or Schedulable
post-job cleanupFinalizer
long-running Lightning calloutsContinuation

Testing minimums

Use the PNB pattern for every feature:

  • Positive path
  • Negative / error path
  • Bulk path (251+ records where relevant)

Modern Apex expectations

Prefer current idioms when available:

  • safe navigation: obj?.Field__c
  • null coalescing: value ?? fallback
  • Assert.* over legacy assertion style
  • WITH USER_MODE and explicit security handling where relevant

Output Format

When finishing, report in this order:

  1. What was created or reviewed
  2. Files changed
  3. Key design decisions
  4. Risk / guardrail notes
  5. Test guidance
  6. Deployment guidance

Suggested shape:

Apex work: <summary>
Files: <paths>
Design: <pattern / framework choices>
Risks: <security, bulkification, async, dependency notes>
Tests: <what to run / add>
Deploy: <dry-run or next step>

LSP Validation Note

This skill supports an LSP-assisted authoring loop for .cls and .trigger files:

  • syntax issues can be detected immediately after write/edit
  • the skill can auto-fix common syntax errors in a short loop
  • semantic quality still depends on the 150-point review rubric

Full guide: references/troubleshooting.md


Cross-Skill Integration

NeedDelegate toReason
describe objects / fields firstsf-metadataavoid coding against wrong schema
seed bulk or edge-case datasf-datacreate realistic test datasets
run Apex tests / fix failing testssf-testingexecute and iterate on failures
deploy to orgsf-deployvalidation and deployment orchestration
build Flow that calls Apexsf-flowdeclarative orchestration
build LWC that calls Apexsf-lwcUI/controller integration

Reference Map

Start here

  • references/patterns-deep-dive.md
  • references/security-guide.md
  • references/bulkification-guide.md
  • references/testing-patterns.md

High-signal checklists

  • references/code-review-checklist.md
  • references/anti-patterns.md
  • references/naming-conventions.md

Specialized patterns

  • references/trigger-actions-framework.md
  • references/automation-density-guide.md
  • references/flow-integration.md
  • references/triangle-pattern.md
  • references/design-patterns.md
  • references/solid-principles.md

Troubleshooting / validation

  • references/troubleshooting.md
  • references/llm-anti-patterns.md
  • references/testing-guide.md

Score Guide

ScoreMeaning
120+strong production-ready Apex
90–119good implementation, review before deploy
67–89acceptable but needs improvement
< 67block deployment

Вставить в README

Ссылка на карточку для вашего README — без картинок и счётчиков.

[DarkPlay: sf-apex](https://darkplay.ru/ai/skills/sf-skills-sf-apex)

Похожие скиллы и другие разделы каталога

Похожие скиллы в категории «Продажи»

Та же категория — сравните, что ещё подойдёт под вашу задачу.

cold-outreachgtmagents · Мастерство холодных писем, LinkedIn и первого контакта с лидами.
444 ★
cargo-gtmgetcargohq · GTM-задачи в Cargo: поиск лидов, обогащение, проверка, скоринг, CRM-синхронизация.
23 ★
business-workflowsAshutosh Tiwari · Проектирование и сборка рабочего процесса целиком: автоматизации, фоновые задачи, записи…
—
buyer-personasStefanos Karakasis · Составляет карту комитета покупателей в enterprise и персоны по структуре Dunford с…
—
competitor-deep-diveStefanos Karakasis · Готовит подробный разбор одного конкурента под конкретное решение: отзывы, сделки…
—
customer-contextStefanos Karakasis · Собирает датированный бриф по клиенту из CRM, писем, звонков и использования, сверяет с…
—
first-customer-finderNalin Dalal · Поиск первых клиентов, бета-пользователей и партнёров по публичным сигналам спроса.
—
full-market-outboundNalin Dalal · Плейбук холодного аутрича: карта рынка, скоринг тайминга, email и звонки, превращение…
—
hiring-signal-finderJasper Vanu, Claude for GTM · Промпт для Claude Code: ищет на карьерных страницах из accounts.csv роли, открытые 60+…
—
ideal-customer-profileStefanos Karakasis · Превращает исследование в портрет идеального клиента: демография, поведение, задачи и…
—
Популярное в разделе «Скиллы»

Самые востребованные скиллов раздела по установкам и звёздам.

find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
4 400 000 устан.
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
1 600 000 устан.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
1 600 000 устан.
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
1 600 000 устан.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
1 600 000 устан.
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
1 500 000 устан.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
1 400 000 устан.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
1 300 000 устан.
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
1 300 000 устан.
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.
1 300 000 устан.
Похожее в других разделах каталога

Соседние разделы каталога: возможно, нужный инструмент живёт там.

Salesforce Expert Agentgithub · Экспертная помощь по Salesforce Platform: Apex Enterprise Patterns, LWC, интеграции и…
36 140 ★
research-ops-skillsalirezarezvani · Домен Research Operations: 5 навыков, включая клинические исследования и оркестратор.
510 комп.
claude-sfdx-iqanthropics · Полный плагин Salesforce DX для Claude Code: агенты, навыки, хуки, команды и правила для…
38 комп.
salesforce-claude-codeanthropics · SCC (scc-universal в npm) — плагин Claude Code для разработки на Salesforce: 17…
38 комп.
sf-env-awarenessanthropics · Навык аудита проектов Salesforce: проверяет конфигурацию sfdx-project.json, порядок…
38 комп.
sfdx-iqanthropics · Плагин даёт Claude Code глубокую экспертизу Salesforce: лучшие практики по безопасности…
38 комп.
Apexjeremylongshore · Техлид: превращает брифы в задачи и координирует специалистов.
2 470 ★
Helmjeremylongshore · Head of Product: превращает цели и проблемы пользователей в продуктовые брифы для…
2 470 ★
apexoracle · Навыки Oracle APEX для разработки приложений, включая роутер APEXlang
935 ★
salesforce-masterjosiahsiegel · Salesforce: SOQL, API, Apex, Lightning Web Components, интеграции.
337 комп.

Лучшие ИИ-инструменты для программирования

ИИ для программирования

Подборка нейросетей и ИИ-ассистентов для разработки и автоматизации кода. Сервисы, которые ускоряют написание, ревью и отладку, экономят часы рутины и снижают порог входа в сложные

GenAPIGenapi
По запросу
5.0
Notepad++ AINotepad-plus-plus
По запросу
4.9
GitHub CopilotGitHub
По подписке
4.9
Creatium MaxCremax
По запросу
4.8
Emacs AIGnu
По запросу
4.8
KiteKite
По запросу
4.8
Amazon Q DeveloperAmazon
По запросу
4.8
VECTA
Есть бесплатный тариф
4.8
SoftPractice
Есть бесплатный тариф
4.8
VibeForge
Есть бесплатный тариф
4.7

Лучшие ИИ-инструменты для генерации видео

Генерация видео

Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,

VEED.IOVeed
По запросу
5.0
MootionMootion
По запросу
5.0
FlyviFlyvi
Есть бесплатный тариф
4.9
Google Veo 3.1Google
Платно
4.9
Sora (OpenAI)OpenAI
Платно
4.9
PikaPika
Платно
4.9
captions space
Есть бесплатный тариф
4.8
Клайп
Есть бесплатный тариф
4.8
viralpulse.appViralpulse
По запросу
4.8
Viral Maker AIViral-maker
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации текста и копирайтинга

Генерация текста и копирайтинг

Подборка нейросетей для генерации текстов и копирайтинга. Сервисы, которые помогают создавать статьи, посты и рекламные объявления с нуля или по черновику, экономя часы рутинной ра

NeuroscribeNeuroscribe
Есть бесплатный тариф
5.0
GoGPTGogpt
По запросу
5.0
ChatsonicChatsonic
По запросу
4.9
НейроТекстерNeuro-texter
По запросу
4.9
ChatGPTOpenAI
По подписке
4.9
Редактум
Есть бесплатный тариф
4.8
ChadGPTChadgpt
По запросу
4.8
Cosmo ScribeCosmoscribe
Есть бесплатный тариф
4.8
Memo HelperCopilot33
По запросу
4.8
LibraChatLibrachat
Есть бесплатный тариф
4.8