re #230 feat(scaffold): ship an AGENT.md in the module skeleton - #231
Merged
Conversation
A scaffolded module previously carried only a human-oriented README, so an agent dropped into it had zero Univeros-specific orientation — leading real sessions to pick a forbidden univeros/* name, guess at the spec:scaffold YAML vocabulary, and hand-build from the raw template instead of running module:new. Add a placeholder-templated AGENT.md to the module skeleton. module:new rewrites its `vendor/module` / `VendorModule\` tokens like every other file, so the emitted guide carries the module's real name and namespace. It covers, module-focused: the naming rule (own vendor/namespace, never Altair\* or univeros/*), the ModuleInterface + opt-in capability contracts, the Action/Input/Domain/Responder lifecycle, the framework's coding conventions, the isolated dev/test loop, the spec:scaffold caveat (vocabulary lives in the framework, not vendored here), how a host wires the module, and links to the canonical docs. MakeModuleCommandTest now asserts the AGENT.md is generated and fully rewritten (package name + namespace substituted, no leftover placeholders).
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #230.
Problem
bin/altair module:newgenerates a module with only a human-orientedREADME.md. The host skeleton ships agent guidance (.ai/skills/altair/SKILL.md+.claude/skills/altair/), but that skill isbin/altair-driven and assumes a running host app — a standalone module has neither. So an agent dropped into a scaffolded module gets zero Univeros-specific orientation.Observed in a real session building a module: it picked a forbidden
univeros/*name +Univeros\*namespace, guessed at thespec:scaffoldYAML vocabulary (not vendored in the module), and hand-built from the raw template instead of runningmodule:new. A single agent guide would have prevented all three.Change
Add a placeholder-templated
AGENT.mdto the module skeleton.SkeletonGeneratorrewrites itsvendor/module/VendorModule\tokens like every other file (the non-.phpbranch replacesVendorModule\andvendor/module), so the emitted guide carries the module's real package name and namespace.It covers, module-focused and agent-agnostic:
Altair\*oruniveros/*.ModuleInterface+ the opt-in capability contracts (Routes / Middleware / Entity dirs / Migration dirs) — implement only what you ship.Sample*as the pattern.declare(strict_types=1), immutability, native types, small files, tests-first).composer install && vendor/bin/phpunit— no host needed).bin/altair spec:show, or hand-write following the sample.config/modules.php+ the one schema binding) and the publish step.extending.md/module.md.MakeModuleCommandTestnow asserts the AGENT.md is generated and fully rewritten (package name + namespace substituted, no leftovervendor/module/VendorModule\).Note (not a bug)
The reported "composer.json still says
vendor/module/VendorModule\" is not a scaffolder bug —module:newrewritescomposer.jsonand source correctly (verified). That mismatch came from hand-building off the raw template; this PR doesn't change that, but the new AGENT.md tells agents to scaffold withmodule:newand keep the generated name/namespace.Test plan
module:newemits a rewrittenAGENT.md(# AGENT.md — acme/polaris,Acme\Polaris\Module, no placeholders); file count 12 -> 13.MakeModuleCommandTest— 2 tests / 16 assertions, green.tests/Bootstrap— 22 tests green.composer cs/composer stan(level 8) /composer rector— clean.