Skip to content

re #230 feat(scaffold): ship an AGENT.md in the module skeleton - #231

Merged
tonydspaniard merged 1 commit into
masterfrom
feat/230-module-skeleton-agent-md
Jun 6, 2026
Merged

re #230 feat(scaffold): ship an AGENT.md in the module skeleton#231
tonydspaniard merged 1 commit into
masterfrom
feat/230-module-skeleton-agent-md

Conversation

@tonydspaniard

Copy link
Copy Markdown
Member

Closes #230.

Problem

bin/altair module:new generates a module with only a human-oriented README.md. The host skeleton ships agent guidance (.ai/skills/altair/SKILL.md + .claude/skills/altair/), but that skill is bin/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 the spec:scaffold YAML vocabulary (not vendored in the module), and hand-built from the raw template instead of running module:new. A single agent guide would have prevented all three.

Change

Add a placeholder-templated AGENT.md to the module skeleton. SkeletonGenerator rewrites its vendor/module / VendorModule\ tokens like every other file (the non-.php branch replaces VendorModule\ and vendor/module), so the emitted guide carries the module's real package name and namespace.

It covers, module-focused and agent-agnostic:

  • The one rule — own vendor/namespace, never Altair\* or univeros/*.
  • ModuleInterface + the opt-in capability contracts (Routes / Middleware / Entity dirs / Migration dirs) — implement only what you ship.
  • The Action -> Input(DTO) -> Domain -> Responder lifecycle; follow the generated Sample* as the pattern.
  • Coding conventions (declare(strict_types=1), immutability, native types, small files, tests-first).
  • The isolated dev/test loop (composer install && vendor/bin/phpunit — no host needed).
  • The spec:scaffold caveat: the YAML vocabulary lives in the framework, not in this package — confirm with bin/altair spec:show, or hand-write following the sample.
  • Host wiring (config/modules.php + the one schema binding) and the publish step.
  • Links to the canonical extending.md / module.md.

MakeModuleCommandTest now asserts the AGENT.md is generated and fully rewritten (package name + namespace substituted, no leftover vendor/module / VendorModule\).

Note (not a bug)

The reported "composer.json still says vendor/module / VendorModule\" is not a scaffolder bug — module:new rewrites composer.json and 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 with module:new and keep the generated name/namespace.

Test plan

  • module:new emits a rewritten AGENT.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.
  • CI: 8.3 + 8.4, Static Analysis, Determinism gate.

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).
@tonydspaniard
tonydspaniard merged commit 8747809 into master Jun 6, 2026
4 checks passed
@tonydspaniard
tonydspaniard deleted the feat/230-module-skeleton-agent-md branch June 6, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scaffold: ship an AGENT.md in the module skeleton so agents know the Univeros conventions

1 participant