Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/bhanu91221/sfdx-iq/triggergit clone --depth 1 https://github.com/bhanu91221/sfdx-iqWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00014 | $0.02001 |
| Opus 5 | $0.00007 | $0.01001 |
| Sonnet 5 | $0.00003 | $0.00400 |
| Haiku 4.5 | $0.00001 | $0.00200 |
Grade A, and why
trigger scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 232 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/trigger
Work with Salesforce triggers and trigger handler classes using --new, --review, --refine, or --bug-fix.
Usage
/trigger --new Create a new trigger + handler + test class
/trigger --review Review an existing trigger/handler for quality and patterns
/trigger --refine Modify a trigger or handler (add event context, change logic)
/trigger --bug-fix Diagnose and fix a bug in a trigger or handler
--new: Create a New Trigger + Handler
Gather Requirements
Ask the user:
- Which SObject? (e.g.,
Account,Custom_Object__c) - Which trigger events? (before insert, before update, before delete, after insert, after update, after delete, after undelete — default: all seven)
- What business logic should the handler implement? (brief description per event)
- Does a trigger already exist on this object? (warn if yes — one trigger per object)
- Use a TriggerHandler framework base class? (if the project has one, detect it)
Check for Existing Triggers
Glob: force-app/**/triggers/<ObjectName>Trigger.trigger
If found: warn the user about the one-trigger-per-object rule. Offer to add logic to the existing trigger or stop.
Trigger Standards (baked in)
One Trigger Per Object:
- ONLY ONE trigger per SObject — ever
- All logic belongs in the handler class, not in the trigger body
- The trigger body is a single dispatcher call
Trigger Pattern:
// AccountTrigger.trigger — NO logic here
trigger AccountTrigger on Account (
before insert, before update, before delete,
after insert, after update, after delete, after undelete
) {
new AccountTriggerHandler().run();
}
Handler Class Pattern:
public with sharing class AccountTriggerHandler {
// Recursion prevention
private static Boolean isRunning = false;
public void run() {
if (isRunning) return;
isRunning = true;
try {
if (Trigger.isBefore) {
if (Trigger.isInsert) beforeInsert(Trigger.new);
if (Trigger.isUpdate) beforeUpdate(Trigger.new, Trigger.oldMap);
if (Trigger.isDelete) beforeDelete(Trigger.old);
}
if (Trigger.isAfter) {
if (Trigger.isInsert) afterInsert(Trigger.new);
if (Trigger.isUpdate) afterUpdate(Trigger.new, Trigger.oldMap);
if (Trigger.isDelete) afterDelete(Trigger.old);
if (Trigger.isUndelete) afterUndelete(Trigger.new);
}
} finally {
isRunning = false;
}
}
private void beforeInsert(List<Account> newRecords) {
// Delegate to service or domain class
AccountDomain.setDefaultIndustry(newRecords);
}
private void afterInsert(List<Account> newRecords) {
// Collect changed records and delegate
AccountService.syncToExternalSystem(new Map<Id, Account>(newRecords).keySet());
}
private void beforeUpdate(List<Account> newRecords, Map<Id, Account> oldMap) { }
private void afterUpdate(List<Account> newRecords, Map<Id, Account> oldMap) { }
private void beforeDelete(List<Account> oldRecords) { }
private void afterDelete(List<Account> oldRecords) { }
private void afterUndelete(List<Account> newRecords) { }
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 232 lines · 14 tokens per session scan A c8eee276119d
trigger is a command published in the GitHub repository bhanu91221/sfdx-iq (2 stars, last pushed 3mo ago), licensed MIT. It adds 14 tokens to every session and 2,001 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
git
Git operations with intelligent commit messages and workflow optimization.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.