commerce-b2b-open-code…
Integrate Salesforce B2B Commerce open source components from GitHub into B2B Commerce…
Use when users create, generate, or validate Salesforce Custom Object metadata. Trigger on custom objects, .object files, sharing models, name fields, or validation rules — e.g. \"create a custom object\" — and deployment errors around sharing models and Master-Detail
$ npx -y skills add forcedotcom/sf-skills --skill platform-custom-object-generate --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/platform-custom-object-generateContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when users create, generate, or validate Salesforce Custom Object metadata. Trigger on custom objects, .object files, sharing models, name fields, or validation rules — e.g. \"create a custom object\" — and deployment errors around sharing models and Master-Detail
name: platform-custom-object-generate description: "Use when users create, generate, or validate Salesforce Custom Object metadata. Trigger on custom objects, .object files, sharing models, name fields, or validation rules — e.g. \"create a custom object\" — and deployment errors around sharing models and Master-Detail relationships. Also keep the object's <description> current when its fields or validation rules change. Do NOT use for non-Custom-Object metadata (Apex, Flows, LWC, Permission Sets, Custom Metadata Types) or standard objects." metadata: version: "1.1" domains: ["Platform"] minApiVersion: "60.0"
Use this skill when you need to:
This document defines the mandatory constraints for generating CustomObject metadata XML (`.object-meta.xml` file). The agent must verify these constraints before outputting XML to prevent Metadata API deployment errors.
**File extension:** `.object-meta.xml`
> **Description freshness — applies to EVERY object change, fields AND validation rules:** Whenever you add, update, or delete a field **or a validation rule** on an object, the `<description>` may now be stale. Before finishing, refresh it per **Section 3.B** (propose, confirm with the user, write). A validation-rule change counts exactly like a field change — the change is **not** done until the description has been reconciled. This is easy to forget on validation-rule edits/deletes — don't.
---
The following constraints must be true for the XML body to deploy successfully.
**Note:** The API Name (fullName) is NOT a tag; it is the filename (e.g., `Vehicle__c.object-meta.xml`).
| Element | Requirement | Notes | |---------|-------------|-------| | `<label>` | Required | Singular UI name | | `<pluralLabel>` | Required | Plural UI name | | `<sharingModel>` | Required | See Sharing Model Rules below | | `<deploymentStatus>` | Required | Always set to `Deployed` | | `<nameField>` | Required | Primary record identifier (requires `<label>` and `<type>`) | | `<visibility>` | Required | Always set to `Public` |
**Default:** Set `<sharingModel>` to `ReadWrite`.
**Exception:** If this object contains a Master-Detail relationship field, `<sharingModel>` MUST be `ControlledByParent`.
**Decision Logic:**
**INCORRECT** — Will cause error: `Cannot set sharingModel to ReadWrite on a CustomObject with a MasterDetail relationship field`
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata"> <label>Order Line Item</label> <pluralLabel>Order Line Items</pluralLabel> <sharingModel>ReadWrite</sharingModel> <!-- WRONG: Object has a M-D field --> <deploymentStatus>Deployed</deploymentStatus> </CustomObject>
**CORRECT:**
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata"> <label>Order Line Item</label> <pluralLabel>Order Line Items</pluralLabel> <sharingModel>ControlledByParent</sharingModel> <!-- CORRECT --> <deploymentStatus>Deployed</deploymentStatus> </CustomObject>
---
The agent must choose which features to enable based on the object's intended use case.
| Type | When to Use | Additional Requirements | |------|-------------|------------------------| | **Text** | Default for human-named entities (Projects, Locations, Teams) | None | | **AutoNumber** | Use for transactions, logs, or IDs (Invoices, Requests, Tickets) | Must include `<displayFormat>` (e.g., `INV-{0000}`) and `<startingNumber>1</startingNumber>` |
**Text Name Field Example:**
<nameField> <label>Project Name</label> <type>Text</type> </nameField>
**AutoNumber Name Field Example:**
<nameField>
<label>Invoice Number</label>
<type>AutoNumber</type>
<displayFormat>INV-{0000}</displayFormat>
<startingNumber>1</startingNumber>
</nameField>**`<description>`**: **Mandatory** — every Custom Object MUST have one. It must read like human-written documentation, **never** a generic template ("Object used to track and manage...") or a metadata dump ("Contains 8 fields including `Project_Name__c`...").
**Always compose an enriched description** — when creating the object, and again on **any** change to it: adding, updating, or deleting a field **or a validation rule** (so it never goes stale). The change — field or validation rule — is never "done" until you've refreshed the object's description. This is not optional; do not ask *whether* to add a description.
**Confirm per change — every time.** Propose and confirm on **each** field/rule change separately. A previous "keep current" applies **only** to that one change; it is **never** standing permission to skip the proposal on a later change. Do not infer a preference from an earlier answer — re-propose and re-ask for every new change.
**Compose** the description (steps below). If the object already has one, use it as a **strong signal** — preserve the business context it carries (domain, team, intent the schema can't reveal) and fold the new field/rule in rather than dis
This repository provides a curated collection of Salesforce agent skills for building applications.
Repo: forcedotcom/afv-library
Integrate Salesforce B2B Commerce open source components from GitHub into B2B Commerce…
Replace OOTB (out-of-the-box) B2B Commerce components with open source equivalents in site…
Use this skill to diagnose and resolve what blocks a DevOps Center promotion of a work item's…
Use this skill to manage the full lifecycle of a DevOps Center pipeline — list all pipelines,…
Use to list, view, or manage DevOps Center projects in a Salesforce org — show all projects,…
Analyzes DevOps Center test failures and Code Analyzer violations in plain language — failure…