mirror of
https://github.com/forcedotcom/afv-library.git
synced 2026-08-03 05:41:08 +08:00
Removed prompts folder; no longer needed
This commit is contained in:
parent
c1cfb9f672
commit
a0252043c3
@ -1,22 +0,0 @@
|
||||
---
|
||||
name: PricingService Invocable Scaffold
|
||||
description: Create a PricingService Apex class with an invocable getPricing method and typed inputs/outputs for Flow.
|
||||
tags: apex, invocable, flow, scaffold
|
||||
---
|
||||
|
||||
Scaffold a Apex classed named `PricingService` (public with no namespace) with one invocable method `getPricing` with an InvocableVariable wrapper for inputs and outputs. Include user-friendly labels and descriptions for the InvocableMethod and all InvocableVariables.
|
||||
|
||||
## Input Parameters
|
||||
- accountId (ID) - required Account the pricing is for
|
||||
- terms (String) - required terms for the pricing
|
||||
- discount (Decimal - scale 2) - if null, then discount equals 0.
|
||||
- products (List of Strings) - the required list product names.
|
||||
|
||||
## Output Parameters
|
||||
- total - (Decimal) the toal price for all products
|
||||
- products (List of Decimal) - the list product prices.
|
||||
- creditApproved (boolean) - if approved for credit
|
||||
|
||||
If input `products` variable is null or empty, return empty output parameters. Use a standard invocable pattern.
|
||||
|
||||
I will provide the implementation later. Do not write unit tests. Deploy the new class to my default org.
|
||||
@ -1,7 +0,0 @@
|
||||
---
|
||||
name: Travel Plan Object Scaffold
|
||||
description: Provision a Travel Plan custom object with fields, layout, tab, and permission set ready for deployment.
|
||||
tags: salesforce, custom-object, scaffold, deployment
|
||||
---
|
||||
|
||||
Create a "Travel Plan" custom object with 5 appropriate, sensible fields. Add all of the fields to the page layout. Do not create or add a compact layout. Create a tab for the object and a permission set that grants read/create/edit access to the object, all fields and custom tab. Deploy to my default org and assign the permission set to my user.
|
||||
@ -1,61 +0,0 @@
|
||||
---
|
||||
name: Trigger Refactor Helper
|
||||
description: Refactor the Opportunity trigger into a handler pattern with tests
|
||||
tags: apex, refactor, testing
|
||||
requires_deploy: true
|
||||
setup_summary: Deploy baseline trigger to target org before running instructions
|
||||
---
|
||||
|
||||
## Setup
|
||||
1. Deploy the baseline trigger shown below to your default or scratch org.
|
||||
2. Confirm the trigger compiles successfully before continuing.
|
||||
|
||||
```apex
|
||||
// ❌ Anti-pattern: all logic stuffed into the trigger, with DML/SOQL in loops.
|
||||
trigger OpportunityTrigger on Opportunity (before insert, before update, after update) {
|
||||
// BEFORE INSERT: validate Closed Won w/ low Amount
|
||||
if (Trigger.isBefore && Trigger.isInsert) {
|
||||
for (Opportunity o : Trigger.new) {
|
||||
if (o.StageName == 'Closed Won' && (o.Amount == null || o.Amount < 1000)) {
|
||||
o.addError('Closed Won opportunities must have Amount ≥ 1000.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// BEFORE UPDATE: if Stage changed, overwrite Description
|
||||
if (Trigger.isBefore && Trigger.isUpdate) {
|
||||
for (Opportunity o : Trigger.new) {
|
||||
Opportunity oldO = Trigger.oldMap.get(o.Id);
|
||||
if (o.StageName != oldO.StageName) {
|
||||
o.Description = 'Stage changed from ' + oldO.StageName + ' to ' + o.StageName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// AFTER UPDATE: when Stage becomes Closed Won, create a follow-up Task
|
||||
if (Trigger.isAfter && Trigger.isUpdate) {
|
||||
for (Opportunity o : Trigger.new) {
|
||||
Opportunity oldO = Trigger.oldMap.get(o.Id);
|
||||
if (o.StageName == 'Closed Won' && oldO.StageName != 'Closed Won') {
|
||||
Task t = new Task(
|
||||
WhatId = o.Id,
|
||||
OwnerId = o.OwnerId,
|
||||
Subject = 'Send thank-you',
|
||||
Status = 'Not Started',
|
||||
Priority = 'Normal',
|
||||
ActivityDate = Date.today()
|
||||
);
|
||||
insert t; // ❌ DML in a loop
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Instructions
|
||||
Refactor `OpportunityTrigger` into a handler class (or classes) that handles the same behavior using bulk-safe patterns. Ensure the trigger itself delegates and remains behaviorally identical.
|
||||
|
||||
## Testing & Reporting
|
||||
- Create unit tests covering positive and negative paths for each handler method.
|
||||
- Include a bulk test that updates 50 `Opportunity` records where only half qualify for the `after update` logic.
|
||||
- Deploy the refactored code and run the tests, then report coverage and key observations.
|
||||
@ -1,9 +0,0 @@
|
||||
---
|
||||
name: Account Test Data Generator
|
||||
description: Create an Apex script that generates 10 realistic Account records with complete business data including name, account number, type, industry, annual revenue, ticker symbol, and number of employees. Includes documentation on how to execute the script anonymously.
|
||||
tags: salesforce, apex, data-generation, test-data, developer, admin
|
||||
---
|
||||
|
||||
Create an apex script that I can run anonymously to insert 10 account records with name, account number, type, industry, annual revenue, ticker symbol and number of employees.
|
||||
|
||||
Generate a document with instruction on how to run the script.
|
||||
@ -1,7 +0,0 @@
|
||||
---
|
||||
name: Account Layout Field Enhancement
|
||||
description: Add Type and Industry fields to the Account page layout for better data organization and reporting.
|
||||
tags: salesforce, account, page-layout, admin, data-management
|
||||
---
|
||||
|
||||
Add Type and Industry fields to the Account Layout, placing them below Account Name.
|
||||
@ -1,7 +0,0 @@
|
||||
---
|
||||
name: Lead Source Picklist Enhancement
|
||||
description: Add a new 'Referral' value to the Lead Source picklist on the Lead object for better lead tracking.
|
||||
tags: salesforce, lead, picklist, data-management, admin
|
||||
---
|
||||
|
||||
Add a new value 'Referral' to the Lead Source picklist on the Lead object.
|
||||
@ -1,7 +0,0 @@
|
||||
---
|
||||
name: High Priority Case Assignment Rule
|
||||
description: Create an assignment rule that automatically routes high priority Cases to a specific queue or user for immediate attention.
|
||||
tags: salesforce, case-management, assignment-rules, automation, admin
|
||||
---
|
||||
|
||||
Add an Assignment Rule that automatically assigns new Cases with Priority = High to a specific queue or user.
|
||||
@ -1,9 +0,0 @@
|
||||
---
|
||||
name: Project Object Quickstart
|
||||
description: Scaffold a Project__c custom object with core fields and deployable metadata.
|
||||
tags: salesforce, custom-object, beginner
|
||||
---
|
||||
|
||||
Create a new Project__c object with an autonumber field {proj-0000}, name, start date, and number of days fields that represent a simple project record.
|
||||
|
||||
Deploy this metadata to my org using the Salesforce DX MCP Server.
|
||||
@ -1,7 +0,0 @@
|
||||
---
|
||||
name: Opportunity Days Open Formula
|
||||
description: Create a formula field on Opportunity that calculates the number of days since the record was created.
|
||||
tags: salesforce, opportunity, formula-field, automation, admin
|
||||
---
|
||||
|
||||
Add a formula field on Opportunity called Days_Open__c that calculates TODAY() - DATEVALUE(CreatedDate).
|
||||
@ -1,7 +0,0 @@
|
||||
---
|
||||
name: Account Editor Permission Set
|
||||
description: Create a permission set that grants edit access to Account records and assign it to the current user.
|
||||
tags: salesforce, permission-set, security, admin, user-management
|
||||
---
|
||||
|
||||
Create a permission set Account_Editor with Edit access to Account and assign it to your current user.
|
||||
@ -1,7 +0,0 @@
|
||||
---
|
||||
name: Account Opportunity Count Roll-Up
|
||||
description: Create a roll-up summary field on Account that counts related Opportunities for better relationship tracking.
|
||||
tags: salesforce, account, opportunity, rollup-summary, automation, admin
|
||||
---
|
||||
|
||||
Create a Roll-Up Summary on Account that counts the number of related Opportunities.
|
||||
@ -1,13 +0,0 @@
|
||||
---
|
||||
name: Hello World LWC Starter
|
||||
description: Generate a greeting Lightning Web Component and explain its HTML, JS, and metadata files.
|
||||
tags: lwc, ui, beginner
|
||||
---
|
||||
|
||||
Help me create my first Lightning Web Component.
|
||||
|
||||
Generate a basic LWC that displays a greeting message. Provide the HTML, JavaScript, and meta configuration files, and provide comments on how each file works.
|
||||
|
||||
Deploy this metadata to my org using the Salesforce DX MCP Server.
|
||||
|
||||
Display instruction on how to add the LWC to a new Home page.
|
||||
@ -1,11 +0,0 @@
|
||||
---
|
||||
name: Opportunity Days Till Close Formula
|
||||
description: Build an Opportunity formula that calculates days between CreatedDate and CloseDate.
|
||||
tags: formula, opportunity, admin
|
||||
---
|
||||
|
||||
Create a formula field on `Opportunity` named `Days till Close` that calculates the number of days between the `CreatedDate` and `CloseDate` fields, if `CloseDate` is not null.
|
||||
|
||||
Deploy this class to my org using the Salesforce DX MCP Server.
|
||||
|
||||
Provide instruction on how to set field level security for my profile and add the new field to the page layout.
|
||||
@ -1,7 +0,0 @@
|
||||
---
|
||||
name: Opportunity Close Date Validation
|
||||
description: Create a validation rule on Opportunity that prevents saving when the Close Date is in the past.
|
||||
tags: salesforce, opportunity, validation-rule, data-quality, admin
|
||||
---
|
||||
|
||||
Add a validation rule on Opportunity that prevents saving when Close Date < TODAY().
|
||||
@ -1,9 +0,0 @@
|
||||
---
|
||||
name: StringUtils Utility Scaffold
|
||||
description: Create a foundational StringUtils Apex helper with core string methods and unit tests.
|
||||
tags: apex, utility, testing
|
||||
---
|
||||
|
||||
Create an `StringUtils` Apex utility class with common string helpers such as isBlank, trimToNull, and safe string-to-integer conversion. Include a focused test class that covers each helper method with both typical inputs. Do not test for edge casees at this time.
|
||||
|
||||
Deploy the classes to my org and run the unit tests, using the Salesforce DX MCP Server.
|
||||
@ -1,16 +0,0 @@
|
||||
---
|
||||
name: DateUtils Utility Primer
|
||||
description: Generate a documented DateUtils Apex class with daysBetween and addDays helpers.
|
||||
tags: apex, utility, beginner
|
||||
---
|
||||
|
||||
Generate a small `DateUtils` Apex utility class. Include clear comments so I can understand the overall structure and common Apex patterns.
|
||||
|
||||
Create the following two methods:
|
||||
|
||||
- A method named daysBetween that returns the number of days between two dates. If either date is null, return null instead of throwing an exception.
|
||||
- Add a method named addDays that returns a new date by adding a given number of days to a base date. If the base date is null, return null.
|
||||
|
||||
Do not create unit tests at this time.
|
||||
|
||||
Deploy this class to my org using the Salesforce DX MCP Server.
|
||||
@ -1,11 +0,0 @@
|
||||
---
|
||||
name: Opportunity Stage Score Formula
|
||||
description: Craft a readable Opportunity formula that assigns numeric scores per stage.
|
||||
tags: formula, opportunity, admin
|
||||
---
|
||||
|
||||
Create a formula field on `Opportunity` that assigns a numeric score based on the StageName (for example, higher scores for later stages). Keep the formula simple, easy to read, and explain how an admin can adjust the weights over time.
|
||||
|
||||
Deploy the metadat to my org using the Salesforce DX MCP Server.
|
||||
|
||||
Provide instruction on how to set field level security for my profile and add the new field to the page layout.
|
||||
@ -1,9 +0,0 @@
|
||||
---
|
||||
name: Test Data Factory Kickoff
|
||||
description: Build an Apex factory for Accounts, Contacts, and Opportunities with usage examples.
|
||||
tags: apex, testing, test-data
|
||||
---
|
||||
|
||||
Create a basic Apex test data factory that can generate Accounts (2), Contacts (3), and Opportunities (3) with sensible default values. Include example test methods that use the factory and explain how it helps keep tests clean and maintainable.
|
||||
|
||||
Deploy the metadat to my org using the Salesforce DX MCP Server.
|
||||
@ -1,11 +0,0 @@
|
||||
---
|
||||
name: Account Trigger Starter
|
||||
description: Create a simple Account trigger and handler that sets default values before insert.
|
||||
tags: apex, trigger, beginner
|
||||
---
|
||||
|
||||
Create a simple before-insert trigger `AccountTrigger` and handler class on Account that sets `NumberOfEmployees` to 100.
|
||||
|
||||
Do not create unit tests at this time.
|
||||
|
||||
Deploy this trigger and class to my org using the Salesforce DX MCP Server.
|
||||
@ -1,9 +0,0 @@
|
||||
---
|
||||
name: Account Employee Validation Rule
|
||||
description: Draft a rule that blocks Account save when NumberOfEmployees is blank.
|
||||
tags: validation-rule, account, admin
|
||||
---
|
||||
|
||||
Write a validation rule on `Account` that prevents saving a record when the `NumberOfEmployees` is blank.
|
||||
|
||||
Deploy this metadata to my org using the Salesforce DX MCP Server.
|
||||
@ -1,9 +0,0 @@
|
||||
---
|
||||
name: Opportunity Approval Investigation
|
||||
description: Diagnose inconsistent approval checkbox behavior on Opportunities and propose a remediation plan.
|
||||
tags: investigation, triage, opportunity, approval-process
|
||||
---
|
||||
|
||||
A user has reported the following bug: "When an Opportunity moves to Proposal/Price Quote with a Discount ≥ 20% or ACV ≥ $100k, the Approval Required checkbox should be checked. Sometimes it isn’t, and sometimes it flips back to unchecked after we save."
|
||||
|
||||
Let's investigate, uncover the problem and plan an approach to fix it.
|
||||
@ -1,39 +0,0 @@
|
||||
---
|
||||
name: Asset Tracker Spec Build
|
||||
description: Gather requirements and deliver a full Asset tracker app via a spec-driven workflow.
|
||||
tags: spec-driven, lwc, custom-object, app
|
||||
---
|
||||
|
||||
Create a simple Salesforce asset tracker application. The code should follow standard Salesforce styling and development best practices and be deployable to a scratch org or sandbox. Keep it fun, readable, and beginner-friendly.
|
||||
|
||||
- Ask questions until you're 95% sure you can complete this task.
|
||||
- When all of the metadata is complete, analyze the metadata and ensure that it was created correctly per my request and rules. Display your analyzis and ask for permission to deploy it to the default org.
|
||||
|
||||
## Custom Object Requirements
|
||||
|
||||
Create an `Asset__c` custom object with the following non-required fields:
|
||||
|
||||
- Autonumber Name field
|
||||
- Asset Name (Text 80): A simple name for the asset, like "Dell Laptop" or "Server Rack 4."
|
||||
- Status (Picklist): This field tracks the current state of the asset.
|
||||
- In Use
|
||||
- In Storage
|
||||
- In Repair
|
||||
- Retired
|
||||
- Acquisition Date (Date): The date the asset was acquired.
|
||||
- Purchase Price (Currency): The cost of the asset.
|
||||
- Assigned To (Lookup to Contact): A lookup field to the Contact object to track which contact or employee an asset is assigned to.
|
||||
|
||||
Add all of the fields to the page layout and create a tab for the object. Do not create or assign a compact layout.
|
||||
|
||||
## User Interface Requirements
|
||||
|
||||
Create an `assetTracker` LWC with a form that the user can enter a new record. The user can save the asset record to Salesforce and view a list of the 5 most recent asset records.
|
||||
|
||||
Add the LWC to a Lightning page and create a tab for the new page.
|
||||
|
||||
Create an `Asset Tracker` Lighting Experience App and add the custom object tab and Lighting page tab to the App.
|
||||
|
||||
## Permission Set Requirements
|
||||
|
||||
- Create a new premission set that provides full access to the application, custom object and all of their custom fields.
|
||||
@ -1,7 +0,0 @@
|
||||
---
|
||||
name: Apex Unit Test Generator
|
||||
description: Create a comprehensive test class for any Apex class with test data setup and result verification.
|
||||
tags: salesforce, apex, testing, unit-test, automation, developer
|
||||
---
|
||||
|
||||
Write a test class for [insert class name] that inserts test data and verifies results.
|
||||
@ -1,7 +0,0 @@
|
||||
---
|
||||
name: Run All Apex Tests
|
||||
description: Execute all Apex tests in the org and display a comprehensive summary including total tests run, number passed, and overall code coverage percentage.
|
||||
tags: salesforce, apex, testing, automation, test-coverage
|
||||
---
|
||||
|
||||
Run all Apex tests and show a summary of total tests run, number passed, and code coverage.
|
||||
@ -1,9 +0,0 @@
|
||||
---
|
||||
name: Compliment Mixer App
|
||||
description: Build a playful compliment generator with custom UI, persistence, and recent history.
|
||||
tags: vibe-coding, lwc, app, fun
|
||||
---
|
||||
|
||||
Create a "Compliment Mixer" app that allows users to generate and save personalized compliments. Create a custom UI so the user can enter two adjectives that describe a person (e.g., "brilliant", "fearless") and a name (e.g., "Alex"). The app then generates a compliment sentence that combines those words and the name using a random sentence template. The user can save the compliment to Salesforce and view a list of the 5 most recent compliments they've generated.
|
||||
|
||||
The code should follow standard Salesforce styling and development best practices and be deployable to a scratch org or sandbox. Keep it fun, readable, and beginner-friendly.
|
||||
Loading…
Reference in New Issue
Block a user