Generateive AI with automated multi-agent architecture for PHP code generation, analysis, and agent orchestration. It can support various AI providers with custom implementation, the default is using an OllamaProvider, so it can be used completely local and open source, too.
This project is in an experimental state, but already usable.
It is a simple implementation but customizable, extandable and powerful tool to generate PHP code from user stories.
Find more details in the HTML-documentation.
- Multi-agent architecture (Architect, Coder, Orchestrator)
- Support for various LLM providers (e.g. Ollama)
- Caching with File-Cache, Array-Cache, and Decorator
- Modular design
- Integration and unit tests
- Compatible with PHP 8.2+
- Generated files will be linted
- Generates generic type annotations for PHP 8.1+
- Parallel task processing with
swoole
/openswoole
extension - Retry mechanisms
- Supports simple user stories
- Supports user stories with acceptance criteria and non-acceptance criteria
You need one or nore LLM Providers to run this project, Ollama is default. You can find more information about Ollama here or in the HTML-documentation.
Note: The default prompts are configured to generate REST-APIs.
<?php
declare(strict_types=1);
require_once __DIR__ . '/../bootstrap.php';
$app = require 'config/app.php';
$app->processTask('As a doctor, I want a dashboard with patient records.');
Generated files:
📂 d7b5e56758d02ddde13307b955372e66/
📄 composer.json
🗂️ src/
📂 App/
🎮 Controller/
📄 DashboardController.php
🗃️ Database/
📄 DatabaseConnection.php
📂 Entity/
📄 Patient.php
📄 PatientRecord.php
🔧 Service/
📄 AuthService.php
🖼️ View/
📄 DashboardView.php
<?php
declare(strict_types=1);
require_once __DIR__ . '/../bootstrap.php';
$app = require 'config/app.php';
$app->processTask(<<<USER_STORY
As a doctor, I want a dashboard with patient records.
Acceptance criteria
- The API provides an endpoint to list patient records with key information (GET /api/patients returns name, ID, diagnosis).
- The API supports searching and filtering patient records by name or ID via query parameters (GET /api/patients?name=...&id=...).
- The API provides an endpoint to retrieve detailed information for a single patient (GET /api/patients/{id}).
- Access to all patient endpoints requires authentication (e.g., JWT token).
- The API responses are structured in JSON and support clients on desktop and tablet.
Non-acceptance criteria
- The API does not provide endpoints to edit or delete patient records (PUT, DELETE are not available).
- The API does not provide endpoints for analytics or statistics.
- The API does not provide endpoints to export patient data (e.g., no CSV/PDF export).
- The API does not send notifications for new records.
- The API does not connect or synchronize with external hospital systems.
USER_STORY);
- Ollama sometimes returns empty responses, which can lead to errors in the agent workflow. The workflow will retry automatically, but this can cause longer execution times.
Contributions are welcome!
Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature
) - Commit your changes (
git commit -am 'Added feature'
) - Push to your fork (
git push origin feature/your-feature
) - Create a pull request
Please follow the PSR-12 Coding Standard and run static analysis before your PR:
composer analyse
composer cs-check
This project is licensed under the BSD-3-Clause License.
Special thanks to the following:
I used in this project:
- laminas/*
- mezzio/*
- symfony/*
- swoole/ide-helper
- ollama
- phpstan
- psr/*
- vimeo/psalm
- phpunit/phpunit
- ramsey/uuid
I recommend to follow their videos, books, and articles:
- Marco Pivetta (Ocramius)
- Ralf Eggert
- Kent Beck
- Martin Fowler
- Gregor Hohpe
- Robert C. Martin (Uncle Bob)
- Dr. Jeff Sutherland
Maintainer: angelobono
Questions and feedback welcome via GitHub Issues or Pull Request.
Have fun developing with Bono LLM Coding Agents!