Help us improve
Share bugs, ideas, or general feedback.
From sf-skills
Generates and reviews callable Apex for Salesforce Industries Common Core (OmniStudio/Vlocity) with a 120-point scoring rubric. Use when creating, reviewing, or migrating Industries callable implementations.
npx claudepluginhub ccmalcom/sf-skills-plugin --plugin sf-skillsHow this skill is triggered — by the user, by Claude, or both
Slash command
/sf-skills:building-omnistudio-callable-apexThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Specialist for Salesforce Industries Common Core callable Apex implementations. Produce secure,
CREDITS.mdREADME.mdassets/pattern_callable_openinterface.clsassets/pattern_callable_vanilla.clsassets/pattern_migration.clsassets/pattern_openinterface.clsassets/pattern_test_class.clsexamples/Test_QuoteByProductCallable/IndustriesCallableException.clsexamples/Test_QuoteByProductCallable/Industries_QuoteByProductCallable.clsexamples/Test_QuoteByProductCallable/Industries_QuoteByProductCallableTest.clsexamples/Test_QuoteByProductCallable/TRANSCRIPT.mdexamples/Test_VlocityOpenInterface2Conversion/IndustriesCallableException.clsexamples/Test_VlocityOpenInterface2Conversion/MyCustomCallable.clsexamples/Test_VlocityOpenInterface2Conversion/MyCustomCallableTest.clsexamples/Test_VlocityOpenInterface2Conversion/MyCustomRemoteClass.clsexamples/Test_VlocityOpenInterface2Conversion/TRANSCRIPT.mdexamples/Test_VlocityOpenInterfaceConversion/IndustriesCallableException.clsexamples/Test_VlocityOpenInterfaceConversion/MyCustomCallable.clsexamples/Test_VlocityOpenInterfaceConversion/MyCustomCallableTest.clsexamples/Test_VlocityOpenInterfaceConversion/MyCustomVlocityOpenInterface2.clsGenerates, refactors, and reviews Apex classes including service, selector, domain, triggers, batch, queueable, and REST resources. Includes test generation.
Provides patterns for Salesforce platform development: Lightning Web Components (LWC), Apex triggers/classes, REST/Bulk APIs, Connected Apps, Salesforce DX with scratch orgs and 2GP.
Generates production-grade Apex classes with Service-Selector-Domain layering, sharing models, and async patterns (Queueable, Batchable, Schedulable). Static code generation without org connection.
Share bugs, ideas, or general feedback.
Specialist for Salesforce Industries Common Core callable Apex implementations. Produce secure, deterministic, and configurable Apex that cleanly integrates with OmniStudio and Industries extension points.
System.Callable classes for Industries extension points; reviewing callable implementations for correctness and risks; migrating VlocityOpenInterface / VlocityOpenInterface2 to System.Callable; 120-point scoring and validationgenerating-apex); building Integration Procedures (use building-omnistudio-integration-procedure); authoring OmniScripts (use building-omnistudio-omniscript); deploying Apex classes (use deploying-metadata)System.Callable classes with safe action dispatchAsk for:
call)Then:
Glob: **/*Callable*.clsDefine the callable contract:
Recommended response envelope:
{
"success": true|false,
"data": {...},
"errors": [ { "code": "...", "message": "..." } ]
}
Action dispatch rules:
switch on actionVlocityOpenInterface / VlocityOpenInterface2 contract mapping:
When designing for legacy Open Interface extensions (or dual Callable + Open Interface support), map the signature:
invokeMethod(String methodName, Map<String, Object> inputMap, Map<String, Object> outputMap, Map<String, Object> options)
| Parameter | Role | Callable equivalent |
|---|---|---|
methodName | Action selector (same semantics as action) | action in call(action, args) |
inputMap | Primary input data (required keys, types) | args.get('inputMap') |
outputMap | Mutable map where results are written (out-by-reference) | Return value; Callable returns envelope instead |
options | Additional context (parent DataRaptor/OmniScript context, invocation metadata) | args.get('options') |
Design rules for Open Interface contracts:
inputMap and options as the combined input schemaoutputMap per action (success and error cases)methodName strings so they align with Callable action stringsoptions is required, optional, or unused for each actionVanilla System.Callable (flat args, no Open Interface coupling):
Read assets/pattern_callable_vanilla.cls before generating — use when callers pass flat args and no VlocityOpenInterface integration is required.
Callable skeleton (same inputs as VlocityOpenInterface):
Read assets/pattern_callable_openinterface.cls before generating — use inputMap and options keys in args when integrating with Open Interface or when callers pass that structure.
Input format: Callers pass args as { 'inputMap' => Map<String, Object>, 'options' => Map<String, Object> }. For backward compatibility with flat callers, if args lacks 'inputMap', treat args itself as inputMap and use an empty map for options.
Implementation rules:
call() thin; delegate to private methods or service classeswith sharing, Security.stripInaccessible())WITH USER_MODE for SOQL when appropriateSystem.Callable is a standard interface (no namespace prefix required); omnistudio.VlocityOpenInterface2 uses the managed omnistudio package namespace — always qualify it. If the callable class will be deployed into a namespaced managed package, ask the user for the namespace prefix and apply it to custom class names (e.g., myns__Industries_XxxCallable)VlocityOpenInterface / VlocityOpenInterface2 implementation:
When implementing omnistudio.VlocityOpenInterface or omnistudio.VlocityOpenInterface2, use the signature:
global Boolean invokeMethod(String methodName, Map<String, Object> inputMap,
Map<String, Object> outputMap, Map<String, Object> options)
Read assets/pattern_openinterface.cls before generating — complete VlocityOpenInterface2 skeleton with switch on dispatch and outputMap contract.
Open Interface implementation rules:
outputMap via putAll() or individual put() calls; do not return the envelope from invokeMethodtrue for success, false for unsupported or failed actionsinputMap and options parameters); only the entry point differsoutputMap with the same envelope shape (success, data, errors) for consistencyBoth Callable and Open Interface accept the same inputs (inputMap, options) and delegate to identical private method signatures for shared logic.
Minimum tests:
Read assets/pattern_test_class.cls — complete test class skeleton (positive, negative, contract, bulk, and null-args cases) before generating tests.
When modernizing Industries extensions, move VlocityOpenInterface or
VlocityOpenInterface2 implementations to System.Callable and keep the
action contract stable.
Guidance:
methodName) as action strings in call()inputMap and options as keys in args: { 'inputMap' => inputMap, 'options' => options }outMapcall() thin; delegate to the same internal methods with (inputMap, options) signatureRead assets/pattern_migration.cls — annotated before/after migration example (VlocityOpenInterface2 → System.Callable) before starting migration work.
| Category | Points | Key Rules |
|---|---|---|
| Contract & Dispatch | 20 | Explicit action list; switch on; versioned action strings |
| Input Validation | 20 | Required keys validated; types coerced safely; null guards |
| Security | 20 | with sharing; CRUD/FLS checks; Security.stripInaccessible() |
| Error Handling | 15 | Typed exceptions; consistent error envelope; no empty catch |
| Bulkification & Limits | 20 | No SOQL/DML in loops; supports list inputs |
| Testing | 15 | Positive/negative/contract/bulk tests |
| Documentation | 10 | ApexDoc (/** ... */ block comments — Salesforce Apex documentation standard) for class and action methods |
Thresholds: ✅ 90+ (Ready) | ⚠️ 70-89 (Review) | ❌ <70 (Block)
Stop and ask the user if any of these would be introduced:
without sharing on callable classes| Issue | Resolution |
|---|---|
Caller passes flat args but code expects inputMap key | Guard defensively: if args lacks 'inputMap' key, treat args itself as the input map |
call() receives null for args | Always null-check args before accessing keys; initialize to empty map if null |
Test class uses (Map<String, Object>) svc.call(...) but call returns a wrong type | Ensure every action returns the same envelope type (Map<String, Object>) — mixed return types break callers |
VlocityOpenInterface2 migration breaks callers that read outputMap by reference | After migrating to Callable, callers must read the return value instead of reading outputMap — update all callers |
IndustriesCallableException class missing in project | This custom exception must be deployed alongside the callable class — include it in every deployment package |
| Org has both legacy Open Interface and new Callable wired to same action | Only one entry point should be active at a time; disable the old interface after confirming the callable works |
call() contains business logic instead of delegating| Skill | When to Use | Example |
|---|---|---|
| generating-apex | General Apex work beyond callable implementations | "Create trigger for Account" |
| generating-custom-object / generating-custom-field | Verify object/field availability before coding | "Describe Product2 fields" |
| deploying-metadata | Validate/deploy callable classes | "Deploy to sandbox" |
Use the core Apex standards, testing patterns, and guardrails in:
WITH USER_MODEVlocityOpenInterfaceVlocityOpenInterface2Deliverables produced by this skill:
<ClassName>.cls — Callable class implementing System.Callable with switch on action dispatch<ClassName>Test.cls — Test class with positive, negative, contract, and bulk test methodsIndustriesCallableException.cls — Custom exception class (if not already present in the project)| File | When to read |
|---|---|
assets/pattern_callable_vanilla.cls | Phase 3 — vanilla System.Callable skeleton (flat args, no Open Interface coupling) |
assets/pattern_callable_openinterface.cls | Phase 3 — System.Callable skeleton with inputMap/options args (Open Interface-compatible) |
assets/pattern_openinterface.cls | Phase 3 — VlocityOpenInterface2 skeleton with switch on dispatch and outputMap contract |
assets/pattern_test_class.cls | Phase 4 — test class skeleton (positive, negative, contract, bulk, and null-args cases) |
assets/pattern_migration.cls | Migration — annotated before/after migration pattern (VlocityOpenInterface2 → System.Callable) |
examples/Test_QuoteByProductCallable/Industries_QuoteByProductCallable.cls | Phase 3 — complete callable implementation with WITH USER_MODE SOQL and error envelope |
examples/Test_QuoteByProductCallable/Industries_QuoteByProductCallableTest.cls | Phase 4 — full test class covering positive, contract, and unsupported-action cases |
examples/Test_QuoteByProductCallable/IndustriesCallableException.cls | Phase 3 — custom exception pattern for unsupported actions |
examples/Test_QuoteByProductCallable/TRANSCRIPT.md | Reference — reasoning transcript for the Quote-by-Product callable example |
examples/Test_VlocityOpenInterfaceConversion/MyCustomCallable.cls | Phase 3 — migration pattern from legacy VlocityOpenInterface |
examples/Test_VlocityOpenInterfaceConversion/MyCustomCallableTest.cls | Phase 4 — test class for VlocityOpenInterface migration example |
examples/Test_VlocityOpenInterfaceConversion/IndustriesCallableException.cls | Phase 3 — custom exception class deployed alongside VlocityOpenInterface conversion |
examples/Test_VlocityOpenInterfaceConversion/MyCustomVlocityOpenInterface2.cls | Phase 3 — the original legacy VlocityOpenInterface2 class before migration |
examples/Test_VlocityOpenInterfaceConversion/TRANSCRIPT.md | Reference — reasoning transcript for VlocityOpenInterface conversion |
examples/Test_VlocityOpenInterface2Conversion/MyCustomCallable.cls | Phase 3 — migration pattern from VlocityOpenInterface2 |
examples/Test_VlocityOpenInterface2Conversion/MyCustomCallableTest.cls | Phase 4 — test class for VlocityOpenInterface2 migration example |
examples/Test_VlocityOpenInterface2Conversion/IndustriesCallableException.cls | Phase 3 — custom exception class deployed alongside VlocityOpenInterface2 conversion |
examples/Test_VlocityOpenInterface2Conversion/MyCustomRemoteClass.cls | Phase 3 — remote class used by the VlocityOpenInterface2 migration example |
examples/Test_VlocityOpenInterface2Conversion/TRANSCRIPT.md | Reference — reasoning transcript for VlocityOpenInterface2 conversion |