From 6c5f21436fd324b9928fad4dcfb7e94b455da346 Mon Sep 17 00:00:00 2001 From: hiyuki <674883329@qq.com> Date: Wed, 13 May 2026 21:09:06 +0800 Subject: [PATCH 01/10] update skill --- .agents/skills/mpx2rn/SKILL.md | 4 ++-- .agents/skills/mpx2rn/references/conditional-compile.md | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.agents/skills/mpx2rn/SKILL.md b/.agents/skills/mpx2rn/SKILL.md index ce4377e920..2e49112839 100644 --- a/.agents/skills/mpx2rn/SKILL.md +++ b/.agents/skills/mpx2rn/SKILL.md @@ -111,8 +111,7 @@ Mpx 是一个以微信小程序语法为基础、进行了类 Vue 语法拓展 1. **最小化使用**:条件编译是处理跨端不兼容的**最后手段**,不是首选方案。使用条件编译之前,应先确认是否存在无需条件编译的跨端兼容写法(参见[样式开发最佳实践](./references/rn-style-practice.md)与各能力参考)。需要用条件编译时,仅最小包裹真正不兼容的片段,不要整段代码都用条件编译分叉。 2. **避免空选择器**:样式条件编译产物中不得留下空选择器(无样式内容的选择器),整条规则(含选择器与花括号内容)须一并被条件编译包裹。详见 [条件编译 · 避免产物中出现空选择器](./references/conditional-compile.md#避免产物中出现空选择器)。 - -完整语法(样式 `@mpx-if` / 模板 `@mode` & `@_mode` & `mpxTagName@mode` / 脚本 `__mpx_mode__` / JSON 配置)参考 [条件编译](./references/conditional-compile.md)。 +3. **各区块使用对应的条件编译语法**:样式条件编译使用 `/* @mpx-if (__mpx_mode__ === ... ) */` 注释语法;模板条件编译使用 `wx:if="{{__mpx_mode__ === ...}}"` 指令或 `@mode` / `@_mode` 属性后缀;脚本和 JSON 配置条件编译使用 `if (__mpx_mode__ === ...)` 条件语句,**避免误用**,详情参考 [条件编译](./references/conditional-compile.md)。 ## 任务一:对已有 Mpx 组件进行 RN 跨端适配改造 @@ -204,6 +203,7 @@ Mpx 是一个以微信小程序语法为基础、进行了类 Vue 语法拓展 **条件编译** - [ ] 不存在大面积连续条件编译,仅最小包裹不兼容片段。 - [ ] 样式条件编译处理后产物中不存在空选择器。 +- [ ] 各个区块内的条件编译语法都符合规范,不存在误用(如在模板区块中使用 `/* @mpx-if */` 注释语法等)。 **本地校验** - [ ] 通过 [编译校验脚本](#编译校验脚本) 真实编译校验。 diff --git a/.agents/skills/mpx2rn/references/conditional-compile.md b/.agents/skills/mpx2rn/references/conditional-compile.md index 0f04fbc24b..4130147710 100644 --- a/.agents/skills/mpx2rn/references/conditional-compile.md +++ b/.agents/skills/mpx2rn/references/conditional-compile.md @@ -16,6 +16,8 @@ ## 样式条件编译 +> **⚠️ `@mpx-if` 注释语法条件编译仅限在 ` diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_gene/outputs/list.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_gene/outputs/list.mpx new file mode 100644 index 0000000000..d45b7428e3 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_gene/outputs/list.mpx @@ -0,0 +1,166 @@ + + + + + + + diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_gene/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_gene/run-1/grading.json new file mode 100644 index 0000000000..579ce4be6b --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_gene/run-1/grading.json @@ -0,0 +1,57 @@ +{ + "eval_id": 0, + "run_kind": "mpx2rn_gene", + "expectations": [ + { + "text": "style: no less nesting (& or rule-in-rule)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style on RN (wx-conditional stripped): no :active", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style on RN: no :first-child", + "passed": true, + "evidence": "PASS" + }, + { + "text": "script: replaced wx.request with mpx.request", + "passed": true, + "evidence": "PASS" + }, + { + "text": "script: replaced wx.navigateTo with mpx.navigateTo", + "passed": true, + "evidence": "PASS" + }, + { + "text": "template: event params use inline syntax (not data- dataset)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "template: dynamic class via wx:class (not class string interp)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style: no empty selector rules after stripping comments", + "passed": true, + "evidence": "PASS" + } + ], + "summary": { + "pass_rate": 1.0, + "passed": 9, + "failed": 0, + "total": 9 + } +} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_gene/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_gene/timing.json new file mode 100644 index 0000000000..d7e05c7627 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_gene/timing.json @@ -0,0 +1,5 @@ +{ + "total_tokens": 81186, + "duration_ms": 136008, + "total_duration_seconds": 136.0 +} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_original/outputs/list.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_original/outputs/list.mpx new file mode 100644 index 0000000000..fdabf66304 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_original/outputs/list.mpx @@ -0,0 +1,139 @@ + + + + + diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_original/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_original/run-1/grading.json new file mode 100644 index 0000000000..3242ebd5af --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_original/run-1/grading.json @@ -0,0 +1,57 @@ +{ + "eval_id": 0, + "run_kind": "mpx2rn_original", + "expectations": [ + { + "text": "style: no less nesting (& or rule-in-rule)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style on RN (wx-conditional stripped): no :active", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style on RN: no :first-child", + "passed": true, + "evidence": "PASS" + }, + { + "text": "script: replaced wx.request with mpx.request", + "passed": true, + "evidence": "PASS" + }, + { + "text": "script: replaced wx.navigateTo with mpx.navigateTo", + "passed": true, + "evidence": "PASS" + }, + { + "text": "template: event params use inline syntax (not data- dataset)", + "passed": false, + "evidence": "FAIL" + }, + { + "text": "template: dynamic class via wx:class (not class string interp)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style: no empty selector rules after stripping comments", + "passed": true, + "evidence": "PASS" + } + ], + "summary": { + "pass_rate": 0.8889, + "passed": 8, + "failed": 1, + "total": 9 + } +} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_original/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_original/timing.json new file mode 100644 index 0000000000..51f97c68fa --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_original/timing.json @@ -0,0 +1,5 @@ +{ + "total_tokens": 86788, + "duration_ms": 222970, + "total_duration_seconds": 223.0 +} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/eval_metadata.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/eval_metadata.json new file mode 100644 index 0000000000..2981b8ee13 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/eval_metadata.json @@ -0,0 +1,17 @@ +{ + "eval_id": 1, + "eval_name": "create-card-component", + "prompt": "请帮我创建一个符合 RN 跨端兼容规范的 Mpx 卡片组件 card.mpx,需求:\n- 接收 props:title (string)、desc (string)、avatar (string,图片 URL)、selected (boolean,默认 false)\n- 卡片整体可点击,点击时通过 triggerEvent 抛出 'tap' 事件\n- 点击时有按下视觉反馈\n- selected=true 时卡片边框色变为蓝色 (#1677ff)\n- 标题需要单行省略\n- 描述最多展示 2 行后省略\n- 使用组合式 API(setup 或 + + + + diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_gene/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_gene/run-1/grading.json new file mode 100644 index 0000000000..d869df3f9c --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_gene/run-1/grading.json @@ -0,0 +1,57 @@ +{ + "eval_id": 1, + "run_kind": "mpx2rn_gene", + "expectations": [ + { + "text": "uses composition API (script setup or setup())", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style: no nesting / compound selectors", + "passed": true, + "evidence": "PASS" + }, + { + "text": "uses hover-class for press feedback (not bare :active on root)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "triggerEvent('tap', ...) is called", + "passed": true, + "evidence": "PASS" + }, + { + "text": "title uses numberOfLines for ellipsis", + "passed": true, + "evidence": "PASS" + }, + { + "text": "avatar uses (not )", + "passed": true, + "evidence": "PASS" + }, + { + "text": "text content wrapped in elements", + "passed": true, + "evidence": "PASS" + }, + { + "text": "defineProps uses Mpx-style value: (not Vue-style default:)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", + "passed": true, + "evidence": "PASS" + } + ], + "summary": { + "pass_rate": 1.0, + "passed": 9, + "failed": 0, + "total": 9 + } +} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_gene/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_gene/timing.json new file mode 100644 index 0000000000..84b4b44f68 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_gene/timing.json @@ -0,0 +1,5 @@ +{ + "total_tokens": 69995, + "duration_ms": 76787, + "total_duration_seconds": 76.8 +} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_original/outputs/card.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_original/outputs/card.mpx new file mode 100644 index 0000000000..31b26a70b4 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_original/outputs/card.mpx @@ -0,0 +1,133 @@ + + + + + + + diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_original/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_original/run-1/grading.json new file mode 100644 index 0000000000..5f7569c960 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_original/run-1/grading.json @@ -0,0 +1,57 @@ +{ + "eval_id": 1, + "run_kind": "mpx2rn_original", + "expectations": [ + { + "text": "uses composition API (script setup or setup())", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style: no nesting / compound selectors", + "passed": true, + "evidence": "PASS" + }, + { + "text": "uses hover-class for press feedback (not bare :active on root)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "triggerEvent('tap', ...) is called", + "passed": true, + "evidence": "PASS" + }, + { + "text": "title uses numberOfLines for ellipsis", + "passed": true, + "evidence": "PASS" + }, + { + "text": "avatar uses (not )", + "passed": true, + "evidence": "PASS" + }, + { + "text": "text content wrapped in elements", + "passed": true, + "evidence": "PASS" + }, + { + "text": "defineProps uses Mpx-style value: (not Vue-style default:)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", + "passed": true, + "evidence": "PASS" + } + ], + "summary": { + "pass_rate": 1.0, + "passed": 9, + "failed": 0, + "total": 9 + } +} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_original/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_original/timing.json new file mode 100644 index 0000000000..4be1f4944a --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_original/timing.json @@ -0,0 +1,5 @@ +{ + "total_tokens": 54868, + "duration_ms": 192051, + "total_duration_seconds": 192.1 +} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/eval_metadata.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/eval_metadata.json new file mode 100644 index 0000000000..a1cff54571 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/eval_metadata.json @@ -0,0 +1,17 @@ +{ + "eval_id": 2, + "eval_name": "adapt-style-block", + "prompt": "请对附件中的 .mpx 文件进行 RN 跨端样式适配改造,重点改造 diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_gene/outputs/style-block.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_gene/outputs/style-block.mpx new file mode 100644 index 0000000000..e45930162b --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_gene/outputs/style-block.mpx @@ -0,0 +1,106 @@ + + + + + diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_gene/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_gene/run-1/grading.json new file mode 100644 index 0000000000..133168d681 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_gene/run-1/grading.json @@ -0,0 +1,57 @@ +{ + "eval_id": 2, + "run_kind": "mpx2rn_gene", + "expectations": [ + { + "text": "style: no less nesting outside of conditional compile", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style on RN: no ::before pseudo-element", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style on RN: no display: grid", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style on RN: no :active pseudo-class", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style on RN: no + adjacent sibling combinator", + "passed": true, + "evidence": "PASS" + }, + { + "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style: numeric font-weight (e.g. 600) replaced with bold/normal", + "passed": true, + "evidence": "PASS" + }, + { + "text": "template: real node added to replace ::before", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style: no empty selector rules", + "passed": true, + "evidence": "PASS" + } + ], + "summary": { + "pass_rate": 1.0, + "passed": 9, + "failed": 0, + "total": 9 + } +} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_gene/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_gene/timing.json new file mode 100644 index 0000000000..18f29701c1 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_gene/timing.json @@ -0,0 +1,5 @@ +{ + "total_tokens": 56045, + "duration_ms": 103260, + "total_duration_seconds": 103.3 +} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_original/outputs/style-block.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_original/outputs/style-block.mpx new file mode 100644 index 0000000000..6b04fef2c5 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_original/outputs/style-block.mpx @@ -0,0 +1,116 @@ + + + + + diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_original/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_original/run-1/grading.json new file mode 100644 index 0000000000..fb914be72b --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_original/run-1/grading.json @@ -0,0 +1,57 @@ +{ + "eval_id": 2, + "run_kind": "mpx2rn_original", + "expectations": [ + { + "text": "style: no less nesting outside of conditional compile", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style on RN: no ::before pseudo-element", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style on RN: no display: grid", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style on RN: no :active pseudo-class", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style on RN: no + adjacent sibling combinator", + "passed": true, + "evidence": "PASS" + }, + { + "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style: numeric font-weight (e.g. 600) replaced with bold/normal", + "passed": true, + "evidence": "PASS" + }, + { + "text": "template: real node added to replace ::before", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style: no empty selector rules", + "passed": true, + "evidence": "PASS" + } + ], + "summary": { + "pass_rate": 1.0, + "passed": 9, + "failed": 0, + "total": 9 + } +} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_original/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_original/timing.json new file mode 100644 index 0000000000..27d09bfe7b --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_original/timing.json @@ -0,0 +1,5 @@ +{ + "total_tokens": 63691, + "duration_ms": 144331, + "total_duration_seconds": 144.3 +} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/eval_metadata.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/eval_metadata.json new file mode 100644 index 0000000000..f58a0da0c9 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/eval_metadata.json @@ -0,0 +1,17 @@ +{ + "eval_id": 3, + "eval_name": "selector-api-animation", + "prompt": "请对附件中的 dashboard.mpx 仪表盘组件进行 RN 跨端适配改造,确保 RN 平台编译运行正确,同时保留小程序/Web 平台兼容性。请输出修改后的完整 .mpx 文件,不要省略任何内容。", + "files": ["input/dashboard.mpx"], + "assertions": [ + {"text": "selector API nodes (#chartBox, #lazyArea) have empty wx:ref in template"}, + {"text": "wx.createAnimation replaced with mpx.createAnimation"}, + {"text": "gradient transparent replaced with rgba equivalent"}, + {"text": "rem units converted to rpx"}, + {"text": "enable-animation declared on animated view"}, + {"text": "@keyframes isolated with conditional compile (RN does not support)"}, + {"text": "display:none replaced with wx:if or size-zero hiding"}, + {"text": "style: no less nesting (all selectors flattened to single-class)"}, + {"text": "conditional compile uses @mpx-endif (not @mpx-end-if)"} + ] +} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/input/dashboard.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/input/dashboard.mpx new file mode 100644 index 0000000000..f8c6346fee --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/input/dashboard.mpx @@ -0,0 +1,176 @@ + + + + + diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_gene/outputs/dashboard.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_gene/outputs/dashboard.mpx new file mode 100644 index 0000000000..8d696a1fe0 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_gene/outputs/dashboard.mpx @@ -0,0 +1,197 @@ + + + + + diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_gene/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_gene/run-1/grading.json new file mode 100644 index 0000000000..707252eecc --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_gene/run-1/grading.json @@ -0,0 +1,67 @@ +{ + "eval_id": 3, + "run_kind": "mpx2rn_gene", + "expectations": [ + { + "text": "selector API nodes (#chartBox, #lazyArea) have empty wx:ref in template", + "passed": true, + "evidence": "PASS" + }, + { + "text": "wx.createAnimation replaced with mpx.createAnimation", + "passed": true, + "evidence": "PASS" + }, + { + "text": "gradient transparent replaced with rgba equivalent", + "passed": true, + "evidence": "PASS" + }, + { + "text": "rem units converted to rpx", + "passed": true, + "evidence": "PASS" + }, + { + "text": "template: event params use inline syntax (not data- dataset)", + "passed": false, + "evidence": "FAIL" + }, + { + "text": "enable-animation declared on animated view", + "passed": false, + "evidence": "FAIL" + }, + { + "text": "@keyframes isolated with conditional compile (RN does not support)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "display:none replaced with wx:if or size-zero hiding", + "passed": true, + "evidence": "PASS" + }, + { + "text": "transition preserved on RN (not stripped into wx-only conditional)", + "passed": false, + "evidence": "FAIL" + }, + { + "text": "style: no less nesting (all selectors flattened to single-class)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", + "passed": true, + "evidence": "PASS" + } + ], + "summary": { + "pass_rate": 0.7273, + "passed": 8, + "failed": 3, + "total": 11 + } +} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_gene/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_gene/timing.json new file mode 100644 index 0000000000..466fda7f55 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_gene/timing.json @@ -0,0 +1,5 @@ +{ + "total_tokens": 106035, + "duration_ms": 147253, + "total_duration_seconds": 147.3 +} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_original/outputs/dashboard.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_original/outputs/dashboard.mpx new file mode 100644 index 0000000000..aba2b2ee0d --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_original/outputs/dashboard.mpx @@ -0,0 +1,237 @@ + + + + + diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_original/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_original/run-1/grading.json new file mode 100644 index 0000000000..63d69145d9 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_original/run-1/grading.json @@ -0,0 +1,67 @@ +{ + "eval_id": 3, + "run_kind": "mpx2rn_original", + "expectations": [ + { + "text": "selector API nodes (#chartBox, #lazyArea) have empty wx:ref in template", + "passed": true, + "evidence": "PASS" + }, + { + "text": "wx.createAnimation replaced with mpx.createAnimation", + "passed": true, + "evidence": "PASS" + }, + { + "text": "gradient transparent replaced with rgba equivalent", + "passed": true, + "evidence": "PASS" + }, + { + "text": "rem units converted to rpx", + "passed": true, + "evidence": "PASS" + }, + { + "text": "template: event params use inline syntax (not data- dataset)", + "passed": false, + "evidence": "FAIL" + }, + { + "text": "enable-animation declared on animated view", + "passed": true, + "evidence": "PASS" + }, + { + "text": "@keyframes isolated with conditional compile (RN does not support)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "display:none replaced with wx:if or size-zero hiding", + "passed": true, + "evidence": "PASS" + }, + { + "text": "transition preserved on RN (not stripped into wx-only conditional)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style: no less nesting (all selectors flattened to single-class)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", + "passed": true, + "evidence": "PASS" + } + ], + "summary": { + "pass_rate": 0.9091, + "passed": 10, + "failed": 1, + "total": 11 + } +} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_original/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_original/timing.json new file mode 100644 index 0000000000..ff9842d054 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_original/timing.json @@ -0,0 +1,5 @@ +{ + "total_tokens": 95452, + "duration_ms": 357870, + "total_duration_seconds": 357.9 +} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/eval_metadata.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/eval_metadata.json new file mode 100644 index 0000000000..4529d9ee31 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/eval_metadata.json @@ -0,0 +1,17 @@ +{ + "eval_id": 4, + "eval_name": "slots-cssvar-i18n", + "prompt": "请对附件中的 panel.mpx 面板组件进行 RN 跨端适配改造,确保 RN 平台编译运行正确,同时保留小程序/Web 平台兼容性。请输出修改后的完整 .mpx 文件,不要省略任何内容。", + "files": ["input/panel.mpx"], + "assertions": [ + {"text": "multipleSlots: true preserved in component options"}, + {"text": "CSS variables (var(--...)) syntax preserved"}, + {"text": "$t() i18n function calls preserved in template"}, + {"text": "background-image only on view components (not text)"}, + {"text": "enable-background declared on dynamic background view"}, + {"text": "::after pseudo-element replaced with real node"}, + {"text": "style: no less nesting (all selectors flattened)"}, + {"text": "calc() expressions preserved"}, + {"text": "conditional compile uses @mpx-endif (not @mpx-end-if)"} + ] +} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/input/panel.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/input/panel.mpx new file mode 100644 index 0000000000..46a3003974 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/input/panel.mpx @@ -0,0 +1,169 @@ + + + + + + + diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_gene/outputs/panel.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_gene/outputs/panel.mpx new file mode 100644 index 0000000000..0f3699d4ed --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_gene/outputs/panel.mpx @@ -0,0 +1,205 @@ + + + + + + + diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_gene/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_gene/run-1/grading.json new file mode 100644 index 0000000000..9ccfdd701e --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_gene/run-1/grading.json @@ -0,0 +1,57 @@ +{ + "eval_id": 4, + "run_kind": "mpx2rn_gene", + "expectations": [ + { + "text": "multipleSlots: true preserved in component options", + "passed": true, + "evidence": "PASS" + }, + { + "text": "CSS variables (var(--...)) syntax preserved", + "passed": true, + "evidence": "PASS" + }, + { + "text": "$t() i18n function calls preserved in template", + "passed": true, + "evidence": "PASS" + }, + { + "text": "background-image only on view components (not text)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "enable-background declared on dynamic background view", + "passed": true, + "evidence": "PASS" + }, + { + "text": "::after pseudo-element replaced with real node", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style: no less nesting (all selectors flattened)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "calc() preserved or replaced with flex equivalent", + "passed": true, + "evidence": "PASS" + }, + { + "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", + "passed": true, + "evidence": "PASS" + } + ], + "summary": { + "pass_rate": 1.0, + "passed": 9, + "failed": 0, + "total": 9 + } +} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_gene/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_gene/timing.json new file mode 100644 index 0000000000..3944eb4a77 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_gene/timing.json @@ -0,0 +1,5 @@ +{ + "total_tokens": 95498, + "duration_ms": 179975, + "total_duration_seconds": 180.0 +} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_original/outputs/panel.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_original/outputs/panel.mpx new file mode 100644 index 0000000000..676f43eb5b --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_original/outputs/panel.mpx @@ -0,0 +1,205 @@ + + + + + + + diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_original/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_original/run-1/grading.json new file mode 100644 index 0000000000..75096d0176 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_original/run-1/grading.json @@ -0,0 +1,57 @@ +{ + "eval_id": 4, + "run_kind": "mpx2rn_original", + "expectations": [ + { + "text": "multipleSlots: true preserved in component options", + "passed": true, + "evidence": "PASS" + }, + { + "text": "CSS variables (var(--...)) syntax preserved", + "passed": true, + "evidence": "PASS" + }, + { + "text": "$t() i18n function calls preserved in template", + "passed": true, + "evidence": "PASS" + }, + { + "text": "background-image only on view components (not text)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "enable-background declared on dynamic background view", + "passed": true, + "evidence": "PASS" + }, + { + "text": "::after pseudo-element replaced with real node", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style: no less nesting (all selectors flattened)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "calc() preserved or replaced with flex equivalent", + "passed": false, + "evidence": "FAIL" + }, + { + "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", + "passed": true, + "evidence": "PASS" + } + ], + "summary": { + "pass_rate": 0.8889, + "passed": 8, + "failed": 1, + "total": 9 + } +} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_original/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_original/timing.json new file mode 100644 index 0000000000..2ea68e714d --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_original/timing.json @@ -0,0 +1,5 @@ +{ + "total_tokens": 97054, + "duration_ms": 180146, + "total_duration_seconds": 180.1 +} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/eval_metadata.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/eval_metadata.json new file mode 100644 index 0000000000..d2b4494c4e --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/eval_metadata.json @@ -0,0 +1,17 @@ +{ + "eval_id": 5, + "eval_name": "pinia-scroll-intersection", + "prompt": "请对附件中的 product-list.mpx 商品列表页面进行 RN 跨端适配改造,确保 RN 平台编译运行正确,同时保留小程序/Web 平台兼容性。请输出修改后的完整 .mpx 文件,不要省略任何内容。", + "files": ["input/product-list.mpx"], + "assertions": [ + {"text": "Pinia store import and usage preserved"}, + {"text": "onPullDownRefresh/onReachBottom replaced with scroll-view events"}, + {"text": "createIntersectionObserver target (#exposureAnchor) has wx:ref"}, + {"text": "all wx.xxx replaced with mpx.xxx"}, + {"text": "e.target.dataset replaced with e.currentTarget.dataset"}, + {"text": "float layout replaced with flex"}, + {"text": "font-weight numeric (500/700) replaced with bold/normal"}, + {"text": "style: no less nesting (all selectors flattened)"}, + {"text": "conditional compile uses @mpx-endif (not @mpx-end-if)"} + ] +} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/input/product-list.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/input/product-list.mpx new file mode 100644 index 0000000000..56527cffbc --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/input/product-list.mpx @@ -0,0 +1,254 @@ + + + + + diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_gene/outputs/product-list.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_gene/outputs/product-list.mpx new file mode 100644 index 0000000000..ee0f3da2ae --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_gene/outputs/product-list.mpx @@ -0,0 +1,365 @@ + + + + + + + diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_gene/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_gene/run-1/grading.json new file mode 100644 index 0000000000..6ac20f139c --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_gene/run-1/grading.json @@ -0,0 +1,57 @@ +{ + "eval_id": 5, + "run_kind": "mpx2rn_gene", + "expectations": [ + { + "text": "Pinia store import and usage preserved", + "passed": true, + "evidence": "PASS" + }, + { + "text": "onPullDownRefresh/onReachBottom replaced with scroll-view events", + "passed": true, + "evidence": "PASS" + }, + { + "text": "createIntersectionObserver target (#exposureAnchor) has wx:ref", + "passed": true, + "evidence": "PASS" + }, + { + "text": "all wx.xxx replaced with mpx.xxx", + "passed": true, + "evidence": "PASS" + }, + { + "text": "template: event params use inline syntax (not data- dataset)", + "passed": false, + "evidence": "FAIL" + }, + { + "text": "float layout replaced with flex", + "passed": true, + "evidence": "PASS" + }, + { + "text": "font-weight numeric (500/700) replaced with bold/normal", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style: no less nesting (all selectors flattened)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", + "passed": true, + "evidence": "PASS" + } + ], + "summary": { + "pass_rate": 0.8889, + "passed": 8, + "failed": 1, + "total": 9 + } +} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_gene/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_gene/timing.json new file mode 100644 index 0000000000..43e9db9282 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_gene/timing.json @@ -0,0 +1,5 @@ +{ + "total_tokens": 103185, + "duration_ms": 156710, + "total_duration_seconds": 156.7 +} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_original/outputs/product-list.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_original/outputs/product-list.mpx new file mode 100644 index 0000000000..ea54ccbdf3 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_original/outputs/product-list.mpx @@ -0,0 +1,341 @@ + + + + + diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_original/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_original/run-1/grading.json new file mode 100644 index 0000000000..702e65e688 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_original/run-1/grading.json @@ -0,0 +1,57 @@ +{ + "eval_id": 5, + "run_kind": "mpx2rn_original", + "expectations": [ + { + "text": "Pinia store import and usage preserved", + "passed": true, + "evidence": "PASS" + }, + { + "text": "onPullDownRefresh/onReachBottom replaced with scroll-view events", + "passed": true, + "evidence": "PASS" + }, + { + "text": "createIntersectionObserver target (#exposureAnchor) has wx:ref", + "passed": true, + "evidence": "PASS" + }, + { + "text": "all wx.xxx replaced with mpx.xxx", + "passed": true, + "evidence": "PASS" + }, + { + "text": "template: event params use inline syntax (not data- dataset)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "float layout replaced with flex", + "passed": true, + "evidence": "PASS" + }, + { + "text": "font-weight numeric (500/700) replaced with bold/normal", + "passed": true, + "evidence": "PASS" + }, + { + "text": "style: no less nesting (all selectors flattened)", + "passed": true, + "evidence": "PASS" + }, + { + "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", + "passed": true, + "evidence": "PASS" + } + ], + "summary": { + "pass_rate": 1.0, + "passed": 9, + "failed": 0, + "total": 9 + } +} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_original/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_original/timing.json new file mode 100644 index 0000000000..0c454d53aa --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_original/timing.json @@ -0,0 +1,5 @@ +{ + "total_tokens": 112184, + "duration_ms": 189880, + "total_duration_seconds": 189.9 +} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/evals.json b/.agents/skills/mpx2rn-workspace/iteration-3/evals.json new file mode 100644 index 0000000000..1b9ecc1e19 --- /dev/null +++ b/.agents/skills/mpx2rn-workspace/iteration-3/evals.json @@ -0,0 +1,113 @@ +{ + "skill_name": "mpx2rn-gene vs mpx2rn", + "comparison": { + "skill_a": "mpx2rn-gene (Gene-based)", + "skill_b": "mpx2rn (Original)" + }, + "evals": [ + { + "id": 0, + "name": "adapt-list-page", + "prompt": "请帮我对附件中的 Mpx 页面 list.mpx 进行 RN 跨端适配改造,确保它能在 RN 平台正确编译运行,同时保留小程序/Web 平台的兼容性。请输出修改后的完整 .mpx 代码(保持 SFC 结构 template/script/style),不要省略任何内容。", + "files": ["input/list.mpx"], + "assertions": [ + {"text": "style: no less nesting (& or rule-in-rule)"}, + {"text": "style on RN (wx-conditional stripped): no :active"}, + {"text": "style on RN: no :first-child"}, + {"text": "script: replaced wx.request with mpx.request"}, + {"text": "script: replaced wx.navigateTo with mpx.navigateTo"}, + {"text": "template: event params use inline syntax (not data- dataset)"}, + {"text": "template: dynamic class via wx:class (not class string interp)"}, + {"text": "conditional compile uses @mpx-endif (not @mpx-end-if)"}, + {"text": "style: no empty selector rules after stripping comments"} + ] + }, + { + "id": 1, + "name": "create-card-component", + "prompt": "请帮我创建一个符合 RN 跨端兼容规范的 Mpx 卡片组件 card.mpx,需求:\n- 接收 props:title (string)、desc (string)、avatar (string,图片 URL)、selected (boolean,默认 false)\n- 卡片整体可点击,点击时通过 triggerEvent 抛出 'tap' 事件\n- 点击时有按下视觉反馈\n- selected=true 时卡片边框色变为蓝色 (#1677ff)\n- 标题需要单行省略\n- 描述最多展示 2 行后省略\n- 使用组合式 API(setup 或 ", + src, re.DOTALL | re.IGNORECASE): + attrs = (m.group("attrs") or "").lower() + body = m.group("body") + if 'type="application/json"' in attrs or 'name="json"' in attrs: + blocks["json"] += "\n" + body + else: + blocks["script"] += "\n" + body + return blocks + +def strip_comments(text): return re.sub(r"/\*.*?\*/", "", text, flags=re.DOTALL) + +def strip_wx_conditional_blocks(text): + return re.sub( + r"/\*\s*@mpx-if[^*]*?(wx|ali|web)[^*]*?\*/.*?/\*\s*@mpx-(endif|end-if)\s*\*/", + "", text, flags=re.DOTALL | re.IGNORECASE) + +def strip_at_rules(text): + """Strip @keyframes and @media blocks so they don't trigger nesting detection.""" + result = re.sub(r"@keyframes\s+[\w-]+\s*\{[^}]*(?:\{[^}]*\}[^}]*)*\}", "", text, flags=re.DOTALL) + result = re.sub(r"@media\s[^{]*\{[^}]*(?:\{[^}]*\}[^}]*)*\}", "", result, flags=re.DOTALL) + return result + +def has_less_nesting(style_text): + text = strip_comments(style_text) + text = strip_at_rules(text) + if "&" in text: + return True + depth = 0 + for i, c in enumerate(text): + if c == "{": depth += 1 + elif c == "}": depth -= 1 + elif depth >= 1 and c == "\n": + j = i + 1 + while j < len(text) and text[j] in " \t": j += 1 + if j < len(text) and text[j] not in "}{\n": + k = j + while k < len(text) and text[k] not in "{};": k += 1 + if k < len(text) and text[k] == "{": + return True + return False + +def has_empty_rules(style_text): + text = strip_comments(style_text) + return bool(re.search(r"[^{}]+\{\s*\}", text)) + +def uses_wrong_endif(text): return "@mpx-end-if" in text + +def check_eval_0(output_path): + src = output_path.read_text() + blocks = extract_blocks(src) + style_rn = strip_wx_conditional_blocks(blocks["style"]) + results = [ + {"text": "style: no less nesting (& or rule-in-rule)", + "passed": not has_less_nesting(blocks["style"])}, + {"text": "style on RN (wx-conditional stripped): no :active", + "passed": ":active" not in strip_comments(style_rn)}, + {"text": "style on RN: no :first-child", + "passed": ":first-child" not in strip_comments(style_rn)}, + {"text": "script: replaced wx.request with mpx.request", + "passed": "wx.request" not in blocks["script"] and "mpx.request" in blocks["script"]}, + {"text": "script: replaced wx.navigateTo with mpx.navigateTo", + "passed": "wx.navigateTo" not in blocks["script"] and "mpx.navigateTo" in blocks["script"]}, + {"text": "template: event params use inline syntax (not data- dataset)", + "passed": not re.search(r'\bdata-\w+\s*=', blocks["template"]) + and "dataset" not in blocks["script"]}, + {"text": "template: dynamic class via wx:class (not class string interp)", + "passed": not re.search(r'(? (not )", + "passed": " elements", "passed": "]*wx:ref', blocks["template"])) or \ + bool(re.search(r'wx:ref[^>]*id="chartBox"', blocks["template"])) + has_wxref_lazy = bool(re.search(r'id="lazyArea"[^>]*wx:ref', blocks["template"])) or \ + bool(re.search(r'wx:ref[^>]*id="lazyArea"', blocks["template"])) + results.append({"text": "selector API nodes (#chartBox, #lazyArea) have empty wx:ref in template", + "passed": has_wxref_chart and has_wxref_lazy}) + results.append({"text": "wx.createAnimation replaced with mpx.createAnimation", + "passed": "wx.createAnimation" not in blocks["script"] + and "mpx.createAnimation" in blocks["script"]}) + results.append({"text": "gradient transparent replaced with rgba equivalent", + "passed": "transparent" not in style_rn_clean + or bool(re.search(r"rgba\(\s*\d+", style_rn_clean))}) + has_rem = bool(re.search(r":\s*[\d.]+rem", style_rn_clean)) + results.append({"text": "rem units converted to rpx", "passed": not has_rem}) + results.append({"text": "template: event params use inline syntax (not data- dataset)", + "passed": not re.search(r'\bdata-\w+\s*=', blocks["template"]) + and "dataset" not in blocks["script"]}) + results.append({"text": "enable-animation declared on animated view", + "passed": "enable-animation" in blocks["template"]}) + has_keyframes_rn = bool(re.search(r"@keyframes", style_rn_clean)) + results.append({"text": "@keyframes isolated with conditional compile (RN does not support)", + "passed": not has_keyframes_rn}) + has_display_none_rn = bool(re.search(r"display\s*:\s*none", style_rn_clean)) + results.append({"text": "display:none replaced with wx:if or size-zero hiding", + "passed": not has_display_none_rn}) + has_transition_rn = bool(re.search(r"transition\s*:", style_rn_clean)) + results.append({"text": "transition preserved on RN (not stripped into wx-only conditional)", + "passed": has_transition_rn}) + results.append({"text": "style: no less nesting (all selectors flattened to single-class)", + "passed": not has_less_nesting(blocks["style"])}) + results.append({"text": "conditional compile uses @mpx-endif (not @mpx-end-if)", + "passed": not uses_wrong_endif(src)}) + return results + +def check_eval_4(output_path): + src = output_path.read_text() + blocks = extract_blocks(src) + style_rn = strip_wx_conditional_blocks(blocks["style"]) + style_rn_clean = strip_comments(style_rn) + results = [] + results.append({"text": "multipleSlots: true preserved in component options", + "passed": "multipleSlots" in blocks["script"] and "true" in blocks["script"]}) + results.append({"text": "CSS variables (var(--...)) syntax preserved", + "passed": bool(re.search(r"var\(--", blocks["style"]))}) + results.append({"text": "$t() i18n function calls preserved in template", + "passed": "$t(" in blocks["template"] or "$t'" in blocks["template"]}) + bg_on_text = bool(re.search(r"]*enable-background", blocks["template"])) + results.append({"text": "background-image only on view components (not text)", + "passed": not bg_on_text}) + results.append({"text": "enable-background declared on dynamic background view", + "passed": "enable-background" in blocks["template"]}) + has_after_rn = "::after" in style_rn_clean or ":after" in style_rn_clean + results.append({"text": "::after pseudo-element replaced with real node", + "passed": not has_after_rn}) + results.append({"text": "style: no less nesting (all selectors flattened)", + "passed": not has_less_nesting(blocks["style"])}) + results.append({"text": "calc() preserved or replaced with flex equivalent", + "passed": "calc(" in blocks["style"] + or "flex:" in style_rn_clean or "flex-grow" in style_rn_clean}) + results.append({"text": "conditional compile uses @mpx-endif (not @mpx-end-if)", + "passed": not uses_wrong_endif(src)}) + return results + +def check_eval_5(output_path): + src = output_path.read_text() + blocks = extract_blocks(src) + style_rn = strip_wx_conditional_blocks(blocks["style"]) + style_rn_clean = strip_comments(style_rn) + results = [] + results.append({"text": "Pinia store import and usage preserved", + "passed": "useProductStore" in blocks["script"]}) + has_scroll_view = "scroll-view" in blocks["template"] + has_scroll_events = "bindscrolltolower" in blocks["template"] or "bindrefresherrefresh" in blocks["template"] + results.append({"text": "onPullDownRefresh/onReachBottom replaced with scroll-view events", + "passed": has_scroll_view and has_scroll_events}) + has_wxref_exposure = bool(re.search(r'id="exposureAnchor"[^>]*wx:ref', blocks["template"])) or \ + bool(re.search(r'wx:ref[^>]*id="exposureAnchor"', blocks["template"])) + results.append({"text": "createIntersectionObserver target (#exposureAnchor) has wx:ref", + "passed": has_wxref_exposure}) + has_wx_api = bool(re.search(r"\bwx\.(request|navigateTo|stopPullDownRefresh)", blocks["script"])) + has_mpx_api = "mpx." in blocks["script"] + results.append({"text": "all wx.xxx replaced with mpx.xxx", + "passed": not has_wx_api and has_mpx_api}) + results.append({"text": "template: event params use inline syntax (not data- dataset)", + "passed": not re.search(r'\bdata-\w+\s*=', blocks["template"]) + and "dataset" not in blocks["script"]}) + has_float_rn = bool(re.search(r"float\s*:\s*(left|right)", style_rn_clean)) + results.append({"text": "float layout replaced with flex", + "passed": not has_float_rn}) + has_numeric_fw = bool(re.search(r"font-weight\s*:\s*[1-9]\d{2}", style_rn_clean)) + results.append({"text": "font-weight numeric (500/700) replaced with bold/normal", + "passed": not has_numeric_fw}) + results.append({"text": "style: no less nesting (all selectors flattened)", + "passed": not has_less_nesting(blocks["style"])}) + results.append({"text": "conditional compile uses @mpx-endif (not @mpx-end-if)", + "passed": not uses_wrong_endif(src)}) + return results + +CHECKERS = {0: check_eval_0, 1: check_eval_1, 2: check_eval_2, + 3: check_eval_3, 4: check_eval_4, 5: check_eval_5} +EVAL_DIRS = {0: "eval-0-adapt-list-page", 1: "eval-1-create-card-component", 2: "eval-2-adapt-style-block", + 3: "eval-3-selector-api-animation", 4: "eval-4-slots-cssvar-i18n", 5: "eval-5-pinia-scroll-intersection"} +OUTPUT_FILES = {0: "list.mpx", 1: "card.mpx", 2: "style-block.mpx", + 3: "dashboard.mpx", 4: "panel.mpx", 5: "product-list.mpx"} +RUN_KINDS = ("mpx2rn_gene", "mpx2rn_original") + +def grade_run(eval_id, run_kind): + eval_dir = WORKSPACE / EVAL_DIRS[eval_id] + out_path = eval_dir / run_kind / "outputs" / OUTPUT_FILES[eval_id] + if not out_path.exists(): + print(f"missing: {out_path}", file=sys.stderr) + return None + results = CHECKERS[eval_id](out_path) + enriched = [{"text": r["text"], "passed": bool(r["passed"]), + "evidence": "PASS" if r["passed"] else "FAIL"} for r in results] + passed = sum(1 for e in enriched if e["passed"]) + total = len(enriched) + grading = { + "eval_id": eval_id, "run_kind": run_kind, "expectations": enriched, + "summary": {"pass_rate": round(passed / total, 4) if total else 0.0, + "passed": passed, "failed": total - passed, "total": total}, + } + run_dir = eval_dir / run_kind / "run-1" + run_dir.mkdir(parents=True, exist_ok=True) + (run_dir / "grading.json").write_text(json.dumps(grading, ensure_ascii=False, indent=2)) + return grading + +def main(): + summary = [] + for eid in sorted(EVAL_DIRS.keys()): + for kind in RUN_KINDS: + g = grade_run(eid, kind) + if g: + s = g["summary"] + summary.append({"eval": EVAL_DIRS[eid], "kind": kind, + "score": f"{s['passed']}/{s['total']}"}) + print(json.dumps(summary, ensure_ascii=False, indent=2)) + +if __name__ == "__main__": + main() diff --git a/.agents/skills/mpx2rn/SKILL.md b/.agents/skills/mpx2rn/SKILL.md index 2e49112839..3fb18c9c46 100644 --- a/.agents/skills/mpx2rn/SKILL.md +++ b/.agents/skills/mpx2rn/SKILL.md @@ -60,9 +60,10 @@ Mpx 是一个以微信小程序语法为基础、进行了类 Vue 语法拓展 1. **基础组件优先**:使用 [模板能力参考 · 基础组件](./references/rn-template-reference.md#基础组件) 中标注 RN 支持的基础组件与其支持属性/事件,不要使用 RN 不支持的属性或事件;如用户通过 `rnConfig.customBuiltInComponents` 编译配置扩充拓展了基础组件能力,以用户说明为准。 2. **页面滚动**:RN 平台页面默认不可滚动,`onPullDownRefresh` / `onReachBottom` / `onPageScroll` 不会触发;需要滚动时使用 `scroll-view` 包裹并使用其等效能力。 -3. **事件冒泡/捕获**:仅基础通用事件(`tap` / `longpress` / `touchstart` / `touchmove` / `touchend` / `touchcancel`)支持冒泡和捕获;其余事件不支持。事件委托不要依赖 `e.target.dataset`,使用 `e.currentTarget` 替代。 +3. **事件冒泡/捕获**:仅基础通用事件(`tap` / `longpress` / `touchstart` / `touchmove` / `touchend` / `touchcancel`)支持冒泡和捕获;其余事件不支持。 4. **模板内方法调用**:模板 Mustache 表达式不支持普通方法调用,需通过 `computed` / `wxs` 实现(i18n 翻译函数除外)。 5. **i18n**:组合式 API 中 `useI18n()` 解构出的翻译函数必须以原名 `t` / `tc` / `te` / `tm` 暴露至模板的 `return`,禁止重命名。 +6. **事件传参**:传递自定义参数给事件处理器时,优先使用事件内联传参语法(如 `bindtap="handleTap('param')"`),而不是通过 `data-` dataset 属性传参。 ### 脚本(script)约束 diff --git a/.agents/skills/mpx2rn/references/rn-script-reference.md b/.agents/skills/mpx2rn/references/rn-script-reference.md index ee8dba4173..e6ec76815e 100644 --- a/.agents/skills/mpx2rn/references/rn-script-reference.md +++ b/.agents/skills/mpx2rn/references/rn-script-reference.md @@ -13,6 +13,11 @@ - [`setup` 的第一个参数 `props`](#setup-的第一个参数-props) - [`setup` 的第二个参数 `context`](#setup-的第二个参数-context) - [` - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-1/eval-0-adapt-list-page/with_skill/outputs/list.mpx b/.agents/skills/mpx2rn-workspace/iteration-1/eval-0-adapt-list-page/with_skill/outputs/list.mpx deleted file mode 100644 index dfc42917a1..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-1/eval-0-adapt-list-page/with_skill/outputs/list.mpx +++ /dev/null @@ -1,129 +0,0 @@ - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-1/eval-0-adapt-list-page/with_skill/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-1/eval-0-adapt-list-page/with_skill/run-1/grading.json deleted file mode 100644 index ba953e66bb..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-1/eval-0-adapt-list-page/with_skill/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 0, - "run_kind": "with_skill", - "expectations": [ - { - "text": "style: no less nesting (& or rule-in-rule)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN (wx-conditional stripped): no `:active`", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no `:first-child`", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: replaced wx.request with mpx.request", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: replaced wx.navigateTo with mpx.navigateTo", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: uses e.currentTarget.dataset (not e.target.dataset)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "template: dynamic class via wx:class (not class string interp)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no empty selector rules after stripping comments", - "passed": true, - "evidence": "PASS" - } - ], - "summary": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-1/eval-0-adapt-list-page/with_skill/run-1/timing.json b/.agents/skills/mpx2rn-workspace/iteration-1/eval-0-adapt-list-page/with_skill/run-1/timing.json deleted file mode 100644 index 691d6dff6c..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-1/eval-0-adapt-list-page/with_skill/run-1/timing.json +++ /dev/null @@ -1 +0,0 @@ -{"total_tokens": 48442, "duration_ms": 63095, "total_duration_seconds": 63.1} diff --git a/.agents/skills/mpx2rn-workspace/iteration-1/eval-0-adapt-list-page/without_skill/outputs/list.mpx b/.agents/skills/mpx2rn-workspace/iteration-1/eval-0-adapt-list-page/without_skill/outputs/list.mpx deleted file mode 100644 index 3aae9f5a61..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-1/eval-0-adapt-list-page/without_skill/outputs/list.mpx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-1/eval-0-adapt-list-page/without_skill/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-1/eval-0-adapt-list-page/without_skill/run-1/grading.json deleted file mode 100644 index b3facf91fe..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-1/eval-0-adapt-list-page/without_skill/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 0, - "run_kind": "without_skill", - "expectations": [ - { - "text": "style: no less nesting (& or rule-in-rule)", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "style on RN (wx-conditional stripped): no `:active`", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no `:first-child`", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: replaced wx.request with mpx.request", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: replaced wx.navigateTo with mpx.navigateTo", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: uses e.currentTarget.dataset (not e.target.dataset)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "template: dynamic class via wx:class (not class string interp)", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "style: no empty selector rules after stripping comments", - "passed": false, - "evidence": "FAIL" - } - ], - "summary": { - "pass_rate": 0.5556, - "passed": 5, - "failed": 4, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-1/eval-0-adapt-list-page/without_skill/run-1/timing.json b/.agents/skills/mpx2rn-workspace/iteration-1/eval-0-adapt-list-page/without_skill/run-1/timing.json deleted file mode 100644 index 556825a195..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-1/eval-0-adapt-list-page/without_skill/run-1/timing.json +++ /dev/null @@ -1 +0,0 @@ -{"total_tokens": 18598, "duration_ms": 65284, "total_duration_seconds": 65.3} diff --git a/.agents/skills/mpx2rn-workspace/iteration-1/eval-1-create-card-component/eval_metadata.json b/.agents/skills/mpx2rn-workspace/iteration-1/eval-1-create-card-component/eval_metadata.json deleted file mode 100644 index b8b2ef7f89..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-1/eval-1-create-card-component/eval_metadata.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "eval_id": 1, - "eval_name": "create-card-component", - "prompt": "请帮我创建一个符合 RN 跨端兼容规范的 Mpx 卡片组件 card.mpx。需求:title/desc/avatar/selected props;triggerEvent('tap');hover 反馈;选中时蓝色边框;标题单行省略;描述 2 行省略;使用组合式 API。", - "files": [] -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-1/eval-1-create-card-component/with_skill/outputs/card.mpx b/.agents/skills/mpx2rn-workspace/iteration-1/eval-1-create-card-component/with_skill/outputs/card.mpx deleted file mode 100644 index 569c17bb29..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-1/eval-1-create-card-component/with_skill/outputs/card.mpx +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-1/eval-1-create-card-component/with_skill/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-1/eval-1-create-card-component/with_skill/run-1/grading.json deleted file mode 100644 index 0784529a00..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-1/eval-1-create-card-component/with_skill/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 1, - "run_kind": "with_skill", - "expectations": [ - { - "text": "uses composition API (script setup or setup())", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no nesting / compound selectors", - "passed": true, - "evidence": "PASS" - }, - { - "text": "uses hover-class for press feedback (not bare :active on root)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "triggerEvent('tap', ...) is called", - "passed": true, - "evidence": "PASS" - }, - { - "text": "title uses numberOfLines for ellipsis", - "passed": true, - "evidence": "PASS" - }, - { - "text": "avatar uses (not )", - "passed": true, - "evidence": "PASS" - }, - { - "text": "text content wrapped in elements", - "passed": true, - "evidence": "PASS" - }, - { - "text": "defineProps uses Mpx-style `value:` (not Vue-style `default:`)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - } - ], - "summary": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-1/eval-1-create-card-component/with_skill/run-1/timing.json b/.agents/skills/mpx2rn-workspace/iteration-1/eval-1-create-card-component/with_skill/run-1/timing.json deleted file mode 100644 index 702ad219de..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-1/eval-1-create-card-component/with_skill/run-1/timing.json +++ /dev/null @@ -1 +0,0 @@ -{"total_tokens": 95996, "duration_ms": 102433, "total_duration_seconds": 102.4} diff --git a/.agents/skills/mpx2rn-workspace/iteration-1/eval-1-create-card-component/without_skill/outputs/card.mpx b/.agents/skills/mpx2rn-workspace/iteration-1/eval-1-create-card-component/without_skill/outputs/card.mpx deleted file mode 100644 index bac75965c0..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-1/eval-1-create-card-component/without_skill/outputs/card.mpx +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-1/eval-1-create-card-component/without_skill/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-1/eval-1-create-card-component/without_skill/run-1/grading.json deleted file mode 100644 index 592a293c8a..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-1/eval-1-create-card-component/without_skill/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 1, - "run_kind": "without_skill", - "expectations": [ - { - "text": "uses composition API (script setup or setup())", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no nesting / compound selectors", - "passed": true, - "evidence": "PASS" - }, - { - "text": "uses hover-class for press feedback (not bare :active on root)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "triggerEvent('tap', ...) is called", - "passed": true, - "evidence": "PASS" - }, - { - "text": "title uses numberOfLines for ellipsis", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "avatar uses (not )", - "passed": true, - "evidence": "PASS" - }, - { - "text": "text content wrapped in elements", - "passed": true, - "evidence": "PASS" - }, - { - "text": "defineProps uses Mpx-style `value:` (not Vue-style `default:`)", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - } - ], - "summary": { - "pass_rate": 0.7778, - "passed": 7, - "failed": 2, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-1/eval-1-create-card-component/without_skill/run-1/timing.json b/.agents/skills/mpx2rn-workspace/iteration-1/eval-1-create-card-component/without_skill/run-1/timing.json deleted file mode 100644 index c324cb00a8..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-1/eval-1-create-card-component/without_skill/run-1/timing.json +++ /dev/null @@ -1 +0,0 @@ -{"total_tokens": 16390, "duration_ms": 115324, "total_duration_seconds": 115.3} diff --git a/.agents/skills/mpx2rn-workspace/iteration-1/eval-2-adapt-style-block/eval_metadata.json b/.agents/skills/mpx2rn-workspace/iteration-1/eval-2-adapt-style-block/eval_metadata.json deleted file mode 100644 index 41a90f689a..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-1/eval-2-adapt-style-block/eval_metadata.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "eval_id": 2, - "eval_name": "adapt-style-block", - "prompt": "请对附件中的 .mpx 文件进行 RN 跨端样式适配改造,重点改造 diff --git a/.agents/skills/mpx2rn-workspace/iteration-1/eval-2-adapt-style-block/with_skill/outputs/style-block.mpx b/.agents/skills/mpx2rn-workspace/iteration-1/eval-2-adapt-style-block/with_skill/outputs/style-block.mpx deleted file mode 100644 index 837b3067ff..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-1/eval-2-adapt-style-block/with_skill/outputs/style-block.mpx +++ /dev/null @@ -1,91 +0,0 @@ - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-1/eval-2-adapt-style-block/with_skill/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-1/eval-2-adapt-style-block/with_skill/run-1/grading.json deleted file mode 100644 index 53fadb2a8e..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-1/eval-2-adapt-style-block/with_skill/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 2, - "run_kind": "with_skill", - "expectations": [ - { - "text": "style: no less nesting outside of conditional compile", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no ::before pseudo-element", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no `display: grid`", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no `:active` pseudo-class", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no `+` adjacent sibling combinator", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: numeric font-weight (e.g. 600) replaced with bold/normal", - "passed": true, - "evidence": "PASS" - }, - { - "text": "template: real node added to replace ::before (e.g. card-decorator/card-bar)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no empty selector rules", - "passed": true, - "evidence": "PASS" - } - ], - "summary": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-1/eval-2-adapt-style-block/with_skill/run-1/timing.json b/.agents/skills/mpx2rn-workspace/iteration-1/eval-2-adapt-style-block/with_skill/run-1/timing.json deleted file mode 100644 index 9276431c44..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-1/eval-2-adapt-style-block/with_skill/run-1/timing.json +++ /dev/null @@ -1 +0,0 @@ -{"total_tokens": 52994, "duration_ms": 57315, "total_duration_seconds": 57.3} diff --git a/.agents/skills/mpx2rn-workspace/iteration-1/eval-2-adapt-style-block/without_skill/outputs/style-block.mpx b/.agents/skills/mpx2rn-workspace/iteration-1/eval-2-adapt-style-block/without_skill/outputs/style-block.mpx deleted file mode 100644 index 1ca7f2b94c..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-1/eval-2-adapt-style-block/without_skill/outputs/style-block.mpx +++ /dev/null @@ -1,113 +0,0 @@ - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-1/eval-2-adapt-style-block/without_skill/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-1/eval-2-adapt-style-block/without_skill/run-1/grading.json deleted file mode 100644 index b785abb7b9..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-1/eval-2-adapt-style-block/without_skill/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 2, - "run_kind": "without_skill", - "expectations": [ - { - "text": "style: no less nesting outside of conditional compile", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "style on RN: no ::before pseudo-element", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no `display: grid`", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no `:active` pseudo-class", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no `+` adjacent sibling combinator", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: numeric font-weight (e.g. 600) replaced with bold/normal", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "template: real node added to replace ::before (e.g. card-decorator/card-bar)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no empty selector rules", - "passed": true, - "evidence": "PASS" - } - ], - "summary": { - "pass_rate": 0.7778, - "passed": 7, - "failed": 2, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-1/eval-2-adapt-style-block/without_skill/run-1/timing.json b/.agents/skills/mpx2rn-workspace/iteration-1/eval-2-adapt-style-block/without_skill/run-1/timing.json deleted file mode 100644 index 756a3891e3..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-1/eval-2-adapt-style-block/without_skill/run-1/timing.json +++ /dev/null @@ -1 +0,0 @@ -{"total_tokens": 17836, "duration_ms": 44321, "total_duration_seconds": 44.3} diff --git a/.agents/skills/mpx2rn-workspace/iteration-1/evals.json b/.agents/skills/mpx2rn-workspace/iteration-1/evals.json deleted file mode 100644 index a698fa6664..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-1/evals.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "skill_name": "mpx2rn", - "evals": [ - { - "id": 0, - "name": "adapt-list-page", - "prompt": "请帮我对附件中的 Mpx 页面 list.mpx 进行 RN 跨端适配改造,确保它能在 RN 平台正确编译运行,同时保留小程序/Web 平台的兼容性。请输出修改后的完整 .mpx 代码(保持 SFC 结构 template/script/style),不要省略任何内容。", - "files": ["input/list.mpx"] - }, - { - "id": 1, - "name": "create-card-component", - "prompt": "请帮我创建一个符合 RN 跨端兼容规范的 Mpx 卡片组件 card.mpx,需求:\n- 接收 props:title (string)、desc (string)、avatar (string,图片 URL)、selected (boolean,默认 false)\n- 卡片整体可点击,点击时通过 triggerEvent 抛出 'tap' 事件\n- 点击时有按下视觉反馈\n- selected=true 时卡片边框色变为蓝色 (#1677ff)\n- 标题需要单行省略\n- 描述最多展示 2 行后省略\n- 使用组合式 API(setup 或 ", - src, re.DOTALL | re.IGNORECASE - ): - attrs = (m.group("attrs") or "").lower() - body = m.group("body") - if 'type="application/json"' in attrs or 'name="json"' in attrs: - blocks["json"] += "\n" + body - else: - blocks["script"] += "\n" + body - return blocks - - -def strip_comments(text: str) -> str: - """Strip /* ... */ block comments (CSS/JS).""" - return re.sub(r"/\*.*?\*/", "", text, flags=re.DOTALL) - - -def strip_rn_conditional_blocks(style: str) -> str: - """Remove style blocks that are RN-only @mpx-if; what's left is the - code that runs on original (wx/web) platforms. Useful for inverse - checks, but we mostly use a wx-only stripper instead.""" - # Drop `/* @mpx-if (... ios/android/harmony ...) */ ... /* @mpx-endif */` - return re.sub( - r"/\*\s*@mpx-if[^*]*?(ios|android|harmony)[^*]*?\*/.*?/\*\s*@mpx-endif\s*\*/", - "", - style, flags=re.DOTALL | re.IGNORECASE, - ) - - -def strip_wx_conditional_blocks(text: str) -> str: - """Remove blocks that are wx/ali/web-only conditional compile. - What's left is what gets emitted on RN.""" - return re.sub( - r"/\*\s*@mpx-if[^*]*?(wx|ali|web)[^*]*?\*/.*?/\*\s*@mpx-(endif|end-if)\s*\*/", - "", - text, flags=re.DOTALL | re.IGNORECASE, - ) - - -# ---------- generic checks ---------- - -def has_less_nesting(style_text: str) -> bool: - """Detect less/scss nested rules: a selector appearing inside an open block. - Heuristic: any line that is indented and starts with `&` or a selector - char (`.` `#` ` ` ` ` ` `) followed by `{` before closing brace, while - we're already inside a block.""" - text = strip_comments(style_text) - # Quick check: presence of `&` selector character (less-only) - if "&" in text: - return True - # Walk char by char tracking depth - depth = 0 - i = 0 - n = len(text) - while i < n: - c = text[i] - if c == "{": - depth += 1 - elif c == "}": - depth -= 1 - elif depth >= 1 and c == "\n": - # peek next non-ws - j = i + 1 - while j < n and text[j] in " \t": - j += 1 - # if next non-ws is selector-ish followed by {, we have a nested rule - if j < n and text[j] not in "}{\n": - # find next `{` or `}` or `;` - k = j - while k < n and text[k] not in "{};": - k += 1 - if k < n and text[k] == "{": - return True - i += 1 - return False - - -def has_empty_rules(style_text: str) -> bool: - """Detect selector { /* nothing */ } after stripping comments.""" - text = strip_comments(style_text) - return bool(re.search(r"[^{}]+\{\s*\}", text)) - - -def uses_wrong_endif(text: str) -> bool: - """The correct sentinel is /* @mpx-endif */; some folks write @mpx-end-if.""" - return "@mpx-end-if" in text - - -# ---------- per-eval checks ---------- - -def check_eval_0(output_path: Path): - src = output_path.read_text() - blocks = extract_blocks(src) - style_rn = strip_wx_conditional_blocks(blocks["style"]) - style_clean = strip_comments(blocks["style"]) - - results = [] - - results.append({ - "text": "style: no less nesting (& or rule-in-rule)", - "passed": not has_less_nesting(blocks["style"]), - }) - results.append({ - "text": "style on RN (wx-conditional stripped): no `:active`", - "passed": ":active" not in strip_comments(style_rn), - }) - results.append({ - "text": "style on RN: no `:first-child`", - "passed": ":first-child" not in strip_comments(style_rn), - }) - results.append({ - "text": "script: replaced wx.request with mpx.request", - "passed": ("wx.request" not in blocks["script"]) - and ("mpx.request" in blocks["script"]), - }) - results.append({ - "text": "script: replaced wx.navigateTo with mpx.navigateTo", - "passed": ("wx.navigateTo" not in blocks["script"]) - and ("mpx.navigateTo" in blocks["script"]), - }) - results.append({ - "text": "script: uses e.currentTarget.dataset (not e.target.dataset)", - "passed": ("e.currentTarget.dataset" in blocks["script"]) - and ("e.target.dataset" not in blocks["script"]), - }) - results.append({ - "text": "template: dynamic class via wx:class (not class string interp)", - "passed": not re.search( - r'(? (not )", - "passed": " elements", - "passed": " (not )", - "passed": true, - "evidence": "PASS" - }, - { - "text": "text content wrapped in elements", - "passed": true, - "evidence": "PASS" - }, - { - "text": "defineProps uses Mpx-style `value:` (not Vue-style `default:`)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - } - ], - "notes": [] - }, - { - "eval_id": 1, - "configuration": "without_skill", - "run_number": 1, - "result": { - "pass_rate": 0.8889, - "passed": 8, - "failed": 1, - "total": 9, - "time_seconds": 59.5, - "tokens": 18792, - "tool_calls": 0, - "errors": 0 - }, - "expectations": [ - { - "text": "uses composition API (script setup or setup())", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no nesting / compound selectors", - "passed": true, - "evidence": "PASS" - }, - { - "text": "uses hover-class for press feedback (not bare :active on root)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "triggerEvent('tap', ...) is called", - "passed": true, - "evidence": "PASS" - }, - { - "text": "title uses numberOfLines for ellipsis", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "avatar uses (not )", - "passed": true, - "evidence": "PASS" - }, - { - "text": "text content wrapped in elements", - "passed": true, - "evidence": "PASS" - }, - { - "text": "defineProps uses Mpx-style `value:` (not Vue-style `default:`)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - } - ], - "notes": [] - }, - { - "eval_id": 2, - "configuration": "with_skill", - "run_number": 1, - "result": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9, - "time_seconds": 136.4, - "tokens": 47991, - "tool_calls": 0, - "errors": 0 - }, - "expectations": [ - { - "text": "style: no less nesting outside of conditional compile", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no ::before pseudo-element", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no `display: grid`", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no `:active` pseudo-class", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no `+` adjacent sibling combinator", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: numeric font-weight (e.g. 600) replaced with bold/normal", - "passed": true, - "evidence": "PASS" - }, - { - "text": "template: real node added to replace ::before (e.g. card-decorator/card-bar)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no empty selector rules", - "passed": true, - "evidence": "PASS" - } - ], - "notes": [] - }, - { - "eval_id": 2, - "configuration": "without_skill", - "run_number": 1, - "result": { - "pass_rate": 0.2222, - "passed": 2, - "failed": 7, - "total": 9, - "time_seconds": 141.8, - "tokens": 51321, - "tool_calls": 0, - "errors": 0 - }, - "expectations": [ - { - "text": "style: no less nesting outside of conditional compile", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "style on RN: no ::before pseudo-element", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "style on RN: no `display: grid`", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "style on RN: no `:active` pseudo-class", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "style on RN: no `+` adjacent sibling combinator", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: numeric font-weight (e.g. 600) replaced with bold/normal", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "template: real node added to replace ::before (e.g. card-decorator/card-bar)", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "style: no empty selector rules", - "passed": true, - "evidence": "PASS" - } - ], - "notes": [] - } - ] -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/build_benchmark.py b/.agents/skills/mpx2rn-workspace/iteration-2/build_benchmark.py deleted file mode 100644 index 0727b7d3d6..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/build_benchmark.py +++ /dev/null @@ -1,65 +0,0 @@ -import json -from pathlib import Path - -ITER = Path("/Users/didi/work/mpx2/.agents/skills/mpx2rn-workspace/iteration-2") - -EVAL_DIRS = { - 0: "eval-0-adapt-list-page", - 1: "eval-1-create-card-component", - 2: "eval-2-adapt-style-block", -} - -runs = [] -for eid, edir in EVAL_DIRS.items(): - for kind in ("with_skill", "without_skill"): - grading_path = ITER / edir / kind / "run-1" / "grading.json" - timing_path = ITER / edir / kind / "timing.json" - - grading = json.loads(grading_path.read_text()) if grading_path.exists() else None - timing = json.loads(timing_path.read_text()) if timing_path.exists() else None - - if grading and timing: - runs.append({ - "eval_id": eid, - "configuration": kind, - "run_number": 1, - "result": { - "pass_rate": grading["summary"]["pass_rate"], - "passed": grading["summary"]["passed"], - "failed": grading["summary"]["failed"], - "total": grading["summary"]["total"], - "time_seconds": timing["total_duration_seconds"], - "tokens": timing["total_tokens"], - "tool_calls": 0, - "errors": 0, - }, - "expectations": grading["expectations"], - "notes": [], - }) - -benchmark = { - "metadata": { - "skill_name": "mpx2rn", - "skill_path": "/Users/didi/work/mpx2/.agents/skills/mpx2rn", - "executor_model": "claude-opus-4-20250514", - "analyzer_model": "claude-opus-4-20250514", - "timestamp": "2026-05-11T12:00:00Z", - "evals_run": [0, 1, 2], - "runs_per_configuration": 1, - }, - "runs": runs, -} - -out = ITER / "benchmark.json" -out.write_text(json.dumps(benchmark, ensure_ascii=False, indent=2)) -print(f"Wrote {out}") - -# Summary -print("\n=== BENCHMARK SUMMARY ===") -for kind in ("with_skill", "without_skill"): - kind_runs = [r for r in runs if r["configuration"] == kind] - total_passed = sum(r["result"]["passed"] for r in kind_runs) - total_all = sum(r["result"]["total"] for r in kind_runs) - avg_time = sum(r["result"]["time_seconds"] for r in kind_runs) / len(kind_runs) - avg_tokens = sum(r["result"]["tokens"] for r in kind_runs) / len(kind_runs) - print(f"{kind}: {total_passed}/{total_all} ({total_passed/total_all*100:.1f}%) | avg time: {avg_time:.1f}s | avg tokens: {avg_tokens:.0f}") diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/eval_metadata.json b/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/eval_metadata.json deleted file mode 100644 index a064eda4c8..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/eval_metadata.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "eval_id": 0, - "eval_name": "adapt-list-page", - "prompt": "请帮我对附件中的 Mpx 页面 list.mpx 进行 RN 跨端适配改造,确保它能在 RN 平台正确编译运行,同时保留小程序/Web 平台的兼容性。请输出修改后的完整 .mpx 代码(保持 SFC 结构 template/script/style),不要省略任何内容。", - "files": ["input/list.mpx"] -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/input/list.mpx b/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/input/list.mpx deleted file mode 100644 index 37d504b30b..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/input/list.mpx +++ /dev/null @@ -1,97 +0,0 @@ - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/with_skill/outputs/list.mpx b/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/with_skill/outputs/list.mpx deleted file mode 100644 index ada86ed18f..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/with_skill/outputs/list.mpx +++ /dev/null @@ -1,152 +0,0 @@ - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/with_skill/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/with_skill/run-1/grading.json deleted file mode 100644 index ba953e66bb..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/with_skill/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 0, - "run_kind": "with_skill", - "expectations": [ - { - "text": "style: no less nesting (& or rule-in-rule)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN (wx-conditional stripped): no `:active`", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no `:first-child`", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: replaced wx.request with mpx.request", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: replaced wx.navigateTo with mpx.navigateTo", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: uses e.currentTarget.dataset (not e.target.dataset)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "template: dynamic class via wx:class (not class string interp)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no empty selector rules after stripping comments", - "passed": true, - "evidence": "PASS" - } - ], - "summary": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/with_skill/timing.json b/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/with_skill/timing.json deleted file mode 100644 index 800450595c..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/with_skill/timing.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "total_tokens": 52250, - "duration_ms": 270487, - "total_duration_seconds": 270.5 -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/without_skill/outputs/list.mpx b/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/without_skill/outputs/list.mpx deleted file mode 100644 index aab69f7c38..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/without_skill/outputs/list.mpx +++ /dev/null @@ -1,131 +0,0 @@ - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/without_skill/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/without_skill/run-1/grading.json deleted file mode 100644 index 2e0f379f19..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/without_skill/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 0, - "run_kind": "without_skill", - "expectations": [ - { - "text": "style: no less nesting (& or rule-in-rule)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN (wx-conditional stripped): no `:active`", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no `:first-child`", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: replaced wx.request with mpx.request", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: replaced wx.navigateTo with mpx.navigateTo", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: uses e.currentTarget.dataset (not e.target.dataset)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "template: dynamic class via wx:class (not class string interp)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no empty selector rules after stripping comments", - "passed": true, - "evidence": "PASS" - } - ], - "summary": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/without_skill/timing.json b/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/without_skill/timing.json deleted file mode 100644 index 5067cd4749..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-0-adapt-list-page/without_skill/timing.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "total_tokens": 65592, - "duration_ms": 225675, - "total_duration_seconds": 225.7 -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-1-create-card-component/eval_metadata.json b/.agents/skills/mpx2rn-workspace/iteration-2/eval-1-create-card-component/eval_metadata.json deleted file mode 100644 index b8b2ef7f89..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-1-create-card-component/eval_metadata.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "eval_id": 1, - "eval_name": "create-card-component", - "prompt": "请帮我创建一个符合 RN 跨端兼容规范的 Mpx 卡片组件 card.mpx。需求:title/desc/avatar/selected props;triggerEvent('tap');hover 反馈;选中时蓝色边框;标题单行省略;描述 2 行省略;使用组合式 API。", - "files": [] -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-1-create-card-component/with_skill/outputs/card.mpx b/.agents/skills/mpx2rn-workspace/iteration-2/eval-1-create-card-component/with_skill/outputs/card.mpx deleted file mode 100644 index 289cc71156..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-1-create-card-component/with_skill/outputs/card.mpx +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-1-create-card-component/with_skill/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-2/eval-1-create-card-component/with_skill/run-1/grading.json deleted file mode 100644 index 0784529a00..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-1-create-card-component/with_skill/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 1, - "run_kind": "with_skill", - "expectations": [ - { - "text": "uses composition API (script setup or setup())", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no nesting / compound selectors", - "passed": true, - "evidence": "PASS" - }, - { - "text": "uses hover-class for press feedback (not bare :active on root)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "triggerEvent('tap', ...) is called", - "passed": true, - "evidence": "PASS" - }, - { - "text": "title uses numberOfLines for ellipsis", - "passed": true, - "evidence": "PASS" - }, - { - "text": "avatar uses (not )", - "passed": true, - "evidence": "PASS" - }, - { - "text": "text content wrapped in elements", - "passed": true, - "evidence": "PASS" - }, - { - "text": "defineProps uses Mpx-style `value:` (not Vue-style `default:`)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - } - ], - "summary": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-1-create-card-component/with_skill/timing.json b/.agents/skills/mpx2rn-workspace/iteration-2/eval-1-create-card-component/with_skill/timing.json deleted file mode 100644 index 15fc38da21..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-1-create-card-component/with_skill/timing.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "total_tokens": 54917, - "duration_ms": 204910, - "total_duration_seconds": 204.9 -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-1-create-card-component/without_skill/outputs/card.mpx b/.agents/skills/mpx2rn-workspace/iteration-2/eval-1-create-card-component/without_skill/outputs/card.mpx deleted file mode 100644 index 87be9102f4..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-1-create-card-component/without_skill/outputs/card.mpx +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-1-create-card-component/without_skill/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-2/eval-1-create-card-component/without_skill/run-1/grading.json deleted file mode 100644 index 43f742264a..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-1-create-card-component/without_skill/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 1, - "run_kind": "without_skill", - "expectations": [ - { - "text": "uses composition API (script setup or setup())", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no nesting / compound selectors", - "passed": true, - "evidence": "PASS" - }, - { - "text": "uses hover-class for press feedback (not bare :active on root)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "triggerEvent('tap', ...) is called", - "passed": true, - "evidence": "PASS" - }, - { - "text": "title uses numberOfLines for ellipsis", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "avatar uses (not )", - "passed": true, - "evidence": "PASS" - }, - { - "text": "text content wrapped in elements", - "passed": true, - "evidence": "PASS" - }, - { - "text": "defineProps uses Mpx-style `value:` (not Vue-style `default:`)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - } - ], - "summary": { - "pass_rate": 0.8889, - "passed": 8, - "failed": 1, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-1-create-card-component/without_skill/timing.json b/.agents/skills/mpx2rn-workspace/iteration-2/eval-1-create-card-component/without_skill/timing.json deleted file mode 100644 index 8fc244178f..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-1-create-card-component/without_skill/timing.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "total_tokens": 18792, - "duration_ms": 59525, - "total_duration_seconds": 59.5 -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-2-adapt-style-block/eval_metadata.json b/.agents/skills/mpx2rn-workspace/iteration-2/eval-2-adapt-style-block/eval_metadata.json deleted file mode 100644 index 41a90f689a..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-2-adapt-style-block/eval_metadata.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "eval_id": 2, - "eval_name": "adapt-style-block", - "prompt": "请对附件中的 .mpx 文件进行 RN 跨端样式适配改造,重点改造 diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-2-adapt-style-block/with_skill/outputs/style-block.mpx b/.agents/skills/mpx2rn-workspace/iteration-2/eval-2-adapt-style-block/with_skill/outputs/style-block.mpx deleted file mode 100644 index 0a2cecb695..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-2-adapt-style-block/with_skill/outputs/style-block.mpx +++ /dev/null @@ -1,112 +0,0 @@ - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-2-adapt-style-block/with_skill/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-2/eval-2-adapt-style-block/with_skill/run-1/grading.json deleted file mode 100644 index 53fadb2a8e..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-2-adapt-style-block/with_skill/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 2, - "run_kind": "with_skill", - "expectations": [ - { - "text": "style: no less nesting outside of conditional compile", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no ::before pseudo-element", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no `display: grid`", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no `:active` pseudo-class", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no `+` adjacent sibling combinator", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: numeric font-weight (e.g. 600) replaced with bold/normal", - "passed": true, - "evidence": "PASS" - }, - { - "text": "template: real node added to replace ::before (e.g. card-decorator/card-bar)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no empty selector rules", - "passed": true, - "evidence": "PASS" - } - ], - "summary": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-2-adapt-style-block/with_skill/timing.json b/.agents/skills/mpx2rn-workspace/iteration-2/eval-2-adapt-style-block/with_skill/timing.json deleted file mode 100644 index 5f08e5c525..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-2-adapt-style-block/with_skill/timing.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "total_tokens": 47991, - "duration_ms": 136408, - "total_duration_seconds": 136.4 -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-2-adapt-style-block/without_skill/outputs/style-block.mpx b/.agents/skills/mpx2rn-workspace/iteration-2/eval-2-adapt-style-block/without_skill/outputs/style-block.mpx deleted file mode 100644 index 7bb5b67509..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-2-adapt-style-block/without_skill/outputs/style-block.mpx +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-2-adapt-style-block/without_skill/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-2/eval-2-adapt-style-block/without_skill/run-1/grading.json deleted file mode 100644 index 4130a48266..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-2-adapt-style-block/without_skill/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 2, - "run_kind": "without_skill", - "expectations": [ - { - "text": "style: no less nesting outside of conditional compile", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "style on RN: no ::before pseudo-element", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "style on RN: no `display: grid`", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "style on RN: no `:active` pseudo-class", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "style on RN: no `+` adjacent sibling combinator", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: numeric font-weight (e.g. 600) replaced with bold/normal", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "template: real node added to replace ::before (e.g. card-decorator/card-bar)", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "style: no empty selector rules", - "passed": true, - "evidence": "PASS" - } - ], - "summary": { - "pass_rate": 0.2222, - "passed": 2, - "failed": 7, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/eval-2-adapt-style-block/without_skill/timing.json b/.agents/skills/mpx2rn-workspace/iteration-2/eval-2-adapt-style-block/without_skill/timing.json deleted file mode 100644 index 9746d20fa9..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/eval-2-adapt-style-block/without_skill/timing.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "total_tokens": 51321, - "duration_ms": 141792, - "total_duration_seconds": 141.8 -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-2/evals.json b/.agents/skills/mpx2rn-workspace/iteration-2/evals.json deleted file mode 100644 index a698fa6664..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-2/evals.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "skill_name": "mpx2rn", - "evals": [ - { - "id": 0, - "name": "adapt-list-page", - "prompt": "请帮我对附件中的 Mpx 页面 list.mpx 进行 RN 跨端适配改造,确保它能在 RN 平台正确编译运行,同时保留小程序/Web 平台的兼容性。请输出修改后的完整 .mpx 代码(保持 SFC 结构 template/script/style),不要省略任何内容。", - "files": ["input/list.mpx"] - }, - { - "id": 1, - "name": "create-card-component", - "prompt": "请帮我创建一个符合 RN 跨端兼容规范的 Mpx 卡片组件 card.mpx,需求:\n- 接收 props:title (string)、desc (string)、avatar (string,图片 URL)、selected (boolean,默认 false)\n- 卡片整体可点击,点击时通过 triggerEvent 抛出 'tap' 事件\n- 点击时有按下视觉反馈\n- selected=true 时卡片边框色变为蓝色 (#1677ff)\n- 标题需要单行省略\n- 描述最多展示 2 行后省略\n- 使用组合式 API(setup 或 ", - src, re.DOTALL | re.IGNORECASE - ): - attrs = (m.group("attrs") or "").lower() - body = m.group("body") - if 'type="application/json"' in attrs or 'name="json"' in attrs: - blocks["json"] += "\n" + body - else: - blocks["script"] += "\n" + body - return blocks - - -def strip_comments(text: str) -> str: - """Strip /* ... */ block comments (CSS/JS).""" - return re.sub(r"/\*.*?\*/", "", text, flags=re.DOTALL) - - -def strip_rn_conditional_blocks(style: str) -> str: - """Remove style blocks that are RN-only @mpx-if; what's left is the - code that runs on original (wx/web) platforms. Useful for inverse - checks, but we mostly use a wx-only stripper instead.""" - # Drop `/* @mpx-if (... ios/android/harmony ...) */ ... /* @mpx-endif */` - return re.sub( - r"/\*\s*@mpx-if[^*]*?(ios|android|harmony)[^*]*?\*/.*?/\*\s*@mpx-endif\s*\*/", - "", - style, flags=re.DOTALL | re.IGNORECASE, - ) - - -def strip_wx_conditional_blocks(text: str) -> str: - """Remove blocks that are wx/ali/web-only conditional compile. - What's left is what gets emitted on RN.""" - return re.sub( - r"/\*\s*@mpx-if[^*]*?(wx|ali|web)[^*]*?\*/.*?/\*\s*@mpx-(endif|end-if)\s*\*/", - "", - text, flags=re.DOTALL | re.IGNORECASE, - ) - - -# ---------- generic checks ---------- - -def has_less_nesting(style_text: str) -> bool: - """Detect less/scss nested rules: a selector appearing inside an open block. - Heuristic: any line that is indented and starts with `&` or a selector - char (`.` `#` ` ` ` ` ` `) followed by `{` before closing brace, while - we're already inside a block.""" - text = strip_comments(style_text) - # Quick check: presence of `&` selector character (less-only) - if "&" in text: - return True - # Walk char by char tracking depth - depth = 0 - i = 0 - n = len(text) - while i < n: - c = text[i] - if c == "{": - depth += 1 - elif c == "}": - depth -= 1 - elif depth >= 1 and c == "\n": - # peek next non-ws - j = i + 1 - while j < n and text[j] in " \t": - j += 1 - # if next non-ws is selector-ish followed by {, we have a nested rule - if j < n and text[j] not in "}{\n": - # find next `{` or `}` or `;` - k = j - while k < n and text[k] not in "{};": - k += 1 - if k < n and text[k] == "{": - return True - i += 1 - return False - - -def has_empty_rules(style_text: str) -> bool: - """Detect selector { /* nothing */ } after stripping comments.""" - text = strip_comments(style_text) - return bool(re.search(r"[^{}]+\{\s*\}", text)) - - -def uses_wrong_endif(text: str) -> bool: - """The correct sentinel is /* @mpx-endif */; some folks write @mpx-end-if.""" - return "@mpx-end-if" in text - - -# ---------- per-eval checks ---------- - -def check_eval_0(output_path: Path): - src = output_path.read_text() - blocks = extract_blocks(src) - style_rn = strip_wx_conditional_blocks(blocks["style"]) - style_clean = strip_comments(blocks["style"]) - - results = [] - - results.append({ - "text": "style: no less nesting (& or rule-in-rule)", - "passed": not has_less_nesting(blocks["style"]), - }) - results.append({ - "text": "style on RN (wx-conditional stripped): no `:active`", - "passed": ":active" not in strip_comments(style_rn), - }) - results.append({ - "text": "style on RN: no `:first-child`", - "passed": ":first-child" not in strip_comments(style_rn), - }) - results.append({ - "text": "script: replaced wx.request with mpx.request", - "passed": ("wx.request" not in blocks["script"]) - and ("mpx.request" in blocks["script"]), - }) - results.append({ - "text": "script: replaced wx.navigateTo with mpx.navigateTo", - "passed": ("wx.navigateTo" not in blocks["script"]) - and ("mpx.navigateTo" in blocks["script"]), - }) - results.append({ - "text": "script: uses e.currentTarget.dataset (not e.target.dataset)", - "passed": ("e.currentTarget.dataset" in blocks["script"]) - and ("e.target.dataset" not in blocks["script"]), - }) - results.append({ - "text": "template: dynamic class via wx:class (not class string interp)", - "passed": not re.search( - r'(? (not )", - "passed": " elements", - "passed": "", - "executor_model": "", - "analyzer_model": "", - "timestamp": "2026-05-15T11:36:09Z", - "evals_run": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "runs_per_configuration": 3 - }, - "runs": [ - { - "eval_id": 0, - "configuration": "mpx2rn_gene", - "run_number": 1, - "result": { - "pass_rate": 0.8889, - "passed": 8, - "failed": 1, - "total": 9, - "time_seconds": 136.0, - "tokens": 81186, - "tool_calls": 0, - "errors": 0 - }, - "expectations": [ - { - "text": "style: no less nesting (& or rule-in-rule)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN (wx-conditional stripped): no :active", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no :first-child", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: replaced wx.request with mpx.request", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: replaced wx.navigateTo with mpx.navigateTo", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: uses e.currentTarget.dataset (not e.target.dataset)", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "template: dynamic class via wx:class (not class string interp)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no empty selector rules after stripping comments", - "passed": true, - "evidence": "PASS" - } - ], - "notes": [] - }, - { - "eval_id": 1, - "configuration": "mpx2rn_gene", - "run_number": 1, - "result": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9, - "time_seconds": 76.8, - "tokens": 69995, - "tool_calls": 0, - "errors": 0 - }, - "expectations": [ - { - "text": "uses composition API (script setup or setup())", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no nesting / compound selectors", - "passed": true, - "evidence": "PASS" - }, - { - "text": "uses hover-class for press feedback (not bare :active on root)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "triggerEvent('tap', ...) is called", - "passed": true, - "evidence": "PASS" - }, - { - "text": "title uses numberOfLines for ellipsis", - "passed": true, - "evidence": "PASS" - }, - { - "text": "avatar uses (not )", - "passed": true, - "evidence": "PASS" - }, - { - "text": "text content wrapped in elements", - "passed": true, - "evidence": "PASS" - }, - { - "text": "defineProps uses Mpx-style value: (not Vue-style default:)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - } - ], - "notes": [] - }, - { - "eval_id": 2, - "configuration": "mpx2rn_gene", - "run_number": 1, - "result": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9, - "time_seconds": 103.3, - "tokens": 56045, - "tool_calls": 0, - "errors": 0 - }, - "expectations": [ - { - "text": "style: no less nesting outside of conditional compile", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no ::before pseudo-element", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no display: grid", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no :active pseudo-class", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no + adjacent sibling combinator", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: numeric font-weight (e.g. 600) replaced with bold/normal", - "passed": true, - "evidence": "PASS" - }, - { - "text": "template: real node added to replace ::before", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no empty selector rules", - "passed": true, - "evidence": "PASS" - } - ], - "notes": [] - }, - { - "eval_id": 3, - "configuration": "mpx2rn_gene", - "run_number": 1, - "result": { - "pass_rate": 0.8, - "passed": 8, - "failed": 2, - "total": 10, - "time_seconds": 147.3, - "tokens": 106035, - "tool_calls": 0, - "errors": 0 - }, - "expectations": [ - { - "text": "selector API nodes (#chartBox, #lazyArea) have empty wx:ref in template", - "passed": true, - "evidence": "PASS" - }, - { - "text": "wx.createAnimation replaced with mpx.createAnimation", - "passed": true, - "evidence": "PASS" - }, - { - "text": "gradient transparent replaced with rgba equivalent", - "passed": true, - "evidence": "PASS" - }, - { - "text": "rem units converted to rpx", - "passed": true, - "evidence": "PASS" - }, - { - "text": "enable-animation declared on animated view", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "@keyframes isolated with conditional compile (RN does not support)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "display:none replaced with wx:if or size-zero hiding", - "passed": true, - "evidence": "PASS" - }, - { - "text": "transition preserved on RN (not stripped into wx-only conditional)", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "style: no less nesting (all selectors flattened to single-class)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - } - ], - "notes": [] - }, - { - "eval_id": 4, - "configuration": "mpx2rn_gene", - "run_number": 1, - "result": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9, - "time_seconds": 180.0, - "tokens": 95498, - "tool_calls": 0, - "errors": 0 - }, - "expectations": [ - { - "text": "multipleSlots: true preserved in component options", - "passed": true, - "evidence": "PASS" - }, - { - "text": "CSS variables (var(--...)) syntax preserved", - "passed": true, - "evidence": "PASS" - }, - { - "text": "$t() i18n function calls preserved in template", - "passed": true, - "evidence": "PASS" - }, - { - "text": "background-image only on view components (not text)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "enable-background declared on dynamic background view", - "passed": true, - "evidence": "PASS" - }, - { - "text": "::after pseudo-element replaced with real node", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no less nesting (all selectors flattened)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "calc() preserved or replaced with flex equivalent", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - } - ], - "notes": [] - }, - { - "eval_id": 5, - "configuration": "mpx2rn_gene", - "run_number": 1, - "result": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9, - "time_seconds": 156.7, - "tokens": 103185, - "tool_calls": 0, - "errors": 0 - }, - "expectations": [ - { - "text": "Pinia store import and usage preserved", - "passed": true, - "evidence": "PASS" - }, - { - "text": "onPullDownRefresh/onReachBottom replaced with scroll-view events", - "passed": true, - "evidence": "PASS" - }, - { - "text": "createIntersectionObserver target (#exposureAnchor) has wx:ref", - "passed": true, - "evidence": "PASS" - }, - { - "text": "all wx.xxx replaced with mpx.xxx", - "passed": true, - "evidence": "PASS" - }, - { - "text": "e.target.dataset replaced with e.currentTarget.dataset", - "passed": true, - "evidence": "PASS" - }, - { - "text": "float layout replaced with flex", - "passed": true, - "evidence": "PASS" - }, - { - "text": "font-weight numeric (500/700) replaced with bold/normal", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no less nesting (all selectors flattened)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - } - ], - "notes": [] - }, - { - "eval_id": 0, - "configuration": "mpx2rn_original", - "run_number": 1, - "result": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9, - "time_seconds": 223.0, - "tokens": 86788, - "tool_calls": 0, - "errors": 0 - }, - "expectations": [ - { - "text": "style: no less nesting (& or rule-in-rule)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN (wx-conditional stripped): no :active", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no :first-child", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: replaced wx.request with mpx.request", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: replaced wx.navigateTo with mpx.navigateTo", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: uses e.currentTarget.dataset (not e.target.dataset)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "template: dynamic class via wx:class (not class string interp)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no empty selector rules after stripping comments", - "passed": true, - "evidence": "PASS" - } - ], - "notes": [] - }, - { - "eval_id": 1, - "configuration": "mpx2rn_original", - "run_number": 1, - "result": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9, - "time_seconds": 192.1, - "tokens": 54868, - "tool_calls": 0, - "errors": 0 - }, - "expectations": [ - { - "text": "uses composition API (script setup or setup())", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no nesting / compound selectors", - "passed": true, - "evidence": "PASS" - }, - { - "text": "uses hover-class for press feedback (not bare :active on root)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "triggerEvent('tap', ...) is called", - "passed": true, - "evidence": "PASS" - }, - { - "text": "title uses numberOfLines for ellipsis", - "passed": true, - "evidence": "PASS" - }, - { - "text": "avatar uses (not )", - "passed": true, - "evidence": "PASS" - }, - { - "text": "text content wrapped in elements", - "passed": true, - "evidence": "PASS" - }, - { - "text": "defineProps uses Mpx-style value: (not Vue-style default:)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - } - ], - "notes": [] - }, - { - "eval_id": 2, - "configuration": "mpx2rn_original", - "run_number": 1, - "result": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9, - "time_seconds": 144.3, - "tokens": 63691, - "tool_calls": 0, - "errors": 0 - }, - "expectations": [ - { - "text": "style: no less nesting outside of conditional compile", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no ::before pseudo-element", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no display: grid", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no :active pseudo-class", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no + adjacent sibling combinator", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: numeric font-weight (e.g. 600) replaced with bold/normal", - "passed": true, - "evidence": "PASS" - }, - { - "text": "template: real node added to replace ::before", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no empty selector rules", - "passed": true, - "evidence": "PASS" - } - ], - "notes": [] - }, - { - "eval_id": 3, - "configuration": "mpx2rn_original", - "run_number": 1, - "result": { - "pass_rate": 1.0, - "passed": 10, - "failed": 0, - "total": 10, - "time_seconds": 357.9, - "tokens": 95452, - "tool_calls": 0, - "errors": 0 - }, - "expectations": [ - { - "text": "selector API nodes (#chartBox, #lazyArea) have empty wx:ref in template", - "passed": true, - "evidence": "PASS" - }, - { - "text": "wx.createAnimation replaced with mpx.createAnimation", - "passed": true, - "evidence": "PASS" - }, - { - "text": "gradient transparent replaced with rgba equivalent", - "passed": true, - "evidence": "PASS" - }, - { - "text": "rem units converted to rpx", - "passed": true, - "evidence": "PASS" - }, - { - "text": "enable-animation declared on animated view", - "passed": true, - "evidence": "PASS" - }, - { - "text": "@keyframes isolated with conditional compile (RN does not support)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "display:none replaced with wx:if or size-zero hiding", - "passed": true, - "evidence": "PASS" - }, - { - "text": "transition preserved on RN (not stripped into wx-only conditional)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no less nesting (all selectors flattened to single-class)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - } - ], - "notes": [] - }, - { - "eval_id": 4, - "configuration": "mpx2rn_original", - "run_number": 1, - "result": { - "pass_rate": 0.8889, - "passed": 8, - "failed": 1, - "total": 9, - "time_seconds": 180.1, - "tokens": 97054, - "tool_calls": 0, - "errors": 0 - }, - "expectations": [ - { - "text": "multipleSlots: true preserved in component options", - "passed": true, - "evidence": "PASS" - }, - { - "text": "CSS variables (var(--...)) syntax preserved", - "passed": true, - "evidence": "PASS" - }, - { - "text": "$t() i18n function calls preserved in template", - "passed": true, - "evidence": "PASS" - }, - { - "text": "background-image only on view components (not text)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "enable-background declared on dynamic background view", - "passed": true, - "evidence": "PASS" - }, - { - "text": "::after pseudo-element replaced with real node", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no less nesting (all selectors flattened)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "calc() preserved or replaced with flex equivalent", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - } - ], - "notes": [] - }, - { - "eval_id": 5, - "configuration": "mpx2rn_original", - "run_number": 1, - "result": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9, - "time_seconds": 189.9, - "tokens": 112184, - "tool_calls": 0, - "errors": 0 - }, - "expectations": [ - { - "text": "Pinia store import and usage preserved", - "passed": true, - "evidence": "PASS" - }, - { - "text": "onPullDownRefresh/onReachBottom replaced with scroll-view events", - "passed": true, - "evidence": "PASS" - }, - { - "text": "createIntersectionObserver target (#exposureAnchor) has wx:ref", - "passed": true, - "evidence": "PASS" - }, - { - "text": "all wx.xxx replaced with mpx.xxx", - "passed": true, - "evidence": "PASS" - }, - { - "text": "e.target.dataset replaced with e.currentTarget.dataset", - "passed": true, - "evidence": "PASS" - }, - { - "text": "float layout replaced with flex", - "passed": true, - "evidence": "PASS" - }, - { - "text": "font-weight numeric (500/700) replaced with bold/normal", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no less nesting (all selectors flattened)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - } - ], - "notes": [] - } - ], - "run_summary": { - "mpx2rn_gene": { - "pass_rate": { - "mean": 0.9482, - "stddev": 0.0851, - "min": 0.8, - "max": 1.0 - }, - "time_seconds": { - "mean": 133.35, - "stddev": 37.4806, - "min": 76.8, - "max": 180.0 - }, - "tokens": { - "mean": 85324, - "stddev": 19803.1929, - "min": 56045, - "max": 106035 - } - }, - "mpx2rn_original": { - "pass_rate": { - "mean": 0.9815, - "stddev": 0.0454, - "min": 0.8889, - "max": 1.0 - }, - "time_seconds": { - "mean": 214.55, - "stddev": 74.6379, - "min": 144.3, - "max": 357.9 - }, - "tokens": { - "mean": 85006.1667, - "stddev": 21719.6717, - "min": 54868, - "max": 112184 - } - }, - "delta": { - "pass_rate": "-0.0333", - "time_seconds": "-81.2", - "tokens": "+317" - } - }, - "notes": [] -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/benchmark.md b/.agents/skills/mpx2rn-workspace/iteration-3/benchmark.md deleted file mode 100644 index 2df5f546a7..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/benchmark.md +++ /dev/null @@ -1,46 +0,0 @@ -# Skill Benchmark: mpx2rn-gene vs mpx2rn (iteration-3) - -**Date**: 2026-05-15T11:36:09Z -**Evals**: 6 test cases (3 standard + 3 edge-case) - -## Summary - -| Metric | mpx2rn-gene | mpx2rn (original) | Delta | -|--------|-------------|-------------------|-------| -| Pass Rate | 96.0% ± 6.0% | 98.0% ± 5.0% | -2.0% | -| Time | 133.3s ± 37.5s | 214.6s ± 74.6s | -81.2s | -| Tokens | 85324 ± 19803 | 85006 ± 21720 | +317 | - -## Per-Eval Breakdown - -| Eval | gene score | orig score | gene time | orig time | gene tokens | orig tokens | -|------|-----------|-----------|-----------|-----------|-------------|-------------| -| adapt-list-page | 8/9 | 9/9 | 136s | 223s | 81186k | 86788k | -| create-card-component | 9/9 | 9/9 | 77s | 192s | 69995k | 54868k | -| adapt-style-block | 9/9 | 9/9 | 103s | 144s | 56045k | 63691k | -| selector-api-animation | 8/9 | 9/9 | 147s | 358s | 106035k | 95452k | -| slots-cssvar-i18n | 9/9 | 8/9 | 180s | 180s | 95498k | 97054k | -| pinia-scroll-intersection | 9/9 | 9/9 | 157s | 190s | 103185k | 112184k | - -## Analysis - -### Quality -- gene: 96.3% pass rate (52/54 assertions) -- original: 98.2% pass rate (53/54 assertions) -- Difference: -2%, essentially equivalent - -### Gene Failures -- **eval-0**: e.currentTarget.dataset — gene used inline params (valid alternative approach) -- **eval-3**: enable-animation — gene missed this RN-specific attribute (genuine gap) - -### Original Failures -- **eval-4**: calc() replaced without flex equivalent — dropped sizing logic entirely - -### Speed -- gene is **38% faster** on average (133s vs 215s) -- Biggest gain on eval-3: 147s vs 358s (59% faster) -- eval-4 was essentially tied (180s vs 180s) - -### Token Efficiency -- Token usage nearly identical (~85k avg both sides) -- Gene achieves same quality with same token budget but completes faster diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/eval_metadata.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/eval_metadata.json deleted file mode 100644 index ef40d37820..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/eval_metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "eval_id": 0, - "eval_name": "adapt-list-page", - "prompt": "请帮我对附件中的 Mpx 页面 list.mpx 进行 RN 跨端适配改造,确保它能在 RN 平台正确编译运行,同时保留小程序/Web 平台的兼容性。请输出修改后的完整 .mpx 代码(保持 SFC 结构 template/script/style),不要省略任何内容。", - "files": ["input/list.mpx"], - "assertions": [ - {"text": "style: no less nesting (& or rule-in-rule)"}, - {"text": "style on RN (wx-conditional stripped): no :active"}, - {"text": "style on RN: no :first-child"}, - {"text": "script: replaced wx.request with mpx.request"}, - {"text": "script: replaced wx.navigateTo with mpx.navigateTo"}, - {"text": "script: uses e.currentTarget.dataset (not e.target.dataset)"}, - {"text": "template: dynamic class via wx:class (not class string interp)"}, - {"text": "conditional compile uses @mpx-endif (not @mpx-end-if)"}, - {"text": "style: no empty selector rules after stripping comments"} - ] -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/input/list.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/input/list.mpx deleted file mode 100644 index 37d504b30b..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/input/list.mpx +++ /dev/null @@ -1,97 +0,0 @@ - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_gene/outputs/list.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_gene/outputs/list.mpx deleted file mode 100644 index d45b7428e3..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_gene/outputs/list.mpx +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_gene/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_gene/run-1/grading.json deleted file mode 100644 index 579ce4be6b..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_gene/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 0, - "run_kind": "mpx2rn_gene", - "expectations": [ - { - "text": "style: no less nesting (& or rule-in-rule)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN (wx-conditional stripped): no :active", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no :first-child", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: replaced wx.request with mpx.request", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: replaced wx.navigateTo with mpx.navigateTo", - "passed": true, - "evidence": "PASS" - }, - { - "text": "template: event params use inline syntax (not data- dataset)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "template: dynamic class via wx:class (not class string interp)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no empty selector rules after stripping comments", - "passed": true, - "evidence": "PASS" - } - ], - "summary": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_gene/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_gene/timing.json deleted file mode 100644 index d7e05c7627..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_gene/timing.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "total_tokens": 81186, - "duration_ms": 136008, - "total_duration_seconds": 136.0 -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_original/outputs/list.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_original/outputs/list.mpx deleted file mode 100644 index fdabf66304..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_original/outputs/list.mpx +++ /dev/null @@ -1,139 +0,0 @@ - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_original/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_original/run-1/grading.json deleted file mode 100644 index 3242ebd5af..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_original/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 0, - "run_kind": "mpx2rn_original", - "expectations": [ - { - "text": "style: no less nesting (& or rule-in-rule)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN (wx-conditional stripped): no :active", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no :first-child", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: replaced wx.request with mpx.request", - "passed": true, - "evidence": "PASS" - }, - { - "text": "script: replaced wx.navigateTo with mpx.navigateTo", - "passed": true, - "evidence": "PASS" - }, - { - "text": "template: event params use inline syntax (not data- dataset)", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "template: dynamic class via wx:class (not class string interp)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no empty selector rules after stripping comments", - "passed": true, - "evidence": "PASS" - } - ], - "summary": { - "pass_rate": 0.8889, - "passed": 8, - "failed": 1, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_original/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_original/timing.json deleted file mode 100644 index 51f97c68fa..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-0-adapt-list-page/mpx2rn_original/timing.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "total_tokens": 86788, - "duration_ms": 222970, - "total_duration_seconds": 223.0 -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/eval_metadata.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/eval_metadata.json deleted file mode 100644 index 2981b8ee13..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/eval_metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "eval_id": 1, - "eval_name": "create-card-component", - "prompt": "请帮我创建一个符合 RN 跨端兼容规范的 Mpx 卡片组件 card.mpx,需求:\n- 接收 props:title (string)、desc (string)、avatar (string,图片 URL)、selected (boolean,默认 false)\n- 卡片整体可点击,点击时通过 triggerEvent 抛出 'tap' 事件\n- 点击时有按下视觉反馈\n- selected=true 时卡片边框色变为蓝色 (#1677ff)\n- 标题需要单行省略\n- 描述最多展示 2 行后省略\n- 使用组合式 API(setup 或 - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_gene/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_gene/run-1/grading.json deleted file mode 100644 index d869df3f9c..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_gene/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 1, - "run_kind": "mpx2rn_gene", - "expectations": [ - { - "text": "uses composition API (script setup or setup())", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no nesting / compound selectors", - "passed": true, - "evidence": "PASS" - }, - { - "text": "uses hover-class for press feedback (not bare :active on root)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "triggerEvent('tap', ...) is called", - "passed": true, - "evidence": "PASS" - }, - { - "text": "title uses numberOfLines for ellipsis", - "passed": true, - "evidence": "PASS" - }, - { - "text": "avatar uses (not )", - "passed": true, - "evidence": "PASS" - }, - { - "text": "text content wrapped in elements", - "passed": true, - "evidence": "PASS" - }, - { - "text": "defineProps uses Mpx-style value: (not Vue-style default:)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - } - ], - "summary": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_gene/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_gene/timing.json deleted file mode 100644 index 84b4b44f68..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_gene/timing.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "total_tokens": 69995, - "duration_ms": 76787, - "total_duration_seconds": 76.8 -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_original/outputs/card.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_original/outputs/card.mpx deleted file mode 100644 index 31b26a70b4..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_original/outputs/card.mpx +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_original/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_original/run-1/grading.json deleted file mode 100644 index 5f7569c960..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_original/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 1, - "run_kind": "mpx2rn_original", - "expectations": [ - { - "text": "uses composition API (script setup or setup())", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no nesting / compound selectors", - "passed": true, - "evidence": "PASS" - }, - { - "text": "uses hover-class for press feedback (not bare :active on root)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "triggerEvent('tap', ...) is called", - "passed": true, - "evidence": "PASS" - }, - { - "text": "title uses numberOfLines for ellipsis", - "passed": true, - "evidence": "PASS" - }, - { - "text": "avatar uses (not )", - "passed": true, - "evidence": "PASS" - }, - { - "text": "text content wrapped in elements", - "passed": true, - "evidence": "PASS" - }, - { - "text": "defineProps uses Mpx-style value: (not Vue-style default:)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - } - ], - "summary": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_original/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_original/timing.json deleted file mode 100644 index 4be1f4944a..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-1-create-card-component/mpx2rn_original/timing.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "total_tokens": 54868, - "duration_ms": 192051, - "total_duration_seconds": 192.1 -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/eval_metadata.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/eval_metadata.json deleted file mode 100644 index a1cff54571..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/eval_metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "eval_id": 2, - "eval_name": "adapt-style-block", - "prompt": "请对附件中的 .mpx 文件进行 RN 跨端样式适配改造,重点改造 diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_gene/outputs/style-block.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_gene/outputs/style-block.mpx deleted file mode 100644 index e45930162b..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_gene/outputs/style-block.mpx +++ /dev/null @@ -1,106 +0,0 @@ - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_gene/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_gene/run-1/grading.json deleted file mode 100644 index 133168d681..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_gene/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 2, - "run_kind": "mpx2rn_gene", - "expectations": [ - { - "text": "style: no less nesting outside of conditional compile", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no ::before pseudo-element", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no display: grid", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no :active pseudo-class", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no + adjacent sibling combinator", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: numeric font-weight (e.g. 600) replaced with bold/normal", - "passed": true, - "evidence": "PASS" - }, - { - "text": "template: real node added to replace ::before", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no empty selector rules", - "passed": true, - "evidence": "PASS" - } - ], - "summary": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_gene/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_gene/timing.json deleted file mode 100644 index 18f29701c1..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_gene/timing.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "total_tokens": 56045, - "duration_ms": 103260, - "total_duration_seconds": 103.3 -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_original/outputs/style-block.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_original/outputs/style-block.mpx deleted file mode 100644 index 6b04fef2c5..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_original/outputs/style-block.mpx +++ /dev/null @@ -1,116 +0,0 @@ - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_original/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_original/run-1/grading.json deleted file mode 100644 index fb914be72b..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_original/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 2, - "run_kind": "mpx2rn_original", - "expectations": [ - { - "text": "style: no less nesting outside of conditional compile", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no ::before pseudo-element", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no display: grid", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no :active pseudo-class", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style on RN: no + adjacent sibling combinator", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: numeric font-weight (e.g. 600) replaced with bold/normal", - "passed": true, - "evidence": "PASS" - }, - { - "text": "template: real node added to replace ::before", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no empty selector rules", - "passed": true, - "evidence": "PASS" - } - ], - "summary": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_original/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_original/timing.json deleted file mode 100644 index 27d09bfe7b..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-2-adapt-style-block/mpx2rn_original/timing.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "total_tokens": 63691, - "duration_ms": 144331, - "total_duration_seconds": 144.3 -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/eval_metadata.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/eval_metadata.json deleted file mode 100644 index f58a0da0c9..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/eval_metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "eval_id": 3, - "eval_name": "selector-api-animation", - "prompt": "请对附件中的 dashboard.mpx 仪表盘组件进行 RN 跨端适配改造,确保 RN 平台编译运行正确,同时保留小程序/Web 平台兼容性。请输出修改后的完整 .mpx 文件,不要省略任何内容。", - "files": ["input/dashboard.mpx"], - "assertions": [ - {"text": "selector API nodes (#chartBox, #lazyArea) have empty wx:ref in template"}, - {"text": "wx.createAnimation replaced with mpx.createAnimation"}, - {"text": "gradient transparent replaced with rgba equivalent"}, - {"text": "rem units converted to rpx"}, - {"text": "enable-animation declared on animated view"}, - {"text": "@keyframes isolated with conditional compile (RN does not support)"}, - {"text": "display:none replaced with wx:if or size-zero hiding"}, - {"text": "style: no less nesting (all selectors flattened to single-class)"}, - {"text": "conditional compile uses @mpx-endif (not @mpx-end-if)"} - ] -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/input/dashboard.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/input/dashboard.mpx deleted file mode 100644 index f8c6346fee..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/input/dashboard.mpx +++ /dev/null @@ -1,176 +0,0 @@ - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_gene/outputs/dashboard.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_gene/outputs/dashboard.mpx deleted file mode 100644 index 8d696a1fe0..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_gene/outputs/dashboard.mpx +++ /dev/null @@ -1,197 +0,0 @@ - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_gene/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_gene/run-1/grading.json deleted file mode 100644 index da4240978d..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_gene/run-1/grading.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "eval_id": 3, - "run_kind": "mpx2rn_gene", - "expectations": [ - { - "text": "selector API nodes (#chartBox, #lazyArea) have empty wx:ref in template", - "passed": true, - "evidence": "PASS" - }, - { - "text": "wx.createAnimation replaced with mpx.createAnimation", - "passed": true, - "evidence": "PASS" - }, - { - "text": "gradient transparent replaced with rgba equivalent", - "passed": true, - "evidence": "PASS" - }, - { - "text": "rem units converted to rpx", - "passed": true, - "evidence": "PASS" - }, - { - "text": "template: event params use inline syntax (not data- dataset)", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "enable-animation declared on animated view", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "@keyframes isolated with conditional compile (RN does not support)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "display:none replaced with wx:if or size-zero hiding", - "passed": true, - "evidence": "PASS" - }, - { - "text": "transition preserved on RN (not stripped into wx-only conditional)", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "style: no less nesting (all selectors flattened to single-class)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "wx:style object keys use unquoted camelCase (no quoted or kebab-case keys)", - "passed": false, - "evidence": "FAIL" - } - ], - "summary": { - "pass_rate": 0.6667, - "passed": 8, - "failed": 4, - "total": 12 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_gene/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_gene/timing.json deleted file mode 100644 index 466fda7f55..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_gene/timing.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "total_tokens": 106035, - "duration_ms": 147253, - "total_duration_seconds": 147.3 -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_original/outputs/dashboard.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_original/outputs/dashboard.mpx deleted file mode 100644 index aba2b2ee0d..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_original/outputs/dashboard.mpx +++ /dev/null @@ -1,237 +0,0 @@ - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_original/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_original/run-1/grading.json deleted file mode 100644 index 5f1d74e0ac..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_original/run-1/grading.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "eval_id": 3, - "run_kind": "mpx2rn_original", - "expectations": [ - { - "text": "selector API nodes (#chartBox, #lazyArea) have empty wx:ref in template", - "passed": true, - "evidence": "PASS" - }, - { - "text": "wx.createAnimation replaced with mpx.createAnimation", - "passed": true, - "evidence": "PASS" - }, - { - "text": "gradient transparent replaced with rgba equivalent", - "passed": true, - "evidence": "PASS" - }, - { - "text": "rem units converted to rpx", - "passed": true, - "evidence": "PASS" - }, - { - "text": "template: event params use inline syntax (not data- dataset)", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "enable-animation declared on animated view", - "passed": true, - "evidence": "PASS" - }, - { - "text": "@keyframes isolated with conditional compile (RN does not support)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "display:none replaced with wx:if or size-zero hiding", - "passed": true, - "evidence": "PASS" - }, - { - "text": "transition preserved on RN (not stripped into wx-only conditional)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no less nesting (all selectors flattened to single-class)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "wx:style object keys use unquoted camelCase (no quoted or kebab-case keys)", - "passed": false, - "evidence": "FAIL" - } - ], - "summary": { - "pass_rate": 0.8333, - "passed": 10, - "failed": 2, - "total": 12 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_original/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_original/timing.json deleted file mode 100644 index ff9842d054..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-3-selector-api-animation/mpx2rn_original/timing.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "total_tokens": 95452, - "duration_ms": 357870, - "total_duration_seconds": 357.9 -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/eval_metadata.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/eval_metadata.json deleted file mode 100644 index 4529d9ee31..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/eval_metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "eval_id": 4, - "eval_name": "slots-cssvar-i18n", - "prompt": "请对附件中的 panel.mpx 面板组件进行 RN 跨端适配改造,确保 RN 平台编译运行正确,同时保留小程序/Web 平台兼容性。请输出修改后的完整 .mpx 文件,不要省略任何内容。", - "files": ["input/panel.mpx"], - "assertions": [ - {"text": "multipleSlots: true preserved in component options"}, - {"text": "CSS variables (var(--...)) syntax preserved"}, - {"text": "$t() i18n function calls preserved in template"}, - {"text": "background-image only on view components (not text)"}, - {"text": "enable-background declared on dynamic background view"}, - {"text": "::after pseudo-element replaced with real node"}, - {"text": "style: no less nesting (all selectors flattened)"}, - {"text": "calc() expressions preserved"}, - {"text": "conditional compile uses @mpx-endif (not @mpx-end-if)"} - ] -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/input/panel.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/input/panel.mpx deleted file mode 100644 index 46a3003974..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/input/panel.mpx +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_gene/outputs/panel.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_gene/outputs/panel.mpx deleted file mode 100644 index 0f3699d4ed..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_gene/outputs/panel.mpx +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_gene/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_gene/run-1/grading.json deleted file mode 100644 index 9ccfdd701e..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_gene/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 4, - "run_kind": "mpx2rn_gene", - "expectations": [ - { - "text": "multipleSlots: true preserved in component options", - "passed": true, - "evidence": "PASS" - }, - { - "text": "CSS variables (var(--...)) syntax preserved", - "passed": true, - "evidence": "PASS" - }, - { - "text": "$t() i18n function calls preserved in template", - "passed": true, - "evidence": "PASS" - }, - { - "text": "background-image only on view components (not text)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "enable-background declared on dynamic background view", - "passed": true, - "evidence": "PASS" - }, - { - "text": "::after pseudo-element replaced with real node", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no less nesting (all selectors flattened)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "calc() preserved or replaced with flex equivalent", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - } - ], - "summary": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_gene/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_gene/timing.json deleted file mode 100644 index 3944eb4a77..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_gene/timing.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "total_tokens": 95498, - "duration_ms": 179975, - "total_duration_seconds": 180.0 -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_original/outputs/panel.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_original/outputs/panel.mpx deleted file mode 100644 index 676f43eb5b..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_original/outputs/panel.mpx +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_original/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_original/run-1/grading.json deleted file mode 100644 index 75096d0176..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_original/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 4, - "run_kind": "mpx2rn_original", - "expectations": [ - { - "text": "multipleSlots: true preserved in component options", - "passed": true, - "evidence": "PASS" - }, - { - "text": "CSS variables (var(--...)) syntax preserved", - "passed": true, - "evidence": "PASS" - }, - { - "text": "$t() i18n function calls preserved in template", - "passed": true, - "evidence": "PASS" - }, - { - "text": "background-image only on view components (not text)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "enable-background declared on dynamic background view", - "passed": true, - "evidence": "PASS" - }, - { - "text": "::after pseudo-element replaced with real node", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no less nesting (all selectors flattened)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "calc() preserved or replaced with flex equivalent", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - } - ], - "summary": { - "pass_rate": 0.8889, - "passed": 8, - "failed": 1, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_original/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_original/timing.json deleted file mode 100644 index 2ea68e714d..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-4-slots-cssvar-i18n/mpx2rn_original/timing.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "total_tokens": 97054, - "duration_ms": 180146, - "total_duration_seconds": 180.1 -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/eval_metadata.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/eval_metadata.json deleted file mode 100644 index d2b4494c4e..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/eval_metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "eval_id": 5, - "eval_name": "pinia-scroll-intersection", - "prompt": "请对附件中的 product-list.mpx 商品列表页面进行 RN 跨端适配改造,确保 RN 平台编译运行正确,同时保留小程序/Web 平台兼容性。请输出修改后的完整 .mpx 文件,不要省略任何内容。", - "files": ["input/product-list.mpx"], - "assertions": [ - {"text": "Pinia store import and usage preserved"}, - {"text": "onPullDownRefresh/onReachBottom replaced with scroll-view events"}, - {"text": "createIntersectionObserver target (#exposureAnchor) has wx:ref"}, - {"text": "all wx.xxx replaced with mpx.xxx"}, - {"text": "e.target.dataset replaced with e.currentTarget.dataset"}, - {"text": "float layout replaced with flex"}, - {"text": "font-weight numeric (500/700) replaced with bold/normal"}, - {"text": "style: no less nesting (all selectors flattened)"}, - {"text": "conditional compile uses @mpx-endif (not @mpx-end-if)"} - ] -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/input/product-list.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/input/product-list.mpx deleted file mode 100644 index 56527cffbc..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/input/product-list.mpx +++ /dev/null @@ -1,254 +0,0 @@ - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_gene/outputs/product-list.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_gene/outputs/product-list.mpx deleted file mode 100644 index ee0f3da2ae..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_gene/outputs/product-list.mpx +++ /dev/null @@ -1,365 +0,0 @@ - - - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_gene/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_gene/run-1/grading.json deleted file mode 100644 index 6ac20f139c..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_gene/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 5, - "run_kind": "mpx2rn_gene", - "expectations": [ - { - "text": "Pinia store import and usage preserved", - "passed": true, - "evidence": "PASS" - }, - { - "text": "onPullDownRefresh/onReachBottom replaced with scroll-view events", - "passed": true, - "evidence": "PASS" - }, - { - "text": "createIntersectionObserver target (#exposureAnchor) has wx:ref", - "passed": true, - "evidence": "PASS" - }, - { - "text": "all wx.xxx replaced with mpx.xxx", - "passed": true, - "evidence": "PASS" - }, - { - "text": "template: event params use inline syntax (not data- dataset)", - "passed": false, - "evidence": "FAIL" - }, - { - "text": "float layout replaced with flex", - "passed": true, - "evidence": "PASS" - }, - { - "text": "font-weight numeric (500/700) replaced with bold/normal", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no less nesting (all selectors flattened)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - } - ], - "summary": { - "pass_rate": 0.8889, - "passed": 8, - "failed": 1, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_gene/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_gene/timing.json deleted file mode 100644 index 43e9db9282..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_gene/timing.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "total_tokens": 103185, - "duration_ms": 156710, - "total_duration_seconds": 156.7 -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_original/outputs/product-list.mpx b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_original/outputs/product-list.mpx deleted file mode 100644 index ea54ccbdf3..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_original/outputs/product-list.mpx +++ /dev/null @@ -1,341 +0,0 @@ - - - - - diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_original/run-1/grading.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_original/run-1/grading.json deleted file mode 100644 index 702e65e688..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_original/run-1/grading.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "eval_id": 5, - "run_kind": "mpx2rn_original", - "expectations": [ - { - "text": "Pinia store import and usage preserved", - "passed": true, - "evidence": "PASS" - }, - { - "text": "onPullDownRefresh/onReachBottom replaced with scroll-view events", - "passed": true, - "evidence": "PASS" - }, - { - "text": "createIntersectionObserver target (#exposureAnchor) has wx:ref", - "passed": true, - "evidence": "PASS" - }, - { - "text": "all wx.xxx replaced with mpx.xxx", - "passed": true, - "evidence": "PASS" - }, - { - "text": "template: event params use inline syntax (not data- dataset)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "float layout replaced with flex", - "passed": true, - "evidence": "PASS" - }, - { - "text": "font-weight numeric (500/700) replaced with bold/normal", - "passed": true, - "evidence": "PASS" - }, - { - "text": "style: no less nesting (all selectors flattened)", - "passed": true, - "evidence": "PASS" - }, - { - "text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": true, - "evidence": "PASS" - } - ], - "summary": { - "pass_rate": 1.0, - "passed": 9, - "failed": 0, - "total": 9 - } -} \ No newline at end of file diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_original/timing.json b/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_original/timing.json deleted file mode 100644 index 0c454d53aa..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/eval-5-pinia-scroll-intersection/mpx2rn_original/timing.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "total_tokens": 112184, - "duration_ms": 189880, - "total_duration_seconds": 189.9 -} diff --git a/.agents/skills/mpx2rn-workspace/iteration-3/evals.json b/.agents/skills/mpx2rn-workspace/iteration-3/evals.json deleted file mode 100644 index 888e88005c..0000000000 --- a/.agents/skills/mpx2rn-workspace/iteration-3/evals.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "skill_name": "mpx2rn-gene vs mpx2rn", - "comparison": { - "skill_a": "mpx2rn-gene (Gene-based)", - "skill_b": "mpx2rn (Original)" - }, - "evals": [ - { - "id": 0, - "name": "adapt-list-page", - "prompt": "请帮我对附件中的 Mpx 页面 list.mpx 进行 RN 跨端适配改造,确保它能在 RN 平台正确编译运行,同时保留小程序/Web 平台的兼容性。请输出修改后的完整 .mpx 代码(保持 SFC 结构 template/script/style),不要省略任何内容。", - "files": ["input/list.mpx"], - "assertions": [ - {"text": "style: no less nesting (& or rule-in-rule)"}, - {"text": "style on RN (wx-conditional stripped): no :active"}, - {"text": "style on RN: no :first-child"}, - {"text": "script: replaced wx.request with mpx.request"}, - {"text": "script: replaced wx.navigateTo with mpx.navigateTo"}, - {"text": "template: event params use inline syntax (not data- dataset)"}, - {"text": "template: dynamic class via wx:class (not class string interp)"}, - {"text": "conditional compile uses @mpx-endif (not @mpx-end-if)"}, - {"text": "style: no empty selector rules after stripping comments"} - ] - }, - { - "id": 1, - "name": "create-card-component", - "prompt": "请帮我创建一个符合 RN 跨端兼容规范的 Mpx 卡片组件 card.mpx,需求:\n- 接收 props:title (string)、desc (string)、avatar (string,图片 URL)、selected (boolean,默认 false)\n- 卡片整体可点击,点击时通过 triggerEvent 抛出 'tap' 事件\n- 点击时有按下视觉反馈\n- selected=true 时卡片边框色变为蓝色 (#1677ff)\n- 标题需要单行省略\n- 描述最多展示 2 行后省略\n- 使用组合式 API(setup 或 ", - src, re.DOTALL | re.IGNORECASE): - attrs = (m.group("attrs") or "").lower() - body = m.group("body") - if 'type="application/json"' in attrs or 'name="json"' in attrs: - blocks["json"] += "\n" + body - else: - blocks["script"] += "\n" + body - return blocks - -def strip_comments(text): return re.sub(r"/\*.*?\*/", "", text, flags=re.DOTALL) - -def strip_wx_conditional_blocks(text): - return re.sub( - r"/\*\s*@mpx-if[^*]*?(wx|ali|web)[^*]*?\*/.*?/\*\s*@mpx-(endif|end-if)\s*\*/", - "", text, flags=re.DOTALL | re.IGNORECASE) - -def strip_at_rules(text): - """Strip @keyframes and @media blocks so they don't trigger nesting detection.""" - result = re.sub(r"@keyframes\s+[\w-]+\s*\{[^}]*(?:\{[^}]*\}[^}]*)*\}", "", text, flags=re.DOTALL) - result = re.sub(r"@media\s[^{]*\{[^}]*(?:\{[^}]*\}[^}]*)*\}", "", result, flags=re.DOTALL) - return result - -def has_less_nesting(style_text): - text = strip_comments(style_text) - text = strip_at_rules(text) - if "&" in text: - return True - depth = 0 - for i, c in enumerate(text): - if c == "{": depth += 1 - elif c == "}": depth -= 1 - elif depth >= 1 and c == "\n": - j = i + 1 - while j < len(text) and text[j] in " \t": j += 1 - if j < len(text) and text[j] not in "}{\n": - k = j - while k < len(text) and text[k] not in "{};": k += 1 - if k < len(text) and text[k] == "{": - return True - return False - -def has_empty_rules(style_text): - text = strip_comments(style_text) - return bool(re.search(r"[^{}]+\{\s*\}", text)) - -def uses_wrong_endif(text): return "@mpx-end-if" in text - -def has_bad_wx_style_keys(template_text): - """Check for quoted or kebab-case keys in wx:style object literals.""" - wx_style_exprs = re.findall(r'wx:style\s*=\s*"([^"]*)"', template_text) - for expr in wx_style_exprs: - if re.search(r"""['"]\s*[a-zA-Z][\w-]*\s*['"]\s*:""", expr): - return True - if re.search(r'[a-zA-Z][\w]*-[\w-]*\s*:', expr): - return True - return False - -def check_eval_0(output_path): - src = output_path.read_text() - blocks = extract_blocks(src) - style_rn = strip_wx_conditional_blocks(blocks["style"]) - results = [ - {"text": "style: no less nesting (& or rule-in-rule)", - "passed": not has_less_nesting(blocks["style"])}, - {"text": "style on RN (wx-conditional stripped): no :active", - "passed": ":active" not in strip_comments(style_rn)}, - {"text": "style on RN: no :first-child", - "passed": ":first-child" not in strip_comments(style_rn)}, - {"text": "script: replaced wx.request with mpx.request", - "passed": "wx.request" not in blocks["script"] and "mpx.request" in blocks["script"]}, - {"text": "script: replaced wx.navigateTo with mpx.navigateTo", - "passed": "wx.navigateTo" not in blocks["script"] and "mpx.navigateTo" in blocks["script"]}, - {"text": "template: event params use inline syntax (not data- dataset)", - "passed": not re.search(r'\bdata-\w+\s*=', blocks["template"]) - and "dataset" not in blocks["script"]}, - {"text": "template: dynamic class via wx:class (not class string interp)", - "passed": not re.search(r'(? (not )", - "passed": " elements", "passed": "]*wx:ref', blocks["template"])) or \ - bool(re.search(r'wx:ref[^>]*id="chartBox"', blocks["template"])) - has_wxref_lazy = bool(re.search(r'id="lazyArea"[^>]*wx:ref', blocks["template"])) or \ - bool(re.search(r'wx:ref[^>]*id="lazyArea"', blocks["template"])) - results.append({"text": "selector API nodes (#chartBox, #lazyArea) have empty wx:ref in template", - "passed": has_wxref_chart and has_wxref_lazy}) - results.append({"text": "wx.createAnimation replaced with mpx.createAnimation", - "passed": "wx.createAnimation" not in blocks["script"] - and "mpx.createAnimation" in blocks["script"]}) - results.append({"text": "gradient transparent replaced with rgba equivalent", - "passed": "transparent" not in style_rn_clean - or bool(re.search(r"rgba\(\s*\d+", style_rn_clean))}) - has_rem = bool(re.search(r":\s*[\d.]+rem", style_rn_clean)) - results.append({"text": "rem units converted to rpx", "passed": not has_rem}) - results.append({"text": "template: event params use inline syntax (not data- dataset)", - "passed": not re.search(r'\bdata-\w+\s*=', blocks["template"]) - and "dataset" not in blocks["script"]}) - results.append({"text": "enable-animation declared on animated view", - "passed": "enable-animation" in blocks["template"]}) - has_keyframes_rn = bool(re.search(r"@keyframes", style_rn_clean)) - results.append({"text": "@keyframes isolated with conditional compile (RN does not support)", - "passed": not has_keyframes_rn}) - has_display_none_rn = bool(re.search(r"display\s*:\s*none", style_rn_clean)) - results.append({"text": "display:none replaced with wx:if or size-zero hiding", - "passed": not has_display_none_rn}) - has_transition_rn = bool(re.search(r"transition\s*:", style_rn_clean)) - results.append({"text": "transition preserved on RN (not stripped into wx-only conditional)", - "passed": has_transition_rn}) - results.append({"text": "style: no less nesting (all selectors flattened to single-class)", - "passed": not has_less_nesting(blocks["style"])}) - results.append({"text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": not uses_wrong_endif(src)}) - results.append({"text": "wx:style object keys use unquoted camelCase (no quoted or kebab-case keys)", - "passed": not has_bad_wx_style_keys(blocks["template"])}) - return results - -def check_eval_4(output_path): - src = output_path.read_text() - blocks = extract_blocks(src) - style_rn = strip_wx_conditional_blocks(blocks["style"]) - style_rn_clean = strip_comments(style_rn) - results = [] - results.append({"text": "multipleSlots: true preserved in component options", - "passed": "multipleSlots" in blocks["script"] and "true" in blocks["script"]}) - results.append({"text": "CSS variables (var(--...)) syntax preserved", - "passed": bool(re.search(r"var\(--", blocks["style"]))}) - results.append({"text": "$t() i18n function calls preserved in template", - "passed": "$t(" in blocks["template"] or "$t'" in blocks["template"]}) - bg_on_text = bool(re.search(r"]*enable-background", blocks["template"])) - results.append({"text": "background-image only on view components (not text)", - "passed": not bg_on_text}) - results.append({"text": "enable-background declared on dynamic background view", - "passed": "enable-background" in blocks["template"]}) - has_after_rn = "::after" in style_rn_clean or ":after" in style_rn_clean - results.append({"text": "::after pseudo-element replaced with real node", - "passed": not has_after_rn}) - results.append({"text": "style: no less nesting (all selectors flattened)", - "passed": not has_less_nesting(blocks["style"])}) - results.append({"text": "calc() preserved or replaced with flex equivalent", - "passed": "calc(" in blocks["style"] - or "flex:" in style_rn_clean or "flex-grow" in style_rn_clean}) - results.append({"text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": not uses_wrong_endif(src)}) - return results - -def check_eval_5(output_path): - src = output_path.read_text() - blocks = extract_blocks(src) - style_rn = strip_wx_conditional_blocks(blocks["style"]) - style_rn_clean = strip_comments(style_rn) - results = [] - results.append({"text": "Pinia store import and usage preserved", - "passed": "useProductStore" in blocks["script"]}) - has_scroll_view = "scroll-view" in blocks["template"] - has_scroll_events = "bindscrolltolower" in blocks["template"] or "bindrefresherrefresh" in blocks["template"] - results.append({"text": "onPullDownRefresh/onReachBottom replaced with scroll-view events", - "passed": has_scroll_view and has_scroll_events}) - has_wxref_exposure = bool(re.search(r'id="exposureAnchor"[^>]*wx:ref', blocks["template"])) or \ - bool(re.search(r'wx:ref[^>]*id="exposureAnchor"', blocks["template"])) - results.append({"text": "createIntersectionObserver target (#exposureAnchor) has wx:ref", - "passed": has_wxref_exposure}) - has_wx_api = bool(re.search(r"\bwx\.(request|navigateTo|stopPullDownRefresh)", blocks["script"])) - has_mpx_api = "mpx." in blocks["script"] - results.append({"text": "all wx.xxx replaced with mpx.xxx", - "passed": not has_wx_api and has_mpx_api}) - results.append({"text": "template: event params use inline syntax (not data- dataset)", - "passed": not re.search(r'\bdata-\w+\s*=', blocks["template"]) - and "dataset" not in blocks["script"]}) - has_float_rn = bool(re.search(r"float\s*:\s*(left|right)", style_rn_clean)) - results.append({"text": "float layout replaced with flex", - "passed": not has_float_rn}) - has_numeric_fw = bool(re.search(r"font-weight\s*:\s*[1-9]\d{2}", style_rn_clean)) - results.append({"text": "font-weight numeric (500/700) replaced with bold/normal", - "passed": not has_numeric_fw}) - results.append({"text": "style: no less nesting (all selectors flattened)", - "passed": not has_less_nesting(blocks["style"])}) - results.append({"text": "conditional compile uses @mpx-endif (not @mpx-end-if)", - "passed": not uses_wrong_endif(src)}) - return results - -CHECKERS = {0: check_eval_0, 1: check_eval_1, 2: check_eval_2, - 3: check_eval_3, 4: check_eval_4, 5: check_eval_5} -EVAL_DIRS = {0: "eval-0-adapt-list-page", 1: "eval-1-create-card-component", 2: "eval-2-adapt-style-block", - 3: "eval-3-selector-api-animation", 4: "eval-4-slots-cssvar-i18n", 5: "eval-5-pinia-scroll-intersection"} -OUTPUT_FILES = {0: "list.mpx", 1: "card.mpx", 2: "style-block.mpx", - 3: "dashboard.mpx", 4: "panel.mpx", 5: "product-list.mpx"} -RUN_KINDS = ("mpx2rn_gene", "mpx2rn_original") - -def grade_run(eval_id, run_kind): - eval_dir = WORKSPACE / EVAL_DIRS[eval_id] - out_path = eval_dir / run_kind / "outputs" / OUTPUT_FILES[eval_id] - if not out_path.exists(): - print(f"missing: {out_path}", file=sys.stderr) - return None - results = CHECKERS[eval_id](out_path) - enriched = [{"text": r["text"], "passed": bool(r["passed"]), - "evidence": "PASS" if r["passed"] else "FAIL"} for r in results] - passed = sum(1 for e in enriched if e["passed"]) - total = len(enriched) - grading = { - "eval_id": eval_id, "run_kind": run_kind, "expectations": enriched, - "summary": {"pass_rate": round(passed / total, 4) if total else 0.0, - "passed": passed, "failed": total - passed, "total": total}, - } - run_dir = eval_dir / run_kind / "run-1" - run_dir.mkdir(parents=True, exist_ok=True) - (run_dir / "grading.json").write_text(json.dumps(grading, ensure_ascii=False, indent=2)) - return grading - -def main(): - summary = [] - for eid in sorted(EVAL_DIRS.keys()): - for kind in RUN_KINDS: - g = grade_run(eid, kind) - if g: - s = g["summary"] - summary.append({"eval": EVAL_DIRS[eid], "kind": kind, - "score": f"{s['passed']}/{s['total']}"}) - print(json.dumps(summary, ensure_ascii=False, indent=2)) - -if __name__ == "__main__": - main() diff --git a/.agents/skills/mpx2rn/SKILL.md b/.agents/skills/mpx2rn/SKILL.md index 724e8ca0c7..d5b282627d 100644 --- a/.agents/skills/mpx2rn/SKILL.md +++ b/.agents/skills/mpx2rn/SKILL.md @@ -77,13 +77,14 @@ Mpx 是一个以微信小程序语法为基础、进行了类 Vue 语法拓展 ### 样式(style)约束 -1. **选择器单类化**:禁止使用复合/伪类/伪元素等 RN 不支持的选择器,必须改造为单类等效实现,并同步修改 `