mf-context
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCollect the following information step by step from (defaults to the current working directory if empty), then output the aggregated MFContext.
$ARGUMENTS从中逐步收集以下信息(若为空则默认使用当前工作目录),随后输出聚合后的MFContext。
$ARGUMENTS1. Basic Info
1. 基础信息
Read and extract:
{projectRoot}/package.json- : project name
name - Merge +
dependenciesinto a full dependency mapdevDependencies
Detect the package manager (check files in order):
- → pnpm
pnpm-lock.yaml - → yarn
yarn.lock - → npm
package-lock.json
读取并提取:
{projectRoot}/package.json- :项目名称
name - 合并+
dependencies得到完整的依赖映射devDependencies
检测包管理器(按顺序检查文件):
- → pnpm
pnpm-lock.yaml - → yarn
yarn.lock - → npm
package-lock.json
2. Bundler & MF Config
2. 打包工具与MF配置
Find config files in the following priority order ( / take precedence over / / ):
.ts.mts.js.mjs.cjs| Priority | Filename |
|---|---|
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
Read the first matched file and extract the , , and fields. Determine the bundler from the filename ( / / ).
remotesexposessharedrspackrsbuildwebpack按以下优先级查找配置文件( / 优先级高于 / / ):
.ts.mts.js.mjs.cjs| 优先级 | 文件名 |
|---|---|
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
读取第一个匹配到的文件,提取、和字段,根据文件名确定打包工具( / / )。
remotesexposessharedrspackrsbuildwebpack3. Determine MF Role
3. 确定MF角色
| Condition | Role |
|---|---|
Has | |
Only | |
Only | |
| Neither | |
| 条件 | 角色 |
|---|---|
同时存在 | |
仅存在 | |
仅存在 | |
| 两者都不存在 | |
4. Recent Error Event (optional)
4. 最近错误事件(可选)
Check if exists; if so, read its contents.
.mf/diagnostics/latest.json检查是否存在,若存在则读取其内容。
.mf/diagnostics/latest.json5. Build Artifacts (optional)
5. 构建产物(可选)
Check if and exist; if so, read them.
dist/mf-manifest.jsondist/mf-stats.jsonAggregate the above information and output the MFContext summary in the following structure:
project:
name, packageManager, mfRole
bundler:
name, configFile
mfConfig:
remotes, exposes, shared
dependencies:
(list installed packages related to MF and their versions)
latestErrorEvent: (if present)
buildArtifacts: (if present)For further diagnostics, call the corresponding diagnostic Skill based on this context.
检查和是否存在,若存在则读取。
dist/mf-manifest.jsondist/mf-stats.json聚合以上信息,按以下结构输出MFContext摘要:
project:
name, packageManager, mfRole
bundler:
name, configFile
mfConfig:
remotes, exposes, shared
dependencies:
(list installed packages related to MF and their versions)
latestErrorEvent: (if present)
buildArtifacts: (if present)如需进一步诊断,可基于该上下文调用对应的诊断Skill。