sf-apex_skill

This skill helps you generate and review Salesforce Apex code following 2025 best practices and a 150-point scoring system.
  • Python

67

GitHub Stars

3

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill jaganpro/sf-skills --skill sf-apex

  • CREDITS.md4.3 KB
  • README.md2.9 KB
  • SKILL.md16.7 KB

Overview

This skill generates and reviews Salesforce Apex code following 2025 best practices and a 150-point scoring system. It produces production-ready classes, triggers, async jobs, and test classes, and it delivers actionable review reports with fixes and risk guidance. Use it to enforce bulkification, security, SOLID architecture, and robust testing standards.

How this skill works

The skill asks targeted questions to gather class type, purpose, target objects, and test requirements, then scans the project for existing Apex and Trigger Action Framework (TAF) usage. For generation it selects templates, creates class and test files, and runs LSP and semantic validations. For review it runs a 150-point validator across eight categories and returns a scored report with prioritized fixes and code examples.

When to use it

  • Creating new Apex classes, triggers, batch jobs, queueables, or @InvocableMethod handlers
  • Reviewing existing Apex for bulkification, security, or architecture issues
  • Writing or refactoring test classes to meet positive/negative/bulk coverage patterns
  • Preparing code for deployment and gating by score thresholds
  • Integrating Apex with Flow, LWC, or packaged TAF patterns

Best practices

  • Never generate SOQL/DML inside loops; collect and operate on lists/sets/maps
  • Always apply with sharing/user-mode and enforce CRUD/FLS via Security.stripInaccessible() where appropriate
  • Write tests covering positive, negative, and bulk (251+ records) scenarios with explicit assertions
  • Follow layered architecture: Trigger -> Domain/Service -> Selector; favor single responsibility and dependency injection
  • Use specific exception handling (no empty catches) and document with ApexDoc on classes and methods
  • Leverage async patterns for heavy work and monitor with Limits to avoid governor exceptions

Example use cases

  • Generate a Trigger + Service + Selector for Account field defaults with corresponding tests and 251+ bulk test
  • Review an existing trigger set and refactor to TAF actions if the package is installed
  • Create an @InvocableMethod class for Flow integration with request/response DTOs and test coverage
  • Audit a repo before deployment and return a 150-point validation report with remediation steps
  • Convert ad-hoc DML in loops into bulkified service layer and regenerate tests

FAQ

The score sums eight categories (Bulkification, Security, Testing, Architecture, Clean Code, Error Handling, Performance, Documentation) to quantify readiness for deployment.

Will you ever generate anti-patterns on request?

No. The skill will stop and ask for confirmation if a requested change would introduce a critical anti-pattern (SOQL/DML in loops, hardcoded IDs, empty catch blocks, SOQL injection, missing sharing, or tests without assertions).

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational