AI coding agents work best when the project gives them concrete local instructions and a predictable way to add
Vendure code. New Vendure projects created with @vendure/create include an AGENTS.md file for this purpose.
The generated AGENTS.md file summarizes the project layout, common commands, and Vendure-specific guidance.
Agents should read this file before making changes. It explains where plugin code belongs, where runtime
configuration lives, and which commands should be run after code changes.
The Vendure CLI supports non-interactive commands, which are useful for AI agents and automation. For example:
Prefer these commands over manually creating boilerplate, because the CLI can update the surrounding Vendure configuration for you.
Plugin code should not read environment variables directly. Read deployment-specific values in
src/vendure-config.ts and pass them through plugin init options:
Then inject the plugin options token into services that need those values. This keeps plugins reusable and makes tests easier to configure.
When a RequestContext is available, pass it to Vendure services and to TransactionalConnection methods:
This allows Vendure to apply the correct transaction and request-scoped behavior.
Create custom job queues in a Nest lifecycle hook, then reuse the queue when adding jobs:
Do not pass a raw RequestContext as job data. Use ctx.serialize() or pass only the fields needed to recreate
the context in the worker.