mirror of
https://github.com/forcedotcom/afv-library.git
synced 2026-08-01 04:16:17 +08:00
Merge branch 'develop' into inline-mosaic-poc
This commit is contained in:
commit
0221ed510b
@ -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: [] }
|
||||
},
|
||||
},
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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"
|
||||
---
|
||||
|
||||
|
||||
@ -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. |
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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: <dry-run or next step>
|
||||
|
||||
## 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`.
|
||||
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`.
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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?
|
||||
- [ ] Is the API name unique on this object?
|
||||
|
||||
@ -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 `<description>` present with a meaningful summary?
|
||||
- [ ] Are `<enableSearch>` and `<enableReports>` set to `true` if user-facing?
|
||||
- [ ] Does the filename match the intended API name?
|
||||
- [ ] Does the filename match the intended API name?
|
||||
|
||||
@ -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 `<customObject>true</customObject>` and `<motif>` — nothing else
|
||||
- Web tab files MUST only contain: `<customObject>false</customObject>`, `<label>`, `<motif>`, `<url>`, `<urlEncodingKey>`, and optionally `<description>`, `<frameHeight>` — nothing else
|
||||
- Never include `<isHidden>`, `<tabVisibility>`, `<type>`, `<mobileReady>`, or empty elements
|
||||
- Never include `<isHidden>`, `<tabVisibility>`, `<type>`, `<mobileReady>`, or empty elements
|
||||
|
||||
162
skills/generating-eval-seed-data/SKILL.md
Normal file
162
skills/generating-eval-seed-data/SKILL.md
Normal file
@ -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/<name>/tests/evals/<dataset>/`) 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/<datasetName>` (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 |
|
||||
132
skills/generating-eval-seed-data/examples/stub-examples.md
Normal file
132
skills/generating-eval-seed-data/examples/stub-examples.md
Normal file
@ -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
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<fullName>Payment_Overdue__c</fullName>
|
||||
<label>Payment Overdue</label>
|
||||
<type>Text</type>
|
||||
<formula>IF(AND(Payment_Due_Date__c < TODAY(), ISPICKVAL(Payment_Status__c, "UNPAID")), "PAYMENT OVERDUE", null)</formula>
|
||||
<formulaTreatBlanksAs>BlankAsZero</formulaTreatBlanksAs>
|
||||
<length>20</length>
|
||||
</CustomField>
|
||||
```
|
||||
|
||||
**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
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<fullName>Payment_Due_Date__c</fullName>
|
||||
<label>Payment Due Date</label>
|
||||
<type>Date</type>
|
||||
</CustomField>
|
||||
```
|
||||
|
||||
`seed-data/objects/Contract/fields/Payment_Status__c.field-meta.xml`:
|
||||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<fullName>Payment_Status__c</fullName>
|
||||
<label>Payment Status</label>
|
||||
<type>Picklist</type>
|
||||
<valueSet>
|
||||
<valueSetDefinition>
|
||||
<value>
|
||||
<fullName>UNPAID</fullName>
|
||||
<label>UNPAID</label>
|
||||
</value>
|
||||
</valueSetDefinition>
|
||||
</valueSet>
|
||||
</CustomField>
|
||||
```
|
||||
|
||||
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
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<deploymentStatus>Deployed</deploymentStatus>
|
||||
<label>Adoption</label>
|
||||
<nameField>
|
||||
<label>Adoption Name</label>
|
||||
<type>Text</type>
|
||||
</nameField>
|
||||
<pluralLabel>Adoptions</pluralLabel>
|
||||
<sharingModel>ReadWrite</sharingModel>
|
||||
</CustomObject>
|
||||
```
|
||||
|
||||
`seed-data/objects/Animal__c/Animal__c.object-meta.xml`:
|
||||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<deploymentStatus>Deployed</deploymentStatus>
|
||||
<label>Animal</label>
|
||||
<nameField>
|
||||
<label>Animal Name</label>
|
||||
<type>Text</type>
|
||||
</nameField>
|
||||
<pluralLabel>Animals</pluralLabel>
|
||||
<sharingModel>ReadWrite</sharingModel>
|
||||
</CustomObject>
|
||||
```
|
||||
|
||||
`seed-data/objects/Adoption__c/fields/Animal__c.field-meta.xml`:
|
||||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<fullName>Animal__c</fullName>
|
||||
<label>Animal</label>
|
||||
<type>Lookup</type>
|
||||
<referenceTo>Animal__c</referenceTo>
|
||||
<relationshipName>Adoptions</relationshipName>
|
||||
</CustomField>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 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
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>62.0</apiVersion>
|
||||
<status>Active</status>
|
||||
</ApexClass>
|
||||
```
|
||||
|
||||
Empty stub — no method bodies or implementations.
|
||||
147
skills/generating-eval-seed-data/references/stub-rules.md
Normal file
147
skills/generating-eval-seed-data/references/stub-rules.md
Normal file
@ -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 |
|
||||
| `<value><fullName>Active</fullName>...</value>` | `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
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<deploymentStatus>Deployed</deploymentStatus>
|
||||
<label>{Object Label}</label>
|
||||
<nameField>
|
||||
<label>{Object Label} Name</label>
|
||||
<type>Text</type>
|
||||
</nameField>
|
||||
<pluralLabel>{Object Plural Label}</pluralLabel>
|
||||
<sharingModel>ReadWrite</sharingModel>
|
||||
</CustomObject>
|
||||
```
|
||||
|
||||
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
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>62.0</apiVersion>
|
||||
<status>Active</status>
|
||||
</ApexClass>
|
||||
```
|
||||
|
||||
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` |
|
||||
| `<referenceTo>Animal__c</referenceTo>` | 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 `<apiVersion>62.0</apiVersion>` |
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>62.0</apiVersion>
|
||||
<status>Active</status>
|
||||
</ApexClass>
|
||||
@ -0,0 +1,6 @@
|
||||
@isTest
|
||||
public class TestFactory {
|
||||
public static List<SObject> invalidateSObjectList(List<SObject> records) {
|
||||
return records;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>62.0</apiVersion>
|
||||
<status>Active</status>
|
||||
</ApexClass>
|
||||
@ -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.
|
||||
@ -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<Account> 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<Account>) 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<fullName>Payment_Due_Date__c</fullName>
|
||||
<label>Payment Due Date</label>
|
||||
<type>Date</type>
|
||||
</CustomField>
|
||||
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<fullName>Payment_Status__c</fullName>
|
||||
<label>Payment Status</label>
|
||||
<type>Picklist</type>
|
||||
<valueSet>
|
||||
<restricted>false</restricted>
|
||||
<valueSetDefinition>
|
||||
<sorted>false</sorted>
|
||||
<value>
|
||||
<fullName>UNPAID</fullName>
|
||||
<default>false</default>
|
||||
<label>UNPAID</label>
|
||||
</value>
|
||||
<value>
|
||||
<fullName>PAID</fullName>
|
||||
<default>false</default>
|
||||
<label>PAID</label>
|
||||
</value>
|
||||
</valueSetDefinition>
|
||||
</valueSet>
|
||||
</CustomField>
|
||||
@ -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.
|
||||
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<fullName>Payment_Overdue__c</fullName>
|
||||
<label>Payment Overdue</label>
|
||||
<type>Text</type>
|
||||
<formula><![CDATA[IF(
|
||||
AND(
|
||||
Payment_Due_Date__c < TODAY(),
|
||||
ISPICKVAL(Payment_Status__c, "UNPAID")
|
||||
),
|
||||
"PAYMENT OVERDUE",
|
||||
null
|
||||
)]]></formula>
|
||||
<formulaTreatBlanksAs>BlankAsZero</formulaTreatBlanksAs>
|
||||
<description>Returns 'PAYMENT OVERDUE' when Payment_Due_Date__c is before today and Payment_Status__c is UNPAID; otherwise null.</description>
|
||||
<trackHistory>false</trackHistory>
|
||||
<trackTrending>false</trackTrending>
|
||||
<required>false</required>
|
||||
<externalId>false</externalId>
|
||||
<unique>false</unique>
|
||||
</CustomField>
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<fullName>AssetProvided__c</fullName>
|
||||
<label>Asset Provided</label>
|
||||
<referenceTo>Account</referenceTo>
|
||||
<relationshipName>AssetProvided</relationshipName>
|
||||
<type>Lookup</type>
|
||||
</CustomField>
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<fullName>AssetServicedBy__c</fullName>
|
||||
<label>Asset Serviced By</label>
|
||||
<referenceTo>Account</referenceTo>
|
||||
<relationshipName>AssetServicedBy</relationshipName>
|
||||
<type>Lookup</type>
|
||||
</CustomField>
|
||||
@ -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.
|
||||
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ValidationRule xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<fullName>AssetFedExValidation</fullName>
|
||||
<active>true</active>
|
||||
<description>Block insert/update if AssetProvided Name contains 'FedEx', AssetServicedBy Owner CompanyName contains 'FedEx', and Asset LastModified is not more than last 3 months</description>
|
||||
<errorConditionFormula>
|
||||
<![CDATA[AND(
|
||||
/* Ensure lookups exist */
|
||||
NOT(ISBLANK(AssetProvided__c)),
|
||||
NOT(ISBLANK(AssetServicedBy__c)),
|
||||
/* Name of AssetProvided contains FedEx (case-insensitive) */
|
||||
CONTAINS( UPPER( AssetProvided__r.Name ), "FEDEX" ),
|
||||
/* Owner CompanyName of AssetServicedBy contains FedEx (case-insensitive) */
|
||||
CONTAINS( UPPER( AssetServicedBy__r.Owner.CompanyName ), "FEDEX" ),
|
||||
/* Asset LastModified is within last 3 months (inclusive) */
|
||||
DATEVALUE(LastModifiedDate) >= ADDMONTHS(TODAY(), -3)
|
||||
)]]>
|
||||
</errorConditionFormula>
|
||||
<errorMessage>Cannot insert/update: Asset conditions not met.</errorMessage>
|
||||
</ValidationRule>
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
name: generating-experience-lwr-site
|
||||
description: "Creates, modifies, or manages Salesforce Experience Cloud LWR sites via DigitalExperience metadata. Always trigger when the tasks involve LWR sites configurations, e.g. creating/modifying pages/routes/views/theme layouts/branding sets, previewing sites, or creating/modifying guest sharing rule (metadata type sharingGuestRules)/guest user access/sharing records to guest users, or when user provides a guest user ID (15 or 18 characters starting with 005). NEVER trigger for React or any other ui bundle framework. LWR sites ONLY."
|
||||
metadata:
|
||||
version: "1.0"
|
||||
---
|
||||
|
||||
# Experience LWR Site Builder
|
||||
@ -240,4 +242,4 @@ sf project deploy validate --metadata DigitalExperienceBundle DigitalExperience
|
||||
|
||||
```bash
|
||||
sf project deploy start --metadata DigitalExperienceBundle DigitalExperience DigitalExperienceConfig Network CustomSite --target-org ${usernameOrAlias}
|
||||
```
|
||||
```
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
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."
|
||||
metadata:
|
||||
version: "1.0"
|
||||
---
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
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."
|
||||
metadata:
|
||||
version: "1.0"
|
||||
---
|
||||
|
||||
## Goal
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
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."
|
||||
metadata:
|
||||
version: "1.0"
|
||||
---
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
name: generating-ui-bundle-features
|
||||
description: "MUST activate when the project contains a uiBundles/*/src/ directory and the user wants to add authentication or search to their app. Use this skill when adding authentication or search to a UI bundle app. Only covers two features: authentication (login, logout, protected routes, session management) and search (global search across pages and content). Always use this skill for these two features instead of building from scratch."
|
||||
metadata:
|
||||
version: "1.0"
|
||||
---
|
||||
|
||||
# UI Bundle Features
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
name: generating-ui-bundle-metadata
|
||||
description: "MUST activate when the project contains a uiBundles/*/src/ directory and scaffolding a new UI bundle or app, or when editing ui-bundle.json, .uibundle-meta.xml, or CSP trusted site files. Use this skill when scaffolding with sf template generate ui-bundle, configuring ui-bundle.json (routing, headers, outputDir), or registering CSP Trusted Sites. Activate when the task involves files matching *.uibundle-meta.xml, ui-bundle.json, or cspTrustedSites/*.cspTrustedSite-meta.xml."
|
||||
metadata:
|
||||
version: "1.0"
|
||||
---
|
||||
|
||||
# UI Bundle Metadata
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
name: generating-ui-bundle-site
|
||||
description: "MUST activate when the project contains a uiBundles/*/src/ directory and the task involves creating or configuring site infrastructure. Use this skill when creating or configuring a Salesforce Digital Experience Site for hosting a UI bundle. Activate when files matching digitalExperiences/, networks/, customSite/, or DigitalExperienceBundle exist and need modification, or when the user wants to publish, host, or configure guest access for their app."
|
||||
metadata:
|
||||
version: "1.0"
|
||||
---
|
||||
|
||||
# Digital Experience Site for React UI Bundles
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
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."
|
||||
metadata:
|
||||
version: "1.0"
|
||||
---
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
name: getting-datacloud-schema
|
||||
description: "Retrieve Data Lake Object (DLO) and Data Model Object (DMO) schema information from Salesforce Data Cloud using REST APIs. Use this skill when you need to inspect DLO or DMO field definitions, data types, or metadata. Takes org alias and optional DLO/DMO name as parameters."
|
||||
metadata:
|
||||
version: "1.0"
|
||||
---
|
||||
|
||||
# getting-datacloud-schema Skill
|
||||
|
||||
@ -3,7 +3,7 @@ name: implementing-ui-bundle-agentforce-conversation-client
|
||||
description: "MUST activate when the project contains a uiBundles/*/src/ directory and the task involves adding or modifying a chat widget, chatbot, or conversational AI. Use this skill when the user asks to add, embed, integrate, configure, style, or remove an agent, chatbot, chat widget, conversation client, or AI assistant. Covers styling (colors, fonts, spacing, borders), layout (inline vs floating, width, height, dimensions), and props (agentId, agentLabel, headerEnabled, showHeaderIcon, showAvatar, styleTokens). Activate when files under uiBundles/*/src/ import AgentforceConversationClient or when adding any chat or agent functionality to a page. Never create a custom agent, chatbot, or chat widget component."
|
||||
metadata:
|
||||
author: ACC Components
|
||||
version: 1.0.1
|
||||
version: "1.0"
|
||||
package: "@salesforce/ui-bundle-template-feature-react-agentforce-conversation-client"
|
||||
sdk-package: "@salesforce/agentforce-conversation-client"
|
||||
last-updated: 2025-04-01
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
name: implementing-ui-bundle-file-upload
|
||||
description: "MUST activate when the project contains a uiBundles/*/src/ directory and the task involves uploading, attaching, or dropping files. Use this skill when adding file upload functionality to a UI bundle app. Provides progress tracking and Salesforce ContentVersion integration. This feature provides programmatic APIs ONLY — build custom UI using the upload() API. ALWAYS use this instead of building file upload from scratch with FormData or XHR."
|
||||
metadata:
|
||||
version: "1.0"
|
||||
---
|
||||
|
||||
# File Upload API (workflow)
|
||||
|
||||
@ -4,7 +4,7 @@ description: "Analyze production Agentforce agent behavior using session traces
|
||||
allowed-tools: Bash Read Write Edit Glob Grep
|
||||
license: Apache-2.0
|
||||
metadata:
|
||||
version: "0.5.1"
|
||||
version: "1.0"
|
||||
last_updated: "2026-04-08"
|
||||
argument-hint: "<org-alias> [--agent-file <path>] [--session-id <id>] [--days <n>]"
|
||||
compatibility: claude-code
|
||||
|
||||
@ -4,7 +4,7 @@ description: "Write, run, and analyze structured test suites for Agentforce agen
|
||||
allowed-tools: Bash Read Write Edit Glob Grep
|
||||
license: Apache-2.0
|
||||
metadata:
|
||||
version: "0.5.1"
|
||||
version: "1.0"
|
||||
last_updated: "2026-04-08"
|
||||
argument-hint: "<org-alias> --authoring-bundle <AgentName> [--utterances <file>] | run <org> --target <flow://Name>"
|
||||
compatibility: claude-code
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
---
|
||||
name: uplifting-components-to-slds2
|
||||
version: "1.0.0"
|
||||
description: "Migrate Lightning Web Components from SLDS 1 to SLDS 2 by running the SLDS linter and fixing violations. Use this skill whenever users mention SLDS 2, SLDS uplift, linter violations, LWC token migration, class overrides, hardcoded CSS values that need SLDS hook replacement, or styling hook selection. Covers all styling hook categories — color, spacing, sizing, typography, borders, radius, and shadows. Also use when users mention no-hardcoded-values, no-slds-class-overrides, lwc-to-slds-hooks, no-deprecated-tokens-slds1, or ask about SLDS component migration — even if they don't explicitly say \"uplift\" or \"migration\"."
|
||||
metadata:
|
||||
version: "1.0"
|
||||
---
|
||||
|
||||
# Goal
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
name: using-ui-bundle-salesforce-data
|
||||
description: "MUST activate when the project contains a uiBundles/*/src/ directory and the task involves ANY Salesforce record operation — reading, creating, updating, or deleting. Use this skill when building forms that submit to Salesforce, pages that display Salesforce records, or any code that touches Salesforce objects or custom objects. Activate when files under uiBundles/*/src/ import from @salesforce/sdk-data, or when *.graphql files or codegen.yml exist. This skill owns all Salesforce data access patterns in UI bundles. Does not apply to authentication/OAuth setup, schema changes, Bulk/Tooling/Metadata API, or declarative automation."
|
||||
metadata:
|
||||
version: "1.0"
|
||||
---
|
||||
|
||||
# Salesforce Data Access
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
---
|
||||
name: validating-slds
|
||||
version: "1.0.0"
|
||||
description: "Audit Lightning Web Components for SLDS compliance and produce a scored quality report. Runs the SLDS linter, analyzes CSS for theming hook usage and pairing, checks HTML for accessibility attributes, and scores findings across categories into an overall grade. Use when asked to \"score my component\", \"SLDS scorecard\", \"quality report\", \"audit SLDS compliance\", \"how good is my SLDS\", \"check component quality\", \"rate my component\", \"evaluate my component\", \"is this component ready to ship?\", \"look at my LWC for issues\", \"audit this before I submit\", \"review my component before code review\", or any time a user wants a quality assessment or production-readiness check on an LWC or SLDS component. Not for fixing violations (use uplifting-components-to-slds2) or building new components (use applying-slds)."
|
||||
metadata:
|
||||
version: "1.0"
|
||||
---
|
||||
|
||||
# SLDS Quality Audit
|
||||
|
||||
Loading…
Reference in New Issue
Block a user