sf-aura-development
Skill15 starsChanged 7 months agoMITView on GitHub
Salesforce Aura component development — bundles, events, server-side actions, Locker Service, and LWC migration. Use when maintaining or migrating Aura.
In this repository58 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- asideSkill
- checkpointSkill
- configure-sccSkill
- continuous-agent-loopSkill
- mcp-server-patternsSkill
- model-routeSkill
- prompt-optimizerSkill
- refactor-cleanSkill
- resume-sessionSkill
- save-sessionSkill
- search-firstSkill
- security-scanSkill
- sessionsSkill
- sf-2gp-security-reviewSkill
- sf-agentforce-developmentSkill
- sf-agentforce-mcp-actionsSkill
- sf-apex-async-patternsSkill
- sf-apex-best-practicesSkill
- sf-apex-constraintsSkill
- sf-apex-cursorSkill
- sf-apex-enterprise-patternsSkill
- sf-apex-testingSkill
- sf-api-designSkill
- sf-approval-processesSkill
- sf-build-fixSkill
- sf-cli-referenceSkill
- sf-data-modelingSkill
- sf-debuggingSkill
- sf-deployment-constraintsSkill
- sf-deploymentSkill
- sf-devops-ci-cdSkill
- sf-docs-lookupSkill
- sf-e2e-testingSkill
- sf-experience-cloudSkill
- sf-flow-developmentSkill
- sf-governor-limitsSkill
- sf-harness-auditSkill
- sf-helpSkill
- sf-integrationSkill
- sf-lwc-constraintsSkill
- sf-lwc-developmentSkill
- sf-lwc-testingSkill
- sf-metadata-managementSkill
- sf-platform-events-cdcSkill
- sf-quickstartSkill
- sf-security-constraintsSkill
- sf-securitySkill
- sf-soql-constraintsSkill
- sf-soql-optimizationSkill
- sf-tdd-workflowSkill
- sf-testing-constraintsSkill
- sf-trigger-constraintsSkill
- sf-trigger-frameworksSkill
- sf-visualforce-developmentSkill
- strategic-compactSkill
- update-docsSkill
- update-platform-docsSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 8 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
When maintaining or extending existing Aura components that cannot be rewritten immediately
- Distinctive: line 16
When migrating Aura components to LWC and needing to understand the source patterns
- Distinctive: line 17
When building interoperability layers between LWC and Aura
- Distinctive: line 18
When debugging Aura event propagation, server-side action callbacks, or Locker Service errors
- Distinctive: line 19
When working with features that still require Aura wrappers (Lightning Out, legacy AppExchange)
- Distinctive: line 118
Prefer component events over application events.
- Distinctive: line 124
Keep controllers thin; helpers do the work.
- Distinctive: line 177
All Apex calls in Aura go through the action queue.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Aura Component Development
Aura is Salesforce's original Lightning component framework (introduced 2014). While LWC is the modern standard, thousands of production orgs still run Aura components. This skill covers authoring, maintaining, and migrating Aura components.
Note: Aura is in maintenance mode. For new development, use LWC (see sf-lwc-development).
When to Use
- When maintaining or extending existing Aura components that cannot be rewritten immediately
- When migrating Aura components to LWC and needing to understand the source patterns
- When building interoperability layers between LWC and Aura
- When debugging Aura event propagation, server-side action callbacks, or Locker Service errors
- When working with features that still require Aura wrappers (Lightning Out, legacy AppExchange)
@../_reference/AURA_COMPONENTS.md
Component Creation Procedure
An Aura component is a folder (bundle) containing up to eight files. Only the .cmp file is required.
force-app/main/default/aura/AccountManager/
AccountManager.cmp <- Component markup (required)
AccountManagerController.js <- Client-side controller (action handlers)
AccountManagerHelper.js <- Reusable logic (called by controller)
AccountManagerRenderer.js <- Custom rendering overrides (rare)
AccountManager.css <- Component-scoped styles
AccountManager.design <- App Builder property editor config
AccountManager.cmp-meta.xml <- Metadata (apiVersion, description)Component Markup (.cmp)
<aura:component controller="AccountController"
implements="force:appHostable,flexipage:availableForAllPageTypes"
access="global">
<aura:attribute name="accounts" type="Account[]" default="[]" />
<aura:attribute name="isLoading" type="Boolean" default="true" />
<aura:attribute name="errorMessage" type="String" />
<aura:registerEvent name="accountSelected" type="c:AccountSelectedEvent" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<lightning:card title="Account Manager" iconName="standard:account">
<aura:if isTrue="{!v.isLoading}">
<lightning:spinner alternativeText="Loading" size="small" />
<aura:set attribute="else">
<aura:iteration items="{!v.accounts}" var="acct">
<lightning:tile label="{!acct.Name}">
<dl class="slds-list_horizontal slds-wrap">
<dt class="slds-item_label">Type:</dt>
<dd class="slds-item_detail">{!acct.Type}</dd>
</dl>
</lightning:tile>
</aura:iteration>
</aura:set>
</aura:if>
</lightning:card>
</aura:component>Event Handling
Component Events (Parent-Child)
<!-- AccountSelectedEvent.evt -->
<aura:event type="COMPONENT" description="Fired when an account is selected">
<aura:attribute name="accountId" type="String" />
</aura:event>// Child controller — firing
handleAccountClick: function(component, event, helper) {
var compEvent = component.getEvent("accountSelected");
compEvent.setParams({ accountId: event.currentTarget.dataset.accountId });
compEvent.fire();
}<!-- Parent — handling -->
<c:AccountTile onaccountSelected="{!c.handleAccountSelected}" />Application Events (Cross-Component)
<aura:event type="APPLICATION" description="Broadcast notification">
<aura:attribute name="message" type="String" />
</aura:event>// Firing
var appEvent = $A.get("e.c:GlobalNotificationEvent");
appEvent.setParams({ message: "Record saved" });
appEvent.fire();<!-- Any component can handle -->
<aura:handler event="c:GlobalNotificationEvent" action="{!c.handleNotification}" />Prefer component events over application events. For new cross-component communication, use Lightning Message Service instead.
Controller and Helper Patterns
Keep controllers thin; helpers do the work.
// AccountManagerController.js
({
doInit: function(component, event, helper) {
helper.loadAccounts(component);
},
handleSearch: function(component, event, helper) {
helper.loadAccounts(component);
}
})// AccountManagerHelper.js
({
loadAccounts: function(component) {
component.set("v.isLoading", true);
var action = component.get("c.getAccounts");
action.setParams({
searchTerm: component.get("v.searchTerm") || ""
});
action.setCallback(this, function(response) {
var state = response.getState();
if (state === "SUCCESS") {
component.set("v.accounts", response.getReturnValue());
} else if (state === "ERROR") {
this.handleErrors(component, response.getError());
} else if (state === "INCOMPLETE") {
component.set("v.errorMessage", "Server unreachable.");
}
component.set("v.isLoading", false);
});
$A.enqueueAction(action);
},
handleErrors: function(component, errors) {
var message = "Unknown error";
if (errors && errors[0] && errors[0].message) {
message = errors[0].message;
}
component.set("v.errorMessage", message);
}
})Server-Side Communication
$A.enqueueAction() Pattern
All Apex calls in Aura go through the action queue. Handle all three states: SUCCESS, ERROR, INCOMPLETE.
Storable Actions (Client-Side Caching)
var action = component.get("c.getPicklistValues");
action.setStorable(); // Only for @AuraEnabled(cacheable=true) methodsCallback may fire twice: once from cache, once from server. Do not use for DML operations.
$A.getCallback() for Async Code
Any code executing outside the Aura lifecycle (setTimeout, Promises, third-party callbacks) must use $A.getCallback():
setTimeout($A.getCallback(function() {
if (component.isValid()) {
component.set("v.status", "Complete");
}
}), 2000);Interoperability with LWC
Embedding LWC Inside Aura
<!-- AuraWrapper.cmp -->
<aura:component>
<c:lwcRecordDetail
record-id="{!v.selectedRecordId}"
onrecordupdate="{!c.handleRecordUpdate}" />
</aura:component>Aura to LWC — pass data via attributes mapped to @api properties.
LWC to Aura — dispatch CustomEvent; Aura receives via on{eventname} handler, access detail via event.getParam("detail").
Migration to LWC
Strategy
- Inventory — list all Aura components, dependencies, usage locations
- Prioritize — start with leaf components (no child Aura dependencies)
- Wrap — replace Aura parents with LWC, keeping Aura children via interop
- Convert — rewrite using LWC patterns
- Test — validate behavior parity
- Deploy — replace references on pages/apps
Key Mappings
| Aura | LWC |
aura:handler name="init" | connectedCallback() |
aura:handler name="destroy" | disconnectedCallback() |
aura:attribute | @api properties |
aura:if / aura:set | lwc:if / lwc:elseif / lwc:else |
aura:iteration | for:each with key |
$A.enqueueAction() | @wire or imperative await |
component.get("v.attr") | this.propertyName |
component.set("v.attr", val) | this.propertyName = val |
component.find("auraId") | this.template.querySelector() |
| Component events | CustomEvent |
| Application events | Lightning Message Service |
$A.getCallback() | Not needed (LWC handles async natively) |
| Helper.js (separate file) | Class methods (single JS file) |
$A.createComponent() | lwc:component with lwc:is |
Related
Guardrails
- sf-lwc-constraints — Enforced rules for LWC (relevant for interop and migration targets)
Agents
- sf-aura-reviewer — For interactive, in-depth Aura review guidance
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

