kugamon/salesforce-core-skills / plugins/salesforce-core/skills/sf-metadata
sf-metadata
VerifiedSalesforce metadata operations expert. Use when creating custom objects, fields, validation rules, record types, permission sets, or querying org metadata structures via a Salesforce MCP server. Do NOT use for comparing metadata across two orgs (use sf-orgdiff), Named or External Credentials and Platform Events (use sf-integration), or querying and loading records (use sf- data). Usage: /sf-metadata [create|update|delete|describe] {ObjectName|FieldName|type} ...
references/naming-conventions.md
View on GitHub<!-- Parent: sf-metadata/SKILL.md -->
# Salesforce Metadata Naming Conventions
## Overview
Consistent naming conventions improve maintainability, discoverability, and team collaboration. Follow these standards for all Salesforce metadata.
---
## Custom Objects
### Format
```
[BusinessEntity]__c
```
### Rules
- Use PascalCase
- Singular form (not plural)
- Max 40 characters (API name)
- No abbreviations
- Descriptive and business-meaningful
### Examples
✅ Good:
- `Invoice__c`
- `Product_Catalog__c`
- `Service_Request__c`
- `Customer_Feedback__c`
❌ Avoid:
- `Invoices__c` (plural)
- `Inv__c` (abbreviated)
- `SvcReq__c` (abbreviated)
- `object1__c` (meaningless)
---
## Custom Fields
### Format
```
[Descriptive_Name]__c
```
### Rules
- Use PascalCase with underscores
- Indicate purpose, not data type
- Max 40 characters (API name)
- Use standard suffixes for relationships
### Standard Suffixes
| Suffix | Use Case |
| ---------- | ---------------------------------------------- |
| `_Date` | Date fields (e.g., `Due_Date__c`) |
| `_Amount` | Currency/Number (e.g., `Total_Amount__c`) |
| `_Count` | Counts (e.g., `Line_Item_Count__c`) |
| `_Percent` | Percentages (e.g., `Discount_Percent__c`) |
| `_Flag` | Boolean indicators (e.g., `Is_Active_Flag__c`) |
| `_Code` | Codes/identifiers (e.g., `Region_Code__c`) |
### Relationship Fields
```
[RelatedObject]__c // Lookup/Master-Detail field
[RelatedObject]__r // Relationship name (auto-generated)
```
### Examples
✅ Good:
- `Account_Manager__c` (Lookup to User)
- `Total_Contract_Value__c` (Currency)
- `Expected_Close_Date__c` (Date)
- `Is_Primary_Contact__c` (Checkbox)
❌ Avoid:
- `Amt__c` (abbreviated)
- `Field1__c` (meaningless)
- `TCV__c` (acronym without context)
- `contactLookup__c` (inconsistent casing)
---
## Profiles
### Format
```
[Role/Function] [Level]
```
### Examples
- `Sales Representative`
- `Sales Manager`
- `Marketing User`
- `System Administrator`
- `Integration User`
### Notes
- Standard profiles cannot be renamed
- Create custom profiles for specific needs
- Use Permission Sets for granular access
---
## Permission Sets
### Format
```
[Feature/Capability]_[AccessLevel]
```
### Patterns
| Pattern | Use Case |
| ---------------------- | ----------------------- |
| `[Object]_Full_Access` | Complete CRUD on object |
| `[Object]_Read_Only` | Read-only access |
| `[Feature]_Manager` | Feature management |
| `[Integration]_API` | Integration access |
### Examples
✅ Good:
- `Invoice_Full_Access`
- `Customer_Portal_User`
- `ERP_Integration_API`
- `Report_Builder_Access`
- `Deal_Approval_Manager`
❌ Avoid:
- `PS1` (meaningless)
- `John_Smith_Access` (user-specific)
- `Temp_Access` (ambiguous)
---
## Validation Rules
### Format
```
[Object]_[Action]_[Condition]
```
### Rules
- Start with object name for organization
- Use verb describing what it prevents/requires
- End with condition being validated
### Examples
✅ Good:
- `Opportunity_Require_Close_Date_When_Closed`
- `Account_Prevent_Type_Change_After_Active`
- `Contact_Require_Email_Or_Phone`
- `Invoice_Amount_Must_Be_Positive`
❌ Avoid:
- `VR001` (meaningless)
- `Check1` (undescriptive)
- `Validation` (too generic)
---
## Record Types
### Format
```
[Category/Type]_[SubCategory]
```
### Examples
✅ Good:
- `Business_Account`
- `Person_Account`
- `New_Business_Opportunity`
- `Renewal_Opportunity`
- `Support_Case`
- `Billing_Inquiry`
❌ Avoid:
- `RT1` (meaningless)
- `Type1` (undescriptive)
---
## Page Layouts
### Format
```
[Object]-[RecordType] Layout
```
### Examples
- `Account-Business Account Layout`
- `Account-Person Account Layout`
- `Opportunity-New Business Layout`
- `Case-Support Case Layout`
---
## Quick Reference Table
| Metadata Type | Pattern | Example |
| --------------- | -------------------------- | ------------------------- |
| Custom Object | `BusinessEntity__c` | `Invoice__c` |
| Custom Field | `Descriptive_Name__c` | `Total_Amount__c` |
| Lookup Field | `RelatedObject__c` | `Primary_Contact__c` |
| Permission Set | `Feature_AccessLevel` | `Invoice_Manager` |
| Validation Rule | `Object_Action_Condition` | `Opp_Require_Amount` |
| Record Type | `Category_SubCategory` | `Business_Account` |
| Page Layout | `Object-RecordType Layout` | `Account-Business Layout` |
---
## Anti-Patterns to Avoid
### Abbreviations
| Instead of | Use |
| ---------- | ---------------- |
| `Acct__c` | `Account__c` |
| `Opp__c` | `Opportunity__c` |
| `Cont__c` | `Contact__c` |
| `Amt__c` | `Amount__c` |
| `Qty__c` | `Quantity__c` |
### Meaningless Names
| Instead of | Use |
| ----------- | -------------------- |
| `Field1__c` | `Customer_Status__c` |
| `Custom__c` | `Priority_Level__c` |
| `Temp__c` | `Processing_Date__c` |
### Inconsistent Casing
| Instead of | Use |
| ----------------- | ----------------- |
| `totalamount__c` | `Total_Amount__c` |
| `TOTAL_AMOUNT__c` | `Total_Amount__c` |
| `TotalAmount__c` | `Total_Amount__c` |
---
## Checklist
Before creating metadata, verify:
- [ ] Name is PascalCase with underscores
- [ ] Name describes business purpose
- [ ] No abbreviations used
- [ ] Follows standard suffix patterns
- [ ] Unique within the object/type
- [ ] Max length constraints met
- [ ] Consistent with existing patterns
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |