Skip to main content
Karen Fidelak (Salesforce) ๋‹˜์ด Agentforce Vibes์— ๊ธ€์„ ์˜ฌ๋ ธ์Šต๋‹ˆ๋‹ค

๐Ÿš€ New in Agentforce for Developers: Custom AI Code Generation Rules

๐Ÿง ๐Ÿ’ป 

 

One of the most common pieces of feedback we've heard from you is:

 

Starting today, you can fix that. โœจ Weโ€™re excited to introduce

AI Customization Rules in Agentforce for Developers - a new way to tailor how the Dev Assistant generates Apex and LWC code based on your

projectโ€™s standards and preferences. 

 

๐Ÿงฉ Whatโ€™s new?

You can now define coding patterns, architectural guidance, or file-specific preferences in a version-controlled rules.md file, located at: .sfdx/a4d/rules/yourRules.md

 

Each rule lets you:

  • Describe when and why it applies
  • Specify what file types it should affect (like .cls, .js, or .html)
  • Give detailed instructions the AI should follow when generating code

๐Ÿ”ง Why it matters

You get:

  • More relevant, customized AI code suggestions
  • Better alignment with your team's architecture and naming conventions
  • Less manual rework of generated code

๐Ÿ’ก Example Use Cases

  • Want to enforce consistent test scaffolding in LWC? Add a rule.
  • Have naming or structure conventions for JS files? You're covered.

# Rule: Apex Naming Conventions

**Description:** Enforce naming guidelines for Apex classes and methods.

**Applies to:** `**/*.cls`

**Guidelines:**

- Class names must be in PascalCase

 

๐Ÿ› 

How to get started

  1. Create the .sfdx/a4d/rules/yourRules.md file in your project
  2. Add one or more rules using the format above
  3. Thatโ€™s it! The AI will automatically use matching rules whenever it generates code

๐Ÿ“ For now, rules are managed manually - but stay tuned: weโ€™re working on further UX to help you create rules more easily right inside VS Code.

0/9000