Skip to content

Commit 7e15983

Browse files
authored
feat: one skill (#4592)
1 parent 2fdac28 commit 7e15983

41 files changed

Lines changed: 1963 additions & 943 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/website-new/docs/en/_nav.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
[
2+
{
3+
"text": "AI",
4+
"link": "/ai/",
5+
"activeMatch": "/ai/"
6+
},
27
{
38
"text": "Guide",
49
"link": "/guide/start/",
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
pageType: doc-wide
3+
sidebar: false
4+
---
5+
6+
# AI Quick Start
7+
8+
:::tip Prefer to read the docs yourself?
9+
If you want to go through Module Federation concepts, configuration, and integration in order, head to the [Getting Started guide](../guide/start/index).
10+
:::
11+
12+
## A Better Way To Start
13+
14+
If you are already using an AI coding tool, the better starting point is not to read all of the docs yourself first.
15+
16+
The faster approach is: **give the latest Module Federation docs to your agent first, then let it answer questions, debug problems, update config, and write code.**
17+
18+
Many models still have incomplete or outdated knowledge of Module Federation 2.0. So the point of this page is not to make you study first. It is to help your agent get the right source material first.
19+
20+
## Recommended Setup
21+
22+
If you use Claude Code, Cursor, Windsurf, or another editor with Skills support, install:
23+
24+
```bash
25+
npx skills add module-federation/core --skill mf -y
26+
```
27+
28+
Then ask the agent to read the docs before answering:
29+
30+
```text
31+
/mf docs What's the difference between singleton and requiredVersion in shared?
32+
```
33+
34+
The idea is simple:
35+
36+
- you do not need to hunt through the docs first
37+
- your agent reads the latest docs before it answers
38+
- the result is much more likely to be accurate
39+
40+
## If You Want Your Agent To Do More
41+
42+
The `mf` skill does more than answer questions. It can also help your agent:
43+
44+
- add Module Federation to an existing project
45+
- inspect config problems
46+
- analyze type issues
47+
- check shared dependency conflicts
48+
- inspect remote module information
49+
50+
👉 [View Agent Skills documentation](./skill)
51+
52+
## You Can Still Use This Without Installing Anything
53+
54+
If you just want a lightweight version first, send this directly to your agent:
55+
56+
```text
57+
Before answering, please read https://module-federation.io/llms.txt to learn about the latest Module Federation 2.0 documentation, then answer my question.
58+
```
59+
60+
This is the easiest way to stop the model from guessing when you have not installed the skill yet.
61+
62+
## Docs You Can Hand To Your Agent
63+
64+
### llms.txt
65+
66+
[module-federation.io](https://module-federation.io) supports the [llms.txt](https://llmstxt.org) standard, which is a good entry point for AI systems:
67+
68+
```text
69+
https://module-federation.io/llms.txt
70+
```
71+
72+
### Markdown Docs
73+
74+
Every page on the docs site is also available in Markdown. Replace `.html` at the end of a docs URL with `.md`:
75+
76+
```text
77+
# HTML version
78+
https://module-federation.io/guide/basic/runtime.html
79+
80+
# Markdown version
81+
https://module-federation.io/guide/basic/runtime.md
82+
```
83+
84+
## Next
85+
86+
If you want to start using this workflow right away:
87+
88+
1. Install `mf`
89+
2. Ask the question you care about most
90+
3. Open [Skills documentation](./skill) to see which sub-commands it supports
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
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.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
["index", "setting-up-env", "quick-start", "features", "glossary", "npm-packages","ai"]
1+
["index", "setting-up-env", "quick-start", "features", "glossary", "npm-packages"]

apps/website-new/docs/en/guide/start/ai.mdx

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)