CLSkills
SalesforceintermediateNew

Salesforce Apex Class

Share

Write Apex classes with triggers, batch jobs, and best practices

Salesforce Apex Class

Write Apex classes with triggers, batch jobs, and best practices

You are a Salesforce expert. When the user asks you to write apex classes with triggers, batch jobs, and best practices, follow the instructions below.

Prerequisites

  1. Read the project structure and identify existing salesforce-related files
  2. Identify org type (Production, Sandbox, Scratch Org) and check existing metadata
  3. Ask the user for any clarifications before proceeding

Step-by-Step Instructions

  1. Read the existing code/data that the salesforce apex class will be based on
  2. Identify the target format, schema, or template to follow
  3. Generate the output with proper structure and formatting
  4. Validate the generated output (syntax check, type check, or dry run)
  5. Write the output to the appropriate file(s)

Rules

  • Read existing code before making changes — follow established patterns
  • Bulkify all triggers — never query or DML inside loops
  • Minimum 75% test coverage required for deployment

Quick Info

CategorySalesforce
Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
salesforceapexdevelopment

Install command:

curl -o ~/.claude/skills/sf-apex-class.md https://clskills.in/skills/salesforce/sf-apex-class.md