Skills

Module Federation provides a set of Agent Skills — loadable instruction sets for AI coding assistants that give them built-in knowledge of Module Federation 2.0 internals. These skills help you diagnose configuration issues, resolve type errors, detect shared dependency conflicts, and more, all within your editor.

What are Agent Skills?

Agent Skills are self-contained SKILL.md files that teach an AI coding assistant how to handle a specific task domain. They work with Claude Code, Cursor, Windsurf, and other popular AI editors. The MF skills live in the skills/ directory of the module-federation/core repository, and they are completely free of any company-internal infrastructure — you can use them in any MF project.

Installation

Use the skills package to install Module Federation skills:

npx skills add module-federation/core

Pick the skills you want interactively — they will be installed automatically and Claude Code will load them.

To install all skills without prompts:

npx skills add module-federation/core --all -y

To install specific skills only:

npx skills add module-federation/core --skill mf-docs --skill mf-context
New to MF Skills?

If you only install one skill, start with mf-docs. Most AI models have limited knowledge of Module Federation 2.0 — mf-docs makes the agent fetch the latest docs from module-federation.io before answering, so responses are accurate and up to date.

npx skills add module-federation/core --skill mf-docs -y
Prerequisite

mf-context is the foundation skill — all other diagnostic skills call it first to collect project context. Always install mf-context when using any other skill.

If you can't use the CLI, you can also manually copy any skill directory from GitHub into your project's skills folder:

https://github.com/module-federation/core/tree/main/skills

Skills Overview

SkillTriggerUse WhenSource
mf-docs/mf-docsAsk any question about Module Federation 2.0 configuration or APIsskills/mf-docs
mf-context/mf-contextInspect your project's MF configuration at a glanceskills/mf-context
mf-module-info/mf-module-infoInspect a remote module's full info (exposes / remotes / shared)skills/mf-module-info
mf-integrate/mf-integrateAdd Module Federation to an existing project — generates provider / consumer config automaticallyskills/mf-integrate
mf-type-check/mf-type-checkTypeScript type errors or missing @mf-types folderskills/mf-type-check
mf-shared-deps/mf-shared-depsShared deps not working, version conflicts, or duplicate bundlingskills/mf-shared-deps
mf-perf/mf-perfSlow HMR or slow build speed in local developmentskills/mf-perf
mf-config-check/mf-config-checkModules are missing from the build output or exposes look wrongskills/mf-config-check
mf-bridge-check/mf-bridge-checkMicro-frontend sub-app integration is unstable or throws errorsskills/mf-bridge-check

mf-docs

The Module Federation 2.0 documentation assistant. Once installed, the agent fetches the latest docs from module-federation.io in real time before answering, ensuring responses are based on accurate and current content rather than outdated training data.

Coverage: configuration options, Runtime API, build plugins (Webpack / Rspack / Rsbuild / Vite), framework integration (React / Vue / Next.js / Modern.js / Angular), shared dependencies, exposes, remotes, debugging, and troubleshooting.

Usage:

/mf-docs

Then ask any question in plain language, for example:

/mf-docs

What's the difference between singleton and requiredVersion in shared?
How do I use Module Federation with Next.js App Router?
Requires internet access

mf-docs fetches documentation live from module-federation.io. Make sure the site is reachable from your network.


mf-context

Collects the current project's Module Federation context (MFContext): bundler, config file, remotes/exposes/shared fields, installed MF package versions, and recent error events. This is the data foundation for all diagnostic skills.

Usage:

/mf-context [project-root]

What it collects:

  • Package manager (pnpm / yarn / npm)
  • Bundler and config file (rspack.config.ts, webpack.config.js, rsbuild.config.ts, …)
  • MF role (host / remote / host+remote / unknown)
  • remotes, exposes, and shared fields
  • All installed MF-related package versions
  • Build artifacts: dist/mf-manifest.json, dist/mf-stats.json (if present)

mf-module-info

Fetches metadata and full manifest info (remotes / exposes / shared) for a remote module from its mf-manifest.json.

Two modes:

  • Inside a consumer project: pass the module name only — the entry URL is resolved from mfConfig.remotes
  • Anywhere: pass the module name plus the remoteEntry URL directly, no local config needed
Tip

To inspect the current project's own configuration, use mf-context instead.

Usage:

# Inside a consumer project
/mf-module-info <module-name>

# Anywhere (provide the remoteEntry URL)
/mf-module-info <module-name> <remoteEntry-url>

Example:

/mf-module-info shop
/mf-module-info shop https://cdn.example.com/shop/remoteEntry.js

Output fields:

FieldDescription
publicPathBase URL of the remote
remoteEntryFull URL to remoteEntry.js
typesZipURL to @mf-types.zip
hasSsrWhether SSR build artifacts were detected
exposesModules this remote exposes
remotesRemotes this module depends on
sharedShared dependencies declared by this module

mf-integrate

Adds Module Federation to an existing project. The skill auto-detects your bundler, collects the required parameters (app name, role, module paths), generates complete configuration files, and installs the necessary packages. The default role is consumer — you can connect to the public demo provider immediately to see MF in action.

Supported bundlers: Rsbuild, Rspack, Webpack, Modern.js, Next.js (deprecated, Pages Router only), Vite

Usage:

/mf-integrate [project-root]

Interactive flow:

  1. Auto-detect bundler and existing MF configuration
  2. Choose role: consumer (default) / provider / both
  3. Enter app name (suggested from package.json name field)
  4. Consumer: connect to the public demo provider, or provide custom remote URLs
  5. Provider: specify the modules to expose
  6. Optionally auto-insert the remote component into the entry file for an instant preview

Starting from scratch?

If no bundler is detected, the skill will prompt you to create a new project from a template:

npm create module-federation@latest

mf-type-check

Diagnoses Module Federation type issues across three categories:

  1. Producer — type file generation failed (TYPE-001)
  2. Consumer — remote types not pulled (@mf-types folder missing)
  3. Consumertsconfig.json missing the paths mapping for @mf-types

Usage:

/mf-type-check [project-root]

Scenarios handled:

ScenarioDescription
TYPE_GENERATION_FAILED@mf-types dir missing; reads .mf/diagnostics/latest.json for @module-federation/enhanced > 2.0.1
TYPES_NOT_PULLEDRemote types have not been downloaded yet
TSCONFIG_PATHS_MISSINGtsconfig.json is missing "*": ["./@mf-types/*"] under compilerOptions.paths
ENV_INCOMPLETEtsconfig.json or typescript dependency is missing

Quick fix for TSCONFIG_PATHS_MISSING:

{
  "compilerOptions": {
    "paths": {
      "*": ["./@mf-types/*"]
    }
  }
}

mf-shared-deps

Detects three common shared dependency problems: shared/externals conflicts, antd/arco UI library sharing silently broken by transformImport, and multiple versions of the same package in build artifacts.

Usage:

/mf-shared-deps [project-root]

What it detects:

CodeSeverityDescription
SHARED-EXTERNALS-CONFLICTwarningThe same library appears in both shared and externals, causing runtime failures
SHARED-TRANSFORM-IMPORTwarningantd / arco is in shared but transformImport / babel-plugin-import is active, silently preventing sharing
SHARED-MULTI-VERSIONwarningMultiple versions of the same shared package found in build artifacts — version negotiation failed and each side bundles its own copy

Fix reference:

  • SHARED-EXTERNALS-CONFLICT: remove the library from either shared or externals
  • SHARED-TRANSFORM-IMPORT: set source.transformImport = false in Modern.js / Rsbuild; remove babel-plugin-import for other bundlers
  • SHARED-MULTI-VERSION: add an alias in your bundler config so all projects resolve to the same physical file
Note

This skill checks only the local project. Run it in both the host and every remote for a complete picture.


mf-perf

Detects missing performance optimization options in your local development configuration that cause slow HMR and slow build speed.

Usage:

/mf-perf [project-root]

Recommendations:

CodeApplies ToRecommendation
PERFAllEnable dev.disableAssetsAnalyze to reduce bundle analysis overhead
PERFRspack / RsbuildSet splitChunks.chunks: "async" to reduce initial bundle size
PERFProjects with TypeScriptConsider disabling DTS or switching to ts-go if type generation is the bottleneck
// rsbuild.config.ts
export default {
  dev: { disableAssetsAnalyze: true },
  output: { splitChunks: { chunks: 'async' } },
};

mf-config-check

Validates your Module Federation build configuration across three areas: MF plugin selection, async entry setup, and exposes path validity.

Usage:

/mf-config-check [project-root]

What it detects:

CodeSeverityDescription
CONFIG-PLUGINwarningThe recommended MF plugin for the detected bundler is not installed
CONFIG-ASYNC-ENTRYwarningexperiments.asyncStartup = true is not set — may cause runtime initialization errors (RUNTIME-006)
CONFIG-EXPOSES-KEYwarningKey does not start with ./ (e.g., "Button" instead of "./Button")
CONFIG-EXPOSES-PATHwarningThe file referenced by an exposes value does not exist (exact extension required)

Plugin reference:

BundlerRecommended plugin
Webpack@module-federation/enhanced
Rspack@module-federation/enhanced/rspack
Rsbuild@module-federation/rsbuild-plugin
Modern.js (app-tools ≥ 3.0.0)@module-federation/modern-js-v3
Modern.js (app-tools < 3.0.0)@module-federation/modern-js
Next.js@module-federation/nextjs-mf

Tip: @module-federation/modern-js-v3 and @module-federation/modern-js handle async entry internally — no manual config needed. For all other bundlers, Rspack requires version > 1.7.4 to support experiments.asyncStartup.


mf-bridge-check

Verifies that producers correctly export export-app and that consumers use the recommended Bridge API instead of manually concatenating remote URLs.

Usage:

/mf-bridge-check [project-root]

What it detects:

CodeSeverityDescription
BRIDGE-USAGEinfoNo export-app-pattern key found in exposes
BRIDGE-USAGEinfoConsumer is not using official APIs like createRemoteAppComponent

Producer fix — add an export-app entry to exposes:

// module-federation.config.ts
exposes: {
  './export-app': './src/export-app.tsx',
}

The exported module must return an object with render and destroy methods (the Bridge spec).