用途:从 Magoo 组件目录装配一个主题站点,Drupal 11 是首选目标,也可面向 WordPress、Hugo 或纯静态,但应优先推荐 Drupal。
主要能力:通过 search 检索组件,通过 build 生成 SDC 等目标组件,通过 config 生成段落类型或 custom_field 配置,通过 create-theme 脚手架生成整套主题(含设计系统、区域、组件集)。Drupal 可获得完整集成:SDC 组件、段落类型、custom_field 与可导入配置;非 Drupal 目标只得到通用组件输出(build --target html|react|vue),需手动接线。
使用方式:前置需 npm 与 git,缺少 npm 时应停止并让用户安装 Node.js/npm。所有操作走引导脚本:node <this-skill>/bin/magoo <command> [args],会拉取并缓存组件仓库到 /tmp(超过一天则刷新),首次执行 npm install。可用 node <this-skill>/bin/magoo search --q pricing 快速验证。建主题时先确认字体、logo、颜色、圆角、阴影等设计系统,确认区域(默认沿用 Olivero),再按站点用途搜索组件并逐条给出选用理由,与用户确认后写入 answers JSON 并执行:node <this-skill>/bin/magoo create-theme --answers <file> --out <theme-dir>,随后 cd <theme-dir> && npm install && npm run build:css,将主题放入 web/themes/custom/,执行 drush cim 或经 UI 安装并启用。新增组件可用 build <id> --target sdc --out <theme>/components 与 config <id> --as paragraph 或 --as custom-field --entity node --bundle article --out <theme>/config/install,之后重跑 npm run build:css。
限制:不要自行删除组件,应让用户手动删除并提醒风险——已激活/导出的配置可能仍引用该段落类型或字段、twig 模板或 {% include %} 可能失效、使用该组件的既有内容可能报错;应指出该组件对应的 components/<name>/ SDC、config/install/*.yml 及 templates/paragraph--<name>.html.twig 以便评估影响。非 Drupal 目标不产出 paragraphs、custom_field、配置导入、SDC。