@salesforce/afv-skills 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/package.json +6 -5
  2. package/skills/accessing-webapp-data/SKILL.md +178 -0
  3. package/skills/agentforce-development/SKILL.md +427 -0
  4. package/skills/agentforce-development/assets/README-legacy.md +89 -0
  5. package/skills/agentforce-development/assets/agent-spec-template.md +90 -0
  6. package/skills/agentforce-development/assets/agents/README.md +45 -0
  7. package/skills/agentforce-development/assets/agents/hello-world.agent +60 -0
  8. package/skills/agentforce-development/assets/agents/multi-topic.agent +105 -0
  9. package/skills/agentforce-development/assets/agents/production-faq.agent +101 -0
  10. package/skills/agentforce-development/assets/agents/production-faq.bundle-meta.xml +4 -0
  11. package/skills/agentforce-development/assets/agents/simple-qa.agent +72 -0
  12. package/skills/agentforce-development/assets/apex/models-api-queueable.cls +225 -0
  13. package/skills/agentforce-development/assets/bundle-meta.xml +23 -0
  14. package/skills/agentforce-development/assets/components/apex-action.agent +52 -0
  15. package/skills/agentforce-development/assets/components/error-handling.agent +58 -0
  16. package/skills/agentforce-development/assets/components/escalation-setup.agent +169 -0
  17. package/skills/agentforce-development/assets/components/flow-action.agent +66 -0
  18. package/skills/agentforce-development/assets/components/n-ary-conditions.agent +110 -0
  19. package/skills/agentforce-development/assets/components/topic-with-actions.agent +40 -0
  20. package/skills/agentforce-development/assets/deterministic-routing.agent +166 -0
  21. package/skills/agentforce-development/assets/escalation-pattern.agent +209 -0
  22. package/skills/agentforce-development/assets/flow-action-lookup.agent +115 -0
  23. package/skills/agentforce-development/assets/hub-and-spoke.agent +104 -0
  24. package/skills/agentforce-development/assets/invocable-apex-template.cls +187 -0
  25. package/skills/agentforce-development/assets/local-info-agent-annotated.agent +355 -0
  26. package/skills/agentforce-development/assets/metadata/basic-prompt-template.promptTemplate-meta.xml +109 -0
  27. package/skills/agentforce-development/assets/metadata/genai-function-apex.xml +92 -0
  28. package/skills/agentforce-development/assets/metadata/genai-function-flow.xml +57 -0
  29. package/skills/agentforce-development/assets/metadata/genai-plugin.xml +72 -0
  30. package/skills/agentforce-development/assets/metadata/http-callout-flow.flow-meta.xml +348 -0
  31. package/skills/agentforce-development/assets/metadata/record-grounded-prompt.promptTemplate-meta.xml +136 -0
  32. package/skills/agentforce-development/assets/minimal-starter.agent +42 -0
  33. package/skills/agentforce-development/assets/patterns/README.md +254 -0
  34. package/skills/agentforce-development/assets/patterns/action-callbacks.agent +178 -0
  35. package/skills/agentforce-development/assets/patterns/advanced-input-bindings.agent +141 -0
  36. package/skills/agentforce-development/assets/patterns/bidirectional-routing.agent +156 -0
  37. package/skills/agentforce-development/assets/patterns/critical-input-collection.agent +244 -0
  38. package/skills/agentforce-development/assets/patterns/delegation-routing.agent +89 -0
  39. package/skills/agentforce-development/assets/patterns/lifecycle-events.agent +127 -0
  40. package/skills/agentforce-development/assets/patterns/llm-controlled-actions.agent +184 -0
  41. package/skills/agentforce-development/assets/patterns/multi-step-workflow.agent +282 -0
  42. package/skills/agentforce-development/assets/patterns/open-gate-routing.agent +286 -0
  43. package/skills/agentforce-development/assets/patterns/procedural-instructions.agent +273 -0
  44. package/skills/agentforce-development/assets/patterns/prompt-template-action.agent +188 -0
  45. package/skills/agentforce-development/assets/patterns/system-instruction-overrides.agent +293 -0
  46. package/skills/agentforce-development/assets/prompt-rag-search.agent +131 -0
  47. package/skills/agentforce-development/assets/template-multi-topic.agent +160 -0
  48. package/skills/agentforce-development/assets/template-single-topic.agent +81 -0
  49. package/skills/agentforce-development/assets/verification-gate.agent +208 -0
  50. package/skills/agentforce-development/references/action-prompt-templates.md +164 -0
  51. package/skills/agentforce-development/references/actions-reference.md +592 -0
  52. package/skills/agentforce-development/references/agent-access-guide.md +72 -0
  53. package/skills/agentforce-development/references/agent-design-and-spec-creation.md +1010 -0
  54. package/skills/agentforce-development/references/agent-metadata-and-lifecycle.md +575 -0
  55. package/skills/agentforce-development/references/agent-script-core-language.md +1218 -0
  56. package/skills/agentforce-development/references/agent-topic-map-diagrams.md +323 -0
  57. package/skills/agentforce-development/references/agent-user-setup.md +526 -0
  58. package/skills/agentforce-development/references/agent-validation-and-debugging.md +803 -0
  59. package/skills/agentforce-development/references/known-issues.md +353 -0
  60. package/skills/agentforce-development/references/minimal-examples.md +67 -0
  61. package/skills/agentforce-development/references/production-gotchas.md +279 -0
  62. package/skills/agentforce-development/references/salesforce-cli-for-agents.md +393 -0
  63. package/skills/agentforce-development/references/version-history.md +23 -0
  64. package/skills/building-webapp-data-visualization/SKILL.md +72 -0
  65. package/skills/building-webapp-data-visualization/implementation/bar-line-chart.md +316 -0
  66. package/skills/building-webapp-data-visualization/implementation/dashboard-layout.md +189 -0
  67. package/skills/building-webapp-data-visualization/implementation/donut-chart.md +181 -0
  68. package/skills/building-webapp-data-visualization/implementation/stat-card.md +150 -0
  69. package/skills/building-webapp-react-components/SKILL.md +96 -0
  70. package/skills/building-webapp-react-components/implementation/component.md +78 -0
  71. package/skills/building-webapp-react-components/implementation/header-footer.md +132 -0
  72. package/skills/building-webapp-react-components/implementation/page.md +93 -0
  73. package/skills/configuring-webapp-csp-trusted-sites/SKILL.md +90 -0
  74. package/skills/configuring-webapp-csp-trusted-sites/implementation/metadata-format.md +281 -0
  75. package/skills/configuring-webapp-metadata/SKILL.md +158 -0
  76. package/skills/creating-webapp/SKILL.md +141 -0
  77. package/skills/deploying-webapp-to-salesforce/SKILL.md +229 -0
  78. package/skills/exploring-webapp-graphql-schema/SKILL.md +149 -0
  79. package/skills/fetching-webapp-rest-api/SKILL.md +167 -0
  80. package/skills/{salesforce-custom-application → generating-custom-application}/SKILL.md +2 -4
  81. package/skills/{salesforce-custom-field → generating-custom-field}/SKILL.md +1 -5
  82. package/skills/{salesforce-custom-lightning-type → generating-custom-lightning-type}/SKILL.md +36 -2
  83. package/skills/{salesforce-custom-object → generating-custom-object}/SKILL.md +1 -1
  84. package/skills/generating-custom-tab/SKILL.md +154 -0
  85. package/skills/generating-experience-lwr-site/SKILL.md +196 -0
  86. package/skills/generating-experience-lwr-site/docs/bootstrap-template-byo-lwr.md +224 -0
  87. package/skills/generating-experience-lwr-site/docs/configure-content-brandingSet.md +131 -0
  88. package/skills/generating-experience-lwr-site/docs/configure-content-route.md +232 -0
  89. package/skills/generating-experience-lwr-site/docs/configure-content-themeLayout.md +141 -0
  90. package/skills/generating-experience-lwr-site/docs/configure-content-view.md +233 -0
  91. package/skills/generating-experience-lwr-site/docs/configure-guest-sharing-rules.md +42 -0
  92. package/skills/generating-experience-lwr-site/docs/handle-component-and-region-ids.md +27 -0
  93. package/skills/generating-experience-lwr-site/docs/handle-ui-components.md +215 -0
  94. package/skills/generating-experience-react-site/SKILL.md +67 -0
  95. package/skills/generating-experience-react-site/docs/configure-metadata-custom-site.md +41 -0
  96. package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience-bundle.md +17 -0
  97. package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience-config.md +21 -0
  98. package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience.md +38 -0
  99. package/skills/generating-experience-react-site/docs/configure-metadata-network.md +72 -0
  100. package/skills/{salesforce-flexipage → generating-flexipage}/SKILL.md +86 -9
  101. package/skills/{salesforce-flow → generating-flow}/SKILL.md +3 -3
  102. package/skills/generating-fragment/SKILL.md +117 -0
  103. package/skills/generating-lightning-app/SKILL.md +423 -0
  104. package/skills/{salesforce-list-view → generating-list-view}/SKILL.md +1 -1
  105. package/skills/generating-permission-set/SKILL.md +174 -0
  106. package/skills/{salesforce-validation-rule → generating-validation-rule}/SKILL.md +1 -1
  107. package/skills/generating-webapp-graphql-mutation-query/SKILL.md +258 -0
  108. package/skills/generating-webapp-graphql-read-query/SKILL.md +253 -0
  109. package/skills/implementing-webapp-file-upload/SKILL.md +396 -0
  110. package/skills/installing-webapp-features/SKILL.md +210 -0
  111. package/skills/managing-webapp-agentforce-conversation-client/SKILL.md +186 -0
  112. package/skills/managing-webapp-agentforce-conversation-client/references/constraints.md +134 -0
  113. package/skills/managing-webapp-agentforce-conversation-client/references/examples.md +132 -0
  114. package/skills/managing-webapp-agentforce-conversation-client/references/style-tokens.md +101 -0
  115. package/skills/managing-webapp-agentforce-conversation-client/references/troubleshooting.md +57 -0
  116. package/skills/switching-org/SKILL.md +28 -0
  117. package/skills/using-webapp-graphql/SKILL.md +324 -0
  118. package/skills/using-webapp-graphql/shared-schema.graphqls +1150 -0
  119. package/skills/apex-class/SKILL.md +0 -253
  120. package/skills/apex-class/examples/AccountDeduplicationBatch.cls +0 -148
  121. package/skills/apex-class/examples/AccountSelector.cls +0 -193
  122. package/skills/apex-class/examples/AccountService.cls +0 -201
  123. package/skills/apex-class/templates/abstract.cls +0 -128
  124. package/skills/apex-class/templates/batch.cls +0 -125
  125. package/skills/apex-class/templates/domain.cls +0 -102
  126. package/skills/apex-class/templates/dto.cls +0 -108
  127. package/skills/apex-class/templates/exception.cls +0 -51
  128. package/skills/apex-class/templates/interface.cls +0 -25
  129. package/skills/apex-class/templates/queueable.cls +0 -92
  130. package/skills/apex-class/templates/schedulable.cls +0 -75
  131. package/skills/apex-class/templates/selector.cls +0 -92
  132. package/skills/apex-class/templates/service.cls +0 -69
  133. package/skills/apex-class/templates/utility.cls +0 -97
  134. package/skills/apex-test-class/SKILL.md +0 -101
  135. package/skills/apex-test-class/references/assertion-patterns.md +0 -209
  136. package/skills/apex-test-class/references/async-testing.md +0 -276
  137. package/skills/apex-test-class/references/mocking-patterns.md +0 -219
  138. package/skills/apex-test-class/references/test-data-factory.md +0 -176
  139. package/skills/deployment-readiness-check/SKILL.md +0 -257
  140. package/skills/deployment-readiness-check/assets/deployment_checklist.md +0 -286
  141. package/skills/deployment-readiness-check/references/rollback_procedures.md +0 -308
  142. package/skills/deployment-readiness-check/scripts/check_metadata.sh +0 -207
  143. package/skills/salesforce-custom-tab/SKILL.md +0 -78
  144. package/skills/salesforce-experience-site/SKILL.md +0 -178
  145. package/skills/salesforce-fragment/SKILL.md +0 -42
  146. package/skills/salesforce-lightning-app-build/SKILL.md +0 -254
  147. package/skills/salesforce-web-app-creating-records/SKILL.md +0 -84
  148. package/skills/salesforce-web-app-feature/SKILL.md +0 -70
  149. package/skills/salesforce-web-app-list-and-create-records/SKILL.md +0 -36
  150. package/skills/salesforce-web-application/SKILL.md +0 -34
@@ -1,308 +0,0 @@
1
- # Rollback Procedures
2
-
3
- This guide provides step-by-step instructions for rolling back a Salesforce deployment if issues are discovered after release.
4
-
5
- ## When to Rollback
6
-
7
- Execute a rollback when:
8
- - **Critical functionality is broken** and cannot be hotfixed quickly
9
- - **Data integrity issues** are discovered
10
- - **Performance degradation** exceeds 50% of baseline
11
- - **Security vulnerabilities** are introduced
12
- - **Stakeholder approval** to rollback is obtained
13
-
14
- Do NOT rollback for:
15
- - Minor UI issues that don't impact functionality
16
- - Issues that can be hotfixed in < 2 hours
17
- - Edge cases affecting < 5% of users
18
- - Cosmetic problems
19
-
20
- ## Pre-Rollback Checklist
21
-
22
- Before initiating rollback:
23
-
24
- - [ ] Confirm the issue severity justifies rollback
25
- - [ ] Obtain stakeholder approval
26
- - [ ] Notify all users of upcoming rollback
27
- - [ ] Backup current production state (post-deployment)
28
- - [ ] Verify pre-deployment backup is available
29
- - [ ] Review rollback plan with team
30
- - [ ] Prepare communication for completion
31
-
32
- ## Rollback Methods
33
-
34
- ### Method 1: Redeploy Previous Version (Recommended)
35
-
36
- **Best for**: Metadata-only deployments with no data changes.
37
-
38
- **Steps**:
39
-
40
- 1. **Retrieve pre-deployment state from version control**:
41
- ```bash
42
- git checkout pre-deployment-YYYYMMDD
43
- ```
44
-
45
- 2. **Validate rollback deployment**:
46
- ```bash
47
- sf project deploy validate \
48
- --manifest manifest/package.xml \
49
- --test-level RunLocalTests \
50
- --target-org production
51
- ```
52
-
53
- 3. **Deploy previous version**:
54
- ```bash
55
- sf project deploy start \
56
- --manifest manifest/package.xml \
57
- --test-level RunLocalTests \
58
- --target-org production
59
- ```
60
-
61
- 4. **Verify rollback**:
62
- - Test critical user flows
63
- - Check for errors in debug logs
64
- - Confirm with stakeholders
65
-
66
- **Timeline**: 30-60 minutes
67
-
68
- ### Method 2: Selective Component Rollback
69
-
70
- **Best for**: When only specific components are problematic.
71
-
72
- **Steps**:
73
-
74
- 1. **Identify problematic components**:
75
- - Review error logs
76
- - Isolate failing functionality
77
- - List components to rollback
78
-
79
- 2. **Create targeted package.xml**:
80
- ```xml
81
- <?xml version="1.0" encoding="UTF-8"?>
82
- <Package xmlns="http://soap.sforce.com/2006/04/metadata">
83
- <types>
84
- <members>ProblematicClass</members>
85
- <name>ApexClass</name>
86
- </types>
87
- <version>59.0</version>
88
- </Package>
89
- ```
90
-
91
- 3. **Retrieve previous version of components**:
92
- ```bash
93
- git show pre-deployment-YYYYMMDD:force-app/main/default/classes/ProblematicClass.cls > temp/ProblematicClass.cls
94
- ```
95
-
96
- 4. **Deploy only those components**:
97
- ```bash
98
- sf project deploy start \
99
- --manifest rollback-package.xml \
100
- --target-org production
101
- ```
102
-
103
- **Timeline**: 15-30 minutes
104
-
105
- ### Method 3: Destructive Changes
106
-
107
- **Best for**: When new components must be removed entirely.
108
-
109
- **Steps**:
110
-
111
- 1. **Create destructiveChanges.xml**:
112
- ```xml
113
- <?xml version="1.0" encoding="UTF-8"?>
114
- <Package xmlns="http://soap.sforce.com/2006/04/metadata">
115
- <types>
116
- <members>NewComponentToDelete</members>
117
- <name>ApexClass</name>
118
- </types>
119
- <version>59.0</version>
120
- </Package>
121
- ```
122
-
123
- 2. **Create empty package.xml**:
124
- ```xml
125
- <?xml version="1.0" encoding="UTF-8"?>
126
- <Package xmlns="http://soap.sforce.com/2006/04/metadata">
127
- <version>59.0</version>
128
- </Package>
129
- ```
130
-
131
- 3. **Deploy destructive changes**:
132
- ```bash
133
- sf project deploy start \
134
- --manifest package.xml \
135
- --pre-destructive-changes destructiveChanges.xml \
136
- --test-level RunLocalTests \
137
- --target-org production
138
- ```
139
-
140
- 4. **Verify deletion**:
141
- ```bash
142
- sf org list metadata --metadata-type ApexClass --target-org production
143
- ```
144
-
145
- **Timeline**: 20-40 minutes
146
-
147
- ## Data Rollback Considerations
148
-
149
- If the deployment included data changes:
150
-
151
- ### Option A: Restore from Backup
152
-
153
- 1. **Locate pre-deployment data backup**:
154
- - Data Export Service snapshot
155
- - Backup tool (OwnBackup, Spanning, etc.)
156
- - Manual CSV exports
157
-
158
- 2. **Restore data**:
159
- ```bash
160
- sf data import tree --plan data-backup/data-plan.json --target-org production
161
- ```
162
-
163
- 3. **Validate data integrity**:
164
- - Run data quality checks
165
- - Verify record counts
166
- - Check relationships
167
-
168
- **Timeline**: 1-4 hours (depending on data volume)
169
-
170
- ### Option B: Reverse Data Changes (Scripted)
171
-
172
- 1. **Identify affected records**:
173
- ```bash
174
- sf data query --query "SELECT Id FROM Account WHERE LastModifiedDate >= YESTERDAY"
175
- ```
176
-
177
- 2. **Apply reverse operations**:
178
- - Create Apex script to reverse changes
179
- - Test in sandbox first
180
- - Execute in production
181
-
182
- **Timeline**: 2-6 hours
183
-
184
- ## Post-Rollback Steps
185
-
186
- After rollback is complete:
187
-
188
- 1. **Verify Functionality**:
189
- - [ ] Execute smoke tests
190
- - [ ] Confirm critical workflows work
191
- - [ ] Check automation (triggers, flows) operates correctly
192
- - [ ] Review debug logs for errors
193
-
194
- 2. **Communication**:
195
- - [ ] Notify users rollback is complete
196
- - [ ] Send post-mortem summary to stakeholders
197
- - [ ] Update status page / internal wiki
198
-
199
- 3. **Root Cause Analysis**:
200
- - [ ] Document what went wrong
201
- - [ ] Identify why issues weren't caught pre-deployment
202
- - [ ] Update deployment checklist to prevent recurrence
203
- - [ ] Schedule retrospective with team
204
-
205
- 4. **Next Steps**:
206
- - [ ] Fix issues in development environment
207
- - [ ] Add test cases to catch similar issues
208
- - [ ] Re-validate deployment in sandbox
209
- - [ ] Schedule new deployment with fixes
210
-
211
- ## Emergency Contacts
212
-
213
- **Production Issues**:
214
- - On-call DevOps: [contact info]
215
- - Salesforce Support: [premier support phone]
216
- - Release Manager: [contact info]
217
-
218
- **Stakeholder Notifications**:
219
- - Product Owner: [contact info]
220
- - Business Analyst: [contact info]
221
- - Executive Sponsor: [contact info]
222
-
223
- ## Rollback Decision Matrix
224
-
225
- | Severity | Impact | Rollback? | Timeline |
226
- |----------|--------|-----------|----------|
227
- | **Critical** | >50% users affected, core functionality broken | Yes | Immediate (< 1 hour) |
228
- | **High** | 10-50% users affected, workaround exists | Consider | Within 2-4 hours |
229
- | **Medium** | <10% users affected, non-critical features | No, hotfix instead | Plan fix for next release |
230
- | **Low** | Edge case, cosmetic issues | No | Address in backlog |
231
-
232
- ## Lessons Learned Template
233
-
234
- After each rollback, document lessons learned:
235
-
236
- ```markdown
237
- # Rollback Post-Mortem: [Date]
238
-
239
- ## Deployment Summary
240
- - Deployment date/time: [timestamp]
241
- - Components deployed: [list]
242
- - Rollback date/time: [timestamp]
243
- - Rollback method used: [method]
244
-
245
- ## Issue Description
246
- [Describe what went wrong]
247
-
248
- ## Root Cause
249
- [Why did the issue occur?]
250
-
251
- ## Detection
252
- - How was the issue discovered?
253
- - How long after deployment?
254
- - Who reported it?
255
-
256
- ## Impact
257
- - Number of users affected: [count]
258
- - Business processes impacted: [list]
259
- - Duration of impact: [timespan]
260
-
261
- ## Resolution
262
- - Rollback timeline: [start - end]
263
- - Additional fixes required: [list]
264
-
265
- ## Prevention
266
- - What tests would have caught this?
267
- - Process improvements needed:
268
- - Deployment checklist updates:
269
-
270
- ## Action Items
271
- - [ ] [Action item with owner]
272
- - [ ] [Action item with owner]
273
- ```
274
-
275
- ## Best Practices
276
-
277
- 1. **Practice rollbacks in sandbox** - Don't wait for an emergency to learn the process
278
- 2. **Maintain detailed backups** - Automate metadata and data backups before every deployment
279
- 3. **Use version control tags** - Tag every production deployment for easy identification
280
- 4. **Document everything** - Keep a deployment log with timestamps and decisions
281
- 5. **Communicate proactively** - Keep stakeholders informed throughout the process
282
- 6. **Set time limits** - If rollback takes >2 hours, consider alternative approaches
283
- 7. **Test the rollback** - Validate in sandbox that the rollback process works
284
-
285
- ## Rollback Scripts Repository
286
-
287
- Keep commonly-used rollback scripts in version control:
288
-
289
- ```
290
- scripts/rollback/
291
- ├── rollback-apex.sh # Rollback Apex classes
292
- ├── rollback-lwc.sh # Rollback Lightning Web Components
293
- ├── rollback-flows.sh # Rollback flows and processes
294
- ├── rollback-data.sh # Restore data from backup
295
- └── verify-rollback.sh # Post-rollback verification
296
- ```
297
-
298
- ## Testing Rollback Procedures
299
-
300
- **Quarterly rollback drill**:
301
- 1. Deploy a test change to sandbox
302
- 2. Wait 1 hour
303
- 3. Execute full rollback procedure
304
- 4. Time the process
305
- 5. Document any issues
306
- 6. Update procedures as needed
307
-
308
- This ensures the team is prepared when a real rollback is needed.
@@ -1,207 +0,0 @@
1
- #!/bin/bash
2
- # Metadata validation script for Salesforce deployments
3
- # Checks for common issues before deployment
4
-
5
- set -e
6
-
7
- # Colors for output
8
- RED='\033[0;31m'
9
- YELLOW='\033[1;33m'
10
- GREEN='\033[0;32m'
11
- NC='\033[0m' # No Color
12
-
13
- ERRORS=0
14
- WARNINGS=0
15
-
16
- echo "=========================================="
17
- echo "Salesforce Metadata Validation"
18
- echo "=========================================="
19
- echo ""
20
-
21
- # Check if we're in an SFDX project
22
- if [ ! -f "sfdx-project.json" ]; then
23
- echo -e "${RED}ERROR: Not in an SFDX project directory${NC}"
24
- echo "Please run this script from your project root"
25
- exit 1
26
- fi
27
-
28
- echo "✓ Found SFDX project"
29
- echo ""
30
-
31
- # 1. Check XML format
32
- echo "Checking XML format..."
33
- XML_ERRORS=0
34
-
35
- find force-app -name "*.xml" -o -name "*.object" -o -name "*.layout" | while read file; do
36
- if ! xmllint --noout "$file" 2>/dev/null; then
37
- echo -e "${RED}✗ Invalid XML: $file${NC}"
38
- XML_ERRORS=$((XML_ERRORS + 1))
39
- fi
40
- done
41
-
42
- if [ $XML_ERRORS -eq 0 ]; then
43
- echo -e "${GREEN}✓ All XML files are well-formed${NC}"
44
- else
45
- echo -e "${RED}✗ Found $XML_ERRORS XML errors${NC}"
46
- ERRORS=$((ERRORS + XML_ERRORS))
47
- fi
48
- echo ""
49
-
50
- # 2. Check API versions
51
- echo "Checking API versions..."
52
- MIN_API_VERSION=56.0
53
-
54
- find force-app -name "*.cls-meta.xml" -o -name "*.trigger-meta.xml" | while read file; do
55
- VERSION=$(grep -o '<apiVersion>[0-9.]*</apiVersion>' "$file" | grep -o '[0-9.]*')
56
- if [ -n "$VERSION" ] && (( $(echo "$VERSION < $MIN_API_VERSION" | bc -l) )); then
57
- echo -e "${YELLOW}⚠ Old API version $VERSION in: $file${NC}"
58
- WARNINGS=$((WARNINGS + 1))
59
- fi
60
- done
61
-
62
- echo -e "${GREEN}✓ API version check complete${NC}"
63
- echo ""
64
-
65
- # 3. Check for deprecated features
66
- echo "Checking for deprecated features..."
67
-
68
- # Check for old-style custom settings
69
- DEPRECATED_SETTINGS=$(find force-app -name "*.object-meta.xml" -exec grep -l "customSettingsType>List" {} \; | wc -l)
70
- if [ $DEPRECATED_SETTINGS -gt 0 ]; then
71
- echo -e "${YELLOW}⚠ Found $DEPRECATED_SETTINGS list custom settings (consider Custom Metadata Types)${NC}"
72
- WARNINGS=$((WARNINGS + 1))
73
- fi
74
-
75
- # Check for old Aura components (should migrate to LWC)
76
- AURA_COMPONENTS=$(find force-app -name "*.cmp" | wc -l)
77
- if [ $AURA_COMPONENTS -gt 5 ]; then
78
- echo -e "${YELLOW}⚠ Found $AURA_COMPONENTS Aura components (consider migrating to LWC)${NC}"
79
- WARNINGS=$((WARNINGS + 1))
80
- fi
81
-
82
- echo -e "${GREEN}✓ Deprecation check complete${NC}"
83
- echo ""
84
-
85
- # 4. Check naming conventions
86
- echo "Checking naming conventions..."
87
-
88
- # Check for spaces in API names (not allowed)
89
- SPACE_ERRORS=$(find force-app -name "*.xml" -exec grep -l "fullName>.*\s.*<" {} \; | wc -l)
90
- if [ $SPACE_ERRORS -gt 0 ]; then
91
- echo -e "${RED}✗ Found $SPACE_ERRORS files with spaces in API names${NC}"
92
- ERRORS=$((ERRORS + SPACE_ERRORS))
93
- fi
94
-
95
- # Check for lowercase custom object names (should be PascalCase)
96
- LOWERCASE_OBJECTS=$(find force-app/main/default/objects -name "*.object-meta.xml" -exec basename {} \; | grep -E "^[a-z]" | wc -l)
97
- if [ $LOWERCASE_OBJECTS -gt 0 ]; then
98
- echo -e "${YELLOW}⚠ Found $LOWERCASE_OBJECTS custom objects with lowercase names${NC}"
99
- WARNINGS=$((WARNINGS + 1))
100
- fi
101
-
102
- echo -e "${GREEN}✓ Naming convention check complete${NC}"
103
- echo ""
104
-
105
- # 5. Check for hardcoded IDs or URLs
106
- echo "Checking for hardcoded values..."
107
-
108
- # Check for record IDs (15 or 18 character Salesforce IDs)
109
- HARDCODED_IDS=$(grep -r -E "'[a-zA-Z0-9]{15,18}'" force-app/main/default/classes force-app/main/default/triggers 2>/dev/null | wc -l)
110
- if [ $HARDCODED_IDS -gt 0 ]; then
111
- echo -e "${YELLOW}⚠ Found $HARDCODED_IDS potential hardcoded record IDs in Apex${NC}"
112
- echo " Review and replace with custom settings or custom metadata"
113
- WARNINGS=$((WARNINGS + 1))
114
- fi
115
-
116
- # Check for hardcoded URLs
117
- HARDCODED_URLS=$(grep -r "https://.*\.salesforce\.com" force-app/main/default/ 2>/dev/null | wc -l)
118
- if [ $HARDCODED_URLS -gt 0 ]; then
119
- echo -e "${YELLOW}⚠ Found $HARDCODED_URLS hardcoded Salesforce URLs${NC}"
120
- echo " Consider using Named Credentials or Custom Settings"
121
- WARNINGS=$((WARNINGS + 1))
122
- fi
123
-
124
- echo -e "${GREEN}✓ Hardcoded value check complete${NC}"
125
- echo ""
126
-
127
- # 6. Check meta.xml files
128
- echo "Checking for missing meta.xml files..."
129
-
130
- MISSING_META=0
131
- find force-app -name "*.cls" | while read file; do
132
- if [ ! -f "${file}-meta.xml" ]; then
133
- echo -e "${RED}✗ Missing meta.xml for: $file${NC}"
134
- MISSING_META=$((MISSING_META + 1))
135
- fi
136
- done
137
-
138
- if [ $MISSING_META -eq 0 ]; then
139
- echo -e "${GREEN}✓ All source files have meta.xml files${NC}"
140
- else
141
- echo -e "${RED}✗ Found $MISSING_META missing meta.xml files${NC}"
142
- ERRORS=$((ERRORS + MISSING_META))
143
- fi
144
- echo ""
145
-
146
- # 7. Check for test classes
147
- echo "Checking test coverage..."
148
-
149
- TOTAL_CLASSES=$(find force-app -name "*.cls" | wc -l)
150
- TEST_CLASSES=$(find force-app -name "*Test.cls" -o -name "*_Test.cls" | wc -l)
151
-
152
- if [ $TOTAL_CLASSES -gt 0 ]; then
153
- TEST_RATIO=$(echo "scale=2; $TEST_CLASSES / $TOTAL_CLASSES * 100" | bc)
154
- echo "Test class ratio: $TEST_CLASSES/$TOTAL_CLASSES (${TEST_RATIO}%)"
155
-
156
- if (( $(echo "$TEST_RATIO < 50" | bc -l) )); then
157
- echo -e "${YELLOW}⚠ Low test class coverage (${TEST_RATIO}%)${NC}"
158
- echo " Consider adding more test classes"
159
- WARNINGS=$((WARNINGS + 1))
160
- else
161
- echo -e "${GREEN}✓ Good test class coverage (${TEST_RATIO}%)${NC}"
162
- fi
163
- else
164
- echo "No Apex classes found"
165
- fi
166
- echo ""
167
-
168
- # 8. Check package.xml
169
- echo "Checking package.xml..."
170
-
171
- if [ -f "manifest/package.xml" ]; then
172
- echo -e "${GREEN}✓ Found package.xml${NC}"
173
-
174
- # Validate it's well-formed XML
175
- if xmllint --noout manifest/package.xml 2>/dev/null; then
176
- echo -e "${GREEN}✓ package.xml is valid XML${NC}"
177
- else
178
- echo -e "${RED}✗ package.xml is invalid XML${NC}"
179
- ERRORS=$((ERRORS + 1))
180
- fi
181
- else
182
- echo -e "${YELLOW}⚠ No package.xml found in manifest/ directory${NC}"
183
- WARNINGS=$((WARNINGS + 1))
184
- fi
185
- echo ""
186
-
187
- # Summary
188
- echo "=========================================="
189
- echo "Validation Summary"
190
- echo "=========================================="
191
- echo -e "Errors: ${RED}$ERRORS${NC}"
192
- echo -e "Warnings: ${YELLOW}$WARNINGS${NC}"
193
- echo ""
194
-
195
- if [ $ERRORS -eq 0 ] && [ $WARNINGS -eq 0 ]; then
196
- echo -e "${GREEN}✓ Metadata validation passed!${NC}"
197
- echo "Your metadata is ready for deployment."
198
- exit 0
199
- elif [ $ERRORS -eq 0 ]; then
200
- echo -e "${YELLOW}⚠ Validation passed with warnings${NC}"
201
- echo "Review warnings before deploying."
202
- exit 0
203
- else
204
- echo -e "${RED}✗ Validation failed${NC}"
205
- echo "Fix errors before deploying."
206
- exit 1
207
- fi
@@ -1,78 +0,0 @@
1
- ---
2
- name: salesforce-custom-tab
3
- 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.
4
- ---
5
-
6
- ## When to Use This Skill
7
-
8
- Use this skill when you need to:
9
- - Create tabs for objects, web pages, or Visualforce pages
10
- - Add navigation tabs to applications
11
- - Configure tab visibility and access
12
- - Troubleshoot deployment errors related to custom tabs
13
-
14
- ## Specification
15
-
16
- # CustomTab Metadata Specification
17
-
18
- ## 📋 Overview
19
- Custom tabs for navigating to objects, web content, or Visualforce pages within Salesforce applications.
20
-
21
- ## 🎯 Purpose
22
- - Provide navigation to custom objects
23
- - Link to external web content
24
- - Access Visualforce pages
25
- - Organize application navigation
26
-
27
- ## ⚙️ Required Properties
28
-
29
- ### Core Tab Properties
30
- - **label**: Display name of the tab
31
- - **fullName**: API name of the object (for object tabs)
32
- - **url**: Web URL (for web tabs)
33
- - **page**: Visualforce page name (for Visualforce tabs)
34
-
35
- ## 🔧 Tab Types
36
-
37
- ### Object Tabs
38
- - **Purpose**: Navigate to custom or standard objects
39
- - **Required**: `fullName` property (set to object API name)
40
- - **Example**: `<fullName>CustomObject__c</fullName>`
41
-
42
- ### Web Tabs
43
- - **Purpose**: Link to external websites or web applications
44
- - **Required**: `url` property
45
- - **Example**: `<url>https://example.com</url>`
46
-
47
- ### Visualforce Tabs
48
- - **Purpose**: Access custom Visualforce pages
49
- - **Required**: `page` property
50
- - **Example**: `<page>CustomPage</page>`
51
-
52
- ## 🎨 Tab Configuration
53
-
54
- ### Tab Style
55
- - **Default**: Use standard tab styling
56
- - **Custom**: Can specify custom tab styles if needed
57
-
58
- ### Tab Visibility
59
- - **Default**: Visible to all users with access
60
- - **Custom**: Can be configured for specific user profiles
61
-
62
- ## 📱 Supported Applications
63
- - **Standard Apps**: Available in standard Salesforce applications
64
- - **Custom Apps**: Can be included in custom applications
65
- - **Community Apps**: Available in community applications
66
-
67
- ## 🔗 Integration Points
68
- - **Object Relationships**: Links to related object records
69
- - **Web Content**: External website integration
70
- - **Visualforce Pages**: Custom page functionality
71
- - **Lightning Components**: Modern component integration
72
- ## ✅ Best Practices
73
- - Use clear, descriptive tab labels
74
- - Choose appropriate tab types for functionality
75
- - Consider user experience and navigation flow
76
- - Test tab functionality across different applications
77
- - Ensure proper permissions and visibility settings
78
- - Follow consistent naming conventions