sfb2b-apex

Enforce SSD architecture boundaries across Salesforce B2B Commerce Apex code.

Updated Feb 12, 2026
One-click install
npx skills add https://github.com/Architect-And-Bot/sf-b2b-commerce-template --skill sfb2b-apex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sfb2b-apex
Source: https://github.com/Architect-And-Bot/sf-b2b-commerce-template/tree/main/.claude/skills/sfb2b-apex
Command: npx skills add https://github.com/Architect-And-Bot/sf-b2b-commerce-template --skill sfb2b-apex

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

SSD-driven architecture enforces separation of concerns across Salesforce Apex layers (Services, Selectors, Domains, Controllers) to improve testability, scalability, and maintainability.

Core Features & Use Cases

  • Enforces clear service-selector-domain-controller boundaries in Apex code.
  • Provides naming conventions and patterns for Services, Selectors, Controllers, Triggers, and Tests to reduce coupling.
  • Use case: adopt in a B2B Commerce Salesforce project to organize backend logic for cart, catalog, and order flows.

Quick Start

Refactor your Apex module to follow the SSD boundaries and run full test suites to verify behavior.

Frequently Asked Questions about sfb2b-apex

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is SSD architecture in Salesforce Apex?

SSD architecture in Salesforce Apex enforces strict separation of concerns by dividing code into Services, Selectors, Domains, and Controllers. This pattern prevents mixing SOQL queries, data mutations, and business logic to improve testability, scalability, and maintainability.

How do I structure Apex controllers and triggers for B2B Commerce?

Structure Apex controllers and triggers for B2B Commerce by isolating logic into Selector, Domain, and Service layers. Controllers handle request orchestration, Domains manage object-specific mutations, and Selectors centralize queries to maintain clear boundaries and bulkification.

What are the best practices for Apex governor limits in B2B Commerce?

Best practices for Apex governor limits in B2B Commerce include enforcing bulkification, using asynchronous processing for large tasks, and centralizing SOQL in Selectors. SSD architecture naturally supports these practices by separating query logic from data mutations.

How do I apply naming conventions to Salesforce Apex service and selector classes?

Apply naming conventions to Salesforce Apex service and selector classes by aligning class names with their SSD layer responsibilities, such as using Service and Selector suffixes. This reduces coupling and clearly signals architectural boundaries to developers.

Does SSD architecture work for large B2B Commerce cart and order flows?

Yes, SSD architecture works for large B2B Commerce cart and order flows by enforcing asynchronous processing for heavy tasks and robust error handling. Separating concerns ensures complex backend logic remains scalable and respects governor limits.

Why should I separate SOQL queries from business logic in Apex?

Separate SOQL queries from business logic in Apex to improve testability and enforce sharing rules. SSD architecture mandates Selectors for queries and Services for logic, preventing mixed responsibilities and making code easier to maintain and secure.