diff --git a/.github/workflows/release-skills.yml b/.github/workflows/release-skills.yml index 3cd55bd..2ec98b0 100644 --- a/.github/workflows/release-skills.yml +++ b/.github/workflows/release-skills.yml @@ -56,6 +56,31 @@ jobs: skip-on-empty: ${{ github.event_name == 'push' }} version-file: "package.json" output-file: "CHANGELOG.md" + git-push: "false" + + - name: Report validate-skills status on release commit + if: ${{ steps.changelog.outputs.skipped == 'false' }} + env: + GH_TOKEN: ${{ secrets.IDEE_GH_TOKEN }} + run: | + SHA=$(git rev-parse HEAD) + gh api "repos/${{ github.repository }}/statuses/$SHA" \ + -f state=success \ + -f context=validate-skills \ + -f description="Validated in release workflow" + + - name: Verify tag does not already exist + if: ${{ steps.changelog.outputs.skipped == 'false' }} + run: | + TAG="${{ steps.changelog.outputs.tag }}" + if git ls-remote --tags origin | grep -q "refs/tags/$TAG$"; then + echo "::error::Tag $TAG already exists on remote. Delete it first if re-releasing: git push --delete origin $TAG" + exit 1 + fi + + - name: Push release commit and tag + if: ${{ steps.changelog.outputs.skipped == 'false' }} + run: git push origin main --follow-tags - name: Create Github Release id: release diff --git a/rules/a4v-expert-global-rule.md b/rules/a4v-expert-global-rule.md index 7112f61..c637924 100644 --- a/rules/a4v-expert-global-rule.md +++ b/rules/a4v-expert-global-rule.md @@ -1,42 +1,73 @@ # Rule: Salesforce Metadata Generation +## Objective +Enforce: **skill load → API context → file generation** for all Salesforce metadata. + ## Constraints -1. **Never write** without both: metadata type skill loaded AND context tools from `salesforce-api-context` MCP server called for that type. -2. **One type at a time** - finish one type before starting the next -3. **One type per API call** - do not batch types when calling MCP tools -4. **Child types need their own context** - if adding any child metadata inside a parent metadata's file, treat the child metadata seperately; don't rely on the parent's schema for creating child metadata -5. **Max one clarifying question** before starting +1. **Never write** without both: metadata type skill loaded AND `Salesforce API Context` MCP Server called for that type +2. **One type at a time** - complete full cycle before next type +3. **Child types need own context** - if adding any child metadata inside a parent metadata's file, load skill and call `Salesforce API Context` for each child type (e.g. CustomField inside CustomObject) separately; don't rely on the parent's schema for creating child metadata +4. **Max one clarifying question** before starting +5. **Don't call `execute_metadata_action` unless a skill instructs to do so** ## Workflow -### Step 1: Metadata Loop - Execute for Each Type -For each type, execute loop below +### 1. Detect Intent +- **App skill** (end-to-end capability like lex/react App) → App Path +- **Direct metadata** (specific fields/objects/pages) → Direct Path + +### 2. App Path +1. Load App related skill, extract metadata type sequence +2. For each type, execute loop (a-e below) +3. Proceed to Step 3 + +### 2. Direct Path +1. Identify all needed types +2. For each type in dependency order, execute loop (a-e below) +3. Proceed to Step 3 + +### Loop (a-e) - Execute for Each Type **a. Load Skill** -- Load the metadata type skill once (not per record) +- Load metadata type skill once (not per record) +- If no skill exists, continue with API context only -**b. Get entity context** -- Use these tools from `salesforce-api-context` MCP server for entity context. - - `get_metadata_type_sections` - - `get_metadata_type_context` - - `get_metadata_type_fields` - - `get_metadata_type_fields_properties` - - `search_metadata_types` +**b. Call API Context** +- Use `Salesforce API Context` and make use of these tools as per requirement: +- `get_metadata_type_sections` +- `get_metadata_type_context` +- `get_metadata_type_fields` +- `get_metadata_type_fields_properties` +- `search_metadata_types` +**c. Pre-Write Gate** +- Before EVERY write: confirm API context called for this type +- If no → stop and call now -### Step 2. Verify deployment +**d. Generate Files** +- Use skill constraints + API context +- Generate all records for this type now + +**e. Checkpoint** +- Skill loaded? API context called? All files written? +- Only proceed to next type when all true + +### 3. Deploy Verification ```bash sf project deploy start --dry-run -d "force-app/main/default" --target-org --test-level NoTestRun --wait 10 --json ``` On failure: attempt to fix the errors and re-run, retrying up to a maximum of 3 times until it succeeds. - ## Anti-Patterns | Don't | Why | Do | |-------|-----|-----| +| Write without API context | Missing schema validation | Call API context before first write | | Reload skill per record | Wastes tokens | Load once per type | +| Skip API context for later types | No schema for those types | Call for EVERY type | | Skip metadata skills | Missing platform constraints | Load skill for every type | | Ask 3+ questions | Token waste | Max 1 question | -| Batch types in calls to MCP tools | Violates constraint | One type per call | \ No newline at end of file +| Skip App skill gates | Wrong artifacts | Follow all mandatory gates | +| Write despite missing checkpoint | Aware violation | Stop and complete missing step | +| Batch types in API call | Violates constraint #3 | One type per call | \ No newline at end of file diff --git a/samples/native-mobile-rental-tenant-app/force-app/main/default/digitalExperiences/experiencecontainer/rentalApp/experience__camaAppMetadata/appMetadata/content.json b/samples/native-mobile-rental-tenant-app/force-app/main/default/digitalExperiences/experiencecontainer/rentalApp/experience__camaAppMetadata/appMetadata/content.json index e60f664..505b6f9 100644 --- a/samples/native-mobile-rental-tenant-app/force-app/main/default/digitalExperiences/experiencecontainer/rentalApp/experience__camaAppMetadata/appMetadata/content.json +++ b/samples/native-mobile-rental-tenant-app/force-app/main/default/digitalExperiences/experiencecontainer/rentalApp/experience__camaAppMetadata/appMetadata/content.json @@ -12,19 +12,19 @@ "id": "home", "label": "Home", "icon": "house.fill", - "screen": "homeScreen" + "screenAPIName": "homeScreen" }, { "id": "tenants", "label": "Tenants", "icon": "person.2.fill", - "screen": "tenantsScreen" + "screenAPIName": "tenantsScreen" }, { "id": "properties", "label": "Properties", "icon": "building.2.fill", - "screen": "propertiesScreen" + "screenAPIName": "propertiesScreen" } ], "toolbarActions": { diff --git a/skills/salesforce-custom-application/SKILL.md b/skills/generating-custom-application/SKILL.md similarity index 99% rename from skills/salesforce-custom-application/SKILL.md rename to skills/generating-custom-application/SKILL.md index 097b140..ece9b0b 100644 --- a/skills/salesforce-custom-application/SKILL.md +++ b/skills/generating-custom-application/SKILL.md @@ -1,5 +1,5 @@ --- -name: salesforce-custom-application +name: generating-custom-application description: Use this skill when users need to create or configure Salesforce Custom Applications. Trigger when users mention custom apps, application metadata, app navigation, or organizing tabs into applications. Use when users want to create app containers for tabs and pages. Always use this skill for custom application work. --- @@ -11,7 +11,6 @@ Use this skill when you need to: - Configure application navigation and branding - Set up custom page layouts for objects - Troubleshoot deployment errors related to custom applications - # CustomApplication (Lightning App) Metadata Specification ## Overview diff --git a/skills/salesforce-custom-field/SKILL.md b/skills/generating-custom-field/SKILL.md similarity index 99% rename from skills/salesforce-custom-field/SKILL.md rename to skills/generating-custom-field/SKILL.md index cb6717a..41d8d8a 100644 --- a/skills/salesforce-custom-field/SKILL.md +++ b/skills/generating-custom-field/SKILL.md @@ -1,5 +1,5 @@ --- -name: salesforce-custom-field +name: generating-custom-field description: Use this skill when users need to create, generate, or validate Salesforce Custom Field metadata. Trigger when users mention custom fields, field types, Roll-up Summary fields, Master-Detail relationships, Lookup relationships, formula fields, picklists, or field metadata. Also use when users encounter field deployment errors, especially around Roll-up Summary format, Master-Detail constraints, or formula issues. Always use this skill for any custom field metadata work, field generation, or field troubleshooting. --- diff --git a/skills/salesforce-custom-lightning-type/SKILL.md b/skills/generating-custom-lightning-type/SKILL.md similarity index 99% rename from skills/salesforce-custom-lightning-type/SKILL.md rename to skills/generating-custom-lightning-type/SKILL.md index 720f4a0..a09e1b0 100644 --- a/skills/salesforce-custom-lightning-type/SKILL.md +++ b/skills/generating-custom-lightning-type/SKILL.md @@ -1,5 +1,5 @@ --- -name: salesforce-custom-lightning-type +name: generating-custom-lightning-type description: Use this skill when users need to create Custom Lightning Types (CLTs) for Einstein Agent actions or structured input/output schemas. Trigger when users mention CLT, Custom Lightning Types, JSON schemas for agents, type definitions, lightning__objectType, or editor/renderer configurations. This is complex - always use this skill for CLT work. --- diff --git a/skills/salesforce-custom-object/SKILL.md b/skills/generating-custom-object/SKILL.md similarity index 99% rename from skills/salesforce-custom-object/SKILL.md rename to skills/generating-custom-object/SKILL.md index 65450a6..581858b 100644 --- a/skills/salesforce-custom-object/SKILL.md +++ b/skills/generating-custom-object/SKILL.md @@ -1,5 +1,5 @@ --- -name: salesforce-custom-object +name: generating-custom-object description: Use this skill when users need to create, generate, or validate Salesforce Custom Object metadata. Trigger when users mention custom objects, creating objects, object metadata, .object files, sharing models, name fields, or validation rules on objects. Also use when users say things like "create a custom object", "generate object metadata", "set up an object for...", or when they're troubleshooting object deployment errors especially around sharing models and Master-Detail relationships. Always use this skill for any custom object metadata work. --- diff --git a/skills/salesforce-custom-tab/SKILL.md b/skills/generating-custom-tab/SKILL.md similarity index 99% rename from skills/salesforce-custom-tab/SKILL.md rename to skills/generating-custom-tab/SKILL.md index 865f82b..f4f9577 100644 --- a/skills/salesforce-custom-tab/SKILL.md +++ b/skills/generating-custom-tab/SKILL.md @@ -1,5 +1,5 @@ --- -name: salesforce-custom-tab +name: generating-custom-tab description: Use this skill when users need to create or configure Salesforce Custom Tabs. Trigger when users mention tabs, navigation tabs, object tabs, web tabs, Visualforce tabs, Lightning component tabs, app page tabs, or tab configuration. Also use when users want to add navigation to custom objects, create tabs for external content, or set up Lightning page tabs. Always use this skill for any custom tab work. --- diff --git a/skills/salesforce-flexipage/SKILL.md b/skills/generating-flexipage/SKILL.md similarity index 99% rename from skills/salesforce-flexipage/SKILL.md rename to skills/generating-flexipage/SKILL.md index b299f77..b4fb281 100644 --- a/skills/salesforce-flexipage/SKILL.md +++ b/skills/generating-flexipage/SKILL.md @@ -1,5 +1,5 @@ --- -name: salesforce-flexipage +name: generating-flexipage description: Use this skill when users need to create, generate, modify, or validate Salesforce Lightning pages (FlexiPages). Trigger when users mention RecordPage, AppPage, HomePage, Lightning pages, page layouts, adding components to pages, or page customization. Also use when users say things like "create a Lightning page", "add a component to a page", "customize the record page", "generate a FlexiPage", or when they're working with FlexiPage XML files and need help with components, regions, or deployment errors. Always use this skill for any FlexiPage-related work, even if they just mention "page" in the context of Salesforce. --- diff --git a/skills/salesforce-flow/SKILL.md b/skills/generating-flow/SKILL.md similarity index 99% rename from skills/salesforce-flow/SKILL.md rename to skills/generating-flow/SKILL.md index 4513457..2f77bc2 100644 --- a/skills/salesforce-flow/SKILL.md +++ b/skills/generating-flow/SKILL.md @@ -1,5 +1,5 @@ --- -name: salesforce-flow +name: generating-flow description: Generate Salesforce Flows using the MCP tool execute_metadata_action. Use when the user asks to create, build, or generate a flow — including Screen, Autolaunched, Record-Triggered (before/after-save), Scheduled. Also trigger for flow-like requests such as "when a record is created", "trigger daily at", "send an email when", "update the field when", "automate", "workflow", or "flow XML/metadata". This is the only skill for Salesforce Flow generation. --- diff --git a/skills/salesforce-fragment/SKILL.md b/skills/generating-fragment/SKILL.md similarity index 99% rename from skills/salesforce-fragment/SKILL.md rename to skills/generating-fragment/SKILL.md index 8e764f9..641cf1d 100644 --- a/skills/salesforce-fragment/SKILL.md +++ b/skills/generating-fragment/SKILL.md @@ -1,5 +1,5 @@ --- -name: salesforce-fragment +name: generating-fragment description: Use this skill when users need to create or edit Salesforce Fragments (reusable UI pieces). Trigger when users mention fragments, UEM blocks, reusable UI templates, structured rendering across Slack/Mobile/LEX, or block-based layouts. Also use when users want to create unified experience components. Always use this skill for any fragment work. --- diff --git a/skills/salesforce-list-view/SKILL.md b/skills/generating-list-view/SKILL.md similarity index 99% rename from skills/salesforce-list-view/SKILL.md rename to skills/generating-list-view/SKILL.md index fb44bee..78e2c1c 100644 --- a/skills/salesforce-list-view/SKILL.md +++ b/skills/generating-list-view/SKILL.md @@ -1,5 +1,5 @@ --- -name: salesforce-list-view +name: generating-list-view description: Use this skill when users need to create, generate, or validate Salesforce List View metadata. Trigger when users mention list views, filtered record lists, creating views, setting up record columns, filtering records by criteria, or ask about list view visibility. Also use when users say things like "I need a view that shows...", "filter records by...", "create a list view for...", or when they're working with ListView XML files and need validation or troubleshooting. --- diff --git a/skills/generate-permission-set/SKILL.md b/skills/generating-permission-set/SKILL.md similarity index 99% rename from skills/generate-permission-set/SKILL.md rename to skills/generating-permission-set/SKILL.md index 9e416ad..69697ac 100644 --- a/skills/generate-permission-set/SKILL.md +++ b/skills/generating-permission-set/SKILL.md @@ -1,5 +1,5 @@ --- -name: generate-permission-set +name: generating-permission-set description: Generates correct, deployable Salesforce permission set metadata (PermissionSet XML) with object, field, user, and app permissions. Use this skill when creating or editing permission set metadata, object permissions, field-level security (FLS), tab visibility, or deploying permission sets. compatibility: Salesforce Metadata API v60.0+ metadata: diff --git a/skills/salesforce-validation-rule/SKILL.md b/skills/generating-validation-rule/SKILL.md similarity index 99% rename from skills/salesforce-validation-rule/SKILL.md rename to skills/generating-validation-rule/SKILL.md index cf208f2..5698316 100644 --- a/skills/salesforce-validation-rule/SKILL.md +++ b/skills/generating-validation-rule/SKILL.md @@ -1,5 +1,5 @@ --- -name: salesforce-validation-rule +name: generating-validation-rule description: Use this skill when users need to create, modify, or validate Salesforce Validation Rules. Trigger when users mention validation rules, field validation, data quality rules, formula validation, error messages, or validation logic. Also use when users encounter validation errors, need to update formulas, or want to enforce business rules at the data layer. Always use this skill for any validation rule work. --- diff --git a/skills/salesforce-lightning-app-build/SKILL.md b/skills/salesforce-lightning-app/SKILL.md similarity index 75% rename from skills/salesforce-lightning-app-build/SKILL.md rename to skills/salesforce-lightning-app/SKILL.md index ebf604c..a55d697 100644 --- a/skills/salesforce-lightning-app-build/SKILL.md +++ b/skills/salesforce-lightning-app/SKILL.md @@ -1,13 +1,13 @@ --- -name: salesforce-lightning-app-build +name: salesforce-lightning-app description: Build complete Salesforce Lightning Experience applications from natural language descriptions. Use this skill when a user requests a "complete app", "Lightning app", "business solution", "management system", or describes a scenario requiring multiple interconnected Salesforce components (objects, fields, pages, tabs, security). Orchestrates all required metadata types in proper dependency order to produce a deployable application. metadata: category: orchestration version: "1.0" - related-skills: salesforce-custom-object, salesforce-custom-field, salesforce-custom-tab, salesforce-flexipage, salesforce-custom-application, salesforce-flow, salesforce-validation-rule, salesforce-list-view, generate-permission-set + related-skills: skills/generating-custom-object/SKILL.md, skills/generating-custom-field/SKILL.md, skills/generating-custom-tab/SKILL.md, skills/generating-flexipage/SKILL.md, skills/generating-custom-application/SKILL.md, skills/generating-flow/SKILL.md, skills/generating-validation-rule/SKILL.md, skills/generating-list-view/SKILL.md, skills/generating-permission-set/SKILL.md --- -# Salesforce Lightning Application Build +# Generating Lightning App Solution ## Overview @@ -35,6 +35,7 @@ Build a complete, deployable Salesforce Lightning Experience application from a - Troubleshooting or debugging existing metadata - Building Salesforce Classic apps (not Lightning Experience) - User asks for just one object, or just one page, or just one permission set (without others) +- User only needs to create or configure an app container (grouping existing tabs) without other metadata — use skills/generating-custom-application/SKILL.md instead ## Metadata Type Registry @@ -42,15 +43,15 @@ This table shows which metadata types are commonly needed for LEX apps and their | Metadata Type | Skill Available? | Skill Name | Usage Rule | |---------------|------------------|------------|------------| -| **Custom Object** | ✅ YES | `salesforce-custom-object` | MUST use skill | -| **Custom Field** | ✅ YES | `salesforce-custom-field` | MUST use skill | -| **Custom Tab** | ✅ YES | `salesforce-custom-tab` | MUST use skill | -| **FlexiPage** | ✅ YES | `salesforce-flexipage` | MUST use skill | -| **Custom Application** | ✅ YES | `salesforce-custom-application` | MUST use skill | -| **List View** | ✅ YES | `salesforce-list-view` | MUST use skill | -| **Validation Rule** | ✅ YES | `salesforce-validation-rule` | MUST use skill (if requested) | -| **Flow** | ✅ YES | `salesforce-flow` | MUST use skill (if requested) | -| **Permission Set** | ✅ YES | `generate-permission-set` | MUST use skill | +| **Custom Object** | ✅ YES | `skills/generating-custom-object/SKILL.md` | MUST use skill | +| **Custom Field** | ✅ YES | `skills/generating-custom-field/SKILL.md` | MUST use skill | +| **Custom Tab** | ✅ YES | `skills/generating-custom-tab/SKILL.md` | MUST use skill | +| **FlexiPage** | ✅ YES | `skills/generating-flexipage/SKILL.md` | MUST use skill | +| **Custom Application** | ✅ YES | `skills/generating-custom-application/SKILL.md` | MUST use skill | +| **List View** | ✅ YES | `skills/generating-list-view/SKILL.md` | MUST use skill | +| **Validation Rule** | ✅ YES | `skills/generating-validation-rule/SKILL.md` | MUST use skill (if requested) | +| **Flow** | ✅ YES | `skills/generating-flow/SKILL.md` | MUST use skill (if requested) | +| **Permission Set** | ✅ YES | `skills/generating-permission-set/SKILL.md` | MUST use skill | ### Skill Usage Rules @@ -74,8 +75,8 @@ Relationships (depends on: Both parent and child objects + fields exist) ``` **Skills to invoke in order:** -1. `salesforce-custom-object` for each object -2. `salesforce-custom-field` for each field (including Master-Detail, Lookup, Roll-up Summary) +1. `skills/generating-custom-object/SKILL.md` — once, with all objects +2. `skills/generating-custom-field/SKILL.md` — once, with all fields (including Master-Detail, Lookup, Roll-up Summary) ### Phase 2: Business Logic (Optional - only if requested) ``` @@ -85,8 +86,8 @@ Flows (depends on: Objects, Fields exist) ``` **Skills to invoke (only if user requested):** -1. `salesforce-validation-rule` if validation requirements mentioned -2. `salesforce-flow` if automation/workflow requirements mentioned +1. `skills/generating-validation-rule/SKILL.md` — once, if validation requirements mentioned +2. `skills/generating-flow/SKILL.md` — once, if automation/workflow requirements mentioned ### Phase 3: User Interface ``` @@ -98,9 +99,9 @@ FlexiPages (depends on: Objects, Tabs exist) ``` **Skills to invoke in order:** -1. `salesforce-list-view` for filtered record views (if requested) -2. `salesforce-custom-tab` for each object tab -3. `salesforce-flexipage` for record/home/app pages +1. `skills/generating-list-view/SKILL.md` — once, for filtered record views (if requested) +2. `skills/generating-custom-tab/SKILL.md` — once, with all object tabs +3. `skills/generating-flexipage/SKILL.md` — once, with all record/home/app pages ### Phase 4: Application Assembly ``` @@ -108,7 +109,7 @@ Custom Application (depends on: Tabs exist) ``` **Skills to invoke:** -1. `salesforce-custom-application` to create the Lightning App container +1. `skills/generating-custom-application/SKILL.md` — once, to create the Lightning App container ### Phase 5: Security & Access ``` @@ -116,7 +117,7 @@ Permission Sets (depends on: Objects, Fields, Tabs, App exist) ``` **Skills to invoke:** -1. `generate-permission-set` for each permission set with access to: +1. `skills/generating-permission-set/SKILL.md` — once, with all permission sets and access to: - Objects (Read, Create, Edit, Delete) - Fields (Read, Edit) - Tabs (Visible) @@ -163,14 +164,14 @@ SECURITY: - Permission Sets: [list with purpose] METADATA SKILLS TO INVOKE: -- salesforce-custom-object (x N) -- salesforce-custom-field (x N) -- salesforce-validation-rule (x N) - if validation requirements identified -- salesforce-flow (x N) - if automation requirements identified -- salesforce-custom-tab (x N) -- salesforce-flexipage (x N) -- salesforce-custom-application (x 1) -- generate-permission-set (x N) +- skills/generating-custom-object/SKILL.md (x 1) +- skills/generating-custom-field/SKILL.md (x 1) +- skills/generating-validation-rule/SKILL.md (x 1) - if validation requirements identified +- skills/generating-flow/SKILL.md (x 1) - if automation requirements identified +- skills/generating-custom-tab/SKILL.md (x 1) +- skills/generating-flexipage/SKILL.md (x 1) +- skills/generating-custom-application/SKILL.md (x 1) +- skills/generating-permission-set/SKILL.md (x 1) DEPENDENCY ORDER: 1. Phase 1: Data Model (Objects → Fields) @@ -182,23 +183,23 @@ DEPENDENCY ORDER: ### STEP 2: Skill Invocation Sequence -Execute in strict dependency order. For each metadata component: +Execute in strict dependency order. Invoke each skill once with all components for that metadata type. 1. **Check Metadata Type Registry**: Does a skill exist? -2. **If YES (✅)**: Invoke the specialized skill with required parameters +2. **If YES (✅)**: Invoke the specialized skill once with all components for that type 3. **If NO (❌)**: Generate metadata directly using Metadata API knowledge 4. **Handle Errors**: If skill invocation fails, log error and continue (don't block entire app) -**Invocation Pattern Example:** +**Invocation Pattern (one invocation per metadata type):** -- For Custom Object → Invoke `salesforce-custom-object` -- For Custom Field → Invoke `salesforce-custom-field` -- For Validation Rule → Invoke `salesforce-validation-rule` -- For Flow → Invoke `salesforce-flow` -- For Custom Tab → Invoke `salesforce-custom-tab` -- For FlexiPage → Invoke `salesforce-flexipage` -- For Custom Application → Invoke `salesforce-custom-application` -- For Permission Set → Invoke `generate-permission-set` +- Custom Objects → Invoke `skills/generating-custom-object/SKILL.md` once with all objects +- Custom Fields → Invoke `skills/generating-custom-field/SKILL.md` once with all fields +- Validation Rules → Invoke `skills/generating-validation-rule/SKILL.md` once (if requested) +- Flows → Invoke `skills/generating-flow/SKILL.md` once (if requested) +- Custom Tabs → Invoke `skills/generating-custom-tab/SKILL.md` once with all tabs +- FlexiPages → Invoke `skills/generating-flexipage/SKILL.md` once with all pages +- Custom Application → Invoke `skills/generating-custom-application/SKILL.md` once +- Permission Sets → Invoke `skills/generating-permission-set/SKILL.md` once with all permission sets ### STEP 3: Final Artifact Assembly