Skip to content

payload-hooks — Agent usage

Use the hooks skill for after-commit side effects and standalone audit logging, the preset skill for the composed setup, and collection design for Payload boundaries.

Trigger

Use when adding, reviewing, or debugging transaction-safe side effects or audit logging in Payload CMS with @nexload-sdk/payload-hooks: afterCommitPlugin, runAfterCommit(req, key, fn), isAfterCommitInstalled, or standalone auditPlugin. Decides where a side effect (SMS, email, queue job, webhook, cache call) may run relative to the database commit, how to pick callback keys, what happens on rollback, and how audit entries relate to transactions. Do not use for the composed preset options (use payload-preset), cache revalidation rules (use payload-revalidate), log event naming and levels (use logger), or custom operation endpoints (use payload-operations).
Terminal window
npx skills add gecut/nexload-sdk --skill payload-hooks

Trigger

Use when configuring or reviewing Payload CMS configuration with @nexload-sdk/payload-preset, composing Persian admin defaults, logger bridge, after-commit callbacks (afterCommit option), field hooks, or collection audit logging with auditPlugin. Decides between preset and standalone plugins, validates options and defaults, verifies plugin order and non-interference with collection fields, or migrates from deprecated logOperation. Do not use for field schema definitions (use payload-schema) or single field customizations (use payload-fields).
Terminal window
npx skills add gecut/nexload-sdk --skill payload-preset

Trigger

Design, name, review, and refactor Payload CMS collections and PostgreSQL-backed data relationships. Use whenever choosing embedded fields versus Globals or collections, modeling cardinality and ownership, defining junction collections, naming resources and fields, selecting indexes and constraints, setting deletion behavior, preserving historical snapshots, or auditing a Payload schema for data-model correctness.
Terminal window
npx skills add gecut/nexload-sdk --skill payload-collection-design
For @nexload-sdk/payload-hooks, load payload-hooks when its trigger matches. Read the package bundle and check public exports against the installed version before editing.

Scoped Markdown bundle.

Send a notification only after the order transaction commits, and audit writes to an explicit collection. Use @nexload-sdk/payload-hooks and the payload-hooks skill. Inspect the installed version and show a minimal typed example for my project.
Review my @nexload-sdk/payload-hooks integration against the optimization page. Identify the relevant source for each finding and one test for the highest-risk behavior.