agentleFS
SalesforceLabsSalesforceLabs/afls-for-claude/CLAUDE.md

afls-for-claude

CLAUDE.md5 starsChanged 3 months agoApache-2.0View on GitHub

A Claude Code plugin providing AFLS-specific knowledge, templates, tools, skills, and agents for AFLS Customer Engagement implementations. When running inside the Electron app and a user asks to see something in "diagram form", "as a diagram", "visualize this", or similar phrasing, always use Mermaid syntax (` ┌─────────────────────────────────────────────────────────────┐ │ Claude Code │ ├─────────────────────────────────────────────────────────────┤ │ │ │ ┌─────────────────────────────────────────────────────────┐ │ │ │ AFLS-for-Claude (Plugin) │ │ │ ├─────────────────────────────────────────────────────────┤ │ │ │ │ │ │ │ Skills (Auto-invoked) │ Commands (User-invoked) │ │ │…

  • Installs packages

The file

Show its rules and text

We split this CLAUDE.md into the rules it gives an agent

13 rules. About 0 are common, 4 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When connecting to a Salesforce org, follow these rules strictly:

    line 11
  2. Very specific:

    To update an action: Call update_afls_action with the ID or name and the fields to change.

    line 205
  3. Very specific:

    To delete an action: Call delete_afls_action with the ID or name.

    line 206
  4. Very specific:

    To check cache status: Call check_mobile_cache_status.

    line 207
  5. Very specific:

    To enable/disable a feature (e.g., DCR): Call list_trigger_handlers to find the handler, then toggle_trigger_handler to enable/disable it.

    line 219
  6. Very specific:

    To view/modify Admin Console settings: Call list_admin_settings with a category, then update_admin_setting to change values.

    line 220
  7. Distinctive:

    After adding a tab: Verify it appears in Admin Console > Mobile > UI Settings, then regenerate the mobile metadata cache for the tab to …

    line 250
  8. Distinctive:

    When you first use the plugin:

    line 507
  9. Very specific:

    Check setup status: Run /afls:setup-plugin

    line 509
  10. Very specific:

    Select target org: Use set_target_org if you have multiple orgs

    line 512
  11. Very specific:

    New object docs: Add to knowledge/objects/{ObjectName}.md

    line 548
  12. Very specific:

    New patterns: Add to knowledge/patterns/{pattern-name}.md

    line 549
  13. Distinctive:

    Test with real AFLS sandbox when possible

    line 555

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

Claude for AFLS

A Claude Code plugin providing AFLS-specific knowledge, templates, tools, skills, and agents for AFLS Customer Engagement implementations.

Diagram Output — Electron App

When running inside the Electron app and a user asks to see something in "diagram form", "as a diagram", "visualize this", or similar phrasing, always use Mermaid syntax (```mermaid code blocks). The Electron app renders Mermaid diagrams as interactive SVGs with zoom, pan, and fullscreen controls. Do not use ASCII art or plaintext diagrams when Mermaid can represent the content.

Org Selection — IMPORTANT

When connecting to a Salesforce org, follow these rules strictly:

  1. If only one org is authenticated, use it automatically — do not ask the user.
  2. If multiple orgs are authenticated and no target is set, ask the user exactly once which org to use, then call set_target_org with their choice.
  3. Once an org is selected (via set_target_org or auto-detection), NEVER ask again. The choice persists for the entire session. All tools automatically use the selected org.
  4. Do not call check_afls_setup or list_sf_orgs before every operation. Only call them if the user explicitly asks about setup or if a tool returns an authentication error.

Architecture

This is a Claude Code Plugin providing an all-in-one AFLS solution:

┌─────────────────────────────────────────────────────────────┐
│                      Claude Code                             │
├─────────────────────────────────────────────────────────────┤
│                                                              │
│  ┌─────────────────────────────────────────────────────────┐ │
│  │              AFLS-for-Claude (Plugin)                     │ │
│  ├─────────────────────────────────────────────────────────┤ │
│  │                                                          │ │
│  │  Skills (Auto-invoked)    │   Commands (User-invoked)   │ │
│  │  ─────────────────────    │   ─────────────────────────  │ │
│  │  • afls-implementation     │   • /afls:setup-plugin        │ │
│  │  • afls-troubleshoot       │   • /afls:soql-query               │ │
│  │  • salesforce-query       │   • /afls:describe            │ │
│  │  • afls-data-model         │   • /afls:help                │ │
│  │                           │   • /afls:docs                │ │
│  │                           │                              │ │
│  │  Agents (Subagents)       │   MCP Server (Tools)         │ │
│  │  ─────────────────────    │   ───────────────────────── │ │
│  │  • afls-consultant         │   • AFLS knowledge tools      │ │
│  │  • afls-admin              │   • Salesforce org tools     │ │
│  │  • afls-developer          │   • SOQL, CRUD, metadata     │ │
│  │                           │                              │ │
│  └─────────────────────────────────────────────────────────┘ │
│                           │                                  │
│                           ▼                                  │
│                    Salesforce CLI (sf)                       │
│                           │                                  │
│                           ▼                                  │
│                  Your AFLS Salesforce Org                     │
└─────────────────────────────────────────────────────────────┘

Plugin Components

Skills (Claude auto-invokes based on context)

SkillDescription
afls-implementationGuides module implementations with best practices
afls-implementation-reviewReviews an implementation/design against field-observed anti-patterns (sharing model, sample/inventory, mobile sync, over-customization, territory, MDM, Agentforce, UAT/go-live discipline) — proactively flags known-bad decisions before go-live
afls-troubleshootDiagnoses and resolves AFLS issues
afls-mobile-validationValidates mobile app configuration (DB Schema, sync settings)
afls-home-page-configurationGuides home page setup for web and mobile apps
afls-quick-actions-configurationGuides quick actions and custom actions setup for web and mobile
afls-visit-managementGuides visit management configuration for web and mobile
afls-sample-managementGuides sample inventory and sample limits configuration
afls-account-managementGuides account management configuration (addresses, affiliations, licenses, DCR, search)
afls-activity-planGuides activity plan configuration (account goals, weighted goals, shared goals, batch jobs, measures)
afls-territory-alignmentGuides territory alignment configuration (explicit assignments, geo rules, affiliation rules, batch jobs)
afls-user-managementGuides user provisioning, permission sets, PSLs, profiles, role hierarchy, and license capacity
afls-key-account-managementGuides KAM account plans, goal definitions, action plan templates, stakeholders, and participants
afls-lists-filtersGuides account lists, dynamic filters, static lists, advanced filters, and bulk actions configuration
afls-field-emailGuides field email setup — templates, jobs, queue, consent integration, and mobile requirements
afls-intelligent-contentGuides CLM/presentation management — upload, distribution, tracking, and presentation settings
afls-calendar-tot-routineGuides calendar, Time Off Territory, routines, and Planner Administration configuration
afls-surveysGuides survey configuration and usage — sharing, launch points, and response tracking
afls-product-managementGuides product hierarchy, territory alignment, messages/objectives, and account restrictions
afls-app-alertsGuides app alerts and notifications — creation, territory targeting, deep links, and alert types
afls-next-bestGuides NBC/NBA/NBM configuration — data model, widgets, Einstein Studio integration
afls-consent-managementGuides consent capture, communication subscriptions, channels, and compliance snapshots
afls-agentforceGuides Agentforce for AFLS (Winter '26) — Field Sales Agent, topics, actions, and Einstein Studio
afls-events-managementGuides Events Management configuration — Managed Events, speaker events, participants, resources, budgets, stage paths
afls-custom-scriptsGuides custom script configuration for validation, checklists, and Visit Action Validation (IIFE patterns, CodeText, Locker Service gotchas)
salesforce-queryHelps construct and execute SOQL queries
afls-mobile-app-settingsManages mobile Application Settings (default browser, password, search, notifications, dynamic actions)
afls-db-schemaManages DB Schema records (mobile object sync configuration, SOQL filters, enable/disable objects)
afls-briefingsGuides Briefings (Daily Podcasts) configuration and troubleshooting
afls-data-modelExpert knowledge of the AFLS data model
afls-health-checkGuides org health assessment and configuration verification
afls-data-migrationGuides data loading and migration (account hierarchies, territory assignments, Veeva CRM migration)
afls-config-migrationGuides configuration migration between orgs (export → diff → selective import of admin settings, DB Schema, trigger handlers, actions; create + update-only safe apply)
afls-demo-data-loadingGuides loading demo data into AFLS orgs (territories, accounts, HCPs, NPIs, contact points, PATI/PATS, business licenses, therapy-area scenarios, localization)
afls-integration-patternsGuides integration patterns (MDM, ERP, IQVIA, email providers, video platforms)
afls-reporting-analyticsGuides CRM Analytics, reports, dashboards, and KPI configuration

Commands (User-invoked with /afls:command)

CommandDescription
/afls:setup-pluginCheck plugin status and connect to Salesforce org
/afls:soql-queryRun a SOQL query against your org
/afls:describeDescribe a Salesforce object's fields
/afls:helpSearch the AFLS knowledge base by topic
/afls:docsBrowse and navigate AFLS documentation by category
/afls:validate-mobileValidate mobile app configuration for deployment
/afls:generate-metadata-cacheGenerate mobile metadata cache programmatically
/afls:auditAudit mobile configuration against best practices
/afls:configure-home-pageInteractive wizard to configure and validate home page
/afls:configure-quick-actionsInteractive wizard to configure quick and custom actions
/afls:configure-visitsInteractive wizard to configure and validate visit management
/afls:configure-samplesInteractive wizard to configure and validate sample management
/afls:configure-accountsInteractive wizard to configure and validate account management
/afls:configure-activity-planInteractive wizard to configure and validate activity plans
/afls:configure-territoryInteractive wizard to configure and validate territory alignment
/afls:configure-usersInteractive wizard to configure and validate user management
/afls:configure-custom-scriptsInteractive wizard to configure and validate custom scripts for validation
/afls:open-orgOpen the Salesforce org in the browser
/afls:diff-orgsCompare configuration between two Salesforce orgs
/afls:health-checkRun a comprehensive AFLS org health check
/afls:release-notesView AFLS release notes by Salesforce release
/afls:export-configExport AFLS org configuration as JSON
/afls:import-configImport AFLS configuration from JSON export
/afls:statusView a dashboard of the connected AFLS org
/afls:configure-briefingsInteractive wizard to configure and validate Briefings (Daily Podcasts)
/afls:diagnose-briefingsDiagnose why Briefings isn't working — validates toggle, permissions, flows, DB Schema
/afls:getting-startedInteractive onboarding — check setup, discover capabilities, get started
/afls:launch-appBuild (first run) and launch the AFLS Assistant desktop app (Electron)

Agents (Specialized subagents)

AgentDescription
afls-consultantSenior implementation consultant for complex projects
afls-adminAdministrator for day-to-day operations
afls-developerDeveloper for OmniStudio and custom development
afls-docs-researcherSearches live official Salesforce Help documentation for AFLS setup, features, and admin configuration

Target Users

  • Consultants: Implementing AFLS for new customers, need guidance on best practices
  • Developers: Building custom functionality and integrations on AFLS
  • Administrators: Managing operations, troubleshooting, and optimizing implementations

MCP Server Tools

The plugin includes an MCP server that provides these tools:

Knowledge & Documentation Tools

ToolDescription
list_afls_modulesList all 28 AFLS4CE modules with documentation
get_afls_module_docsGet detailed documentation for a specific module
search_afls_knowledgeSearch across all documentation for topics/terms
explain_afls_conceptGet explanation of AFLS concepts (ARC, Sample Limits, etc.)
get_afls_admin_setupGet admin configuration guidance for a feature
list_afls_help_docsList all available documentation (help, guides, exercises, troubleshooting)
get_afls_help_docGet official Salesforce help documentation for a topic
get_afls_guideGet guide documentation (developer guide, mobile setup)
get_afls_troubleshootingGet common issues and troubleshooting documentation
get_afls_exerciseGet hands-on exercise documentation

Salesforce Org Tools

ToolDescription
check_afls_setupCheck if SF CLI is installed and orgs are authenticated
install_sf_cliInstall Salesforce CLI via npm (with user consent)
list_sf_orgsList all authenticated Salesforce orgs
set_target_orgSet which org to use for operations
open_orgOpen the target org in the browser, optionally to a specific page path
run_soqlExecute SOQL queries against the target org
describe_sobjectGet object metadata (fields, types, etc.)
get_recordRetrieve a specific record by ID
create_recordCreate a new record
update_recordUpdate an existing record
delete_recordDelete a record
generate_mobile_metadata_cacheGenerate mobile metadata cache for specified profiles
upload_presentationUpload a presentation (.pptx, .pdf, or .zip files) to AFLS Intelligent Content. Auto-detects format: PPTX converts via LibreOffice, PDF uploads directly, HTML ZIPs are validated and uploaded as pages. All formats use the Bulk Presentation API.
distribute_presentationDistribute a presentation to territories. Creates PresentationShare records with territory Group IDs (TerritoryAndSubordinates for cascading).
assign_presentation_contentAssign topics to a presentation and/or products to its pages. Creates TopicAssignment and PresentationPageProduct records.
diff_orgsCompare AFLS configuration between two orgs. Compares trigger handlers, admin settings, DB Schema, and actions to identify configuration drift.

CRITICAL — Presentation language interpretation:

  • "associate with X" / "link to X" / "tag with X" → X is a Topic name. Search Topic object, then call assign_presentation_content with topicNames. NEVER search Territory2 for this.
  • "give access to [person]" / "grant access to [person]" → Look up the person's territory via UserTerritory2Association, then call distribute_presentation with that territory ID.
  • "distribute to [territory]" → Call distribute_presentation directly with the territory ID.

AFLS Action Tools

CRITICAL: These are the ONLY tools that work for AFLS actions. NEVER use run_soql, Bash, delete_record, or create_record for actions.

ToolDescription
list_afls_actionsList Quick Actions and Custom Actions via Tooling API (includes IDs, profiles)
create_quick_actionCreate a Quick Action (Email, NewVisit, LogCall, etc.)
create_custom_actionCreate a Custom Action (URL, App, Utterance)
update_afls_actionUpdate an existing Quick/Custom Action (label, fields, profiles, active status)
delete_afls_actionDelete a Quick Action or Custom Action by ID or name
check_mobile_cache_statusCheck mobile metadata cache status

NEVER use run_soql to query actions or cache status. These objects DO NOT EXIST:

  • LifeSciCustomAction__mdt, CustomAction__c, QuickAction__mdt, LifeSciConfigType__c
  • MobileMetadataCache__c, MobileApplicationDetail, lsc4ce__MobileMetadataCache__c

To update an action: Call update_afls_action with the ID or name and the fields to change. To delete an action: Call delete_afls_action with the ID or name. To check cache status: Call check_mobile_cache_status.

Admin Console & Trigger Handler Tools

ToolDescription
list_trigger_handlersList trigger handlers and their active/inactive status
toggle_trigger_handlerEnable or disable a specific trigger handler by DeveloperName
list_admin_settingsList Admin Console settings by category with field values
update_admin_settingUpdate an existing Admin Console setting or field value
create_admin_settingCreate a new Admin Console setting with field values

To enable/disable a feature (e.g., DCR): Call list_trigger_handlers to find the handler, then toggle_trigger_handler to enable/disable it. To view/modify Admin Console settings: Call list_admin_settings with a category, then update_admin_setting to change values.

NEVER use run_soql, get_record, or describe_sobject for Admin Console settings (including DbSchema records). These are Tooling API entities (LifeSciConfigRecord, LifeSciConfigFieldValue, LifeSciConfigCategory) — they do NOT exist in standard SOQL. Always use list_admin_settings, update_admin_setting, and create_admin_setting instead. list_admin_settings already returns complete record details including all field values — there is no need to call get_record for additional information.

DbSchema Tools

ToolDescription
list_db_schemaList all DB Schema records with SObject, Type, Active, SOQL filter, sync direction
get_db_schemaGet full details of a DB Schema record (field values + profile assignments)
create_db_schemaCreate a new DB Schema record with correct data types (OBJECT, LONGTEXT, FIELD, etc.)
update_db_schemaUpdate a DB Schema record's fields (whereSoql, oneWaySync, attachments, etc.)
toggle_db_schemaEnable or disable a DB Schema record (IsActive toggle)

Use these dedicated tools instead of the generic list_admin_settings/update_admin_setting/create_admin_setting for DbSchema records. The generic tools work but the dedicated tools handle all 7 data types (TEXT, INTEGER, PICKLIST, BOOLEAN, LONGTEXT, OBJECT, FIELD) correctly and provide a better interface.

NEVER use run_soql, get_record, or describe_sobject for DbSchema records. These are Tooling API entities (LifeSciConfigRecord, LifeSciConfigFieldValue) — they do NOT exist in standard SOQL.

CORRECT field names: SObject, Type, WhereSoql, DeltaDateField, OneWaySync, AttachmentsSupport, MandatoryFields. WRONG field names (DO NOT USE): EntityType, SOQLFilterCondition, DeltaSyncDateField, WebToMobileSync, AttachmentDownloadMethod.

Navigation Tab Tools

ToolDescription
list_navigation_tabsList mobile navigation tabs configured in Admin Console > Mobile > UI Settings
add_navigation_tabAdd a new navigation tab to AFLS Mobile with label, tab name, order, and profile assignments

Navigation tabs are stored as LifeSciConfigRecord records (Tooling API) in the "UISchema" category. Use these dedicated tools rather than list_admin_settings/create_admin_setting for tab management.

After adding a tab: Verify it appears in Admin Console > Mobile > UI Settings, then regenerate the mobile metadata cache for the tab to appear in the iPad app.

Visit Management Tools

ToolDescription
check_visit_configCheck Visit Management configuration (record types, settings, compliance, territory info, mobile cache)
add_visit_engagement_sidebar_itemAdd a custom object as a related list on a Visit page layout so it appears in the visit engagement sidebar on mobile. Retrieves the layout XML, inserts the related list, and deploys it back.

CORRECT object names: Visit, ProviderVisit, ProviderVisitProdDetailing, ProviderVisitProdDiscussion, ProviderAcctTerritoryInfo, ComplianceStatementDef. WRONG names (DO NOT USE): Visit__c, ProviderVisit__c, VisitSetting__c, VisitConfiguration__mdt, VisitRecordType__c, VisitType__c.

Sample Management Tools

ToolDescription
check_sample_configCheck Sample Management configuration (products, inventory, locations, batches, limits, mobile cache)

CORRECT object names: Product2, LifeSciMarketableProduct, Location, ProductionBatch, ProductItem, ProductBatchItem, InventoryOperation, ProductRequest, InventoryCountAssessment, ProductDisbursement, ProviderSampleLimit. WRONG names (DO NOT USE): SampleTransaction__c, SampleInventory__c, SampleLimit__c, SampleProduct__c, SampleLot__c.

Account Management Tools

ToolDescription
check_account_configCheck Account Management configuration (accounts, providers, addresses, licenses, affiliations, DCR, mobile cache)

CORRECT object names: Account, HealthcareProvider, ContactPointAddress, BusinessLicense, ProviderAffiliation, ProviderAcctTerritoryInfo, LifeSciDataChgDefMngFld, UserAdditionalInfo. WRONG names (DO NOT USE): HealthcareProvider__c, ContactPointAddress__c, BusinessLicense__c, ProviderAffiliation__c, AccountAddress__c.

Activity Plan Tools

ToolDescription
check_activity_plan_configCheck Activity Plan configuration (time periods, plans, territories, goals, measures, product goals, mobile cache)
check_briefings_configCheck Briefings (Daily Podcasts) configuration (toggle, permissions, flows, content definitions, DB Schema, mobile cache)

CORRECT object names: ActivityPlan, ActivityPlanTerritory, TimePeriod, ProviderActivityGoal, ProviderActivityGoalMeasure, PrvdActvtyGoalMeasureProdt, ProviderAcctTerritoryInfo. WRONG names (DO NOT USE): ActivityPlan__c, ProviderActivityGoal__c, AccountGoal__c, TimePeriod__c, GoalMeasure__c.

Territory Alignment Tools

ToolDescription
check_territory_configCheck Territory Alignment configuration (territory model, territories, explicit assignments, geo rules, affiliation rules, ProviderAcctTerritoryInfo)

CORRECT object names: Territory2, Territory2Model, ObjectTerritory2Association, TerritoryGeoAssignmentRule, TerritoryProviderAffiliationAlignmentRule, ProviderAcctTerritoryInfo. WRONG names (DO NOT USE): AccountTerritory__c, TerritoryAssignment__c, TerritoryInfo__c, AffiliationAlignmentRule__c, ZipTerritory__c.

User Management Tools

ToolDescription
check_user_configCheck user management configuration (package licenses, PSL capacity, permission set assignments, profiles, roles, territory-user associations)
list_usersList active users with filters (by profile, permission set, territory, or find users without territories/PSLs)
list_permission_setsList AFLS permission sets and PSLs with assignment counts and capacity
assign_permission_setAssign a permission set to one or more users by label/API name
unassign_permission_setRemove a permission set assignment from one or more users

CORRECT object names: User, Profile, UserRole, PermissionSet, PermissionSetAssignment, PermissionSetLicense, PermissionSetLicenseAssign, UserTerritory2Association, PackageLicense. WRONG names (DO NOT USE): User__c, UserProfile__c, PermissionSetAssignment__c, PSLAssignment__c, LicenseAssignment__c, UserTerritory__c, RoleHierarchy__c.

Validation & Audit Tools

ToolDescription
audit_mobile_configRun automated checks against validation rules to identify misconfigurations
list_validation_groupsList available validation groups (mobile-login-check, pre-deployment, etc.)
diagnose_afls_issueFind validation rules matching a specific error message or symptom

Health Check & Status Tools

ToolDescription
health_checkRun a comprehensive AFLS org health check (trigger handlers, PSLs, territory model, DB Schema, mobile cache)
get_org_statusGet a single dashboard view of the connected AFLS org (packages, features, territory model, user count)
export_configExport AFLS configuration (Admin Console settings, DB Schema, trigger handlers, actions) as JSON
import_configImport AFLS configuration from a snapshot into a target org. Diff-driven, create + update-only (safe). Modes: report (diff summary, default), ui (local browser review/apply UI on 127.0.0.1 with checkboxes + live progress), apply (headless apply of a selection). Auto-backs-up the target first; never deletes/deactivates target-only records
get_release_notesGet AFLS release notes for a specific Salesforce release (Spring '26, Winter '26, etc.)

Developer & Integrator Tools

ToolDescription
run_apexExecute anonymous Apex code against the target org (batch jobs, data fixes, testing)
bulk_create_recordsCreate multiple records from a JSON array (seed data loading)
bulk_update_recordsUpdate multiple records from a JSON array (bulk data fixes)
deploy_metadataDeploy metadata from a local source directory to the target org
retrieve_metadataRetrieve metadata from the target org to a local directory

Resources

ResourceDescription
afls://modulesList of all modules with documentation counts
afls://overviewOverview of AFLS4CE capabilities and architecture

Prompts

PromptDescription
afls_implementation_checklistGenerate implementation checklist for a module
afls_troubleshootGet help troubleshooting an AFLS issue

AFLS4CE Modules (with Documentation)

ModuleCoverageKey Topics
Account Management✅ FullProvider Card, Addresses, Affiliations, Ratings, Search/SBC, Data Change Requests, Business Licenses, Multi-Object Component
Visit Management✅ FullPage Layout Config, Admin Console, Web & Mobile demos
Sample Management✅ FullInventory, Sample Limits Admin Setup
Activity Plan✅ FullAccount Goals, Weighted Plans, Product-based Plans, Shared Territory Goals, Admin Console
Territory Alignment✅ AdminAdmin configuration and setup
User Management✅ FullPermission sets, PSLs, profiles, role hierarchy, license capacity, user provisioning
Consent Management✅ DemoDemo talk track
Lists & Filters✅ FullTranscript available
Field Email✅ FulliPad, Web Admin, Web End User
Intelligent Content✅ FullContent Management Admin, Presentation Settings, Dynamic Content, Mobile End User
Home Page✅ FullHome Page configuration
Calendar/TOT/Routine✅ FullCalendar, Time Off Territory, Routines, My Team
Surveys✅ FullSurvey configuration
Product Management✅ FullProduct setup and management
App Alerts/Notifications✅ FullAdmin + End User
Next Best (NBC/NBA/NBM)✅ FullNext Best Customer, Action, Message
Key Account Management✅ FullKAM Account Plans (Web & Mobile), E2E Demo
Segmentation✅ AdminAdmin-only configuration
Workflow Management✅ DemoGeneric workflow
Agentforce for AFLS✅ Winter'26Agentforce enablement
Data Cloud/Singularity✅ DemoTabNext Metrics, NBC Predictive Model
AFLS Apps✅ DemoApp configuration
Briefings (Daily Podcasts)✅ FullSetup, troubleshooting, mobile config, DB Schema, validation rules
Mobile Metadata Cache✅ FullProgrammatic generation, DB Schema configuration, DB Schema record management
Starter Config✅ FullLSStarterConfig — bulk-configure trigger handlers, admin settings, DB Schema in one shot (Spring '26)
Custom Scripts✅ FullValidation + checklist LWC patterns, IIFE/CodeText conventions, Locker Service gotchas, Visit Action Validation

Recent Additions (Jun 2026)

AFLS4CE Value Chain Training (Engineering → Support, 15 sessions, 18 files) — Deep support-engineering content spanning Feb 2026 → Jun 2026 across 14 modules. Topics: Sync internals, Search Before Create (internal + OneKey), Medical Inquiry multi-entity setup, KAM Account Plan deep dive, Consent Management proof + filtering, Quick & Custom Actions (Spring '26 + evergreen config guide), Validations via Custom Scripts, LSStarterConfig, Territory Alignment Jobs, Activity Plan, Activity Timeline, Visit Management (configuration + troubleshooting + side menu), Intelligent Content, Generic Workflow. Files use the support-engineering-* prefix (evergreen) or release-260-* (Spring '26-specific). Two new modules introduced: starter-config/, custom-scripts/.

Technical Components

  • Data Model: Industry objects (PersonAccount, Address, Affiliation, etc.)
  • OmniStudio: FlexCards, OmniScripts, DataRaptors, Integration Procedures (web app only — NOT available in AFLS Mobile/iPad)
  • Business Rules Engine: Validation, calculations, automation
  • Analytics: Reports, dashboards, CRM Analytics templates

CRITICAL: AFLS Mobile Constraints

  • OmniStudio components (FlexCards, OmniScripts, DataRaptors) are NOT available anywhere in the AFLS Mobile app (iPad). NEVER suggest OmniStudio as a solution for mobile customization. OmniStudio is only available on the web app.

Project Structure

AFLS-for-Claude/
├── .claude-plugin/           # Plugin manifest
│   └── plugin.json           # Plugin metadata (name, version, etc.)
├── skills/                   # Agent Skills (auto-invoked by Claude)
│   ├── afls-implementation/
│   │   └── SKILL.md
│   ├── afls-troubleshoot/
│   │   └── SKILL.md
│   ├── afls-mobile-validation/
│   │   └── SKILL.md          # Mobile/iPad app configuration validation
│   ├── salesforce-query/
│   │   └── SKILL.md
│   └── afls-data-model/
│       └── SKILL.md
├── commands/                 # User-invocable slash commands
│   ├── setup-plugin.md       # /afls:setup-plugin
│   ├── soql-query.md         # /afls:soql-query
│   ├── describe.md           # /afls:describe
│   ├── help.md               # /afls:help
│   ├── docs.md               # /afls:docs
│   ├── validate-mobile.md    # /afls:validate-mobile
│   ├── generate-metadata-cache.md  # /afls:generate-metadata-cache
│   ├── audit.md              # /afls:audit
│   └── open-org.md           # /afls:open-org
├── agents/                   # Specialized subagents
│   ├── afls-consultant.md     # Implementation consultant
│   ├── afls-admin.md          # Administrator
│   └── afls-developer.md      # Developer
├── .mcp.json                 # MCP server configuration
├── CLAUDE.md                 # This file
├── package.json              # Dependencies
├── tsconfig.json             # TypeScript config
├── src/                      # MCP server source
│   ├── index.ts              # MCP server entry point
│   ├── knowledge-loader.ts   # Knowledge base loader and search
│   ├── salesforce/           # Salesforce org integration
│   │   ├── index.ts          # Module exports
│   │   ├── cli.ts            # SF CLI wrapper
│   │   └── auth.ts           # Org detection, selection
│   └── validation/           # Configuration validation system
│       ├── index.ts          # Module exports
│       ├── rules-loader.ts   # YAML rule file parser
│       └── rules-executor.ts # Rule execution engine
├── scripts/
│   ├── process-docs.sh       # Convert .docx to markdown (calls process-pdfs.sh)
│   └── process-pdfs.sh       # Convert PDFs to markdown
├── documentation/            # Source documentation
│   ├── pm enablement materials/  # PM enablement (.docx files)
│   ├── official help documentation/  # Salesforce help PDFs (served live via MCP, not bundled)
│   ├── hands-on exercises/   # Training exercises (2 PDFs)
│   ├── life_sciences_dev_guide.pdf  # Developer guide (27MB)
│   ├── SE AFLS Mobile Setup and Configuration Guide.pdf  # Mobile setup (7.6MB)
│   └── common_issues.md      # Troubleshooting guide
├── knowledge/                # Processed knowledge base (markdown)
│   ├── modules/              # PM enablement content (28 module directories)
│   ├── help/                 # Official help served live via salesforce-docs MCP (not bundled)
│   ├── guides/               # Dev guide, mobile setup guide (2 files)
│   ├── exercises/            # Hands-on training (2 files)
│   ├── troubleshooting/      # Common issues (1 file)
│   └── validation-rules/     # Configuration validation rules
│       ├── _schema.yaml      # Rule format documentation
│       └── mobile-config.yaml # Mobile configuration rules (15 rules)
└── dist/                     # Compiled JavaScript

Installation & Usage

Prerequisites

  • Node.js 18+
  • Claude Code 1.0.33 or later
  • Salesforce CLI (auto-installed if missing)

Build the Plugin

npm install
npm run build

Load as a Plugin

Option 1: Development mode (recommended for testing)

claude --plugin-dir /path/to/AFLS-for-Claude

Option 2: Add to a marketplace for distribution See Claude Code Plugin Marketplaces

Available Commands

Once loaded, you can use:

  • /afls:setup-plugin - Check setup and connect to Salesforce
  • /afls:soql-query <soql> - Run a SOQL query
  • /afls:describe <object> - Describe a Salesforce object
  • /afls:help <topic> - Search AFLS documentation by topic
  • /afls:docs - Browse AFLS documentation by category

Available Agents

Invoke specialized agents with /agents:

  • afls:afls-consultant - Implementation consulting
  • afls:afls-admin - Administration tasks
  • afls:afls-developer - Development tasks

Salesforce Org Setup

When you first use the plugin:

  1. Check setup status: Run /afls:setup-plugin
  2. Install SF CLI (if needed): The plugin offers to install it
  3. Authenticate to your org: sf org login web --alias my-afls-org
  4. Select target org: Use set_target_org if you have multiple orgs
┌─────────────────────────────────────────────────────────────┐
│                    Plugin Setup Flow                         │
├─────────────────────────────────────────────────────────────┤
│  1. Check if SF CLI exists                                  │
│     ├─ Yes → Check for authenticated orgs                   │
│     └─ No  → Offer to install via npm                       │
│                                                              │
│  2. Check for authenticated orgs                            │
│     ├─ Found → Auto-select or let user choose               │
│     └─ None  → Guide through sf org login web               │
│                                                              │
│  3. Ready to use!                                           │
│     • Use /afls:* commands                                   │
│     • Query AFLS data                                        │
│     • Get implementation guidance                           │
└─────────────────────────────────────────────────────────────┘

Development

npm run dev      # Run with hot reload
npm run test     # Run tests
npm run lint     # Lint code

Development Guidelines

Code Style

  • TypeScript with strict mode
  • ESLint + Prettier for formatting
  • Conventional commits for version control

Adding New Content

  1. New object docs: Add to knowledge/objects/{ObjectName}.md
  2. New patterns: Add to knowledge/patterns/{pattern-name}.md
  3. New tools: Implement in src/tools/ and register in src/index.ts

Testing

  • Unit tests for all tools
  • Validate documentation accuracy against Salesforce docs
  • Test with real AFLS sandbox when possible

Resources

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.