Read this when adding or changing a discoverable PHP plugin, permission, or menu entry.
Use the discovery convention. Create a directory below src/ with an initializer named after the directory. Its namespace must follow the path and the class must extend PluginStrategy.
namespace Modules\Example;
use OpenMind\System\PluginStrategy;
class Example extends PluginStrategy
{
public function __construct()
{
}
}
Keep plugin construction safe at boot. ApplicationComposition instantiates every valid plugin after System; configuration, database, and framework globals are then available.
Use persistent numeric permission IDs. Use the existing catalog ID defined by the subsystem, such as permission ID 2 for Inventory Monitor. Permission ID 1 is reserved for administrator authorization.
Register menu entries through AddMenuItem(). Use a numeric permissionId for protected entries. The method publishes entries only when the restored user has the required permission.
$this->AddMenuItem('Inventory Monitor', ['url' => 'inventory', 'permissionId' => 2]);
For API behavior, add routes in OpenMind\Api\Api, not in the new plugin. Follow add-api-endpoint.md.
For an interactive page, add a matching React route and ensure the navigation URL resolves under the application base path. The implemented Inventory Monitor page uses /inventory; frontend route guards are not a substitute for API authorization.
Update documentation. Add the subsystem to module index; create a domain spec only if it introduces a non-obvious data model and business contracts.
See backend conventions and file structure.