What problem does it solve?
Inconsistent Apex structure, weak error handling, null-safety gaps, and inefficient collection usage cause brittle, hard-to-maintain Salesforce code and production incidents; this Skill provides clear, actionable conventions to make Apex classes robust and maintainable.
Core Features & Use Cases
- Class organization: Prescribed ordering for constants, statics, fields, constructors, public methods, private methods, and inner classes to improve readability and discoverability.
- Error handling and exceptions: Patterns for domain-specific exceptions, precise catch scopes, and meaningful messages including SaveResult inspection for partial DML failures.
- Null safety and collections: Guidance on null-safe navigation, map/list/set selection, and governor-limit-aware collection patterns and query-to-map idioms.
- Use Cases: Use when writing or reviewing Apex service classes, bulk processing logic, integration callouts, or refactoring legacy Apex for production readiness.
Quick Start
Analyze this Apex class and recommend reorganization, domain-specific exception usage, SaveResult checks, null-safety fixes, and collection optimizations for production readiness.