VS Code Copilot

Copilot Skills Salesforce: Complete Setup Guide

Copilot skills Salesforce developers use turn GitHub Copilot into a Salesforce AI pair programming assistant that enforces Copilot Apex best practices on every single prompt. In other words, these AI skills for Salesforce — also called custom Copilot instructions — teach your IDE how to write bulkified Apex, secure LWC components, and optimized SOQL. This Salesforce Copilot setup guide walks you through the complete GitHub Copilot Salesforce configuration so that every line of AI-generated code respects governor limits, the Well-Architected Framework, and your team’s standards.

The .github/skills/ folder structure showing SKILL.md and reference files inside VS Code

What Are Copilot Skills Salesforce Developers Use?

In short, Copilot skills are markdown instruction files that live inside your repository’s .github/skills/ folder. When you open VS Code and chat with Copilot, it automatically reads these AI skills for Salesforce and uses them as context. As a result, every response follows your team’s coding standards without any extra effort.

Think of these custom Copilot instructions as a senior developer and a solution architect sitting right inside your IDE. Consequently, they review every line of code before you even see it, catching mistakes that would otherwise reach production.

Here is what the folder structure looks like in practice (Get the github repo here: https://github.com/SalesforceDiariesBySanket/Copilot-Skills-Salesforce):

.github/
├── copilot-instructions.md
└── skills/
    ├── salesforce-developer/
    │   ├── SKILL.md
    │   └── references/
    │       ├── apex-patterns.md
    │       ├── lwc-guide.md
    │       ├── soql-optimization.md
    │       ├── api-integration.md
    │       ├── flows-automation.md
    │       ├── security-sharing.md
    │       ├── deployment-devops.md
    │       ├── agentforce-ai.md
    │       └── formulas-validation.md
    └── salesforce-architect-skill/
        ├── SKILL.md
        └── references/
            ├── data-model-patterns.md
            ├── integration-patterns.md
            └── well-architected-checklist.md

The copilot-instructions.md file at the root ties everything together by telling Copilot which skills exist and where to find them. Furthermore, you do not need to manually trigger anything because Copilot loads the right skill automatically based on your prompt. Meanwhile, every developer who clones the repo inherits the same Salesforce AI coding instructions.

If you are new to Salesforce development tooling, check out our beginner’s guide to Salesforce DX for background context.


How the Developer Skill Enables Salesforce AI Pair Programming

This Copilot skill turns your AI assistant into a true Salesforce AI pair programming partner. It covers Apex, LWC, SOQL, Flows, REST APIs, Agentforce, and deployment. Moreover, it enforces Copilot Apex best practices on every single response your team generates.

What Copilot Apex Best Practices Are Enforced?

Every time you prompt Copilot, the developer skill automatically enforces these rules (You can change it based on what you follow as your coding standard, you can take this skill example as a template to start with):

  • Bulkification — No SOQL or DML inside loops, so triggers handle 200+ records safely.
  • Governor Limits — Stays within 100 SOQL queries, 150 DML statements, 50,000 rows, 10 seconds CPU time, and 6 MB heap.
  • Security — Applies with sharing on classes, WITH SECURITY_ENFORCED in SOQL, and Security.stripInaccessible() for DML.
  • Layered Architecture — Uses a Trigger → Handler → Service → Selector pattern with one trigger per object.
  • Modern CLI — Uses the sf CLI (not the deprecated sfdx) and the latest GA API version 66.0.

In particular, these Copilot Apex best practices prevent the most common AI-assisted Salesforce development mistakes that plague generic coding assistants.

Anti-Pattern List: Stopping AI Hallucinations

The most valuable part of these AI skills for Salesforce is the anti-pattern list. It explicitly tells Copilot what not to generate, which is equally important as telling it what to produce. Below are some of the specific mistakes it blocks:

Anti-Pattern What AI Gets Wrong What the Skill Forces
Non-existent types Uses HashMap, ArrayList, int Uses Map, List, Integer
Missing SOQL fields References a field not in SELECT Includes every referenced field
LWC inline expressions Uses {a + b} in templates Uses JavaScript getters instead
Static vs Instance Calls String.toLowerCase() as static Calls it on an instance correctly
Recursion guard Uses static Boolean Uses static Set<Id> for safety
A bulkified Apex trigger handler generated by Copilot with AI-assisted Salesforce development rules active

Nine Reference Guides for AI-Assisted Salesforce Development

Additionally, the skill ships with nine detailed reference files(you can add more based on your coding standard), and Copilot reads the relevant one based on your prompt:

  1. apex-patterns.md — Triggers, testing, async Apex, JSON handling, and error patterns
  2. soql-optimization.md — Query optimization, dynamic SOQL, Big Objects, and LDV strategies
  3. lwc-guide.md — Components, dynamic LWC, and lazy loading techniques
  4. api-integration.md — REST, Bulk, SOAP, OAuth, and Named Credentials
  5. formulas-validation.md — Formula fields and validation rules
  6. flows-automation.md — Screen Flows, record-triggered Flows, and process automation
  7. security-sharing.md — CRUD/FLS, the sharing model, encryption, and permissions
  8. deployment-devops.md — sf CLI, scratch orgs, CI/CD pipelines, and packaging
  9. agentforce-ai.md — Agentforce agents, Prompt Builder, Platform Events, and CDC

read our post on LLM Mistakes in Apex & LWC: Salesforce Code Generation Rules.


How the Architect Skill Guides Copilot Skills Salesforce Teams Rely On

Writing correct code is only half the battle, so the second of these Copilot skills Salesforce architects value grounds every design decision in the Salesforce Well-Architected Framework — Trusted, Easy, Adaptable.

Well-Architected Design Through AI Skills for Salesforce

The architect skill evaluates each recommendation against three pillars, in priority order:

  1. Trusted — Is the solution secure, compliant, and reliable? This pillar always wins.
  2. Easy — Does it deliver value fast, and is it maintainable over time?
  3. Adaptable — Can it evolve with the business as requirements change?

Because of this, Copilot enforces “Standard Before Custom.” Accordingly, it will recommend Flows, formulas, and validation rules before suggesting custom Apex. In addition, it accounts for Large Data Volumes, data skew, and API limits from day one. Therefore, your Salesforce AI pair programming experience extends beyond code into full solution design.

Built-In Architect Decision Guides

These Copilot agent skills for developers include the same decision guides used by certified Salesforce architects:

  • Record-Triggered Automation — Before-Save Flow vs After-Save Flow vs Apex Trigger
  • Building Forms — Dynamic Forms vs Screen Flows vs OmniStudio vs full LWC
  • Data Integration — Platform Events vs Bulk API vs Salesforce Connect vs Data 360
  • Event-Driven Architecture — Platform Events vs CDC vs Pub/Sub API
  • ALM/DevOps — Change Sets vs CLI vs DevOps Center vs full CI/CD

Architecture Anti-Patterns Blocked Automatically

Similarly to the developer skill, the architect skill blocks poor design decisions before they reach your org:

  • Profile-Centric Security — Forces Permission Sets and Permission Set Groups over Profiles.
  • God Objects — Warns against objects with 500+ fields serving unrelated purposes.
  • Public Read/Write OWD — Always starts with the most restrictive sharing model.
  • Synchronous Bottlenecks — Pushes high-volume processes to Batch, Queueable, or Platform Events.
  • Missing Idempotency — Requires external IDs and upsert on all integration designs.

To learn more about this framework, visit architect.salesforce.com.


Salesforce Copilot Setup: Step-by-Step Configuration

Getting your Salesforce Copilot setup done takes about five minutes. Below is a step-by-step walkthrough of the complete GitHub Copilot Salesforce configuration.

Step 1: First, clone or copy the .github/skills/ folder into your Salesforce DX project root.

Step 2: Next, create a copilot-instructions.md file at .github/copilot-instructions.md that points to both skills:

# Salesforce Developer — GitHub Copilot Instructions

This project uses two Agent Skills:

1. **salesforce-developer** at `.github/skills/salesforce-developer/`
2. **salesforce-architect-skill** at `.github/skills/salesforce-architect-skill/`

Read each skill's SKILL.md and references/ files before generating any Salesforce code.

Step 3: Finally, open VS Code with GitHub Copilot Chat (or use Cursor or Claude Code) and start prompting.

That is it — the entire Salesforce Copilot setup is complete. There is nothing to install, no extension to configure, and no API key to manage. Instead, these custom Copilot instructions are plain markdown files living in your repo. Consequently, every team member who clones the repository automatically gets the same Copilot Apex best practices enforced on their code.


Five Prompts to Test Your AI Skills for Salesforce

Now that your Salesforce Copilot setup is complete, here are five prompts to try immediately. Each one demonstrates how these AI skills for Salesforce handle different scenarios:

  1. “Create an Account trigger handler that updates all related Contact mailing addresses when the Account billing address changes.”
  2. “Design an integration pattern to sync 500,000 Order records daily from SAP into Salesforce.”
  3. “Build an LWC datatable that displays Opportunities with inline editing and calls an Apex controller.”
  4. “Review this Apex class for governor limit violations and security issues.” (paste your code)
  5. “What is the best automation approach for sending a Slack notification when a high-priority Case is created?”

For example, prompt 1 activates apex-patterns.md and enforces Copilot Apex best practices. Meanwhile, prompt 2 pulls from integration-patterns.md and data-model-patterns.md simultaneously. As a result, both AI-assisted Salesforce development responses follow platform standards automatically.


Why Teams Choose Salesforce AI Pair Programming with Copilot

Without these custom Copilot instructions, every developer on your team gets a different quality of output. For instance, one person might receive bulkified code, while another gets SOQL inside a loop. However, Copilot skills Salesforce teams share create a single source of truth for the entire AI-assisted Salesforce development workflow.

On top of that, these AI skills for Salesforce work as living documentation. When Salesforce releases a new API version or deprecates a feature, you simply update the skill files once. After that, every developer benefits instantly — no retraining required. In essence, Salesforce AI pair programming becomes a team-wide standard rather than an individual experiment.

Additionally, Copilot agent skills for developers scale across projects. You can copy the same .github/skills/ folder into every Salesforce DX repo your team maintains. Therefore, custom Copilot instructions Salesforce teams invest in pay dividends across the entire portfolio.


Conclusion

Copilot skills Salesforce developers rely on bridge the gap between generic AI and platform-specific expertise. The Developer Skill handles Copilot Apex best practices like bulkification and security. Meanwhile, the Architect Skill handles solution design using the Well-Architected Framework. Together, they transform Salesforce AI pair programming from a risky experiment into a reliable AI-assisted Salesforce development workflow.

To complete your Salesforce Copilot setup, simply drop the .github/skills/ folder into your next project and start prompting. Have you tried using these AI skills for Salesforce on your team? Share your experience in the comments below!


Happy Coding, Trailblazers!

4 comments

Leave a Reply