Skip to content

Commit 4965997

Browse files
committed
feat: release 3 new skills: configuring-code-analyzer, managing-cdc-enablement, using-salesforce-archive @W-23038011@
1 parent d289e9e commit 4965997

29 files changed

Lines changed: 4945 additions & 268 deletions

skills/building-sf-integrations/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: building-sf-integrations
3-
description: "Salesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data)."
3+
description: "Salesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), data import/export (use handling-sf-data), or CDC channel-membership metadata such as PlatformEventChannel, PlatformEventChannelMember, or EnrichedField (use managing-cdc-enablement)."
44
metadata:
55
version: "1.1"
66
---

skills/configuring-code-analyzer/SKILL.md

Lines changed: 482 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Code Analyzer Configuration — Apex-focused Project
2+
#
3+
# This file contains ONLY overrides. Code Analyzer's built-in defaults
4+
# handle everything else. Only add entries here that intentionally
5+
# change behavior for your project.
6+
#
7+
# Usage:
8+
# Place at project root as code-analyzer.yml
9+
# Validate: sf code-analyzer config --config-file code-analyzer.yml
10+
11+
# Exclude non-project files (these would otherwise be scanned)
12+
ignores:
13+
files:
14+
- "**/node_modules/**"
15+
- "**/.sfdx/**"
16+
- "**/.sf/**"
17+
- "**/staticresources/**"
18+
19+
# Engine tuning — only override what differs from defaults
20+
engines:
21+
# SFGE: increase heap for projects with 200+ Apex classes
22+
# (built-in default is dynamic/1g, too small for large projects)
23+
sfge:
24+
java_max_heap_size: "4g"
25+
26+
# Rule overrides — promote security, demote noise
27+
rules:
28+
pmd:
29+
# Promote security rules to Critical (default is High)
30+
ApexCRUDViolation:
31+
severity: 1
32+
ApexSOQLInjection:
33+
severity: 1
34+
ApexSharingViolations:
35+
severity: 1
36+
# Demote noisy rules (default is Moderate)
37+
ApexDoc:
38+
severity: 5
39+
# Disable rules that conflict with project conventions
40+
AvoidGlobalModifier:
41+
disabled: true
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# GitHub Actions Workflow — Code Analyzer Quality Gate
2+
#
3+
# Scans pull requests for code quality and security violations.
4+
# Uploads SARIF results to GitHub Code Scanning for inline annotations.
5+
#
6+
# Usage:
7+
# Copy to .github/workflows/code-analyzer.yml in your repository
8+
# Customize severity-threshold and rule-selector as needed
9+
#
10+
# Prerequisites:
11+
# - Repository must have GitHub Advanced Security enabled for SARIF upload
12+
# - Or remove the "Upload SARIF" step for basic artifact-only workflow
13+
14+
name: Code Analyzer
15+
16+
on:
17+
pull_request:
18+
branches: [main, develop]
19+
paths:
20+
- 'force-app/**'
21+
- 'src/**'
22+
- '**/*.cls'
23+
- '**/*.trigger'
24+
- '**/*.js'
25+
- '**/*.ts'
26+
- '**/*.html'
27+
- '**/*.flow-meta.xml'
28+
- 'code-analyzer.yml'
29+
push:
30+
branches: [main, develop]
31+
32+
permissions:
33+
contents: read
34+
security-events: write # Required for SARIF upload
35+
36+
jobs:
37+
code-analysis:
38+
runs-on: ubuntu-latest
39+
timeout-minutes: 30
40+
41+
steps:
42+
- name: Checkout code
43+
uses: actions/checkout@v4
44+
with:
45+
fetch-depth: 0 # Full history for diff-based scans
46+
47+
- name: Set up Node.js
48+
uses: actions/setup-node@v4
49+
with:
50+
node-version: '20'
51+
52+
- name: Set up Java
53+
uses: actions/setup-java@v4
54+
with:
55+
distribution: 'temurin'
56+
java-version: '11'
57+
58+
- name: Install Salesforce CLI
59+
run: npm install -g @salesforce/cli
60+
61+
- name: Install Code Analyzer
62+
run: sf plugins install @salesforce/plugin-code-analyzer
63+
64+
- name: Verify installation
65+
run: |
66+
sf --version
67+
sf plugins --core | grep code-analyzer
68+
java -version
69+
node --version
70+
71+
- name: Run Code Analyzer
72+
run: |
73+
sf code-analyzer run \
74+
--rule-selector Recommended \
75+
--severity-threshold 2 \
76+
--output-file results.sarif \
77+
--output-file results.json \
78+
--output-file results.html \
79+
--config-file code-analyzer.yml
80+
81+
- name: Upload SARIF to GitHub Security
82+
if: always()
83+
uses: github/codeql-action/upload-sarif@v3
84+
with:
85+
sarif_file: results.sarif
86+
category: code-analyzer
87+
88+
- name: Upload Results as Artifact
89+
if: always()
90+
uses: actions/upload-artifact@v4
91+
with:
92+
name: code-analyzer-results
93+
path: |
94+
results.json
95+
results.html
96+
retention-days: 30
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Code Analyzer Configuration — Full-Stack Salesforce Project
2+
#
3+
# This file contains ONLY overrides. Code Analyzer's built-in defaults
4+
# handle everything else. Only add entries here that intentionally
5+
# change behavior for your project.
6+
#
7+
# Usage:
8+
# Place at project root as code-analyzer.yml
9+
# Validate: sf code-analyzer config --config-file code-analyzer.yml
10+
11+
# Exclude non-project files
12+
ignores:
13+
files:
14+
- "**/node_modules/**"
15+
- "**/.sfdx/**"
16+
- "**/.sf/**"
17+
- "**/jest-mocks/**"
18+
- "**/__tests__/**"
19+
- "**/*.min.js"
20+
- "**/staticresources/jquery*"
21+
- "**/staticresources/bootstrap*"
22+
23+
# Engine tuning — only what differs from defaults
24+
engines:
25+
# SFGE: increase heap for large Apex codebases
26+
sfge:
27+
java_max_heap_size: "4g"
28+
# ESLint: use project's existing config for LWC-specific rules
29+
eslint:
30+
auto_discover_eslint_config: true
31+
32+
# Rule overrides — only rules that need project-specific treatment
33+
rules:
34+
pmd:
35+
# Promote security rules (default is High → make Critical)
36+
ApexCRUDViolation:
37+
severity: 1
38+
ApexSOQLInjection:
39+
severity: 1
40+
# Demote noisy documentation rule
41+
ApexDoc:
42+
severity: 5
43+
eslint:
44+
# Demote console warnings in development (default is Moderate)
45+
no-console:
46+
severity: 4
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Code Analyzer Configuration — LWC-focused Project
2+
#
3+
# This file contains ONLY overrides. Code Analyzer's built-in defaults
4+
# handle everything else. Only add entries here that intentionally
5+
# change behavior for your project.
6+
#
7+
# Usage:
8+
# Place at project root as code-analyzer.yml
9+
# Validate: sf code-analyzer config --config-file code-analyzer.yml
10+
11+
# Exclude non-project files and test infrastructure
12+
ignores:
13+
files:
14+
- "**/node_modules/**"
15+
- "**/.sfdx/**"
16+
- "**/.sf/**"
17+
- "**/jest-mocks/**"
18+
- "**/__tests__/**"
19+
- "**/*.min.js"
20+
21+
# Engine tuning
22+
engines:
23+
# ESLint: opt-in to use project's existing ESLint config
24+
# (built-in default is false — Code Analyzer uses its own base configs)
25+
eslint:
26+
auto_discover_eslint_config: true

0 commit comments

Comments
 (0)