-
Notifications
You must be signed in to change notification settings - Fork 0
Contributing
Harish Dhanraj Sugandhi edited this page Mar 4, 2026
·
1 revision
- WordPress 6.9+ development environment
- PHP 7.4+
- Node.js 18+ and npm
- Composer
# Clone the repository
git clone https://github.com/earth9890/openwp-agent.git
cd openwp-agent
# Install PHP dependencies
composer install
# Install Node dependencies
npm install# Start development server with hot reload
npm run start
# Production build
npm run build| Command | Description |
|---|---|
npm run start |
Dev build with hot reload (wp-scripts) |
npm run build |
Production build |
npm run lint:js |
Lint JavaScript (wp-scripts lint-js) |
npm run lint:css |
Lint CSS (wp-scripts lint-style) |
npm run format |
Format JS source files |
composer test |
Run PHPUnit tests |
npm run i18n # Generate .pot file
npm run i18n:po # Update .po translations
npm run i18n:mo # Compile .mo files
npm run i18n:json # Generate JSON translations for JS- PSR-4 autoloading under
OpenWP\Inc\namespace - WordPress Coding Standards (WPCS) compliance
- PHPStan for static analysis
- PHPCS security audit sniffs
- WordPress script linting rules
- React best practices
- Tailwind CSS utility classes
-
Create handler class in
inc/Actions/:
namespace OpenWP\Inc\Actions;
class My_Actions {
public static function my_action($params, $context) {
// Implementation
return ['result' => 'value'];
}
}-
Register in
Action_Bootstrap(inc/Core/Action_Bootstrap.php):
$this->register(
'my_action',
[My_Actions::class, 'my_action'],
'edit_posts', // capability
'low', // risk level
true, // mutates
false, // requires backup
[ // input schema
'required' => ['param1'],
'properties' => [
'param1' => ['type' => 'string'],
],
],
'openwp/my-category', // category
[ // output schema
'type' => 'object',
'properties' => ['result' => ['type' => 'string']],
]
);-
Create module class implementing
ToolModuleInterface:
namespace OpenWP\Inc\MCP\Modules;
class MyTools implements ToolModuleInterface {
public function tools(): array {
return [
[
'name' => 'my_tool',
'description' => 'Does something',
'inputSchema' => [...],
'accessLevel' => 'read', // read|write|admin
],
];
}
public function call(string $name, array $args): array {
// Implementation
}
}- Register in
Tool_Registry
All service classes use the Get_Instance trait:
use OpenWP\Inc\Traits\Get_Instance;
class MyService {
use Get_Instance;
private function __construct() {
// initialization
}
}| Directory | Namespace | Purpose |
|---|---|---|
inc/Actions/ |
OpenWP\Inc\Actions |
Action handlers |
inc/Agent/ |
OpenWP\Inc\Agent |
LLM orchestration |
inc/API/ |
OpenWP\Inc\API |
REST controllers |
inc/Backup/ |
OpenWP\Inc\Backup |
Backup service |
inc/Core/ |
OpenWP\Inc\Core |
Bootstrap + settings |
inc/Database/ |
OpenWP\Inc\Database |
Migrations + tables |
inc/Logs/ |
OpenWP\Inc\Logs |
Audit + approvals |
inc/MCP/ |
OpenWP\Inc\MCP |
MCP server |
inc/Memory/ |
OpenWP\Inc\Memory |
Agent memory |
inc/Providers/ |
OpenWP\Inc\Providers |
LLM clients |
inc/Security/ |
OpenWP\Inc\Security |
Security layer |
# Run PHPUnit tests
composer testThe project uses Grunt for release automation:
-
grunt-bumpup- Version bumping -
grunt-contrib-clean- Clean build artifacts -
grunt-contrib-copy- Copy files to release directory -
grunt-contrib-compress- Create ZIP archive -
grunt-rtlcss- Generate RTL stylesheets
OpenWP v0.1.4 | GitHub Repository | GPLv2+