diff --git a/AGENTS.md b/AGENTS.md index f9f2ff737..5e721855d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -87,6 +87,13 @@ Plugins live in `app/Plugins//` and are auto-discovered by `PluginMa - Configuration stored in `ospos_plugin_config` table - Plugin-specific routes go in `Config/Routes.php` within the plugin directory +#### Core/Plugin Boundary + +Core must never reference a specific plugin by name or path: +- No plugin name may appear in `composer.json`, `package.json`, `app/Config/*`, or any other core file +- Plugins resolve entirely through PSR-4 autoloading (`App\Plugins\{Name}\...` → `app/Plugins/{Name}/...`) and runtime auto-discovery via `PluginManager` +- Installing or removing a plugin must never require editing a core file + #### View Hook Points Core views inject plugin UI using `pluginContent('hook_name', $data)`. All currently defined hook points are listed in `app/Plugins/README.md`. When adding a new hook point to a core view: diff --git a/app/Plugins/README.md b/app/Plugins/README.md index f799557b0..a055fe0ed 100644 --- a/app/Plugins/README.md +++ b/app/Plugins/README.md @@ -26,6 +26,13 @@ The PluginManager recursively scans `app/Plugins/` directory: Both formats are supported, but directory plugins allow for self-contained packages with their own components. +### Core/Plugin Boundary + +Core never references a specific plugin: +- Installing or removing a plugin must never require editing any file outside `app/Plugins//` +- No plugin name or path may appear in `composer.json`, `package.json`, `app/Config/*`, or any other core file +- Everything resolves via PSR-4 autoloading and runtime auto-discovery + ## Uninstall > **Warning:** Uninstall is destructive and cannot be reversed. All plugin data will be permanently deleted.