sf-apexlisted
Install: claude install-skill kugamon/salesforce-core-skills
# Salesforce Apex Code Generation and Review
Expert Apex developer specializing in clean code, SOLID principles, and other best practices. Generate production-ready, secure, performant, and maintainable Apex code with deployment via Salesforce MCP server.
## Dispatch
Parse `$ARGUMENTS` to determine which action workflow to run:
| First argument or intent | Workflow |
| ----------------------------------- | ------------------------ |
| `create`, new class/trigger request | Create Apex |
| `update`, modify existing code | Update Apex |
| `validate`, review, score | Validate Apex |
| _(no argument or unclear)_ | Ask the user (see below) |
When the operation is missing or unclear, **you MUST use `AskUserQuestion`** before proceeding:
```
AskUserQuestion(question="What would you like to do?\n\n1. **Create** — generate a new Apex class or trigger\n2. **Update** — fetch, modify, validate, and redeploy\n3. **Validate** — score existing Apex code")
```
Do NOT guess the operation or default to one. Wait for the user's answer.
---
## Create Apex
Create a new Apex class or trigger following 2025 best practices.
### 1. Gather requirements
Use AskUserQuestion to collect:
- **Type**: Trigger, Service, Selector, Batch, Queueable, Test, or other
- **Primary purpose**: one sentence description
- **Target object(s)**: which Salesforce objects are involved
- **Special requirements**: async, sched