mf-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.
How do I install this agent skill?
npx skills add https://github.com/module-federation/core --skill mf-shared-depsIs this agent skill safe to install?
- Gen Agent Trust Hubwarn
This skill checks for Module Federation configuration issues but is vulnerable to command injection. It instructs the agent to run a shell command containing data from project files without proper escaping, which could allow a malicious repository to run arbitrary code on the user's system.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
- Runlayerpass
2 files scanned · No issues
What does this agent skill do?
Step 1: Call the mf-context Skill (pass $ARGUMENTS) to collect MFContext.
Step 2: Serialize MFContext to JSON and pass it to the check script via the --context argument:
node scripts/shared-config-check.js --context '<MFContext-JSON>'
Process each item in the output results array:
SHARED-EXTERNALS-CONFLICT · warning — same library in both shared and externals
sharedandexternalsare not mutually exclusive in config, but the same library must not appear in both — it causes the module to be excluded from the bundle while also being declared as shared, leading to runtime failures- Show the conflicting library name and guide the user to remove it from one of the two configs
SHARED-TRANSFORM-IMPORT · warning — antd/arco UI library shared but transformImport is active
babel-plugin-import(or the built-intransformImportin Modern.js / Rsbuild) rewrites import paths at build time, which prevents the shared dep from being recognized and causes sharing to fail silently- Fix:
- Modern.js / Rsbuild: set
source.transformImport = falseto disable the built-in behavior - Other bundlers: remove
babel-plugin-importfrom the Babel config
- Modern.js / Rsbuild: set
- Show which UI library triggered the warning
SHARED-MULTI-VERSION · warning — multiple versions of the same shared package detected
- The build artifacts contain more than one version of a shared package, meaning the version negotiation failed and both host and remote are each bundling their own copy
- Recommended fix: add an
aliasin the bundler config so all projects resolve to the same physical file - Show the detected versions
When results is empty
- Inform the user that no shared dependency conflicts were detected in this project
- Remind them that a complete picture requires running the same check in both the host and every remote
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/module-federation/core/mf-shared-deps">View mf-shared-deps on skillZs</a>