πŸ€– Master AI Contract Guide

Architectural Guidelines for Safe AI-Assisted Plugin & Theme Generation (v2.7.0)

Why an AI Contract Guide?

Domain-System is architected to work seamlessly with AI coding assistants (Gemini, Claude, ChatGPT, Copilot, Cursor). To ensure AI-generated code strictly respects our SOLID and Clean Architecture boundaries, every extension follows explicit interface contracts.

1. Non-Negotiable Architectural Rules

2. CLI Boilerplate Generator

To scaffold a compliant plugin structure automatically, run:

php os-cli.php make:plugin my_plugin

This generates plugin.json (version 2.7.0 / os_version: 2.7), Plugin.php implementing OsExtensionInterface, and the auto-discovered manual module manual/module.php (ManualModuleInterface).

3. Standard Plugin Directory Tree

src/Plugins/my_plugin/
β”œβ”€β”€ plugin.json
β”œβ”€β”€ Plugin.php
β”œβ”€β”€ Contracts/
β”‚   └── MyRepositoryInterface.php
β”œβ”€β”€ Repositories/
β”‚   └── PdoMyRepository.php
β”œβ”€β”€ Services/
β”‚   └── MyService.php
β”œβ”€β”€ Controllers/
β”‚   └── MyController.php
β”œβ”€β”€ manual/
β”‚   └── module.php
└── views/
    β”œβ”€β”€ admin/
    └── front/

4. Automated Verification

Before deploying any AI-assisted change, run the architecture and unit test suites:

php phpunit.phar tests/Architecture
php phpunit.phar