MageHub
GitHub
Magento 2 x AI coding assistants Magento 2 x AI 编程助手

Structured Magento 2 skills for tools that normally guess wrong. 为那些通常会猜错的工具,提供结构化的 Magento 2 技能。

MageHub turns Magento 2 architecture, conventions, anti-patterns, and examples into reusable AI skills. Use one local CLI to generate context files for Claude Code, OpenCode, Codex, and Qoder. MageHub 将 Magento 2 的架构、约定、反模式和示例转化为可复用的 AI 技能。通过一个本地 CLI 为 Claude Code、OpenCode、Codex 和 Qoder 生成上下文文件。

$ npx magehub install module-plugin performance
Created ~/.magehub/config.yaml
 module-plugin installed
 performance installed

$ magehub skill:list
admin-ui-grid
api-graphql-resolver
devops-warden
hyva-module-compatibility
mage-review
magento-upgrade
module-di
module-plugin
module-scaffold
module-setup
performance
standards-coding
testing-phpunit
0 Bundled v1.0 skills v1.0 内置技能
0 Supported output formats 支持的输出格式
CLI Local-first, schema-backed workflow 本地优先、Schema 驱动的工作流

Bundled skill catalog 内置技能目录

The first 13 skills target where Magento AI workflows usually break. 前13个技能针对 Magento AI 工作流通常出问题的地方。

module-scaffold

Bootstrap valid module structure, registration, and metadata. 搭建有效的模块结构、注册和元数据。

module-plugin

Guide plugin design, interception boundaries, and anti-pattern avoidance. 指导插件设计、拦截边界和反模式规避。

module-di

Keep preferences, constructor injection, and virtual types maintainable. 保持偏好设置、构造函数注入和虚拟类型的可维护性。

magento-upgrade

Plan version upgrades with UCT analysis, dependency waves, and verification gates. 用 UCT 分析、依赖波次和验证门禁规划版本升级。

module-setup

Use declarative schema and patches instead of legacy install scripts. 使用声明式 Schema 和补丁,替代传统的安装脚本。

admin-ui-grid

Build admin listing UI Components without XML spaghetti. 构建管理后台列表 UI 组件,告别 XML 意大利面。

api-graphql-resolver

Keep GraphQL resolvers thin and Magento-native. 保持 GraphQL 解析器精简且符合 Magento 原生规范。

devops-warden

Run Magento commands through Warden's containerized local dev environment. 通过 Warden 的容器化本地开发环境运行 Magento 命令。

hyva-module-compatibility

Convert Luma assumptions into Hyva-friendly frontend behavior. 将 Luma 假设转换为 Hyva 友好的前端行为。

testing-phpunit

Write focused PHPUnit unit tests around Magento service logic. 围绕 Magento 服务逻辑编写专注的 PHPUnit 单元测试。

performance

Apply cache layers safely without serving broken personalized output. 安全地应用缓存层,避免提供损坏的个性化输出。

standards-coding

Encode Magento coding standards into repeatable AI instructions. 将 Magento 编码标准编码为可重复的 AI 指令。

mage-review

Structured code review workflow with confidence scoring, covering DI, security, performance, and more. 结构化代码审查工作流,带置信度评分,涵盖 DI、安全、性能等领域。

Workflow 工作流

One repository, one config, many AI tools. 一个仓库,一个配置,多种 AI 工具

MageHub treats skills as versioned YAML artifacts, validates them with JSON Schema, and assembles them into a generated context file that matches the target assistant's expected shape. MageHub 将技能视为版本化的 YAML 构件,通过 JSON Schema 验证,并将其组装成符合目标助手预期格式的生成上下文文件。

1

Install skills 安装技能

Install globally by default, or use -c to select bundled and project-local skills in .magehub.yaml. 默认全局安装;使用 -c 时在 .magehub.yaml 中选择内置或项目本地技能。

2

Verify structure 验证结构

Catch bad schema, duplicate IDs, and heading issues before generation. 在生成前捕获错误的 Schema、重复 ID 和标题问题。

3

Generate context 生成上下文

Produce tool-specific prompt/context files from the same skill set. 从同一套技能集生成工具特定的提示/上下文文件。

Output formats 输出格式

Generate for the tools your team already uses. 为你的团队已在使用的工具生成。

Claude Code ~/.claude/skills/<id>/SKILL.md
OpenCode ~/.opencode/skills/<id>/SKILL.md
Codex ~/.codex/AGENTS.md
Qoder ~/.qoder/skills/<id>/SKILL.md

Quick start 快速开始

Start locally in a few commands. 几个命令在本地开始。

# Install skills globally; --format defaults to claude
$ npx magehub install module-plugin performance

# Install into the current project instead
$ npx magehub install -c module-plugin performance --format=codex

# Browse all available skills
$ magehub skill:list

# Search for skills by keyword
$ magehub skill:search caching# 默认全局安装技能;--format 默认 claude
$ npx magehub install module-plugin performance

# 安装到当前项目
$ npx magehub install -c module-plugin performance --format=codex

# 浏览所有可用技能
$ magehub skill:list

# 按关键词搜索技能
$ magehub skill:search caching

Documentation 文档

Read the proposal, CLI reference, or author new skills. 阅读提案、CLI 参考,或编写新技能