/optimus-frontend:mastergo-to-wpf-componentsfrom optimus-frontend
当用户提供 MasterGo 设计稿链接并要求抽取可复用视觉组件、生成组件库、沉淀样式/DataTemplate/自定义控件时使用此 Skill;产出组件索引、颜色资源与 DataTemplate 资源,并可按严格映射登记控件。触发词:"抽组件"、"生成组件库"、"抽取可复用组件"、"设计稿转组件"、"WPF 组件库"、"沉淀样式"。Not for page generation (use mastergo-to-wpf-page) or icon export (use mastergo-icon-expoter).
Ships in optimus-frontend. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
从分区 DSL 离线抽取重复视觉模式,生成可审查的组件索引、颜色资源和 DataTemplate 资源。组件正文、交互和动画只能在已验证的设计信息与项目约定范围内生成。
一次性比对设计稿链接、组件抽取范围和输出目录的缺失项,不逐 Step 追问。MASTERGO_TOKEN 属系统状态,不作为缺失项询问。
MASTERGO_TOKEN、链接的 fileId/layerId、Team 版及非草稿箱条件;任一不满足即停止。wpf-project-conventions/CONVENTIONS.md;文件缺失或 MVVM、解决方案、目录、资源字典、命名或编译关键项为空时停止,请项目负责人先填写。components-index.json 时说明将进行增量合并。调用不带 sectionIndex 的 mcp__getDesignSections,原样写入 .mastergo-dsl/sections-list.json。区块数超过 8 时停止并请用户指定范围。
展示待处理 sectionIndex、由约定确定的输出目录,以及是否携带 --mapping。等待用户明确确认后,才读取分区 DSL。
按确认范围调用 mcp__getDesignSections(sectionIndex=N),每批 3–5 个,保存为 .mastergo-dsl/section-{N}.json。禁止使用 getDsl 绕过分区流程。
$SkillDir 必须是 Skill 加载时提供的绝对 base directory,不能取用户项目 cwd:
python "$SkillDir\scripts\extract_components.py" --input .mastergo-dsl --out <约定输出目录>
# 仅携带用户确认的严格映射时追加:--mapping .mastergo-dsl\wpf-project-mapping.json
exit 0 时据实报告抽取数量;exit 2 时原样转达 stderr 单行 error: ...,不得包装为成功。
逐条展示 components-index.json 中 status=new 的设计稿来源和资源 key。资源 key 冲突时展示新旧 diff。
等待用户选择覆盖或保留;不得自动覆盖。
status=mapped 的组件仅按严格映射白名单生成控件引用。Background、BorderBrush、CornerRadius 等正文仅从首个出现节点依 DSL 映射规则提取,不猜测。
需要 code-behind、事件或 Storyboard 的组件一律不自动生成;在索引项写入 manual=true,并在交付摘要逐条列出。
从仓库根按约定的编译命令执行 dotnet build。失败按输出最多修复两轮;仍失败时输出 diff 交人工,不能宣称成功。
交付新增、冲突和人工接管组件;列出 components-index.json、Colors.generated.xaml、DataTemplates.generated.xaml,并摘要 fallbacks、manualHandoffs 与 unverified。
CHANGELOG.md (opens in a new tab)README.md (opens in a new tab)references/component-extraction-rules.md (opens in a new tab)scripts/assets/broken-token.json (opens in a new tab)scripts/assets/instance-repeated.json (opens in a new tab)scripts/assets/mapped-instance.json (opens in a new tab)scripts/assets/repeated-frames.json (opens in a new tab)scripts/assets/single-instance.json (opens in a new tab)scripts/extract_components.py (opens in a new tab)scripts/test_extract_components.py (opens in a new tab)test-prompts.json (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
8 skills in this plugin
/avalonia-code-reviewUse when reviewing Avalonia AXAML or C# UI code for framework correctness, binding and styling defects, cross-platform risks, accessibility, performance concerns, or before merging an Avalonia UI change. 触发词:"审查 Avalonia 代码"、"Avalonia review"、"AXAML 检查"、"Avalonia PR 审查"。/avalonia-deb-releaseUse when packaging an already-published Avalonia Linux build into a `.deb` with `dpkg-deb`, or validating that package via command-line/GUI install. 触发词:"Avalonia Linux 打包"、"打 deb"、"Ubuntu 安装包"、"dpkg-deb"。/avalonia-wpf-migrationUse when migrating a WPF application to Avalonia, selecting Avalonia XPF versus native Avalonia, or producing a staged, validated migration plan. 触发词:"WPF 迁移 Avalonia"、"WPF 跨平台"、"XPF 还是 Avalonia"、"评估 WPF 改造"。Other plugins' skills for the same job
npx claudepluginhub glepooek/optimus-plugins --plugin optimus-frontend