KernDX - Developer Documentation
This page is the map to everything you can read about KernDX. It is for anyone building on the framework, whether you are a brand-new Salesforce developer looking for a quick task guide or an architect comparing design choices. Skim the Learning Paths if you are starting out, jump to a Fast Start when you have a specific task, or open a full Guide when you want the complete picture.
Using an AI coding assistant? Load
docs/AI Agent Instructions.mdinto it before generating KernDX code. That one file is the assistant's complete context for writing selectors, triggers, callouts, LWC, and tests the KernDX way. It's already in this repo and release; see its header for exactly how to wire it into your tool.
Table of Contents
Expand
Before You Begin
Verify these prerequisites before starting any Fast Start guide:
- [ ] Salesforce org access: a developer or sandbox org with admin permissions
- [ ] Salesforce DX: the
sfCLI installed and authenticated to your org - [ ] KernDX deployed: the KernDX managed package installed
- [ ] API version 67.0: org and project metadata aligned to API 67.0
- [ ] Custom Metadata access: permission to create and edit Custom Metadata Type records
Learning Paths
Choose the path that matches your project needs:
Data Layer Path
Selectors → DML → Security → Data Masking → Test Data
Automation Path
Trigger Actions → Custom Validations → Async Processing → Logging
Integration Path
Outbound APIs → Resilience → Inbound APIs → Async Chains → Feature Flags → Logging
Testing Path
Quality Path
UI Path
Fast Starts
Have a specific task in mind? These short, focused guides walk you through one job at a time so you can build it quickly.
Data Access
| Name | Description | Key Reference |
|---|---|---|
| Selectors | Build object selectors and fluent queries | SEL_Base, QRY_Builder |
| DML | Insert, update, delete with Unit of Work | DML_Builder |
| Test Data | Create test data with builders and factories | TST_Builder, TST_Factory |
Triggers & Validation
| Name | Description | Key Reference |
|---|---|---|
| Trigger Actions | Build metadata-driven trigger actions | TRG_Dispatcher, TRG_Base, IF_Trigger |
| Custom Validations | Build formula-driven validation rules | UTIL_ValidationRule, FLOW_ExecuteValidationRules |
Web Services
| Name | Description | Key Reference |
|---|---|---|
| Outbound APIs | Call external REST APIs | API_Outbound, DTO_JsonBase, UTIL_HttpClient |
| Inbound APIs | Expose REST endpoints for external callers | API_Inbound, API_Dispatcher |
| Resilience | Retry, backoff, and circuit breaker for flaky callouts | UTIL_HttpClient, UTIL_Retry, UTIL_CircuitBreaker |
Operations
| Name | Description | Key Reference |
|---|---|---|
| Async Processing | Adaptive async jobs, chain orchestration with shared context, scheduling | IF_Async, UTIL_AsyncChain, IF_Schedulable |
| Logging | Application logging and monitoring | LOG_Builder |
| Feature Flags | Metadata-driven feature toggles | UTIL_FeatureFlag |
Security
| Name | Description | Key Reference |
|---|---|---|
| Security | Queries and DML that run with the user's own permissions and sharing by default (USER_MODE) | QRY_Builder, DML_Builder |
| Data Masking | Redact cards, secrets, and PII on records before they save | MaskingTarget__mdt, UTIL_FeatureFlag |
User Interface
| Name | Description | Key Reference |
|---|---|---|
| LWC | Build Lightning Web Components on the ComponentBuilder base class | LWC - Guide |
Code Quality
| Name | Description | Key Reference |
|---|---|---|
| Code Scanning | PMD and ESLint enforcement of framework conventions in IDE and CI/CD | Code Scanning - Guide |
Testing
| Name | Description | Key Reference |
|---|---|---|
| E2E Testing | Browser-based Playwright tests for Salesforce Lightning | E2E Testing - Guide |
Guides
In-depth reference guides. Open one of these when you want the complete picture of a framework area: what it can do, the patterns behind it, and the recommended way to use it.
Core Frameworks
| Name | Description |
|---|---|
| Selectors - Guide | Layered query architecture, QRY_Builder, sharing enforcement, caching, pagination |
| Triggers - Guide | Metadata-driven trigger actions, bypass mechanisms, entry criteria, recursion prevention |
| Validation - Guide | Formula-driven validation, bypass hierarchy, shadow mode, Flow integration |
| DML - Guide | Unit of Work, bulk DML, sharing enforcement, CRUD/FLS, data purge |
| Async Processing - Guide | Adaptive async processing, chain orchestration with shared context, ApiStep web service bridge, Chain Monitor UI, scheduling |
| Web Services - Guide | Outbound/inbound REST, named credentials, retry logic, Flow integration |
| Resilience - Guide | Retry strategies, exponential/linear backoff, jitter, circuit breaker states, declarative resilience on registered handlers |
| Logging - Guide | Application logging, async log publishing, log filtering, and the Log Console for browsing and diagnosing what was logged |
| Feature Flags - Guide | Metadata-driven flags, targeting strategies, custom strategy handlers, Apex/Flow/LWC checks |
Data & Security
| Name | Description |
|---|---|
| Data Masking - Guide | Write-time field redaction, masking rules and targets, the Data Masking Advisor |
| DTOs - Guide | JSON serialisation, SObject transformation, populate/transform patterns, JsonPath |
| Security - Guide | CRUD/FLS enforcement, sharing control, encryption |
| Objects & Metadata - Guide | Custom objects, platform events, and custom metadata types included in the package |
UI
| Name | Description |
|---|---|
| LWC - Guide | ComponentBuilder pattern, utility modules, pre-built components, Jest testing |
| Administration Tools - Guide | Kern Home and the built-in tools: API Test Harness, Streaming Event Monitor, Chain Monitor, Data Masking Advisor, Log Console |
Utilities
| Name | Description |
|---|---|
| Utilities - Guide | String, date, number, collection utilities, type resolution, random data, feature flags, indexing |
Code Quality
| Name | Description |
|---|---|
| Code Scanning - Guide | PMD rulesets, ESLint plugin, naming validators, CI/CD integration, phased adoption |
Testing
| Name | Description |
|---|---|
| Test Data - Guide | TST_Builder, TST_Mock, TST_Factory: auto-population, bulk creation, relationships, DML-free query mocking |
| E2E Testing - Guide | Playwright E2E testing for Salesforce: authentication, helpers, page objects, CI/CD |
API Reference
Auto-generated API reference documentation for all Apex classes, custom objects, platform events, and custom metadata types.
| Category | Link |
|---|---|
| Apex Classes | Browse |
| Custom Objects | Browse |
| Platform Events | Browse |
| Custom Metadata Types | Browse |
Special Documents
| Document | Description |
|---|---|
| AI Agent Instructions | Complete framework reference for AI agents, repackaging with custom namespace, org setup |
| Code Conventions - Guide | Canonical Apex/LWC/JS coding conventions: naming, formatting, ApexDoc, anti-patterns |
| Installation | Your org configuration, post-install steps, health check verification |
Strategic Guide (9 documents)
| Document | Description |
|---|---|
| Overview | Executive tear sheet, key findings, recommendations, navigation hub |
| Architecture & Philosophy | Design principles, capabilities, Well-Architected + Security Benchmark for Salesforce alignment |
| Adoption | Enterprise delivery, TCO model, decision matrices, build-vs-buy economics |
| Choosing a Framework | Capability-by-capability comparison against the established Apex frameworks, pick-by-capability guidance, head-to-head trade-offs |
| Operations | Day-2 ownership, packaging, exit strategy, observability |
| Risks | Risk register and mitigations for adoption decisions |
| Personas | Stakeholder-specific decision views (CTO, architect, developer, PM, ISV) |
| Glossary | Term definitions with links to relevant sections |
| Metrics | Canonical framework metrics: class counts, test coverage, metadata totals |
Choosing the Right Document
| I want to... | Start with |
|---|---|
| Learn KernDX for the first time | Learning Paths |
| Build a selector or query data | Fast Start - Selectors |
| Build a trigger action | Fast Start - Trigger Actions |
| Build a validation rule | Fast Start - Custom Validations |
| Insert, update, or delete records | Fast Start - DML |
| Call an external API | Fast Start - Outbound APIs |
| Make a simple ad-hoc HTTP call | UTIL_HttpClient |
| Expose a REST endpoint | Fast Start - Inbound APIs |
| Create test data | Fast Start - Test Data |
| Process large data sets asynchronously | Fast Start - Async Processing |
| Orchestrate multi-step async workflows | Async Processing - Guide (Chain Orchestration section) |
| Chain outbound API calls in sequence | Async Processing - Guide (ApiStep section) |
| Add logging to my code | Fast Start - Logging |
| Browse and diagnose production logs | Logging - Guide (The Log Console section) |
| Monitor integrations, jobs, and logs from one place | Administration Tools - Guide |
| Toggle features on and off | Fast Start - Feature Flags |
| Make a flaky callout resilient (retry, circuit breaker) | Fast Start - Resilience |
| Enforce CRUD/FLS on every read and write (USER_MODE) | Fast Start - Security |
| Build my first Lightning Web Component | Fast Start - LWC |
| Understand full query architecture | Selectors - Guide |
| Understand full trigger framework | Triggers - Guide |
| Transform data between formats (DTOs) | DTOs - Guide |
| Enforce CRUD/FLS or encrypt data | Security - Guide |
| Control record-level sharing at runtime | Security - Guide |
| Redact sensitive data before it is stored | Fast Start - Data Masking |
| Configure the data masking framework and Advisor | Data Masking - Guide |
| Build Lightning Web Components | LWC - Guide |
| Use string, date, number, or collection utilities | Utilities - Guide |
| Evaluate KernDX vs fflib trade-offs | Choosing a Framework |
| Set up KernDX in a subscriber org | Installation |
| Configure AI-assisted KernDX development | AI Agent Instructions |
| Write browser-based E2E tests | Fast Start - E2E Testing |
| Enforce framework conventions in CI/CD | Fast Start - Code Scanning |
| Build custom PMD rules or adopt scanning incrementally | Code Scanning - Guide |
| Design an E2E test strategy | E2E Testing - Guide |
| Look up a specific class API | API Reference |