PluginBench
Skill
Pass
Audit score 90

sf-metadata

jaganpro/sf-skills

Generate and query Salesforce metadata with 120-point quality scoring.

What is sf-metadata?

sf-metadata handles custom object, field, validation rule, and schema definition for Salesforce projects. Use it when creating or discovering metadata structures, but delegate deployment to sf-deploy, permission analysis to sf-permissions, and Flow work to sf-flow.

  • Generate metadata XML for objects, fields, validation rules, record types, layouts, profiles, and permission sets
  • Query org schema and metadata using sf CLI describe commands
  • Validate metadata quality against 120-point scoring rubric across 6 categories
  • Auto-generate permission-set follow-ups for new custom objects and fields with field-level security
  • Enforce naming conventions and structural correctness before deployment
  • Identify field-type fit and downstream deployment dependencies

How to install sf-metadata

npx skills add https://github.com/jaganpro/sf-skills --skill sf-metadata
Prerequisites
  • sf CLI installed and authenticated to target org
  • Target org alias configured if querying existing metadata
Claude Code
Cursor
Windsurf
Cline

How to use sf-metadata

  1. 1.Determine whether you need generation (new/updated metadata XML) or querying (discovery)
  2. 2.For generation: select metadata type and use templates from assets/ directory (objects, fields, permission-sets, profiles, record-types, validation-rules, layouts)
  3. 3.For querying: use sf metadata and sobject describe commands to inspect org schema
  4. 4.Validate generated metadata against naming conventions and field-type fit
  5. 5.Generate or update permission sets with fieldPermissions for eligible custom fields unless explicitly opted out
  6. 6.Review metadata quality score; block deployment if score is below 84
  7. 7.Hand off to sf-deploy for rollout when metadata is complete

Use cases

Good for
  • Create custom objects and fields with automatic permission-set generation for field-level security
  • Discover existing org schema and metadata structure before building Flows or Apex
  • Generate validation rules with intentional bypass strategies for operational needs
  • Build permission sets with fieldPermissions for newly created custom fields
  • Audit metadata quality and security implications before rollout
Who it's for
  • Salesforce developers building custom schema
  • Admins defining new objects and fields
  • Architects planning metadata structure before implementation
  • Teams auditing metadata quality before deployment

sf-metadata FAQ

When should I use sf-metadata vs. sf-deploy?

Use sf-metadata to generate, query, and validate metadata definitions. Use sf-deploy when you're ready to roll out the metadata to an org.

Do I need to manually create permission sets after adding custom fields?

No. sf-metadata defaults to generating or updating permission sets with fieldPermissions for new custom objects and fields unless you explicitly opt out.

What does the 120-point scoring mean?

Metadata is scored across 6 categories. Scores 108+ are production-ready, 96–107 are good with minor review, 84–95 need careful validation, and below 84 should be blocked from deployment.

What metadata types are excluded from permission-set generation?

System-managed and always-available categories are excluded. The skill notes which categories cannot be included in permission sets.

Should I use profiles or permission sets?

Prefer permission sets over profile-centric patterns for cleaner, more maintainable access control.

Full instructions (SKILL.md)

Source of truth, from jaganpro/sf-skills.


name: sf-metadata description: > Salesforce metadata generation and querying with 120-point scoring. TRIGGER when: user creates custom objects, fields, validation rules, or touches .object-meta.xml, .field-meta.xml, .profile-meta.xml files. DO NOT TRIGGER when: permission set analysis (use sf-permissions), deploying metadata (use sf-deploy), or Flow XML (use sf-flow). license: MIT metadata: version: "1.2.0" author: "Jag Valaiyapathy" scoring: "120 points across 6 categories"

sf-metadata: Salesforce Metadata Generation and Org Querying

Use this skill when the user needs metadata definition or org metadata discovery: custom objects, fields, validation rules, record types, page layouts, permission sets, or schema inspection with sf CLI.

When This Skill Owns the Task

Use sf-metadata when the work involves:

  • object, field, validation rule, record type, layout, profile, or permission-set metadata
  • .object-meta.xml, .field-meta.xml, .profile-meta.xml, and related metadata files
  • describing schema before coding or Flow work
  • generating metadata XML from requirements

Delegate elsewhere when the user is:

  • analyzing permission access rather than defining metadata → sf-permissions
  • deploying metadata → sf-deploy
  • editing Flow XML → sf-flow

Required Context to Gather First

Ask for or infer:

  • whether the user wants generation or querying
  • metadata type(s) involved
  • target object / field / package directory
  • target org alias if querying is required
  • whether new custom objects or fields should also include permission-set / FLS generation

Unless the user explicitly opts out, assume new custom objects or fields need permission-set follow-up.


Recommended Workflow

1. Choose the mode

ModeUse when
generationthe user wants new or updated metadata XML
queryingthe user needs object / field / metadata discovery

2. Start from templates or CLI describe data

For generation, use the assets under:

  • assets/objects/
  • assets/fields/
  • assets/permission-sets/
  • assets/profiles/
  • assets/record-types/
  • assets/validation-rules/
  • assets/layouts/

For querying, prefer sf metadata and sobject describe commands.

Recent SDR/CLI support worth knowing when reading older examples: CnfgItemSourceDefinition, ExtlClntAppOauthSecuritySettings, and UIBundle are now source-supported under their current names. See references/metadata-types-reference.md.

3. Validate metadata quality

Check:

  • naming conventions
  • structural correctness
  • field-type fit
  • security / FLS implications
  • downstream deployment dependencies

4. Plan permission impact by default

When new custom fields or objects are created:

  • default to generating or updating a Permission Set unless the user opts out
  • include fieldPermissions for eligible custom fields
  • note any metadata categories that are excluded because Salesforce treats them as system-managed or always-available
  • remember that object CRUD alone does not make custom fields visible

5. Hand off deployment

Use sf-deploy when the user needs the metadata rolled out.


High-Signal Rules

  • field-level security is often the hidden blocker after deployment
  • object permissions ≠ field permissions
  • prefer permission sets over profile-centric access patterns
  • generate Permission Set follow-up by default for new custom objects and fields
  • include fieldPermissions for eligible custom fields instead of leaving FLS as a manual afterthought
  • avoid hardcoded IDs in formulas or metadata logic
  • validation rules should have intentional bypass strategy when operationally necessary
  • create metadata before attempting Flow or data tasks that depend on it

Output Format

When finishing, report in this order:

  1. Metadata created or queried
  2. Files created or updated
  3. Key schema/security decisions
  4. Permission / layout follow-ups
  5. Deploy next step

Suggested shape:

Metadata task: <generate / query>
Items: <objects, fields, rules, layouts, permsets>
Files: <paths>
Notes: <naming, field types, security, dependencies>
Next step: <deploy, assign permset, or verify in Setup>

Cross-Skill Integration

NeedDelegate toReason
deploy metadatasf-deployrollout and validation
build Flows on new schemasf-flowdeclarative automation
build Apex on new schemasf-apexcode against metadata
analyze permission access after creationsf-permissionsaccess auditing
seed data after deploysf-datatest data creation

Reference Map

Start here

Security / scoring / examples


Score Guide

ScoreMeaning
108+strong production-ready metadata
96–107good metadata with minor review items
84–95acceptable but validate carefully
< 84block deployment until corrected