Skip to content

Salesforce for developers — Overview

Status: draft. This describes the org’s developer surface based on what exists in production. Actual dev practices — who codes, who deploys, branching model — need to be confirmed with the engineering team before marking current.

PWG’s Salesforce has a substantial custom-code footprint sitting alongside Financial Services Cloud:

Artefact typeCount
Apex classes (total)3,230
Apex classes (custom)156
Apex triggers113
Active Flows271
Flow versions (total)1,611
SObjects (custom)272

LWC, Aura, Custom Metadata Types, Custom Settings counts pending — they are not currently emitted by the automation inventory generator.

The custom-Apex count is small next to the total because the managed packages (FSC, DLRS, and others) contribute the bulk of the 3,230. The 156 custom classes are the code PWG owns and maintains.

  • Apex — business logic, triggers, batch jobs, Invocable methods.
  • SOQL / SOSL — data access.
  • Flow — the strongly-preferred automation surface. 271 active, 1,610 versions. One surviving Workflow Rule.
  • Lightning Web Components — frontend extensions (TODO confirm inventory).
  • DLRS (Declarative Lookup Rollup Summaries) — a managed package used instead of hand-rolling rollup Apex.
DirectoryContents
mcp-server/Read-only MCP server + generator scripts (TypeScript)
mcp-server/src/MCP tools, jsforce helpers, doc generators
mcp-server/scripts/CLI entrypoints — runners for each doc generator
docs/human/Curated narrative docs (federated to Shannon)
docs/dev/Developer-facing curated narrative (this file)
docs/generated/Auto-generated dumps — not federated
analysis/Dated audit reports

This repo does not contain Apex source. It is a documentation and analysis repo that reads the live production org over the MCP. Apex source lives wherever PWG’s deployment pipeline sources it from (TODO confirm — sfdx-project? unpackaged? managed package repo?).

The mcp-server/ is a Node + jsforce + JWT Bearer MCP that exposes read-only Salesforce access to Claude Code. Seven tools are shipped:

ToolWhat it does
soql_querySOQL against any readable object (DML keywords blocked)
tooling_queryTooling API SOQL (ApexClass, Flow, etc.)
describe_globalSObject list, optionally custom-only
describe_objectFields, RTs, child relationships (24h disk cache)
limitsOrg governor limits snapshot
event_log_filesList EventLogFile records
event_log_downloadDownload a specific EventLogFile

All tools enforce read-only at the protocol layer (non-GET REST is rejected). The automation@pwg.com.au user carries only a Claude MCP Read-Only Permission Set — no DML perms regardless.

From mcp-server/:

Terminal window
npm install
export SF_PRIVATE_KEY_PATH=/path/to/server.key
export SF_CONSUMER_KEY=...
export SF_USERNAME=automation@pwg.com.au
export SF_LOGIN_URL=https://partnerswealthgroup.my.salesforce.com
npx tsx scripts/smoke-access.ts # JWT round-trip + whoami
npx tsx scripts/generate-all-docs.ts # Regenerate docs/generated/objects/

See docs/generated/README.md for the full regeneration list.

  • docs/dev/architecture.md — Apex and Flow architecture
  • docs/dev/integrations.md — callout patterns, auth flows
  • docs/dev/admin-procedures.md — deployment, data loads
  • docs/dev/known-issues.md — platform gotchas and limits