Skip to content

Commit 287a7e9

Browse files
authored
@W-21648052 Include new Context API MCP server (#70)
Updated rules file to incliude new Context API MCP server, removed extraneous instructions
1 parent 8bc46ed commit 287a7e9

1 file changed

Lines changed: 17 additions & 44 deletions

File tree

rules/a4v-expert-global-rule.md

Lines changed: 17 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,42 @@
11
# Rule: Salesforce Metadata Generation
22

3-
## Objective
4-
Enforce: **skill load → API context → file generation** for all Salesforce metadata.
5-
63
## Constraints
74

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. **Child types need own context** - if adding any child metadata inside a parent metadata's file, load skill and call `get_metadata_api_context` for each child type (e.g. CustomField inside CustomObject) separately; don't rely on the parent's schema for creating child metadata
5+
1. **Never write** without both: metadata type skill loaded AND context tools from `salesforce-api-context` MCP server called for that type.
6+
2. **One type at a time** - finish one type before starting the next
7+
3. **One type per API call** - do not batch types when calling MCP tools
8+
4. **Child types need their own context** - if adding any child metadata inside a parent metadata's file, treat the child metadata seperately; don't rely on the parent's schema for creating child metadata
129
5. **Max one clarifying question** before starting
1310

1411
## Workflow
1512

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
13+
### Step 1: Metadata Loop - Execute for Each Type
14+
For each type, execute loop below
3115

3216
**a. Load Skill**
33-
- Load metadata type skill once (not per record)
34-
- If no skill exists, continue with API context only
17+
- Load the metadata type skill once (not per record)
3518

36-
**b. Call API Context**
37-
- `get_metadata_api_context("TypeName")` - single type only
38-
- Wait for response
19+
**b. Get entity context**
20+
- Use these tools from `salesforce-api-context` MCP server for entity context.
21+
- `get_metadata_type_sections`
22+
- `get_metadata_type_context`
23+
- `get_metadata_type_fields`
24+
- `get_metadata_type_fields_properties`
25+
- `search_metadata_types`
3926

40-
**c. Pre-Write Gate**
41-
- Before EVERY write: confirm API context called for this type
42-
- If no → stop and call now
4327

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
28+
### Step 2. Verify deployment
5329
```bash
5430
sf project deploy start --dry-run -d "force-app/main/default" --target-org <alias> --test-level NoTestRun --wait 10 --json
5531
```
5632
On failure: attempt to fix the errors and re-run, retrying up to a maximum of 3 times until it succeeds.
5733

34+
5835
## Anti-Patterns
5936

6037
| Don't | Why | Do |
6138
|-------|-----|-----|
62-
| Write without API context | Missing schema validation | Call API context before first write |
6339
| 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 |
6540
| Skip metadata skills | Missing platform constraints | Load skill for every type |
6641
| 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 |
42+
| Batch types in calls to MCP tools | Violates constraint | One type per call |

0 commit comments

Comments
 (0)