Skip to content

kugamon/salesforce-core-skills / plugins/salesforce-core/skills/sf-metadata

sf-metadata

Verified

Salesforce 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} ...

FileKindSize
CREDITS.mdmarkdown2.3 KB
LICENSEother1.1 KB
README.mdmarkdown3.5 KB
SKILL.mdskill md33.8 KB
assets/fields/checkbox-field.xmlconfig971 B
assets/fields/currency-field.xmlconfig1.3 KB
assets/fields/date-field.xmlconfig1.0 KB
assets/fields/email-field.xmlconfig1.1 KB
assets/fields/formula-field.xmlconfig2.3 KB
assets/fields/lookup-field.xmlconfig2.1 KB
assets/fields/master-detail-field.xmlconfig1.8 KB
assets/fields/multi-select-picklist.xmlconfig2.0 KB
assets/fields/number-field.xmlconfig1.4 KB
assets/fields/phone-field.xmlconfig1.0 KB
assets/fields/picklist-field.xmlconfig2.1 KB
assets/fields/rollup-summary-field.xmlconfig2.7 KB
assets/fields/text-field.xmlconfig1.2 KB
assets/fields/textarea-field.xmlconfig1.1 KB
assets/fields/url-field.xmlconfig940 B
assets/layouts/page-layout.xmlconfig6.5 KB
assets/objects/custom-object.xmlconfig2.4 KB
assets/permission-sets/permission-set.xmlconfig5.7 KB
assets/profiles/profile.xmlconfig5.2 KB
assets/record-types/record-type.xmlconfig3.7 KB
assets/validation-rules/validation-rule.xmlconfig5.1 KB
references/best-practices-scoring.mdmarkdown3.6 KB
references/customfield-metadata-schema.jsonconfig16.1 KB
references/customobject-metadata-schema.jsonconfig49.9 KB
references/execution-modes.mdmarkdown7.0 KB
references/field-types-guide.mdmarkdown8.8 KB
references/flexipage-metadata-schema.jsonconfig11.6 KB
references/fls-best-practices.mdmarkdown7.8 KB
references/layout-metadata-schema.jsonconfig17.8 KB
references/mcp-pagination.mdmarkdown3.1 KB
references/metadata-types-reference.mdmarkdown8.5 KB
references/naming-conventions.mdmarkdown5.6 KB
references/permset-auto-generation.mdmarkdown2.8 KB
references/quickaction-metadata-schema.jsonconfig6.9 KB
references/recordtype-metadata-schema.jsonconfig2.9 KB
references/validationrule-metadata-schema.jsonconfig1.2 KB
scripts/mcp_validator.pyscript4.5 KB
scripts/pre-mcp-validate.pyscript4.3 KB
scripts/validate_metadata_operation.pyscript13.9 KB

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
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: 472kUpdated Claude CodeCodexVerifiedInstall
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: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
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 availableStars: 322kUpdated Claude CodeCodexVerifiedInstall