sf-minimal-change

Selects the smallest Salesforce change satisfying a requirement before writing Apex, LWC, or metadata.

2|Updated Sep 12, 2026
One-click install
npx skills add https://github.com/grzmol/vibe-force --skill sf-minimal-change-grzmol
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sf-minimal-change
Source: https://github.com/grzmol/vibe-force/tree/main/skills/sf-minimal-change
Command: npx skills add https://github.com/grzmol/vibe-force --skill sf-minimal-change-grzmol

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Salesforce teams routinely over-build: custom Apex where a validation rule would do, custom LWC forms duplicating lightning-record-edit-form, custom REST endpoints duplicating Composite and Bulk API 2.0, and second trigger frameworks beside existing ones. This Skill walks a seven-rung decision ladder that challenges the requirement, searches the repo and org for existing solutions, and prefers declarative configuration, base components, and standard APIs before any custom code is written. ## Core Features & Use Cases - Seven-rung decision ladder: Challenges whether the requirement needs to exist, checks the repo and org for existing artefacts, prefers validation rules, formula fields, roll-up summaries, Flows, and sharing rules over Apex, prefers base Lightning components and LDS wire adapters over custom components, and prefers standard REST/Composite/Bulk API 2.0 endpoints over custom Apex REST. - Non-negotiable correctness floor: Enforces CRUD/FLS (WITH USER_MODE at API 67.0+), sharing declarations, bulkification, tests, accessibility, idempotency, and no secrets in metadata, so minimal never means incomplete. - Over-build catalogue and review checklist: Maps common over-builds (wrapper components, single-caller interfaces, config flags nobody flips) to their smaller alternatives, with verification commands and PR review questions. - Use Case: Before implementing "show total open pipeline on Account", the ladder finds Opportunity-to-Account is a lookup, selects a record-triggered Flow instead of an Apex rollup, and records the rejected alternatives in the decision log. ## Quick Start Ask the assistant to apply the minimal-change ladder to decide the smallest Salesforce implementation for a new requirement before writing any Apex, LWC, or Flow.

Frequently Asked Questions about sf-minimal-change

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

FAQPage Schema
How do I decide between a validation rule and an Apex trigger in Salesforce?

Use a validation rule when the condition is expressible as a formula over the record and its parent fields, since it applies to every entry path including UI, API, Bulk, and Flow. Move to an Apex trigger with addError only when the condition needs sibling records, non-rollup aggregates, or callouts.

When should I use lightning-record-edit-form instead of a custom LWC form?

Use lightning-record-edit-form by default because it enforces FLS and sharing, surfaces validation-rule errors, and needs no Apex controller. A custom component is justified only for UI API-unsupported objects, criteria-based record selection, cross-record transactions, or genuinely non-form UIs.

When is a custom Apex REST endpoint justified over standard Salesforce APIs?

Apex REST is justified only when the endpoint performs multi-object business logic in one transaction or enforces a domain invariant the caller cannot. Single-record CRUD, sObject Collections, Composite, Composite Graph, and Bulk API 2.0 above 2,000 records cover everything else without deployable code.

Can a roll-up summary field replace an Apex rollup trigger?

Yes, when the relationship is master-detail and the operation is Count, Min, Max, or Sum with optional filter criteria. Lookup relationships or non-standard aggregates need a record-triggered Flow at low volume or a bulk-safe Apex rollup at high volume.

What is the difference between WITH USER_MODE and WITH SECURITY_ENFORCED in Apex?

WITH USER_MODE is the supported enforcement clause at API version 67.0 and later, alongside AccessLevel.USER_MODE and DML with 'as user'. WITH SECURITY_ENFORCED is not allowed in Apex SOQL at 67.0+, and older samples using it must not be copied.

When should a record-triggered Flow be used instead of an Apex trigger?

Record-triggered Flows win for before-save field updates and simple related-record creation. Apex wins for before-delete handling, deterministic ordering with existing triggers, complex bulk logic, and callouts; never run both a Flow and a trigger on the same object for the same event.