# Section-by-Section Guide Detailed quality guidance for every section of a metadata generation SKILL.md. Use this reference when authoring or reviewing individual sections to ensure each meets the standards proven across 30+ production skills. --- ## A. Frontmatter Standards (Mandatory) The YAML frontmatter is the skill's identity and activation mechanism. ```yaml --- name: {action}ing-{metadata-type} description: "{PRIMARY_PURPOSE}. Trigger when users mention {METADATA_NAMES}, {FILE_EXTENSIONS}, or ask to {ACTION_VERBS}. Also use when users say things like {TRIGGER_PHRASES}. Always use this skill for any {DOMAIN} metadata work." metadata: version: "1.0" related-skills: "{skill1}, {skill2}" author: "{team-name}" last_updated: "{YYYY-MM-DD}" compatibility: "Requires Salesforce CLI, Python 3.9+" license: Apache-2.0 allowed-tools: Bash(sf project deploy start) Read Write --- ``` ### The TRIGGER / SKIP Description Pattern The description is the sole mechanism by which agents decide whether to activate your skill. Use the TRIGGER / SKIP pattern (from Anthropic's skill design) to make activation explicit: **Good description:** ``` description: "Generate and validate Salesforce Custom Field metadata. TRIGGER when: user mentions custom fields, field types, Roll-up Summary, Master-Detail, Lookup, formula fields, picklists, .field-meta.xml files, or field deployment errors. SKIP when: user needs the object itself (use generating-custom-object), needs a validation rule (use generating-validation-rule), or needs a page layout (use generating-flexipage)." ``` **Bad descriptions** are too vague, contain no trigger keywords, no file types, no exclusions. The description must be 100-300 words with 5+ specific trigger phrases. ### allowed-tools Field Declares which tools the skill can access. This scopes the agent's tool use during skill execution. Scope Bash to specific commands rather than blanket access: ```yaml allowed-tools: Bash(sf project deploy start) Read Write ``` Include only the tools the skill actually needs. Common values: `Bash`, `Read`, `Write`, `Edit`. If the skill only reads files and generates output, `Read Write` may suffice. ### license Field Top-level frontmatter field (not nested under metadata): ```yaml license: Apache-2.0 ``` ### related-skills Cross-skill referencing lists actual afv-library skill names. Skills are self-contained; orchestration between skills happens outside the skill via the agent's routing. List related skills so the agent knows where to delegate: ```yaml metadata: related-skills: "generating-custom-object, generating-validation-rule" ``` ### Key Rule: name Must Match Directory The `name` field in SKILL.md frontmatter must match the directory name exactly. `generating-custom-field/SKILL.md` must have `name: generating-custom-field`. --- ## B. Overview / Purpose (Optional) 1-2 paragraphs explaining: - What this metadata type is. - What problem the skill solves. - Which areas have the highest failure rate. Keep it brief. The overview orients the agent but does not contain actionable instructions. --- ## C. Clarifying Questions (Optional) Before generating metadata, the agent often needs information the user has not provided. Rather than guessing (which causes deployment failures), define explicit questions the agent should ask. ```markdown ## Clarifying Questions Before generating metadata, ask the user if not already clear: - What object is this for? (standard object name or custom object API name) - What field type do you need? (Text, Number, Lookup, Master-Detail, etc.) - Is this field required? (Note: cannot be set on Master-Detail fields) - For relationship fields: what is the related object? - For picklist fields: what are the values? - Should this be an external ID or unique field? ``` **Guidelines:** - Only include questions where the wrong assumption leads to deployment failure or significant rework. - Do not ask about things the agent can safely default. - Order questions from most critical to least critical. - Include parenthetical notes about constraints that affect the answer (e.g., "cannot be set on Master-Detail fields"). --- ## D. Specification / Tiered Constraints (Mandatory) Organize constraints by severity so the agent prioritizes correctly. This four-tier structure has proven most effective across all metadata generation skills. ### Tier 1 — Syntactic Essentials Elements that MUST be present for deployment to succeed. Present as a table. ```markdown ## Syntactic Essentials | Element | Requirement | Notes | |---------|-------------|-------| | `` | Required | Must end in `__c` for custom | | `