mf-context
Collect the following information step by step from $ARGUMENTS (defaults to the current working directory if empty), then output the aggregated MFContext.
1. Basic Info
Read {projectRoot}/package.json and extract:
name: project name- Merge
dependencies+devDependenciesinto a full dependency map
Detect the package manager (check files in order):
pnpm-lock.yaml→ pnpmyarn.lock→ yarnpackage-lock.json→ npm
2. Bundler & MF Config
Find config files in the following priority order (.ts / .mts take precedence over .js / .mjs / .cjs):
| Priority | Filename |
|---|---|
| 1 | module-federation.config.{ts,mts,js,mjs,cjs} |
| 2 | rsbuild.config.{ts,mts,js,mjs,cjs} |
| 3 | rspack.config.{ts,mts,js,mjs,cjs} |
| 4 | modern.config.{ts,mts,js,mjs,cjs} |
| 5 | next.config.{ts,mts,js,mjs,cjs} |
| 6 | webpack.config.{ts,js} |
Read the first matched file and extract the remotes, exposes, and shared fields. Determine the bundler from the filename (rspack / rsbuild / webpack).
3. Determine MF Role
| Condition | Role |
|---|---|
Has remotes and exposes |
host+remote |
Only remotes |
host |
Only exposes |
remote |
| Neither | unknown |
4. Recent Error Event (optional)
Check if .mf/diagnostics/latest.json exists; if so, read its contents.
5. Build Artifacts (optional)
Check if dist/mf-manifest.json and dist/mf-stats.json exist; if so, read them.
Aggregate 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.
More from module-federation/core
mf
All-in-one Module Federation skill. Use when the user asks anything about MF — concepts, configuration, runtime API, shared dependencies, type errors, runtime error code troubleshooting, slow builds, Bridge integration, or adding MF to an existing project.
411mf-integrate
Integrate Module Federation into an existing project — add provider (exposes modules) or consumer (loads remote modules) configuration. Use when the user wants to add Module Federation to an existing Rsbuild / Rspack / Webpack / Modern.js / Next.js / Vite project, set up a remote, create a host app, or quickly consume the demo provider to see MF working. Default role is consumer.
107mf-docs
Answer questions about Module Federation (MF) — configuration, runtime API, build plugins (Webpack/Rspack/Rsbuild/Vite), framework integration (React/Vue/Next.js/Modern.js/Angular), shared dependencies, exposes, remotes, debugging, troubleshooting, and micro-frontend architecture. Use this skill when the user asks anything about module federation, remote modules, shared deps, mf-manifest, federation runtime, or micro-frontends with MF.
100mf-shared-deps
Check Module Federation shared dependency configuration: detect shared/externals conflicts, antd/arco transformImport blocking shared deps, and multiple versions of the same shared package in build artifacts. Use when shared dependencies fail to be shared, or host and remote load duplicate instances of a library.
61mf-perf
Check Module Federation local development performance configuration: detect whether recommended performance optimization options are enabled to alleviate slow HMR and slow build speed.
60mf-config-check
Check Module Federation build configuration: verify correct MF plugin for the bundler, async entry configuration, exposes key format, and exposes path existence. Use when modules cannot be correctly exposed, expected modules are missing from the build output, or runtime initialization errors occur.
56