sf-metadata

Generates and queries Salesforce metadata XML including custom objects, fields, validation rules, and permission sets.

1|Updated May 7, 2026
One-click install
npx skills add https://github.com/amanpraaj/sf-skill-hub --skill sf-metadata-amanpraaj
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sf-metadata
Source: https://github.com/amanpraaj/sf-skill-hub/tree/main/skills/salesforce/sf-metadata
Command: npx skills add https://github.com/amanpraaj/sf-skill-hub --skill sf-metadata-amanpraaj

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve? Creating Salesforce metadata by hand is error-prone: wrong field types, missing field-level security, inconsistent naming, and invalid XML structure cause failed deployments and invisible fields. This Skill generates production-quality metadata XML and queries org schema via the sf CLI, with a 120-point scoring rubric to validate structure, naming, security, and best practices. ## Core Features & Use Cases - Metadata Generation: Create custom objects, fields, validation rules, record types, page layouts, profiles, and permission sets from templates with correct XML structure and naming conventions. - Org Querying: Describe objects and list metadata types in a target org using sf CLI commands like sf sobject describe and sf org list metadata. - Automatic FLS Follow-Up: Generates or updates Permission Sets with fieldPermissions for new custom objects and fields by default, since object CRUD alone does not make fields visible. - Use Case: Ask for a custom Invoice__c object with amount and due date fields, and receive complete object, field, and validation rule XML plus a Permission Set granting access, ready for deployment via sf-deploy. ## Quick Start Ask the agent to create a custom object Invoice__c with amount and due date fields, including a permission set for the new fields.

Frequently Asked Questions about sf-metadata

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

FAQPage Schema
How do I create a custom object and fields in Salesforce with XML?▼

Define a CustomObject XML file with label, name field, and sharing model, then add CustomField XML files under the object's fields folder. This Skill generates both from templates with correct namespaces, API versions, and naming conventions.

How do I query Salesforce object metadata with the sf CLI?▼

Use sf sobject describe --sobject Account --target-org alias to inspect fields, or sf org list metadata --metadata-type CustomObject to list objects. The Skill's CLI reference covers describe, retrieve, and manifest generation commands.

Why are my new custom fields not visible after deployment?▼

Object permissions do not grant field-level security, so new fields are hidden until FLS is configured. This Skill generates Permission Sets with fieldPermissions for eligible custom fields by default to prevent this issue.

Should I use Permission Sets or Profiles for field access in Salesforce?▼

Permission Sets are preferred because they are additive and composable, while Profiles are monolithic and harder to maintain. The Skill defaults to Permission Set generation and treats Profile-first approaches as a scoring deduction.

When should I use Lookup versus Master-Detail relationships?▼

Use Lookup when the parent is optional and children can exist independently; use Master-Detail when the parent is required and you need cascade delete or roll-up summaries. The Skill's decision matrix covers junction objects and hierarchical lookups too.

When should I not use this metadata generation skill?▼

Do not use it for deploying metadata (use sf-deploy), analyzing existing permission access (use sf-permissions), or editing Flow XML (use sf-flow). It focuses on defining and querying metadata, not rollout or auditing.