adachsoft / rule-author-agent-tool
AI tool that delegates authoring and editing agent rules to an isolated agent.
Package info
gitlab.com/a.adach/rule-author-agent-tool
pkg:composer/adachsoft/rule-author-agent-tool
Requires
- php: ^8.3
- adachsoft/agent-rule: ^0.4
- adachsoft/agent-rule-contract: ^0.6
- adachsoft/agent-rule-tool: ^0.3
- adachsoft/ai-agent: ^0.12
- adachsoft/ai-agent-config-repository: ^0.6
- adachsoft/ai-agent-factory: ^0.2
- adachsoft/ai-tool-call: ^2.0
- adachsoft/collection: ^3.0
Requires (Dev)
- adachsoft/php-code-style: ^0.7
- friendsofphp/php-cs-fixer: ^3.95
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^12.5
- rector/rector: ^2.7
- symplify/phpstan-rules: ^14.9
- vlucas/phpdotenv: ^5.6
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-10-09 16:57:44 UTC
README
adachsoft/rule-author-agent-tool provides an AI tool that delegates authoring and editing agent rules to an isolated rule-authoring agent.
Features
- Creates and updates agent rules through a dedicated AI agent.
- Uses the
agent_ruleandagent_rule_admintools for rule storage operations. - Supports stateful conversations through a configurable
conversation_id. - Stores rules in a JSON file selected by the application.
- Exposes the tool through the
adachsoft/ai-tool-callSPI.
Installation
composer require adachsoft/rule-author-agent-tool
Integration
Create the tool with RuleAuthorAgentToolFactory and provide the provider credentials, model configuration, and JSON rules path through ConfigMap:
use AdachSoft\AiToolCall\SPI\Collection\ConfigMap;
use AdachSoft\RuleAuthorAgentTool\RuleAuthorAgentToolFactory;
$tool = (new RuleAuthorAgentToolFactory())->create(new ConfigMap([
'provider_id' => 'openai',
'api_key' => $apiKey,
'model_id' => 'gpt-4o-mini',
'rules_path' => __DIR__ . '/var/rules.json',
'conversation_id' => 'rule-author-session',
]));
The resulting RuleAuthorAgentTool implements the standard ToolInterface. Pass a ToolCallRequestDto containing a message parameter to delegate a rule-authoring request.
See docs/examples/rule-author-agent.md for a complete request example and configuration details.
License
This library is released under the MIT License.