Skip to content
CAI
Software that uses CAICheck a score

lezhnev74/ddd-generator

55.3

Adequate · 21 September 2026

709

lines of production code

PHP

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a PHP-based code generator that scaffolds three-layered applications following clean architecture principles. It provides a command-line interface and domain objects to automate the creation of classes and tests from configurable templates. The tool manages directory structures, namespaces, and stub files to streamline the development of application, domain, and infrastructure layers.

Features

Add new 'generate' console command for creating primitives

A new 'generate' console command has been added to the application. It allows users to generate new primitives (such as commands, events, or queries) from stub files. The command requires arguments for layer, primitive name, and PSR-4 name, and supports a '--silent' option to skip confirmation prompts. It also accepts an optional '--config' (-c) option to load an external configuration file, which must return an array containing 'primitives' and 'layers' definitions. If no config is provided, it defaults to a local config.php file.

src/app · high confidence

Added built-in stubs for simple classes and tests

The application now includes pre-defined template files for generating new PHP classes and their corresponding PHPUnit test cases. Specifically, new stub files have been added for the 'Simple' primitive, providing a basic class structure with PSR-4 namespace placeholders and a minimal test case skeleton, streamlining the creation of new components.

resources · medium confidence

Introduced domain objects for code generation

Added new domain classes to the src/domain directory, including Generator, FQCN, Layer, and Primitive value objects. These classes handle the core logic for generating code from stubs, managing layer configurations, and processing primitive types, enabling the tool to create files based on templates and namespace structures.

src/domain · high confidence

Introduction of dddtool CLI entry point

A new executable script, bin/dddtool, has been added to the project. This PHP script serves as the command-line interface for the application, automatically locating and loading the appropriate autoload file from various potential project root directories. It initializes a Symfony Console Application, registers the 'Generate' command, and executes the application with version 0.0.1.

bin · high confidence

Behavioural changes

Demo environment now uses a structured configuration for code generation

The demo application has been updated to use a new configuration file (demo.config.php) that defines the directory structure, namespaces, and stub templates for generating code. This change introduces a more organized approach to scaffolding, with separate directories for app, domain, and infrastructure layers, along with corresponding test stubs. The existing demo code for the 'Logout' feature has been restructured to align with this new configuration, ensuring that generated code follows the defined conventions.

demo · medium confidence

Introduce new config.php for layer and primitive generation

A new config.php file has been added to define the structure for code generation. It specifies layer configurations (app, domain, infrastructure) with their respective source and test directories and namespaces. Additionally, it defines the configuration for generating primitives, mapping specific stub files for source and test generation, such as Simple.stub.php and SimpleTest.stub.php.

config · medium confidence

Test coverage

Added automated tests for the code generation system; Added test suite for Value Objects and test resources.

Dependencies

Introduce DDD Generator as a PHP library

The project is now defined as a PHP library named lezhnev74/ddd-generator, providing a generator for 3-layered applications using clean architecture principles. The package specifies PHP 7.1+ and requires beberlei/assert, symfony/console, and phpunit for development, establishing the project's dependencies and structure.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 59 → 55 (-3.5)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 100 → 98 (-2.1)
  • Architecture 69 → 69 (+0.0)
  • Maturity 67 → 67 (+0.0)
  • Readiness 41 → 33 (-7.1)
  • Security 100 → 100 (+0.0)

Resolved (7)

  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • No exposed public API
  • Test reliability not included
  • The 'Usage' section is clipped mid-sentence ('run command with given config') before explaining how to invoke the generator. (README.md)
  • early-stage repository — too little history to judge knowledge freshness
  • single-maintainer — knowledge-concentration (bus factor) risk

New (11)

  • Dependency hygiene PARTLY measured — Composer dependencies read, no committed lock to grade for currency
  • Documentation: no usage examples (README.md)
  • Inconsistent naming convention and typo. 'append' is standard, but 'preppend' is a typo (should be 'prepend'). Additionally, 'append' usually implies adding to the end, while 'prepend' adds to the beginning. The asymmetry in spelling ('append' vs 'preppend') is a clear inconsistency.
  • No ADRs found
  • No dependency advisory monitoring
  • Redundant methods with ambiguous distinction. Both methods return a string and take the same argument. It is unclear if 'File' implies a filename (without directory) or a full path, while 'Path' implies a directory path. Without clear documentation or distinct return types (e.g., Path vs Filename), these are confusingly similar.
  • TodoComment (src/app/Input/Console/Commands/Generate.php)
  • TodoComment (src/domain/VO/FQCN.php)
  • TodoComment (tests/ConsoleGeneratorTest.php)
  • TodoComment (tests/GeneratorTest.php)
  • TodoComment (tests/GeneratorTest.php)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

lezhnev74/ddd-generator was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit e335d81e9a5e053f0cd52feade8a6860d80cd71a — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-fa71c66cabd8.