mgamadeus / ddd-agents
The agentic loop for mgamadeus/ddd: conversations, messages, compaction, the task plan, skills and MCP metadata, purposes and criteria, widgets and signal sources, delegation, the supervisor and run claims
Requires
- erusev/parsedown: ^1.7
- mgamadeus/ddd: ^3.37.2
- mgamadeus/ddd-ai: ^3.4.0
- mgamadeus/ddd-argus: ^1.6.0
- mgamadeus/ddd-common-money: ^1.1.1
Requires (Dev)
- php-tui/php-tui: ^0.2.1
- phpstan/phpstan: ^2.3
- phpunit/phpunit: ^11.5
Suggests
- php-tui/php-tui: Draws the full-screen agent chat (app:ai-agent:chat-tui); without it the command ends with a line naming the library
Provides
None
Conflicts
None
Replaces
None
- dev-main
- 0.1.29
- 0.1.28
- 0.1.27
- 0.1.26
- 0.1.25
- 0.1.24
- 0.1.23
- 0.1.22
- 0.1.21
- 0.1.20
- 0.1.19
- 0.1.18
- 0.1.17
- 0.1.16
- 0.1.15
- 0.1.14
- 0.1.13
- 0.1.12
- 0.1.11
- 0.1.10
- 0.1.9
- 0.1.8
- 0.1.7
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- 0.1.0-alpha.70
- 0.1.0-alpha.69
- 0.1.0-alpha.68
- 0.1.0-alpha.67
- 0.1.0-alpha.66
- 0.1.0-alpha.65
- 0.1.0-alpha.64
- 0.1.0-alpha.63
- 0.1.0-alpha.62
- 0.1.0-alpha.61
- 0.1.0-alpha.60
- 0.1.0-alpha.59
- 0.1.0-alpha.58
- 0.1.0-alpha.57
- 0.1.0-alpha.56
- 0.1.0-alpha.55
- 0.1.0-alpha.54
- 0.1.0-alpha.53
- 0.1.0-alpha.52
- 0.1.0-alpha.51
- 0.1.0-alpha.50
- 0.1.0-alpha.49
- 0.1.0-alpha.48
- 0.1.0-alpha.47
- 0.1.0-alpha.46
- 0.1.0-alpha.45
- 0.1.0-alpha.44
- 0.1.0-alpha.43
- 0.1.0-alpha.42
- 0.1.0-alpha.41
- 0.1.0-alpha.40
- 0.1.0-alpha.39
- 0.1.0-alpha.38
- 0.1.0-alpha.37
- 0.1.0-alpha.36
- 0.1.0-alpha.35
- 0.1.0-alpha.34
- 0.1.0-alpha.33
- 0.1.0-alpha.32
- 0.1.0-alpha.31
- 0.1.0-alpha.30
- 0.1.0-alpha.29
- 0.1.0-alpha.28
- 0.1.0-alpha.27
- 0.1.0-alpha.26
- 0.1.0-alpha.25
- 0.1.0-alpha.24
- 0.1.0-alpha.23
- 0.1.0-alpha.22
- 0.1.0-alpha.21
- 0.1.0-alpha.20
- 0.1.0-alpha.19
- 0.1.0-alpha.18
- 0.1.0-alpha.17
- 0.1.0-alpha.16
- 0.1.0-alpha.15
- 0.1.0-alpha.14
- 0.1.0-alpha.13
- 0.1.0-alpha.12
- 0.1.0-alpha.11
- 0.1.0-alpha.10
- 0.1.0-alpha.9
- 0.1.0-alpha.8
- 0.1.0-alpha.7
- 0.1.0-alpha.6
- 0.1.0-alpha.5
- 0.1.0-alpha.4
- 0.1.0-alpha.3
- 0.1.0-alpha.2
- 0.1.0-alpha.1
This package is auto-updated.
Last update: 2026-11-23 02:50:14 UTC
README
Status: pre-release (0.1.0-alpha). Nothing here is stable API yet.
The agentic loop for mgamadeus/ddd, on top of mgamadeus/ddd-ai: conversations, messages, compaction, the task
plan, skills and MCP metadata, purposes and done criteria, widgets and signal sources, delegation and sub-runs, the
supervisor, run claims, the decision layer, the message handlers of the loop and the MCP tool executor.
Layout
| Path | Content |
|---|---|
src/Modules/Agents/AgentsModule.php |
the DDDModule (source and config path, public service namespaces, exclude patterns) |
src/Domain/AI/… |
the agent core, in the namespace DDD\Domain\AI\… shared with ddd-ai (no class name collides) |
src/Presentation/… |
the agent console printer, the JSON-RPC base controller MCPController, MCPToolExecutorService |
config/app/AI/ |
the module's defaults: application names and wording, egress, persona, the tool-call child process, context retention (an application overrides a file under its own config/app/AI/) |
tests/ |
the package's own suite: unit, contract, integration (a local MariaDB) and the reference-kernel smoke test |
examples/ |
reference-kernel/ (a minimal host without an application) and workers.yaml (one consumer per transport) |
.claude/skills/ |
the developer skills: the entry skill ddd-module-agents-specialist and eight topic skills |
Developer skills
Start with .claude/skills/ddd-module-agents-specialist/SKILL.md: install, wiring, the duties a host takes over
(console commands, crons, middlewares, transports) and a table that names the topic skill of every source folder —
loop, context, skills and purposes, tools, widgets, autonomy, decisions and guards, observability.
tests/Contract/DeveloperSkill*Test.php keep the skills in step with the code (every named class exists, every file
under src/ and config/ has exactly one owning skill).
Application overrides
DDD resolves an overridable class through the application's same-path subclass first (App\Domain\AI\…\X before
DDD\Domain\AI\…\X), so an application customizes a service, an entity set or a repository by a subclass at the same
path under its own root namespace.
The hooks a host usually needs first: AgentAccountRightsService::isAccountReaderOfAllAgentRows() (who reads every
row of the agent's tables; by default the framework's admin role of any account), AgentOwnerFacingTextTranslationService
(the translation of the texts the module writes for the owner; by default the framework's translation keys) and
MCPToolExecutorService::isEnvironmentWideWriteLockActive() (refuses every tool that is no declared read; off by
default). The entry skill's override-points reference lists every hook.
The client context. The web client sends what the owner sees (route path, route parameters, record kind and id,
tab; each capped, an over-cap value refused with HTTP 400) with a start, a posted message and an injected signal. The
server stores it on that owner message (AgentClientContext) and the model reads the newest owner input's context as
one volatile line [SIGNAL:client-context] right before the clock — never in the cached prefix, never a transcript row.
A host turns ids into names and labels the keys in a same-path subclass of AgentClientContextService
(describeRecordOfClientContext(), getClientContextKeyLabel()); the default renders the keys plainly. Details: the
context skill, "What the model sees", section "The client context".
Tokens per model call. config/app/AI/agentModelInputOptions.php (and a purpose's modelInputOptions: map) leaves
parts of the model input out: the delegation, task-plan, askOwner and findWidgets meta tools, the widget part of
the base prompt, base prompt sections by heading, the memory rules when no memory tool is reachable, and the reachable
tool schemas before their skill is loaded. Every switch defaults to the package's behaviour, so the input stays
byte-identical until a host sets one. The default character (config/app/AI/Prompts/AI/Agent/Character.md) is an
example; a host replaces it with its own file at the same path. Details: the context skill, "What the model sees",
section 5.
Environment of the package test kernel (tests/Support/kernel)
No env file is committed. tests/Support/PackageTestEnvironment.php sets every variable where the kernel is built
(tests/bootstrap.php, tests/Support/bin/console.php); key-shaped values there are the fake test-not-a-secret.
Order: process environment, then a git-ignored tests/Support/kernel/.env.test (copy .env.dist), then those
defaults. Nothing connects to a database unless a test reads or writes a DB entity.
| Variable | Purpose | Example format |
|---|---|---|
APP_ENV, APP_DEBUG |
Symfony environment and debug flag | test, 0 |
APP_SECRET |
Symfony's secret | any random string |
DB_DEFAULT_CONNECTION_DRIVER |
Doctrine driver | pdo_mysql |
DB_DEFAULT_CONNECTION_HOST, …_HOST_PORT |
a local throwaway database (integration tests only) | 127.0.0.1, 3307 |
DB_DEFAULT_CONNECTION_DB_NAME |
its schema | ddd_agents_test |
DB_DEFAULT_CONNECTION_USER, …_PASSWORD |
its credentials | <your local user>, <your local password> |
DB_DEFAULT_CONNECTION_DB_SERVER_VERSION, …_DB_SERVER_CHARSET |
server version and charset | mariadb-11.8.5, utf8mb4 |
LAZYLOAD_DEFAULT_REPO_TYPE |
the repository type of a LazyLoad without repoType |
DB |
Environment of the reference host (examples/reference-kernel)
No env file is committed. Copy examples/reference-kernel/.env.dist to .env (git-ignored) and fill the empty values;
a git-ignored .env.local overrides .env, and the process environment wins over both. Without a .env the bootstrap
loads .env.dist. The smoke test (tests/Kernel/ReferenceKernelSmokeTest.php) passes test-not-a-secret for every
key-shaped variable. No model provider is called: the model answers come from a recording.
| Variable | Purpose | Example format |
|---|---|---|
APP_ENV, APP_DEBUG |
Symfony environment and debug flag (never false: use 0) |
prod, 0 |
APP_SECRET |
Symfony's secret | any random string |
DB_DEFAULT_CONNECTION_DRIVER |
Doctrine driver | pdo_mysql |
DB_DEFAULT_CONNECTION_HOST, …_HOST_PORT |
the host's database (MariaDB 11.8+ for VECTOR columns) | 127.0.0.1, 3307 |
DB_DEFAULT_CONNECTION_DB_NAME |
its schema | ddd_agents_reference |
DB_DEFAULT_CONNECTION_USER, …_PASSWORD |
its credentials | <your local user>, <your local password> |
DB_DEFAULT_CONNECTION_DB_SERVER_VERSION, …_DB_SERVER_CHARSET |
server version and charset | mariadb-11.8.5, utf8mb4 |
LAZYLOAD_DEFAULT_REPO_TYPE |
the repository type of a LazyLoad without repoType |
DB |
REFERENCE_DEMO_OWNER_ACCOUNT_ID |
the fixed demo account every request acts as | 1 |
CACHE_APC_TTL |
cache TTL in seconds (every cache group falls back to APCu) | 3600 |
OPENROUTER_KEY |
the provider key the model catalog names; the egress refuses to build a request while it is empty, even when the recorded transport answers | <your provider key> (any non-empty string for the recording) |
JWT_HASH_KEY |
key that signs every outgoing Argus call and login token | a random string of 32+ characters |
JWT_HASH_METHOD |
its algorithm | HS256 |