Apex
# Apex Generation Rules > Instructions for AI agents when generating Apex code in this project. --- ## Before Writing Any Apex 1. **Check `conventions.md`** for naming, architecture, and security rules. 2. **Check `architecture.md`** for existing classes and patterns in this project. 3. **Identify the correct layer** — is this a Trigger, Handler, Service, or Selector? --- ## Mandatory Rules ### Architecture - **One trigger per object** → delegates to `{Object}TriggerHandler` - **Handler** routes events → calls `{Object}Service` methods - **Service** contains all business logic → calls `{Object}Selector` for data - **Selector** contains all SOQL → returns typed collections - **Zero business logic in triggers or handlers** ### Security (v67.0+ Secure-by-Default) In API v67.0+, `with sharing` and User Mode are **automatic defaults**. However, explicit declarations are still recommended for code clarity.
fill the variables
This prompt has 1 variable. Pro fills them into a ready-to-paste prompt for you — no manual find-and-replace.
{Object}
Unlock with Pro →when to use it
Community prompt sourced from the open-source GitHub repo rvaghela20/forcekit (MIT). A "Apex" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
productivitycommunitydeveloper
source
rvaghela20/forcekit · MIT
more in Productivity
Productivity✓ tested
Summarize a doc into decisions & actions
chief of staff who extracts what to DO, not just what was said
Productivity✓ tested
Draft a reply to a hard email
calm, direct communicator who de-escalates without caving
Productivity✓ tested
Turn a brain-dump into a weekly plan
planning coach who protects your focus, not just your calendar