Repository navigation
docs(skills): 更新 maafw-template-migration 至 CMP 3.5.1 - #15
Merged
Merged
Conversation
按 create-maa-project 3.5.1 现状重写迁移指南:
- 补齐 base 与各 add-on 的文件构成,说明 managed/once 的刷新语义
- 修正失效内容:github add-on 才提供 build-release.mjs/sync-runtime.mjs、
bootstrap.py 已移除、发布包自带 Python 运行时、interface.json 由 --sync 部分托管
- 补 OCR 两种供应方式的布局差异与 ocr.files 方向约束
- 补维护面:--add/--sync/--update/--doctor/--report 与备份回滚
- 坑位更新:logo.ico 需提交、macOS bash 3.2 与 ${gui^^}、schema v1 迁移路径
maahub_meta: version 0.2.0、mfwVersion 5.13.0、updatedAt 2026-09-15
There was a problem hiding this comment.
你好——我发现了 1 个问题
面向 AI 代理的提示
请处理此次代码审查中的评论:
## 各条评论
### 评论 1
<location path="Storage/skills/Windsland52/maafw-template-migration/SKILL.md" line_range="51" />
<code_context>
```bash
-pnpm dlx create-maa-project@latest
+npx create-maa-project@latest ./new-project --template agent \
+ --slug m9a --name "M9A" --controller Adb,Win32 --license AGPL-3.0-or-later \
+ --add dev-tools --add github --yes --no-interactive
```
</code_context>
<issue_to_address>
**issue (bug_risk):** 该示例创建的项目 slug 为 `m9a`,但显示名称为 `M9A`;而后续说明指出,打包时要求 `interface.json.name` 与发布产物的 slug 完全匹配。遵循这两条说明会生成 `interface.json.name = M9A` 和产物 slug `m9a`,因此文档中的脚手架无法通过所述的打包验证。
**触发条件:** 生成的 `interface.json.name` 使用 `--name "M9A"` 的值,且打包检查区分大小写时。
**建议修复:** 明确检查比较的是显示名称还是 slug;如果确实要求与 slug 完全匹配,请在示例中使用一致的值,或说明所需的生成字段覆盖方式。
```suggestion
--slug m9a --name "m9a" --controller Adb,Win32 --license AGPL-3.0-or-later \
```
</issue_to_address>Original comment in English
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="Storage/skills/Windsland52/maafw-template-migration/SKILL.md" line_range="51" />
<code_context>
```bash
-pnpm dlx create-maa-project@latest
+npx create-maa-project@latest ./new-project --template agent \
+ --slug m9a --name "M9A" --controller Adb,Win32 --license AGPL-3.0-or-later \
+ --add dev-tools --add github --yes --no-interactive
```
</code_context>
<issue_to_address>
**issue (bug_risk):** The example creates a project with slug `m9a` but display name `M9A`, while the later instruction says packaging requires `interface.json.name` to exactly match the release artifact slug. Following both instructions produces `interface.json.name = M9A` and an artifact slug of `m9a`, so the documented scaffold fails the stated packaging validation.
**Triggers:** When the generated `interface.json.name` follows the `--name "M9A"` value and the packaging check is case-sensitive.
**Suggested fix:** Clarify whether the check compares the display name or slug; if it truly requires an exact slug, use matching values in the example or document the required generated-field override.
```suggestion
--slug m9a --name "m9a" --controller Adb,Win32 --license AGPL-3.0-or-later \
```
</issue_to_address>- 脚手架示例不再使用真实项目的身份(slug/显示名/license 组合),改为中性占位值, 并说明 --slug 写入 project.slug 与 interface.json 的 name,--name 只写 label - 修正打包校验的描述:比较对象是 project.slug,产物文件名由显示名派生, --sync display-name 只改 label,不再表述为 "与产物 slug 匹配"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
Storage/skills/Windsland52/maafw-template-migration写于 2026-07-07,之后 create-maa-project(CMP)多次重构,指南里若干关键结论已经失效。本次按 CMP 3.5.1 与 MaaFramework 5.13.0 的实际现状重写,依据来自 CMP 仓库 HEAD(模板、src/project-config.ts、docs/commands.md、CHANGELOG)、M9A 迁移后的真实目录,以及上游 release 列表。主要修正
tools/build-release.mjs、tools/sync-runtime.mjs、release.yml当作基础产物;实际它们来自githubadd-on,package.json/.node-version/tools/schema/*来自dev-tools。补齐 base 与各 add-on 的文件清单及managed/once刷新语义。agent/bootstrap.py已在 CMP 3.5.0 移除,发布包改为自带 Python 运行时,迁移需--update python-runtime/--update python-deps。--sync会就地修复派生部分(控制器标识与type,含Android/WlRoots旧拼写)并保留手写内容,另有project.interfaceUnmanaged供完全自管(M9A 采用)。CREATE_MAA_PROJECT_OCR_SOURCE、ocr.submodulePath与--update ocr-models;确认ocr.files为{目标文件名: 子模块内相对路径}且仅用于 submodule 模式。--add/--sync/--update/--doctor --report、备份与--restore回滚、schema v1 → v2 的显式迁移路径、Node >= 22.13,以及 CMP 自带 skill/MCP(日常维护交给它,本 skill 只覆盖迁移)。logo.ico未提交会导致打包静默跳过图标(hashFiles('logo.ico')),以及发布 workflow 里${gui^^}在 macOS runner 的 bash 3.2 下不可用(M9A 的迁移后 workflow 正是用tr预计算的补丁)。变更文件
SKILL.md:指南重写README.md:中文说明同步更新maahub_meta.json:version0.1.0 → 0.2.0、mfwVersion5.11.1 → 5.13.0、updatedAt→ 2026-09-15、描述同步校验
本地
npm run validate:meta通过(24 个 meta 文件);SKILL.md front-matter 可被 YAML 正常解析。Sourcery 摘要
使 MaaFramework 模板迁移技能及其元数据与当前的 create-maa-project 工作流和项目结构保持同步。
增强:
文档:
测试:
杂项:
Original summary in English
Sourcery 摘要
将 MaaFramework 模板迁移技能和元数据更新至与 create-maa-project 3.5.1 和 MaaFramework 5.13.0 兼容的最新状态。
新功能:
改进:
文档:
测试:
杂项:
Original summary in English
Summary by Sourcery
Bring the MaaFramework template migration skill and metadata up to date with create-maa-project 3.5.1 and MaaFramework 5.13.0.
New Features:
Enhancements:
Documentation:
Tests:
Chores: