Skip to content

Commit e0fb839

Browse files
authored
Merge branch 'main' into t/authzx/add-skills-for-metadata-permission-set
2 parents 1ae418c + eb5662a commit e0fb839

37 files changed

Lines changed: 4767 additions & 0 deletions

File tree

rules/a4v-expert-global-rule.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Rule: Salesforce Metadata Generation
2+
3+
## Objective
4+
Enforce: **skill load → API context → file generation** for all Salesforce metadata.
5+
6+
## Constraints
7+
8+
1. **Never write** without both: metadata type skill loaded AND `get_metadata_api_context` called for that type
9+
2. **One type at a time** - complete full cycle before next type
10+
3. **One type per API call** - no batching
11+
4. **No cross-type content** in files
12+
5. **Max one clarifying question** before starting
13+
14+
## Workflow
15+
16+
### 1. Detect Intent
17+
- **Solution skill** (end-to-end capability like lex/react app) → Solution Path
18+
- **Direct metadata** (specific fields/objects/pages) → Direct Path
19+
20+
### 2. Solution Path
21+
1. Load solution skill, extract metadata type sequence
22+
2. For each type, execute loop (a-e below)
23+
3. Proceed to Step 3
24+
25+
### 2. Direct Path
26+
1. Identify all needed types
27+
2. For each type in dependency order, execute loop (a-e below)
28+
3. Proceed to Step 3
29+
30+
### Loop (a-e) - Execute for Each Type
31+
32+
**a. Load Skill**
33+
- Load metadata type skill once (not per record)
34+
- If no skill exists, continue with API context only
35+
36+
**b. Call API Context**
37+
- `get_metadata_api_context("TypeName")` - single type only
38+
- Wait for response
39+
40+
**c. Pre-Write Gate**
41+
- Before EVERY write: confirm API context called for this type
42+
- If no → stop and call now
43+
44+
**d. Generate Files**
45+
- Use skill constraints + API context
46+
- Generate all records for this type now
47+
48+
**e. Checkpoint**
49+
- Skill loaded? API context called? All files written?
50+
- Only proceed to next type when all true
51+
52+
### 3. Deploy Verification
53+
```bash
54+
sf project deploy start --dry-run -d "<path>" --target-org <alias> --test-level NoTestRun --wait 10 --json
55+
```
56+
On failure: attempt to fix the errors and re-run, retrying up to a maximum of 5 times until it succeeds.
57+
58+
## Anti-Patterns
59+
60+
| Don't | Why | Do |
61+
|-------|-----|-----|
62+
| Write without API context | Missing schema validation | Call API context before first write |
63+
| Reload skill per record | Wastes tokens | Load once per type |
64+
| Skip API context for later types | No schema for those types | Call for EVERY type |
65+
| Skip metadata skills | Missing platform constraints | Load skill for every type |
66+
| Ask 3+ questions | Token waste | Max 1 question |
67+
| Skip solution skill gates | Wrong artifacts | Follow all mandatory gates |
68+
| Write despite missing checkpoint | Aware violation | Stop and complete missing step |
69+
| Batch types in API call | Violates constraint #3 | One type per call |

samples/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,14 @@ Source is synced from the npm package [@salesforce/webapp-template-app-react-sam
4141
### Version tracking
4242

4343
The file `samples/webapp-template-app-react-sample-b2x-experimental/.version` stores the last-synced npm version. The Action compares it to the latest on npm and only creates a PR when they differ.
44+
45+
## native-mobile-rental-tenant-app
46+
47+
A sample Custom Agentic Mobile App (CAMA) for rental property tenants. This sample is maintained directly in this repository (not synced from npm). It includes:
48+
49+
- **digitalExperiences** metadata: CAMA app config (`experience__camaAppMetadata`), build metadata (`experience__camaBuildMetadata`), EC definition (`experience__camaECDefinition`), and screens (`experience__camaScreen`) with tabs (Home, Tenants, Properties), theme, and toolbar settings
50+
- **Source**: Synced from [cama-mcp-server](https://git.soma.salesforce.com/khawkins/cama-mcp-server) (branch `apply_metadata_updates`)
51+
52+
### How it's used
53+
54+
The sample appears on the Agentforce Vibes welcome page under the **Mobile** app type. Users can clone it via the welcome page wizard or directly from this repo.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status
2+
# More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm
3+
#
4+
5+
package.xml
6+
7+
# LWC configuration files
8+
**/jsconfig.json
9+
**/.eslintrc.json
10+
11+
# LWC Jest
12+
**/__tests__/**
13+
14+
node_modules/
15+
.DS_Store
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Salesforce
5+
.sfdx/
6+
.localdevserver/
7+
8+
# IDE
9+
.idea/
10+
.vscode/
11+
*.swp
12+
*.swo
13+
14+
# OS
15+
.DS_Store
16+
Thumbs.db
17+
18+
# Logs
19+
*.log
20+
npm-debug.log*
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Native Mobile Rental Tenant App
2+
3+
A sample Custom Agentic Mobile App (CAMA) for property managers and tenants. Use this as a starting point for building native mobile apps with Salesforce Mobile Publisher, MCF (Mobile Component Framework), and SharedUI.
4+
5+
## Overview
6+
7+
This sample demonstrates a rental tenant experience—browse properties, submit maintenance requests, pay rent, and communicate with property management—all from a native iOS or Android app.
8+
9+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"orgName": "Rental Tenant Dev",
3+
"edition": "Developer",
4+
"features": [],
5+
"settings": {
6+
"mobileSettings": {
7+
"enableS1EncryptedStoragePref2": false
8+
}
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"apiName": "appMetadata",
3+
"type": "experience__camaAppMetadata",
4+
"path": "appMetadata"
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"type": "experience__camaAppMetadata",
3+
"title": "App Metadata",
4+
"contentBody": {
5+
"name": "Homestead",
6+
"description": "Mobile application for managing property rentals, tenant information, lease agreements, and maintenance requests.",
7+
"version": "1.0.0",
8+
"url": "http://login.test1.pc-rnd.salesforce.com/",
9+
"templateID": "1",
10+
"tabs": [
11+
{
12+
"id": "home",
13+
"label": "Home",
14+
"icon": "house.fill",
15+
"screen": "homeScreen"
16+
},
17+
{
18+
"id": "tenants",
19+
"label": "Tenants",
20+
"icon": "person.2.fill",
21+
"screen": "tenantsScreen"
22+
},
23+
{
24+
"id": "properties",
25+
"label": "Properties",
26+
"icon": "building.2.fill",
27+
"screen": "propertiesScreen"
28+
}
29+
],
30+
"toolbarActions": {
31+
"notifications": false,
32+
"search": false,
33+
"agentforce": false
34+
},
35+
"theme": {
36+
"accentColor": "#9400D3",
37+
"primaryColor": "#000000",
38+
"secondaryColor": "#B3B3B3"
39+
}
40+
}
41+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"apiName": "buildMetadata",
3+
"type": "experience__camaBuildMetadata",
4+
"path": "buildMetadata"
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"type": "experience__camaBuildMetadata",
3+
"title": "Build Metadata",
4+
"contentBody": {
5+
"BiometricOptIn": false,
6+
"NotificationOptIn": false
7+
}
8+
}

0 commit comments

Comments
 (0)