diff --git a/.agents/skills/changelog-generator/SKILL.md b/.agents/skills/changelog-generator/SKILL.md index 35aff4b765..ff1db21ddc 100644 --- a/.agents/skills/changelog-generator/SKILL.md +++ b/.agents/skills/changelog-generator/SKILL.md @@ -19,6 +19,14 @@ description: 通过查看当前最新版本与上一版本间的git提交记录 生成内容写入到 CHANGELOG.md 文件中。 +## 文档与 Skill 同步约束 + +生成变更日志后,检查版本变更内容是否涉及**用户开发使用方式**(对外暴露的 API、配置项、模板/样式/脚本/JSON 能力、CLI 参数、生命周期、内建组件、环境 API、跨端行为差异等),如涉及则必须同步更新对应的文档与 Skill: + +- **文档**:更新 [docs-vitepress/](docs-vitepress/) 下对应位置的 `.md`,并按 [docs-vitepress/AGENTS.md](docs-vitepress/AGENTS.md) 的归档原则与索引要求同步侧边栏、导航及目录索引。 +- **Skill**:当变更涉及**跨端输出 RN 的能力**(模板/脚本/样式/JSON 配置维度、基础组件、环境 API 在 RN 平台的支持情况、Mpx2RN 编译行为等)时,必须同步更新 [.agents/skills/mpx2rn/](.agents/skills/mpx2rn/) 下的相关知识库。 +- 仅修改内部实现、重构、测试、构建脚本而不改变对外使用方式的变更项,无需更新文档或 Skill。 + ## 内容示例 ```markdown diff --git a/.agents/skills/mpx2rn-gene/SKILL.md b/.agents/skills/mpx2rn-gene/SKILL.md new file mode 100644 index 0000000000..656fb75af1 --- /dev/null +++ b/.agents/skills/mpx2rn-gene/SKILL.md @@ -0,0 +1,86 @@ +--- +name: mpx2rn-gene +description: Mpx 跨端输出 RN 开发适配的 Gene 表达形式——基于 Gene Evolution Protocol (GEP) 将文档导向的 Skill 蒸馏为紧凑的 Strategy Gene 集合。当用户要求对已有 Mpx 组件进行 RN 跨端适配改造、创建符合 RN 跨端兼容规范的 Mpx 组件时调用。与 mpx2rn skill 的区别:mpx2rn 提供完整文档参考,本 skill 提供紧凑的行为控制指令,适合执行阶段直接注入上下文。 +metadata: + version: "1.0.0" + author: donghongping + based_on: mpx2rn + approach: gene-evolution-protocol +--- + +# Mpx2RN Strategy Gene Skill + +本 Skill 基于 Gene Evolution Protocol (GEP) 蒸馏为 8 个领域 Gene + 1 个演化控制 Gene,每个 ~200-300 tokens,直接控制行为而非解释文档。支持 GEP 三层结构(Gene / Capsule / Event)和六步演化循环。 + +## Gene 注册表 + +| gene_id | 触发信号 | 文件 | +|---------|---------|------| +| `gene_cross_platform` | 跨平台兼容, dual-track, 原平台 | [genes/gene_cross_platform.md](genes/gene_cross_platform.md) | +| `gene_template` | template, wx:class, wx:style, wx:ref, 基础组件 | [genes/gene_template.md](genes/gene_template.md) | +| `gene_style_selector` | selector, 选择器, 单类, compound, pseudo | [genes/gene_style_selector.md](genes/gene_style_selector.md) | +| `gene_style_property` | style, flex, rpx, font-weight, display-none | [genes/gene_style_property.md](genes/gene_style_property.md) | +| `gene_script` | script, lifecycle, mpx.xxx, api-proxy, selector-api | [genes/gene_script.md](genes/gene_script.md) | +| `gene_conditional_compile` | 条件编译, @mpx-if, @mode, __mpx_mode__ | [genes/gene_conditional_compile.md](genes/gene_conditional_compile.md) | +| `gene_text_overflow` | text-overflow, numberOfLines, hairlineWidth | [genes/gene_text_overflow.md](genes/gene_text_overflow.md) | +| `gene_json_config` | json, usingComponents, disableScroll, tabBar | [genes/gene_json_config.md](genes/gene_json_config.md) | +| `gene_evolution` | 演化, evolution, capsule, event, GEP loop | [genes/gene_evolution.md](genes/gene_evolution.md) | + +## 调度规则 + +### 任务一:对已有 Mpx 组件进行 RN 跨端适配改造 + +**始终加载:** `gene_cross_platform` + `gene_conditional_compile` + +**按 SFC 区块顺序加载:** +1. `