Skip to content

ADD: mage ai command for AI assisted development setup#47

Open
allrude wants to merge 1 commit into
mainfrom
feature/ai-setup
Open

ADD: mage ai command for AI assisted development setup#47
allrude wants to merge 1 commit into
mainfrom
feature/ai-setup

Conversation

@allrude

@allrude allrude commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Adds mage ai, a command that prepares a Magento project for working with an AI coding agent.

What it does

Step Result
Git git init if absent, plus a Magento aware .gitignore. Local only, no remote is ever added.
CLAUDE.md Records the deploy mode, the package-source symlink setup, and the selected frontend stack.
Packages Ensures the package-source/*/* composer path repository exists.
MCP Registers the magento2-lsp MCP server at user scope, so an agent can query the merged config instead of grepping.

Design notes

Magento is the base, and the frontend stack is asked separately (luma, hyva, or none), defaulting to whatever is_hyva_installed reports. CLAUDE.md only documents the layer the project actually has, since a file describing a stack the project does not use is worse than no file.

The .gitignore matters more than it looks. app/etc/env.php holds the database credentials and the crypt key, so a git add . on a fresh Magento root before any ignore rules exist is a credential leak waiting to happen.

Every step is idempotent and reports what it skipped, so the command is safe on an existing project. It is also offered as an optional prompt at the end of mage create, defaulting to no.

npm and claude are called directly rather than through $NPM_CLI, because the MCP server has to live on the host even under Warden.

Not included

mage itself is not rebuilt here. Per the history, the built artifact is only regenerated on Release commits.

Prepares a Magento project for working with an AI coding agent:

- local only git repository with a Magento aware .gitignore, so that
  vendor/, generated/ and app/etc/env.php are never committed
- CLAUDE.md describing the deploy mode, the package-source symlink
  setup, and the selected code stack
- package-source/*/* composer path repository, for roots that did not
  come from mage install
- magento2-lsp MCP server registered at user scope

Magento is the base. The frontend stack (luma, hyva, nft or none) and
the Nebula admin theme are asked separately and default to whatever is
already installed, so nothing project specific is assumed.

Every step is idempotent and reports what it skipped, so the command is
safe to run on an existing project. Also available as an optional prompt
at the end of mage create.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@allrude
allrude requested a review from GrimLink July 19, 2026 12:45
@allrude allrude self-assigned this Jul 19, 2026
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.

1 participant