>_ DevTrendsen

Language

Home

Languages

Sections

Frontend Backend Mobile DevOps AI / ML GameDev Blockchain Embedded Security
Python

How to teach Cursor and Claude Code to write properly for Salesforce

If you've tried generating Apex triggers or Lightning Web Components through ChatGPT or standard Cursor, you've likely seen the typical errors. The model mixes up trigger contexts, forgets about SOQL limits inside loops, or assembles XML manifests with outdated API versions. You end up writing massive system prompts and manually attaching documentation snippets to every request.

Salesforce decided to tackle this systematically and released a repository sf-skills. It's a set of ready-made instructions, templates, and executable scripts, packaged according to an open agent skills standard.

sf-skills/
├── skills/               # Директории с конкретными воркфлоу
   ├── platform-apex-generate/
   ├── platform-custom-object-generate/
   ├── automation-flow-generate/
   └── ...
├── samples/              # Примеры приложений
└── scripts/

What are Agent Skills

The format idea is simple. Instead of feeding an LLM long, unstructured text, each skill is organized as a separate folder with a clear architecture:

  • SKILL.md — a required file with instructions and metadata in YAML front matter. It describes when and how the agent should apply this skill.
  • scripts/ — executable scripts in Python, Bash, or JavaScript that the agent can run for validation or artifact generation.
  • references/ — reference materials and documentation summaries for a specific topic.
  • assets/ — ready-made templates, metadata schemas, and mapping tables.

The repository follows the agentskills.io specification. This means the skills aren't hardcoded to the company's internal services. They can be connected to any tool that supports this open format.

How to connect to your editor

If you work in the internal Agentforce Vibes environment, skills are pulled in and updated automatically. For familiar developer tools like Claude Code, OpenCode, or Cursor, connecting takes one terminal command:

npx skills add forcedotcom/sf-skills

The utility downloads the required bundles and registers them in the assistant configuration. After that, the agent understands platform-specific commands and rules without additional clarification in the chat.

What's inside the library

The repository contains workflows for different platform layers.

Server-side code generation includes rules for creating Apex classes, proper SOQL query writing with FLS (Field-Level Security) in mind, and templates for unit tests. The assistant stops generating empty asserts just for line coverage.

For declarative development, there are skills for creating custom objects, fields, and permission sets. The agent assembles valid XML metadata files that can be deployed immediately through Salesforce CLI without manual tag editing.

A separate section is dedicated to automations and interfaces. This includes workflows for creating Flow and Lightning Web Components (LWC), including auxiliary React UI bundles.

The samples folder contains examples of ready-made applications. For instance, a UI bundle template syncs directly with the @salesforce/ui-bundle-template-app-react-sample-b2e npm package via GitHub Actions. You can run synchronization locally:

npm install
npm run sync-react-b2e-sample

What to pay attention to

The project is in active rework. The developers honestly warn in the README: folder structure and skill names may change without backward compatibility. There's no stability guarantees here, unlike what you'd expect from GA Salesforce API releases.

If you fork the repository or make local changes, be prepared to resolve conflicts when updating from upstream. Currently, the project has just under 900 stars on GitHub, but the commit base is updated almost daily.

Is it worth trying

If you regularly write for Salesforce and use AI assistants in the terminal or IDE, the project will definitely save time. You'll no longer have to manually remind the model about the XML structure for Custom Field or explain the rules for writing mock classes for HTTP calls in Apex.

The easiest way to start is by installing via npx skills add in a test project to see how your usual model handles metadata generation with the new instructions.

Related projects