|
| 1 | +--- |
| 2 | +pageType: doc-wide |
| 3 | +sidebar: false |
| 4 | +--- |
| 5 | + |
| 6 | +# Skills |
| 7 | + |
| 8 | +Module Federation now exposes one unified **`mf` skill**. |
| 9 | + |
| 10 | +You do not need to pick from a long list of separate skills, and you do not need to read the docs first and then translate them back to your agent. The simpler approach is to install this one skill and let the agent decide whether it should read docs, inspect config, or troubleshoot a problem. |
| 11 | + |
| 12 | +If you have not read it yet, start with [AI Quick Start](./index). |
| 13 | + |
| 14 | +## Installation |
| 15 | + |
| 16 | +```bash |
| 17 | +npx skills add module-federation/core --skill mf -y |
| 18 | +``` |
| 19 | + |
| 20 | +After that, the main entry is: |
| 21 | + |
| 22 | +```text |
| 23 | +/mf <sub-command or question> |
| 24 | +``` |
| 25 | + |
| 26 | +If you cannot use the CLI, you can also copy the directory manually from GitHub: |
| 27 | + |
| 28 | +```text |
| 29 | +https://github.com/module-federation/core/tree/main/skills/mf |
| 30 | +``` |
| 31 | + |
| 32 | +## How to use it |
| 33 | + |
| 34 | +`mf` has one entry point, but it contains multiple capabilities. You can either provide an explicit sub-command or just ask in plain language. |
| 35 | + |
| 36 | +With explicit sub-commands: |
| 37 | + |
| 38 | +```text |
| 39 | +/mf docs How do I use Module Federation in Modern.js? |
| 40 | +/mf integrate |
| 41 | +/mf type-check |
| 42 | +/mf runtime-error RUNTIME-008 |
| 43 | +``` |
| 44 | + |
| 45 | +With natural language: |
| 46 | + |
| 47 | +```text |
| 48 | +/mf What's the difference between singleton and requiredVersion in shared? |
| 49 | +/mf Help me figure out why this project is not pulling remote types |
| 50 | +/mf Add Module Federation to the current project |
| 51 | +``` |
| 52 | + |
| 53 | +## What `mf` supports |
| 54 | + |
| 55 | +| Sub-command | Use it for | |
| 56 | +|---|---| |
| 57 | +| `docs` | Read the latest docs first, then answer configuration, API, and concept questions | |
| 58 | +| `context` | Inspect the current project's MF configuration | |
| 59 | +| `module-info` | Inspect remote module URLs, exposed modules, and related metadata | |
| 60 | +| `integrate` | Add Module Federation to an existing project | |
| 61 | +| `type-check` | Troubleshoot type-related issues | |
| 62 | +| `shared-deps` | Troubleshoot shared dependency conflicts and duplicate bundling | |
| 63 | +| `perf` | Troubleshoot slow local development and slow HMR | |
| 64 | +| `config-check` | Troubleshoot config mistakes, missing files, and plugin mismatches | |
| 65 | +| `bridge-check` | Troubleshoot Bridge integration issues | |
| 66 | +| `runtime-error` | Troubleshoot explicit runtime error codes, especially `RUNTIME-001` and `RUNTIME-008` | |
| 67 | + |
| 68 | +## The most common workflows |
| 69 | + |
| 70 | +### 1. Read the docs before answering |
| 71 | + |
| 72 | +This is the most common use case, and the best place to start: |
| 73 | + |
| 74 | +```text |
| 75 | +/mf docs What's the difference between singleton and requiredVersion in shared? |
| 76 | +``` |
| 77 | + |
| 78 | +That makes the agent read the latest docs first instead of guessing from outdated memory. |
| 79 | + |
| 80 | +### 2. Let the agent integrate it for you |
| 81 | + |
| 82 | +If you want to add Module Federation to an existing project: |
| 83 | + |
| 84 | +```text |
| 85 | +/mf integrate |
| 86 | +``` |
| 87 | + |
| 88 | +The agent will inspect your current project and decide what to do next. |
| 89 | + |
| 90 | +### 3. Let the agent troubleshoot directly |
| 91 | + |
| 92 | +If you already have a concrete problem: |
| 93 | + |
| 94 | +```text |
| 95 | +/mf type-check |
| 96 | +/mf shared-deps |
| 97 | +/mf config-check |
| 98 | +/mf runtime-error RUNTIME-008 |
| 99 | +``` |
| 100 | + |
| 101 | +At that point, the goal is not for you to manually investigate first. The goal is to let the agent start diagnosing immediately. |
| 102 | + |
| 103 | +## The one thing you really need to remember |
| 104 | + |
| 105 | +You do not need to read the docs first and then tell the agent what to do. |
| 106 | + |
| 107 | +Install `mf`, then let the agent read, inspect, decide, and act. |
0 commit comments