Rules

Rules are persistent instructions that the agent follows in every interaction. They encode standards that should always apply—coding conventions, architectural constraints, safety guardrails—so you don’t have to repeat them in every prompt. Unlike Skills (which activate on-demand), Rules are always active.

The Rules panel groups rules by scope:

  • Project—rules scoped to your current workspace, stored in .vibes/rules/. Commit them to version control so the whole team shares the same standards.
  • Global—rules that apply across all your workspaces regardless of project.
  • Salesforce—built-in rules that ship with Agentforce Vibes for core behavioral guidelines and safety.

Examples of included Salesforce rules:

RuleDescription
a4v-expert-global-ruleCore Agentforce Vibes behavioral guidelines
production-guardrailsSafety constraints for production org operations
metadata-best-practicesMetadata retrieval and deployment standards

The full list of Salesforce rules appears in the Toolkit panel.

  1. Open the Agentforce Vibes panel and click the Toolkit tab.
  2. Click Rules.

The panel shows all rules with a toggle to enable or disable each one. Click the menu next to a rule to edit or delete it.

  1. Click + Add Rule in the Rules panel.
  2. Enter a Name in kebab-case (for example, apex-naming-conventions).
  3. Select a Scope: Project or Global.
  4. Select an Application mode:
    • Always—the rule applies to every interaction.
    • File pattern—the rule applies only when the agent works with files that match a glob pattern (for example, **/*.cls).
  5. Write the content in markdown—the rule instructions that the agent should follow.
  6. Click Add Rule.

For example, a rule that enforces Apex naming standards:

  • Name: apex-naming-conventions
  • Scope: Project
  • Application: File pattern (**/*.cls)
  • Content: Class names use PascalCase. Method names use camelCase. Test classes end with "Test" suffix. Constants use SCREAMING_SNAKE_CASE.

The agent applies this rule automatically whenever it generates or modifies .cls files.

Rules support two application modes that control when the agent applies them:

  • Always—the rule is active in every interaction regardless of what files are involved. Use for broad standards like “never deploy to production without running tests.”
  • File pattern—the rule activates only when the agent works with files matching a specific glob pattern. Use for language-specific or file-type-specific conventions (for example, **/*.cls for Apex rules, **/*.html for LWC template rules).
  • Salesforce rules can’t be edited or deleted. You can only toggle them on or off.
  • Project rules override global rules when both define the same guidance.
  • Rules consume context in every interaction. Keep them concise and focused on a single concern per rule.
  • Use file patterns to reduce noise. A rule about Apex conventions doesn’t need to load when the agent is working on LWC HTML templates.