dotkernel-dot-maker
Use before hand-writing any new scaffolding in a Dotkernel project — a module, entity, repository, service, service interface, handler, collection, form, input, input filter, middleware or CLI command
SKILL.md.claude/skills/dotkernel-dot-maker/SKILL.md
GitHubdot-maker: generate, then customise
Applies to
Projects: - Dotkernel API
- Dotkernel Admin
Packages: - none
dotkernel/dot-maker generates files matching the Dotkernel/Mezzio layout and the handler
naming pattern. It is comparable to the Symfony Maker Bundle, and more opinionated than Mezzio's
own CLI tooling because it targets Dotkernel conventions specifically.
Always propose the composer make … command before hand-writing boilerplate. Manual file
creation is where registrations get missed.
Availability varies: the stock API and Admin have it in require-dev with a make script alias;
the stock Frontend, Light and Queue do not. Check composer.json. If the project does not have
it, say so and fall back to copying the nearest existing module by hand.
Running it
composer make <thing> or ./vendor/bin/dot-maker <thing> — the composer make form needs the
script alias present in composer.json.
It is interactive and prompts through a series of choices. In an agent session, do not try to pipe answers blindly: give the user the exact command and the answers to give, then continue from the generated files. Treat generation like an install — the user's call.
Commands
| Command | Generates |
|---|---|
module |
a full module: entity, repository, service, handler(s), ConfigProvider, RoutesDelegator, and documentation stub |
entity |
Entity/X.php + Repository/XRepository.php (skips whichever exists) |
repository |
the same pair, from the repository side |
service |
Service/XService.php + Service/XServiceInterface.php |
service-interface |
the same pair, from the interface side |
handler |
a handler in an existing module |
collection |
a …Collection (API-style projects) |
form |
a Form (Admin — not used in the API) |
input |
a single Input/…Input.php |
input-filter |
an InputFilter — prompts for create / edit / replace |
middleware |
a PSR-15 middleware |
command |
a CLI command |
dot-maker detects which Dotkernel project it is running in and generates accordingly — collections in an API, forms and templates in Admin. That detection is also a useful confirmation of the variant you think you are in.
What it does not do — your job afterwards
- Register the module. It creates the
ConfigProviderand prints what to add, but you still add the entry toconfig/config.phpand the PSR-4 entries tocomposer.json(which needs user approval). - Configure authorization. Add every new route name to this project's authorization
config. API:
authorization.global.php, where a missed entry denies the route. Admin:authorization-guards.global.php, where a missed entry leaves the route open to everyone. - Migrations. It tells you the command; you run
php ./vendor/bin/doctrine-migrations diff(it prompts for approval), then give the user themigratecommand to run — theguard-bash.shhook refusesmigratefor Claude, approval or not. Never hand-write a migration. - Real logic. Generated services and handlers are skeletons. Fill in validation, ownership checks, presentation metadata, documentation detail.
- Tests. Nothing is generated under
test/. - QA. Run the repo's
cs-fixthencheck— generated code still has to pass phpcs and phpstan.
Post-generation checklist
-
composer dump-autoloadafter any new PSR-4 namespace. - Both
ConfigProviders (application module andCore) registered inconfig/config.php. - Handlers present under
factories— and underdelegatorstoo in the API. - Service interface aliased to the concrete service.
- Routes named per this project's dialect (
dotkernel-handler-naming); authorization entries added. - Presentation registered — HAL metadata or template path.
- Documentation completed with real request/response detail, where the project publishes it.
- Migration generated, reviewed, applied.
- QA suite green.
- Generated files are UTF-8 without BOM and LF.
When not to use it
Editing an existing class, adding a method, or any single-file change. dot-maker creates; it does not refactor.