From 808127c03add7a0ff219588d0d78391acba9d23e Mon Sep 17 00:00:00 2001 From: ysachdeva-sfdc Date: Tue, 5 May 2026 13:13:46 +0530 Subject: [PATCH 1/2] @W-22335628 add generating-eval-seed-data skill (#237) * feat: add generating-eval-seed-data skill New skill that generates minimal seed-data stubs (custom fields, objects, Apex class stubs) for evaluation datasets in the afv-library. Adapted from the adk-eval-seed-data-generator with afv-library conventions and all PR #194 review feedback addressed (scoped allowed-tools, no hardcoded paths, progressive disclosure, skills referenced by name). * fix: replace stub eval data with real adk-core datasets Replace fabricated eval stubs with actual gold files and seed-data from adk-core: payment_overdue (formula field), AssetFedexValidationRule (validation rule with lookup deps), QueueableWithCalloutRecipes (Apex with class dependencies). * fix: remove related-skills from generating-eval-seed-data frontmatter * fix: use detailed allowed-tools command signatures * fix: scope allowed-tools to sf project deploy start only * fix: change stage from Draft to Pilot --- skills/generating-eval-seed-data/SKILL.md | 162 ++++++++++++++++++ .../examples/stub-examples.md | 132 ++++++++++++++ .../references/stub-rules.md | 147 ++++++++++++++++ .../gold/classes/RestClient.cls | 20 +++ .../gold/classes/RestClient.cls-meta.xml | 5 + .../gold/classes/TestFactory.cls | 6 + .../gold/classes/TestFactory.cls-meta.xml | 5 + .../prompt.md | 1 + .../classes/QueueableWithCalloutRecipes.cls | 70 ++++++++ .../fields/Payment_Due_Date__c.field-meta.xml | 6 + .../fields/Payment_Status__c.field-meta.xml | 22 +++ .../prompt.md | 1 + .../fields/Payment_Overdue__c.field-meta.xml | 21 +++ .../fields/AssetProvided__c.field-meta.xml | 8 + .../fields/AssetServicedBy__c.field-meta.xml | 8 + .../prompt.md | 1 + ...setFedexValidation.validationRule-meta.xml | 20 +++ 17 files changed, 635 insertions(+) create mode 100644 skills/generating-eval-seed-data/SKILL.md create mode 100644 skills/generating-eval-seed-data/examples/stub-examples.md create mode 100644 skills/generating-eval-seed-data/references/stub-rules.md create mode 100644 skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/gold/classes/RestClient.cls create mode 100644 skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/gold/classes/RestClient.cls-meta.xml create mode 100644 skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/gold/classes/TestFactory.cls create mode 100644 skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/gold/classes/TestFactory.cls-meta.xml create mode 100644 skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/prompt.md create mode 100644 skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/seed-data/classes/QueueableWithCalloutRecipes.cls create mode 100644 skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-formula-field/gold/objects/Contract/fields/Payment_Due_Date__c.field-meta.xml create mode 100644 skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-formula-field/gold/objects/Contract/fields/Payment_Status__c.field-meta.xml create mode 100644 skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-formula-field/prompt.md create mode 100644 skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-formula-field/seed-data/objects/Contract/fields/Payment_Overdue__c.field-meta.xml create mode 100644 skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-validation-rule/gold/objects/Asset/fields/AssetProvided__c.field-meta.xml create mode 100644 skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-validation-rule/gold/objects/Asset/fields/AssetServicedBy__c.field-meta.xml create mode 100644 skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-validation-rule/prompt.md create mode 100644 skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-validation-rule/seed-data/objects/Asset/validationRules/AssetFedexValidation.validationRule-meta.xml diff --git a/skills/generating-eval-seed-data/SKILL.md b/skills/generating-eval-seed-data/SKILL.md new file mode 100644 index 0000000..bf1699f --- /dev/null +++ b/skills/generating-eval-seed-data/SKILL.md @@ -0,0 +1,162 @@ +--- +name: generating-eval-seed-data +description: "Generate minimal seed-data stubs for Salesforce metadata evaluation datasets in the afv-library. Use this skill to create seed-data directories containing lightweight dependency declarations (custom fields, objects, Apex class stubs) that a dataset's gold file references. TRIGGER when: user says generate seed data, create seed-data stubs, populate seed-data, dataset dependencies, gold file dependencies, add supporting metadata for eval, or wants to set up prerequisite objects/fields for a test dataset. Also use when the user mentions seed-data, eval fixtures, stub generation, or asks to fill in the seed-data directory for any skill's tests/evals/ dataset. SKIP when: user wants to generate the gold file itself (use the domain-specific generating skill), wants to run evals (use eval runner tooling), or wants to create a new skill from scratch (use creating-sf-skill)." +license: LICENSE.txt has complete terms +metadata: + version: "1.0" + stage: Pilot +allowed-tools: Bash(sf project deploy start) Read Write +--- + +# Generating Eval Seed Data + +Generate seed-data **stubs** — minimal supporting metadata dependencies — for evaluation datasets in the afv-library. Stubs declare the bare-minimum custom objects, fields, relationships, and Apex classes that a dataset's gold file references, just enough so the gold file can be validated in isolation. + +## Scope + +- **In scope**: Analyzing gold files to identify custom dependencies, generating minimal stub XML/Apex for those dependencies, validating stubs deploy successfully via dry-run, and populating the `seed-data/` directory. +- **Out of scope**: Generating the gold file itself (delegate to the domain-specific skill), creating new eval datasets or prompt.md files (delegate to `creating-sf-skill`), deploying metadata to production orgs. + +--- + +## Required Inputs + +Gather before proceeding: + +- **Dataset path**: Path to a single dataset (`skills//tests/evals//`) or a domain path containing multiple datasets. Always ask if not provided. +- **Target org alias**: The Salesforce org alias for dry-run validation (e.g., `myDevOrg`). Ask if not provided. + +Defaults unless specified: +- API version: `62.0` +- Stub style: absolute minimum elements per metadata type (see `references/stub-rules.md`) + +--- + +## Workflow + +All steps are sequential. Do not skip or reorder. + +### Phase 1 — Identify and Read + +1. **Identify the dataset(s)** + - If the path contains `tests/evals/` (or has `prompt.md` / `gold/` directly inside), treat as a single dataset. + - Otherwise, look for `tests/evals/` subdirectory. If it exists, list all subdirectories — each is a dataset. Process them all. + - If neither pattern matches, ask the user to clarify. + +2. **Read the gold file(s)** + - Look for gold files in `{dataset_path}/gold/`. These are Salesforce metadata XML or Apex files. + - If gold files exist, proceed to step 3. + - If gold files do NOT exist, ask: "This dataset has no gold file. Would you like me to generate one from `prompt.md`?" If yes, read `prompt.md` and generate a plausible gold file, then proceed. + +3. **Read stub generation rules** — load `references/stub-rules.md` before analyzing. + +### Phase 2 — Analyze and Generate + +4. **Analyze dependencies** + - Read all gold files and identify every custom dependency. Look for: + - **Custom fields** (`__c`): referenced in formulas, conditions, assignments, or relationship traversals (`__r.Name` implies a lookup `__c`) + - **Custom objects** (`__c`): any custom object the gold metadata lives on or references via lookups + - **Apex classes**: parent classes, interfaces, or utility classes referenced by gold code + - For each dependency, determine: metadata type, correct API name, minimum required attributes. + - Standard Salesforce objects (Account, Contact, Case, etc.) and their standard fields do NOT need stubs. + +5. **Generate stubs** + - Create the `seed-data/` directory structure following the rules in `references/stub-rules.md`. + - Include ONLY the minimum elements per metadata type — no optional attributes. + - For picklists: only include values explicitly referenced in the gold file. + +6. **Compare against example** — verify output matches patterns in `examples/stub-examples.md`. + +### Phase 3 — Validate + +7. **Validate with dry-run deployment** + - Create a temporary SFDX project: + ```bash + cd /tmp && sf project generate --name seed-data-validation-$(date +%s) --template empty + ``` + - Read the temp project's `sfdx-project.json` to resolve the deploy path — do not hardcode `force-app/main/default/`. Extract `packageDirectories[].path` (use the entry with `"default": true`; if none, use the first entry). + - Copy seed-data and gold files into the resolved deploy path: + ```bash + cp -r {dataset_path}/seed-data/* {temp_project}/{resolved_path}/ + cp -r {dataset_path}/gold/* {temp_project}/{resolved_path}/ + ``` + - Run dry-run: + ```bash + sf project deploy start --dry-run -d "{resolved_path}" --target-org {target_org} --test-level NoTestRun --wait 10 --json + ``` + +8. **Auto-fix on failure** + - Parse JSON error output and fix issues (missing fields, invalid types, missing relationships). + - Re-run dry-run after each fix. Max 3 retries. + - If still failing after 3 retries, report remaining errors and ask for guidance. + +9. **Copy validated stubs back** + - Replace `{dataset_path}/seed-data/` with the validated versions. + - Only copy back stub files you generated — do NOT copy gold file content into seed-data. + +10. **Clean up and report** + - Delete the temporary SFDX project. + - Report: files generated, validation status, any fixes applied. + - For multiple datasets, print a summary table: + + | # | Dataset | Stubs Generated | Validation | Notes | + |---|---------|----------------|------------|-------| + | 1 | … | … | … | … | + +--- + +## Rules / Constraints + +| Constraint | Rationale | +|-----------|-----------| +| Stubs include ONLY minimum required elements | Optional attributes add noise and can cause unexpected deployment errors | +| Never invent picklist values beyond what gold references | Extra values create false dependencies and mislead evaluators | +| Standard objects/fields never get stubs | They exist in every org; stubs would be redundant and can conflict | +| Always validate via dry-run before finalizing | Catches missing dependencies and malformed XML before the contributor sees them | +| API version defaults to 62.0 | Matches current afv-library convention; override only if gold file specifies otherwise | +| Copy back only stub files, not gold files | Mixing gold content into seed-data corrupts the dataset structure | +| Never hardcode `force-app/main/default/` — always read `sfdx-project.json` | Customers customize the package directory path; hardcoding breaks non-default projects | +| Reference cross-skills by name, never by filesystem path | Skill catalog layout varies across AFV installations; hardcoded paths break portability | + +--- + +## Gotchas + +| Issue | Resolution | +|-------|------------| +| Relationship traversal (`__r.Name`) implies a lookup field | Generate a Lookup stub for the corresponding `__c` field | +| Gold file references a field on a standard object | Only generate the custom field stub, not the standard object definition | +| Multiple gold files reference the same custom object | Generate the object stub once; place field stubs under the same object directory | +| Picklist referenced in formula via `ISPICKVAL` | Extract only the specific value string from the formula; do not add other values | +| Gold file has no custom dependencies | Skip stub generation; report "no seed-data needed" | +| Dry-run fails with `DUPLICATE_DEVELOPER_NAME` | A stub conflicts with an existing org object — rename or skip | + +--- + +## Output Expectations + +Deliverables: +- Stub metadata files: `{dataset_path}/seed-data/objects/{ObjectName}/fields/{FieldName}.field-meta.xml` +- Stub object definitions: `{dataset_path}/seed-data/objects/{ObjectName}/{ObjectName}.object-meta.xml` +- Stub Apex classes: `{dataset_path}/seed-data/classes/{ClassName}.cls` + `.cls-meta.xml` +- Console report: list of generated files, validation status, fixes applied + +--- + +## Cross-Skill Integration + +| Need | Delegate to | +|------|-------------| +| Generate the gold file for a dataset | Domain-specific skill (`generating-validation-rule`, `generating-apex`, etc.) | +| Create a new skill with eval datasets | `creating-sf-skill` | +| Generate a complete custom field (not a stub) | `generating-custom-field` | +| Generate a complete custom object (not a stub) | `generating-custom-object` | + +--- + +## Reference File Index + +| File | When to read | +|------|-------------| +| `references/stub-rules.md` | Phase 2, step 3 — before generating any stubs | +| `examples/stub-examples.md` | Phase 2, step 6 — to verify generated output matches expected patterns | diff --git a/skills/generating-eval-seed-data/examples/stub-examples.md b/skills/generating-eval-seed-data/examples/stub-examples.md new file mode 100644 index 0000000..9d4f624 --- /dev/null +++ b/skills/generating-eval-seed-data/examples/stub-examples.md @@ -0,0 +1,132 @@ +# Seed-Data Stub Examples + +Input/output examples showing gold file analysis and the resulting seed-data stubs. + +--- + +## Example 1: Formula Field with Date and Picklist Dependencies + +**Gold file**: `gold/objects/Contract/fields/Payment_Overdue__c.field-meta.xml` + +```xml + + + Payment_Overdue__c + + Text + IF(AND(Payment_Due_Date__c < TODAY(), ISPICKVAL(Payment_Status__c, "UNPAID")), "PAYMENT OVERDUE", null) + BlankAsZero + 20 + +``` + +**Analysis**: Formula references `Payment_Due_Date__c` (Date) and `Payment_Status__c` +(Picklist with value `UNPAID`). + +**Generated stubs**: + +`seed-data/objects/Contract/fields/Payment_Due_Date__c.field-meta.xml`: +```xml + + + Payment_Due_Date__c + + Date + +``` + +`seed-data/objects/Contract/fields/Payment_Status__c.field-meta.xml`: +```xml + + + Payment_Status__c + + Picklist + + + + UNPAID + + + + + +``` + +Only `UNPAID` is included — no other values. + +--- + +## Example 2: Flow Referencing Custom Objects + +**Gold file**: A Flow XML that triggers on `Adoption__c` record creation and references +a Lookup to `Animal__c`. + +**Generated stubs**: + +`seed-data/objects/Adoption__c/Adoption__c.object-meta.xml`: +```xml + + + Deployed + + + + Text + + Adoptions + ReadWrite + +``` + +`seed-data/objects/Animal__c/Animal__c.object-meta.xml`: +```xml + + + Deployed + + + + Text + + Animals + ReadWrite + +``` + +`seed-data/objects/Adoption__c/fields/Animal__c.field-meta.xml`: +```xml + + + Animal__c + + Lookup + Animal__c + Adoptions + +``` + +--- + +## Example 3: Apex Class with Parent Class Dependency + +**Gold file**: `gold/classes/OrderProcessor.cls` extends `BaseProcessor`. + +**Generated stubs**: + +`seed-data/classes/BaseProcessor.cls`: +```java +public abstract class BaseProcessor { +} +``` + +`seed-data/classes/BaseProcessor.cls-meta.xml`: +```xml + + + 62.0 + Active + +``` + +Empty stub — no method bodies or implementations. diff --git a/skills/generating-eval-seed-data/references/stub-rules.md b/skills/generating-eval-seed-data/references/stub-rules.md new file mode 100644 index 0000000..db7ac16 --- /dev/null +++ b/skills/generating-eval-seed-data/references/stub-rules.md @@ -0,0 +1,147 @@ +# Stub Generation Rules + +Rules for generating minimal seed-data stubs. Stubs declare what exists and what type +it is — nothing more. + +--- + +## General Principles + +- **Stubs, not full metadata**: generate the absolute minimum XML to declare a field, + object, or class. No optional attributes, no invented values. +- **Only what gold references**: for picklists, include ONLY values explicitly named in + the gold file. For objects, do not add fields beyond what gold uses. +- **No optional attributes**: omit `description`, `trackHistory`, `trackTrending`, + `required`, `externalId`, `inlineHelpText`, `restricted`, `sorted`, `default`, + `relationshipLabel`, and any other non-essential element. +- **Standard objects don't need definitions**: Account, Contact, Opportunity, Case, Lead, + User, and other standard objects already exist. Only stub their custom fields (`__c`). +- **API version**: use `62.0` unless gold specifies otherwise. + +--- + +## Custom Field Stubs + +**Path**: `seed-data/objects/{ObjectName}/fields/{FieldApiName}.field-meta.xml` + +Include ONLY these elements per field type: + +| Field Type | Required Elements | +|-----------|------------------| +| Lookup | `fullName`, `label`, `type`, `referenceTo`, `relationshipName` | +| Master-Detail | `fullName`, `label`, `type`, `referenceTo`, `relationshipName` | +| Picklist | `fullName`, `label`, `type`, `valueSet` (only referenced values) | +| Text | `fullName`, `label`, `type`, `length` | +| Number | `fullName`, `label`, `type`, `precision`, `scale` | +| Currency | `fullName`, `label`, `type`, `precision`, `scale` | +| Percent | `fullName`, `label`, `type`, `precision`, `scale` | +| Date | `fullName`, `label`, `type` | +| DateTime | `fullName`, `label`, `type` | +| Checkbox | `fullName`, `label`, `type`, `defaultValue` | +| Email | `fullName`, `label`, `type` | +| Phone | `fullName`, `label`, `type` | +| Url | `fullName`, `label`, `type` | +| TextArea | `fullName`, `label`, `type` | +| LongTextArea | `fullName`, `label`, `type`, `length`, `visibleLines` | + +### Picklist Value Rules + +Only include picklist values that appear explicitly in the gold file. Common patterns: + +| Gold Pattern | Extract | +|-------------|---------| +| `ISPICKVAL(Status__c, "UNPAID")` | `UNPAID` only | +| `IF(Stage__c = "Closed Won", ...)` | `Closed Won` only | +| `Active...` | `Active` only | + +Do NOT add values "for completeness." If the gold formula checks for `"UNPAID"`, do not +add `PAID`, `PARTIALLY_PAID`, or any other values. + +--- + +## Custom Object Stubs + +**Path**: `seed-data/objects/{ObjectApiName}/{ObjectApiName}.object-meta.xml` + +Include ONLY these elements: + +```xml + + + Deployed + + + + Text + + {Object Plural Label} + ReadWrite + +``` + +Do NOT add `description`, `enableActivities`, `enableBulkApi`, `enableHistory`, +`enableReports`, `enableSearch`, or any other optional element. + +--- + +## Apex Class Stubs + +**Path**: `seed-data/classes/{ClassName}.cls` + `seed-data/classes/{ClassName}.cls-meta.xml` + +The `.cls` file is an empty stub — class signature only: + +```java +public class MyUtilClass { +} +``` + +For interfaces: +```java +public interface MyInterface { +} +``` + +For abstract classes: +```java +public abstract class MyBaseClass { +} +``` + +The `.cls-meta.xml`: +```xml + + + 62.0 + Active + +``` + +Do NOT generate method bodies, business logic, or implementations. + +--- + +## Dependency Detection Patterns + +| Gold Pattern | Dependency Type | Stub Needed | +|-------------|----------------|-------------| +| `Payment_Due_Date__c` in formula | Custom field | Date field stub | +| `AssetProvided__r.Name` in formula | Lookup relationship | Lookup field stub for `AssetProvided__c` | +| `ISPICKVAL(Status__c, "X")` | Picklist field | Picklist stub with value `X` | +| `Animal__c` | Custom object | Object stub for `Animal__c` | +| `extends BaseHandler` | Apex parent class | Class stub for `BaseHandler` | +| `implements Queueable` | Standard interface | No stub needed (standard) | +| `Account.Name` | Standard object + field | No stub needed | +| `CustomObj__c.Custom_Field__c` | Custom field on custom object | Both object and field stubs | + +--- + +## Common Validation Errors and Fixes + +| Error Pattern | Fix | +|--------------|-----| +| `Field does not exist: FieldName__c` | Add the missing field stub | +| `Invalid type: ObjectName__c` | Add the custom object stub | +| `Missing required field: X` | Add the required XML element | +| `Invalid picklist value` | Add the missing value to the picklist stub | +| `Relationship not found` | Add the lookup field that defines the relationship | +| `apiVersion is required` | Add `62.0` | diff --git a/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/gold/classes/RestClient.cls b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/gold/classes/RestClient.cls new file mode 100644 index 0000000..38be2a5 --- /dev/null +++ b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/gold/classes/RestClient.cls @@ -0,0 +1,20 @@ +public with sharing class RestClient { + public enum HttpVerb { + GET, + POST, + PUT, + PATCH, + DEL + } + + public static HttpResponse makeApiCall( + String namedCredential, + HttpVerb method, + String path + ) { + HttpRequest request = new HttpRequest(); + request.setEndpoint('callout:' + namedCredential + '/' + path); + request.setMethod(method.name()); + return new Http().send(request); + } +} diff --git a/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/gold/classes/RestClient.cls-meta.xml b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/gold/classes/RestClient.cls-meta.xml new file mode 100644 index 0000000..998805a --- /dev/null +++ b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/gold/classes/RestClient.cls-meta.xml @@ -0,0 +1,5 @@ + + + 62.0 + Active + diff --git a/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/gold/classes/TestFactory.cls b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/gold/classes/TestFactory.cls new file mode 100644 index 0000000..cb3fbce --- /dev/null +++ b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/gold/classes/TestFactory.cls @@ -0,0 +1,6 @@ +@isTest +public class TestFactory { + public static List invalidateSObjectList(List records) { + return records; + } +} diff --git a/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/gold/classes/TestFactory.cls-meta.xml b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/gold/classes/TestFactory.cls-meta.xml new file mode 100644 index 0000000..998805a --- /dev/null +++ b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/gold/classes/TestFactory.cls-meta.xml @@ -0,0 +1,5 @@ + + + 62.0 + Active + diff --git a/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/prompt.md b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/prompt.md new file mode 100644 index 0000000..bc26f39 --- /dev/null +++ b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/prompt.md @@ -0,0 +1 @@ +Generate seed-data for an Apex dataset. The gold file is a QueueableWithCalloutRecipes class that implements Queueable and Database.AllowsCallouts. It references RestClient.makeApiCall() and TestFactory.invalidateSObjectList(). The dataset path is domains/apex/datasets/QueueableWithCalloutRecipes/. My target org is myDevOrg. \ No newline at end of file diff --git a/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/seed-data/classes/QueueableWithCalloutRecipes.cls b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/seed-data/classes/QueueableWithCalloutRecipes.cls new file mode 100644 index 0000000..c39451e --- /dev/null +++ b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-apex-callout/seed-data/classes/QueueableWithCalloutRecipes.cls @@ -0,0 +1,70 @@ +/** + * @description Demmonstrates the use of the Queueable interface to make + * callouts. The methods in this class are called by the system at run time. + * To enqueue this job and see it's results, use `System.enqueueJob(new QueueableWithCalloutRecipes());` + * + * More on the Queable interface: + * https://sfdc.co/queueable-apex + * + * @group Async Apex Recipes + * @see RestClient + */ +public with sharing class QueueableWithCalloutRecipes implements Queueable, Database.AllowsCallouts { + // This allows us to cause a DML failure in execute batch, enabling testing. + @testVisible + private static Boolean throwError = false; + @testVisible + private static Boolean circuitBreakerThrown = false; + + /** + * @description Internal custom exception class + */ + public class QueueableWithCalloutRecipesException extends Exception { + } + + /** + * @description This is the only required method to implement Queueable. + * Queueable classes that also implement Database.allowsCallouts can make + * HTTP requests to external services. In this recipe we make a GET request + * to developer.salesforce.com + * @param qc dependency injected by the system + * @example + * ``` + * System.enqueueJob(new QueueableWithCalloutRecipes()); + * ``` + */ + public static void execute(QueueableContext qc) { + HttpResponse response = RestClient.makeApiCall( + 'GoogleBooksAPI', + RestClient.HttpVerb.GET, + 'volumes?q=salesforce' + ); + List accounts = [ + SELECT Id + FROM Account + ORDER BY Id + LIMIT 1000 + ]; + for (Account acct : accounts) { + acct.Description = String.valueOf(response.getStatusCode()); + } + if (Test.isRunningTest() && throwError) { + accounts = (List) TestFactory.invalidateSObjectList( + accounts + ); + } + + try { + update accounts; + } catch (DmlException dmle) { + System.debug( + LoggingLevel.INFO, + 'real life use cases should do something more than just logging the error: ' + + dmle.getMessage() + ); + if (Test.isRunningTest()) { + QueueableWithCalloutRecipes.circuitBreakerThrown = true; + } + } + } +} diff --git a/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-formula-field/gold/objects/Contract/fields/Payment_Due_Date__c.field-meta.xml b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-formula-field/gold/objects/Contract/fields/Payment_Due_Date__c.field-meta.xml new file mode 100644 index 0000000..529519e --- /dev/null +++ b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-formula-field/gold/objects/Contract/fields/Payment_Due_Date__c.field-meta.xml @@ -0,0 +1,6 @@ + + + Payment_Due_Date__c + + Date + diff --git a/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-formula-field/gold/objects/Contract/fields/Payment_Status__c.field-meta.xml b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-formula-field/gold/objects/Contract/fields/Payment_Status__c.field-meta.xml new file mode 100644 index 0000000..0cc9719 --- /dev/null +++ b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-formula-field/gold/objects/Contract/fields/Payment_Status__c.field-meta.xml @@ -0,0 +1,22 @@ + + + Payment_Status__c + + Picklist + + false + + false + + UNPAID + false + + + + PAID + false + + + + + diff --git a/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-formula-field/prompt.md b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-formula-field/prompt.md new file mode 100644 index 0000000..0239a01 --- /dev/null +++ b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-formula-field/prompt.md @@ -0,0 +1 @@ +Generate seed-data for a CustomFormulaField dataset. The gold file is a formula field on Contract that checks if a payment is overdue — it references Payment_Due_Date__c and ISPICKVAL(Payment_Status__c, "UNPAID"). The dataset path is domains/CustomFormulaField/datasets/payment_overdue/. My target org is myDevOrg. \ No newline at end of file diff --git a/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-formula-field/seed-data/objects/Contract/fields/Payment_Overdue__c.field-meta.xml b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-formula-field/seed-data/objects/Contract/fields/Payment_Overdue__c.field-meta.xml new file mode 100644 index 0000000..0aa951b --- /dev/null +++ b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-formula-field/seed-data/objects/Contract/fields/Payment_Overdue__c.field-meta.xml @@ -0,0 +1,21 @@ + + + Payment_Overdue__c + + Text + + BlankAsZero + Returns 'PAYMENT OVERDUE' when Payment_Due_Date__c is before today and Payment_Status__c is UNPAID; otherwise null. + false + false + false + false + false + diff --git a/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-validation-rule/gold/objects/Asset/fields/AssetProvided__c.field-meta.xml b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-validation-rule/gold/objects/Asset/fields/AssetProvided__c.field-meta.xml new file mode 100644 index 0000000..1d2ad30 --- /dev/null +++ b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-validation-rule/gold/objects/Asset/fields/AssetProvided__c.field-meta.xml @@ -0,0 +1,8 @@ + + + AssetProvided__c + + Account + AssetProvided + Lookup + diff --git a/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-validation-rule/gold/objects/Asset/fields/AssetServicedBy__c.field-meta.xml b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-validation-rule/gold/objects/Asset/fields/AssetServicedBy__c.field-meta.xml new file mode 100644 index 0000000..754ac23 --- /dev/null +++ b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-validation-rule/gold/objects/Asset/fields/AssetServicedBy__c.field-meta.xml @@ -0,0 +1,8 @@ + + + AssetServicedBy__c + + Account + AssetServicedBy + Lookup + diff --git a/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-validation-rule/prompt.md b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-validation-rule/prompt.md new file mode 100644 index 0000000..3404461 --- /dev/null +++ b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-validation-rule/prompt.md @@ -0,0 +1 @@ +Generate seed-data for a ValidationRule dataset. The gold file is a validation rule on Asset that blocks insert/update when AssetProvided Name contains FedEx, AssetServicedBy Owner CompanyName contains FedEx, and Asset was modified within last 3 months. The dataset path is domains/ValidationRule/datasets/AssetFedexValidationRule/. My target org is myDevOrg. \ No newline at end of file diff --git a/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-validation-rule/seed-data/objects/Asset/validationRules/AssetFedexValidation.validationRule-meta.xml b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-validation-rule/seed-data/objects/Asset/validationRules/AssetFedexValidation.validationRule-meta.xml new file mode 100644 index 0000000..96f77a9 --- /dev/null +++ b/skills/generating-eval-seed-data/tests/evals/generating-eval-seed-data-validation-rule/seed-data/objects/Asset/validationRules/AssetFedexValidation.validationRule-meta.xml @@ -0,0 +1,20 @@ + + + AssetFedExValidation + true + Block insert/update if AssetProvided Name contains 'FedEx', AssetServicedBy Owner CompanyName contains 'FedEx', and Asset LastModified is not more than last 3 months + += ADDMONTHS(TODAY(), -3) + )]]> + + Cannot insert/update: Asset conditions not met. + From 597ec0162da43d19b2c0d59dd1c91f8be7d93fdc Mon Sep 17 00:00:00 2001 From: Jasmine Kaur Date: Tue, 5 May 2026 13:30:56 +0530 Subject: [PATCH 2/2] feat: Add-test-related-toversion-frontmatter-field @W-22253778@ (#236) Add-test-related-toversion-frontmatter-field --- scripts/validate-skills.ts | 42 ++++++++++++++++++- skills/applying-slds/SKILL.md | 3 +- skills/building-ui-bundle-frontend/SKILL.md | 2 + skills/deploying-ui-bundle/SKILL.md | 2 + skills/developing-agentforce/SKILL.md | 2 +- .../references/version-history.md | 26 ++++++------ .../SKILL.md | 2 + skills/generating-apex-test/SKILL.md | 2 + skills/generating-apex/SKILL.md | 4 +- skills/generating-custom-application/SKILL.md | 2 + skills/generating-custom-field/SKILL.md | 4 +- .../generating-custom-lightning-type/SKILL.md | 2 + skills/generating-custom-object/SKILL.md | 4 +- skills/generating-custom-tab/SKILL.md | 4 +- .../generating-experience-lwr-site/SKILL.md | 4 +- skills/generating-flexipage/SKILL.md | 2 + skills/generating-flow/SKILL.md | 2 + skills/generating-list-view/SKILL.md | 2 + skills/generating-ui-bundle-features/SKILL.md | 2 + skills/generating-ui-bundle-metadata/SKILL.md | 2 + skills/generating-ui-bundle-site/SKILL.md | 2 + skills/generating-validation-rule/SKILL.md | 2 + skills/getting-datacloud-schema/SKILL.md | 2 + .../SKILL.md | 2 +- .../SKILL.md | 2 + skills/observing-agentforce/SKILL.md | 2 +- skills/testing-agentforce/SKILL.md | 2 +- skills/uplifting-components-to-slds2/SKILL.md | 3 +- .../using-ui-bundle-salesforce-data/SKILL.md | 2 + skills/validating-slds/SKILL.md | 3 +- 30 files changed, 110 insertions(+), 27 deletions(-) diff --git a/scripts/validate-skills.ts b/scripts/validate-skills.ts index fcae01e..10d5351 100644 --- a/scripts/validate-skills.ts +++ b/scripts/validate-skills.ts @@ -306,11 +306,30 @@ Wrap values that contain \`: \` (colon + space), such as long descriptions with }, }, { - description: 'Metadata must include a "version" field', + description: 'Frontmatter must include a metadata block with a "version" field', run({ dirName, rawFrontmatter }) { if (rawFrontmatter === null) return { errors: [] } const meta = parseMetadataBlock(rawFrontmatter) - if (meta === null || typeof meta === "string") return { errors: [] } + + // Fail if no metadata block exists + if (meta === null) { + return { + errors: [ + `skills/${dirName}/SKILL.md: frontmatter must include a "metadata:" block with a "version" field (e.g. metadata:\\n version: "1.0")`, + ], + } + } + + // Fail if metadata is a scalar (inline value) + if (typeof meta === "string") { + return { + errors: [ + `skills/${dirName}/SKILL.md: metadata must be a key-value block, not an inline scalar — use indented sub-keys (e.g. metadata:\\n version: "1.0")`, + ], + } + } + + // Fail if version is missing inside metadata if (!meta.version) { return { errors: [ @@ -318,6 +337,25 @@ Wrap values that contain \`: \` (colon + space), such as long descriptions with ], } } + + return { errors: [] } + }, + }, + { + description: 'Version must follow x.y format (e.g. "1.0", "2.5")', + run({ dirName, rawFrontmatter }) { + if (rawFrontmatter === null) return { errors: [] } + const meta = parseMetadataBlock(rawFrontmatter) + if (meta === null || typeof meta === "string") return { errors: [] } + if (!meta.version) return { errors: [] } + const versionPattern = /^\d+\.\d+$/ + if (!versionPattern.test(meta.version)) { + return { + errors: [ + `skills/${dirName}/SKILL.md: version must follow x.y format (e.g. "1.0", "2.5") — got: "${meta.version}"`, + ], + } + } return { errors: [] } }, }, diff --git a/skills/applying-slds/SKILL.md b/skills/applying-slds/SKILL.md index 17ca40a..558876c 100644 --- a/skills/applying-slds/SKILL.md +++ b/skills/applying-slds/SKILL.md @@ -1,7 +1,8 @@ --- name: applying-slds -version: "1.0.0" description: "Apply SLDS-compliant UI using the correct blueprints, styling hooks, utility classes, and icons. Use when building any UI that needs SLDS, choosing between Lightning Base Components and SLDS Blueprints, applying styling hooks for theming, using utility classes for layout and spacing, or selecting icons. Triggers include \"build a modal\", \"create a form\", \"data table\", \"SLDS styling\", \"style with hooks\", \"add an icon\"." +metadata: + version: "1.0" --- # Applying SLDS diff --git a/skills/building-ui-bundle-frontend/SKILL.md b/skills/building-ui-bundle-frontend/SKILL.md index 372da9c..d6e837d 100644 --- a/skills/building-ui-bundle-frontend/SKILL.md +++ b/skills/building-ui-bundle-frontend/SKILL.md @@ -1,6 +1,8 @@ --- name: building-ui-bundle-frontend description: "MUST activate before editing ANY file under uiBundles/*/src/ for visual or UI changes to an EXISTING app — pages, components, sections, layout, styling, colors, fonts, navigation, animations, or any look-and-feel change. Use this skill when modifying pages, components, layout, styling, or navigation in an existing UI bundle app. Activate when the project contains appLayout.tsx, routes.tsx, src/pages/, src/components/, or global.css. This skill contains critical project-specific conventions (appLayout.tsx shell, shadcn/ui components, Tailwind CSS, Salesforce base-path routing, module restrictions) that override general knowledge. Without this skill, generated code will use wrong imports, break routing, or ignore project structure. Do NOT use when creating a new app from scratch (use building-ui-bundle-app instead)." +metadata: + version: "1.0" --- # UI Bundle UI diff --git a/skills/deploying-ui-bundle/SKILL.md b/skills/deploying-ui-bundle/SKILL.md index 7bff06a..b4f31f7 100644 --- a/skills/deploying-ui-bundle/SKILL.md +++ b/skills/deploying-ui-bundle/SKILL.md @@ -1,6 +1,8 @@ --- name: deploying-ui-bundle description: "MUST activate when the project contains a uiBundles/*/src/ directory or sfdx-project.json and the task involves deploying, pushing to an org, or post-deploy setup. Use this skill when deploying a UI bundle app to a Salesforce org. Covers the full deployment sequence: org authentication, pre-deploy build, metadata deployment, permission set assignment, data import, GraphQL schema fetch, and codegen. Activate when files like *.uibundle-meta.xml or sfdx-project.json exist and the user mentions deploying, pushing, org setup, or post-deploy tasks." +metadata: + version: "1.0" --- # Deploying a UI Bundle diff --git a/skills/developing-agentforce/SKILL.md b/skills/developing-agentforce/SKILL.md index 4b81779..31d9652 100644 --- a/skills/developing-agentforce/SKILL.md +++ b/skills/developing-agentforce/SKILL.md @@ -4,7 +4,7 @@ description: "Build, modify, debug, and deploy agents with Agentforce Agent Scri license: Apache-2.0 compatibility: "Requires Agentforce license, API v66.0+, Einstein Agent User" metadata: - version: "0.5.1" + version: "1.0" last_updated: "2026-04-08" --- diff --git a/skills/developing-agentforce/references/version-history.md b/skills/developing-agentforce/references/version-history.md index 0115932..a3d6bf4 100644 --- a/skills/developing-agentforce/references/version-history.md +++ b/skills/developing-agentforce/references/version-history.md @@ -1,4 +1,4 @@ -# Version History +d# Version History Skill version changelog for developing-agentforce. @@ -8,16 +8,16 @@ Skill version changelog for developing-agentforce. | Version | Date | Changes | |---------|------|---------| -| 0.4.8 | 2026-03-17 | **Agent access guide + merge cleanup**: Adopted `agent-access-guide.md` from sf-permissions (import rules applied). Routed post-activation access step in Create and Deploy domains. Merged `preview-test-loop.md` content (jq trace diagnostics, fix strategies table, context variable limitations, utterance derivation) into `agent-validation-and-debugging.md`. Deleted orphaned `preview-test-loop.md`. Added custom object scanning guidance to Agent Spec creation. Refined post-action output field instructions. | -| 0.4.7 | 2026-03-15 | **Post-action session state fix**: Added explicit post-action instructions to prevent session state corruption by specifying output fields the agent must reference. Driven by T02 run-2026-03-15-vc-02 finding. | -| 0.4.6 | 2026-03-15 | **USER_MODE P0-1 fix**: Added static vs. dynamic SOQL guidelines to backing logic sections in `agent-design-and-spec-creation.md` and invocable Apex template. `AccessLevel.USER_MODE` required for dynamic SOQL. Added "Rules That Always Apply" cardinal rules block to SKILL.md (`--json` first, diagnose before fix, spec approval gate). | -| 0.4.5 | 2026-03-15 | **Full editorial pass + spec approval gate**: Conciseness pass across all 9 SKILL.md domains. Added spec approval hard gate (user must approve Agent Spec before implementation). Added `filter_from_agent` output visibility to Agent Spec template. Restructured Agent Spec inputs/outputs sections. Step 8 redirect to Diagnose Behavioral Issues workflow. | -| 0.4.4 | 2026-03-13 | **Staging + cleanup**: Moved unmerged reference files to `staging/` folder. Clarified live actions command syntax. Refined `agent-user-setup.md` license requirements and USER_MODE documentation. | -| 0.4.3 | 2026-03-12 | **sf-skills merge: production-gotchas + new domain**: Added "Diagnose Production Issues" task domain to SKILL.md (9 domains total). Routed `production-gotchas.md` as primary reference. Added `production-gotchas.md` as secondary reference in Diagnose Compilation (reserved keywords trigger). Added `WITH USER_MODE` object permissions warning to `agent-user-setup.md` Section 6.2. Archived orphan `agent-user-setup-and-perms.md`. Fixed stale SKILL.md reference (Section 2 → Section 6.2). | -| 0.4.2 | 2026-03-12 | **sf-skills merge: known-issues + one-at-a-time deploy**: Integrated `known-issues.md` into 6 of 8 SKILL.md domains with domain-specific loading triggers. Added one-at-a-time Apex stub deploy instruction to SKILL.md Create/Modify domains, `agent-design-and-spec-creation.md`, and `salesforce-cli-for-agents.md`. Moved Issue 16 (`connections:` → `connection messaging:`) to Resolved. | -| 0.4.0 | 2026-03-11 | **T03 test run + type mapping restructure**: Restructured Section 5 type mapping in `agent-design-and-spec-creation.md` into Primitive + Complex tables keyed by `target` type. Added steps 10 (Activate) and 11 (Verify published agent) to Create, Modify, and Deploy domains. | -| 0.3.2 | 2026-03-10 | **T02 post-fix run**: Platform-injected `show_command` tool diagnostic pattern added to `agent-validation-and-debugging.md`. Post-publish preview language strengthened in SKILL.md. | -| 0.3.0 | 2026-03-10 | **T02 first run + test framework**: Created testing framework (README, run structure, scoring rubric). First T02 run: 13/13 SUCCESS. | -| 0.2.0 | 2026-03-09 | **T01 first run**: Created T01 test scenario. First end-to-end test of skill. Identified `agent_type` inference gap. | -| 0.1.0 | 2026-03-08 | **Initial skill**: SKILL.md router with 8 task domains. 7 reference files. Agent Spec template. Asset library. | +| N/A | 2026-03-17 | **Agent access guide + merge cleanup**: Adopted `agent-access-guide.md` from sf-permissions (import rules applied). Routed post-activation access step in Create and Deploy domains. Merged `preview-test-loop.md` content (jq trace diagnostics, fix strategies table, context variable limitations, utterance derivation) into `agent-validation-and-debugging.md`. Deleted orphaned `preview-test-loop.md`. Added custom object scanning guidance to Agent Spec creation. Refined post-action output field instructions. | +| N/A | 2026-03-15 | **Post-action session state fix**: Added explicit post-action instructions to prevent session state corruption by specifying output fields the agent must reference. Driven by T02 run-2026-03-15-vc-02 finding. | +| N/A | 2026-03-15 | **USER_MODE P0-1 fix**: Added static vs. dynamic SOQL guidelines to backing logic sections in `agent-design-and-spec-creation.md` and invocable Apex template. `AccessLevel.USER_MODE` required for dynamic SOQL. Added "Rules That Always Apply" cardinal rules block to SKILL.md (`--json` first, diagnose before fix, spec approval gate). | +| N/A | 2026-03-15 | **Full editorial pass + spec approval gate**: Conciseness pass across all 9 SKILL.md domains. Added spec approval hard gate (user must approve Agent Spec before implementation). Added `filter_from_agent` output visibility to Agent Spec template. Restructured Agent Spec inputs/outputs sections. Step 8 redirect to Diagnose Behavioral Issues workflow. | +| N/A | 2026-03-13 | **Staging + cleanup**: Moved unmerged reference files to `staging/` folder. Clarified live actions command syntax. Refined `agent-user-setup.md` license requirements and USER_MODE documentation. | +| N/A | 2026-03-12 | **sf-skills merge: production-gotchas + new domain**: Added "Diagnose Production Issues" task domain to SKILL.md (9 domains total). Routed `production-gotchas.md` as primary reference. Added `production-gotchas.md` as secondary reference in Diagnose Compilation (reserved keywords trigger). Added `WITH USER_MODE` object permissions warning to `agent-user-setup.md` Section 6.2. Archived orphan `agent-user-setup-and-perms.md`. Fixed stale SKILL.md reference (Section 2 → Section 6.2). | +| N/A | 2026-03-12 | **sf-skills merge: known-issues + one-at-a-time deploy**: Integrated `known-issues.md` into 6 of 8 SKILL.md domains with domain-specific loading triggers. Added one-at-a-time Apex stub deploy instruction to SKILL.md Create/Modify domains, `agent-design-and-spec-creation.md`, and `salesforce-cli-for-agents.md`. Moved Issue 16 (`connections:` → `connection messaging:`) to Resolved. | +| N/A | 2026-03-11 | **T03 test run + type mapping restructure**: Restructured Section 5 type mapping in `agent-design-and-spec-creation.md` into Primitive + Complex tables keyed by `target` type. Added steps 10 (Activate) and 11 (Verify published agent) to Create, Modify, and Deploy domains. | +| N/A | 2026-03-10 | **T02 post-fix run**: Platform-injected `show_command` tool diagnostic pattern added to `agent-validation-and-debugging.md`. Post-publish preview language strengthened in SKILL.md. | +| N/A | 2026-03-10 | **T02 first run + test framework**: Created testing framework (README, run structure, scoring rubric). First T02 run: 13/13 SUCCESS. | +| N/A | 2026-03-09 | **T01 first run**: Created T01 test scenario. First end-to-end test of skill. Identified `agent_type` inference gap. | +| N/A | 2026-03-08 | **Initial skill**: SKILL.md router with 8 task domains. 7 reference files. Agent Spec template. Asset library. | diff --git a/skills/developing-datacloud-code-extension/SKILL.md b/skills/developing-datacloud-code-extension/SKILL.md index f69aa4f..47c35d6 100644 --- a/skills/developing-datacloud-code-extension/SKILL.md +++ b/skills/developing-datacloud-code-extension/SKILL.md @@ -1,6 +1,8 @@ --- name: developing-datacloud-code-extension description: "Develop and deploy Data Cloud Code Extensions using SF CLI plugin. Use this skill when creating custom Python transformations for Data Cloud, deploying code extensions, or testing data transformations. Supports init, run, scan, and deploy operations." +metadata: + version: "1.0" --- # developing-datacloud-code-extension Skill diff --git a/skills/generating-apex-test/SKILL.md b/skills/generating-apex-test/SKILL.md index 7b008a7..388d4a8 100644 --- a/skills/generating-apex-test/SKILL.md +++ b/skills/generating-apex-test/SKILL.md @@ -1,6 +1,8 @@ --- name: generating-apex-test description: "Generate and validate Apex test classes with TestDataFactory patterns, bulk testing (251+ records), mocking strategies, assertion best practices, and disciplined test-fix loops. Use this skill when creating new Apex test classes, improving test coverage, debugging and fixing failing Apex tests, running test execution and coverage analysis, or implementing testing patterns for triggers, services, controllers, batch jobs, queueables, and integrations. Triggers on *Test.cls, *_Test.cls files, sf apex run test workflows, coverage reports, test-fix loops. Do NOT trigger for production Apex code (use generating-apex) or Jest/LWC tests." +metadata: + version: "1.0" --- # Generating Apex Tests diff --git a/skills/generating-apex/SKILL.md b/skills/generating-apex/SKILL.md index 4ee230c..19416d2 100644 --- a/skills/generating-apex/SKILL.md +++ b/skills/generating-apex/SKILL.md @@ -1,6 +1,8 @@ --- name: generating-apex description: "Primary Apex authoring skill for class generation, refactoring, and review. ALWAYS ACTIVATE when the user mentions Apex, .cls, triggers, or asks to create/refactor a class (service, selector, domain, batch, queueable, schedulable, invocable, DTO, utility, interface, abstract, exception, REST resource). Use this skill for requests involving SObject CRUD, mapping collections, fetching related records, scheduled jobs, batch jobs, trigger design, @AuraEnabled controllers, @RestResource endpoints, custom REST APIs, or code review of existing Apex." +metadata: + version: "1.0" --- # Generating Apex @@ -403,4 +405,4 @@ Deploy: ## Troubleshooting Boundary -This skill handles production `.cls`/`.trigger`/`.apex` issues only: compile/parse failures, deployment dependency errors, runtime governor-limit failures. For test execution, assertions, coverage, or `sf apex run test` failures, delegate to `generating-apex-test`. \ No newline at end of file +This skill handles production `.cls`/`.trigger`/`.apex` issues only: compile/parse failures, deployment dependency errors, runtime governor-limit failures. For test execution, assertions, coverage, or `sf apex run test` failures, delegate to `generating-apex-test`. diff --git a/skills/generating-custom-application/SKILL.md b/skills/generating-custom-application/SKILL.md index 7d9e75b..bcb1a10 100644 --- a/skills/generating-custom-application/SKILL.md +++ b/skills/generating-custom-application/SKILL.md @@ -1,6 +1,8 @@ --- 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." +metadata: + version: "1.0" --- ## When to Use This Skill diff --git a/skills/generating-custom-field/SKILL.md b/skills/generating-custom-field/SKILL.md index 6eb9c6f..38c0246 100644 --- a/skills/generating-custom-field/SKILL.md +++ b/skills/generating-custom-field/SKILL.md @@ -1,6 +1,8 @@ --- 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." +metadata: + version: "1.0" --- ## When to Use This Skill @@ -498,4 +500,4 @@ Before generating CustomField XML, verify: ### Naming Checks - [ ] Is the API name free of reserved words (`Order`, `Group`, `Select`, etc.)? -- [ ] Is the API name unique on this object? \ No newline at end of file +- [ ] Is the API name unique on this object? diff --git a/skills/generating-custom-lightning-type/SKILL.md b/skills/generating-custom-lightning-type/SKILL.md index 45511e0..bdf2fb1 100644 --- a/skills/generating-custom-lightning-type/SKILL.md +++ b/skills/generating-custom-lightning-type/SKILL.md @@ -1,6 +1,8 @@ --- 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." +metadata: + version: "1.0" --- ## When to Use This Skill diff --git a/skills/generating-custom-object/SKILL.md b/skills/generating-custom-object/SKILL.md index c4ac93d..99534e0 100644 --- a/skills/generating-custom-object/SKILL.md +++ b/skills/generating-custom-object/SKILL.md @@ -1,6 +1,8 @@ --- 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." +metadata: + version: "1.0" --- ## When to Use This Skill @@ -235,4 +237,4 @@ Before generating the Custom Object XML, verify: ### Architectural Checks - [ ] Is `` present with a meaningful summary? - [ ] Are `` and `` set to `true` if user-facing? -- [ ] Does the filename match the intended API name? \ No newline at end of file +- [ ] Does the filename match the intended API name? diff --git a/skills/generating-custom-tab/SKILL.md b/skills/generating-custom-tab/SKILL.md index 648b5b8..01c19d0 100644 --- a/skills/generating-custom-tab/SKILL.md +++ b/skills/generating-custom-tab/SKILL.md @@ -1,6 +1,8 @@ --- 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." +metadata: + version: "1.0" --- ## When to Use This Skill @@ -151,4 +153,4 @@ Also forbidden: - Follow consistent naming conventions - Object tab files MUST only contain `true` and `` — nothing else - Web tab files MUST only contain: `false`, `