Skip to content

Commit 992b742

Browse files
authored
Merge branch 'main' into chore/rsdoctor-skills-fix
2 parents 6981577 + 02796fa commit 992b742

File tree

5 files changed

+103
-46
lines changed

5 files changed

+103
-46
lines changed

README.md

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,66 @@
11
# Agent Skills
22

3-
A collection of Agent Skills for [Rstack](https://rspack.rs/guide/start/ecosystem#rstack).
3+
<p>
4+
<a href="https://discord.gg/XsaKEEk4mW"><img src="https://img.shields.io/badge/chat-discord-blue?style=flat-square&logo=discord&colorA=564341&colorB=EDED91" alt="discord channel" /></a>
5+
<a href="https://github.com/rstackjs/agent-skills/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="license" /></a>
6+
<a href="https://github.com/rstackjs/agent-skills"><img src="https://img.shields.io/github/stars/rstackjs/agent-skills?style=flat-square&colorA=564341&colorB=EDED91" alt="stars" /></a>
7+
<a href="https://github.com/rstackjs/agent-skills/issues"><img src="https://img.shields.io/github/issues/rstackjs/agent-skills?style=flat-square&colorA=564341&colorB=EDED91" alt="issues" /></a>
8+
</p>
49

5-
## Rspack Skills
10+
A collection of Agent Skills for [Rstack](https://rspack.rs/guide/start/ecosystem#rstack).
611

7-
### rspack-debugging
12+
> AI-powered skills for debugging, tracing, upgrading, and analyzing Rstack projects.
813
9-
```bash
10-
npx skills add rstackjs/agent-skills --skill rspack-debugging
11-
```
14+
## Table of Contents
1215

13-
Helps Rspack users and developers debug crashes or deadlocks/hangs in the Rspack build process using LLDB.
16+
- [Usage](#usage)
17+
- [Skills](#skills)
18+
- [Rspack](#rspack)
19+
- [Rsbuild](#rsbuild)
20+
- [Rspress](#rspress)
21+
- [Rsdoctor](#rsdoctor)
22+
- [Contributing](#contributing)
23+
- [License](#license)
1424

15-
Use this Skill when users encounter "Segmentation fault" errors during Rspack builds or when the build progress gets stuck.
25+
## Usage
1626

17-
### rspack-tracing
27+
Install any skill with:
1828

1929
```bash
20-
npx skills add rstackjs/agent-skills --skill rspack-tracing
30+
npx skills add rstackjs/agent-skills --skill <skill-name>
2131
```
2232

23-
Comprehensive guide and toolkit for diagnosing Rspack build issues. Quickly identify where crashes/errors occur, or perform detailed performance profiling to resolve bottlenecks.
33+
## Skills
2434

25-
Use when the user encounters build failures, slow builds, or wants to optimize Rspack performance.
35+
### Rspack
2636

27-
## Rsbuild Skills
37+
| Skill | Description | Use When |
38+
| ------------------ | -------------------------------------------------------------------------------- | -------------------------------------------------------- |
39+
| `rspack-debugging` | Debug crashes or deadlocks/hangs in Rspack builds using LLDB | Encountering "Segmentation fault" errors or build hangs |
40+
| `rspack-tracing` | Diagnose Rspack build issues with crash identification and performance profiling | Build failures, slow builds, or performance optimization |
2841

29-
### rsbuild-v2-upgrade
42+
### Rsbuild
3043

31-
```bash
32-
npx skills add rstackjs/agent-skills --skill rsbuild-v2-upgrade
33-
```
44+
| Skill | Description | Use When |
45+
| -------------------- | -------------------------------------- | ---------------------------------------------------------------------- |
46+
| `rsbuild-v2-upgrade` | Migrate Rsbuild projects from v1 to v2 | Upgrading Rsbuild, updating configs/plugins, or validating the upgrade |
3447

35-
Migrate Rsbuild projects from v1 to v2. Use when a user asks to upgrade Rsbuild, follow the v1-to-v2 guide, update configs/plugins, or validate the upgrade.
48+
### Rspress
3649

37-
## Rsdoctor Skills
50+
| Skill | Description | Use When |
51+
| -------------------- | -------------------------------------- | ------------------------------------------------------------------------------ |
52+
| `rspress-v2-upgrade` | Migrate Rspress projects from v1 to v2 | Upgrading Rspress, updating packages/configs/themes, or validating the upgrade |
3853

39-
### rsdoctor-analysis
54+
### Rsdoctor
4055

41-
```bash
42-
npx skills add rstackjs/agent-skills --skill rsdoctor-analysis
43-
```
56+
| Skill | Description | Use When |
57+
| ------------------- | ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
58+
| `rsdoctor-analysis` | Analyze Rspack/Webpack bundles for insights and optimizations | Analyzing bundle composition, duplicates, large chunks, side-effect modules, or for optimization recommendations |
4459

45-
Analyze Rspack/Webpack bundles from local Rsdoctor build data. Provides intelligent analysis of chunk, module, package, and loader data. Provides evidence-based conclusions and actionable optimization recommendations.
60+
## Contributing
4661

47-
Use when you need to analyze bundle composition, identify duplicate packages, detect similar packages, find large chunks, analyze side effects modules, or get comprehensive bundle optimization recommendations.
62+
Contributions are welcome! Feel free to open an [issue](https://github.com/rstackjs/agent-skills/issues) or submit a [pull request](https://github.com/rstackjs/agent-skills/pulls).
4863

4964
## License
5065

51-
MIT licensed.
66+
[MIT](./LICENSE)

packages/rsdoctor-analysis/rslib.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ export default defineConfig({
2121
legalComments: 'none',
2222
cleanDistPath: true,
2323
},
24+
tools: {
25+
rspack: {
26+
optimization: {
27+
runtimeChunk: false,
28+
},
29+
},
30+
},
2431
},
2532
],
2633
});

skills/rsdoctor-analysis/scripts/rsdoctor.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,23 @@ import * as __rspack_external_node_events_0a6aefe7 from "node:events";
44
import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
55
import * as __rspack_external_node_path_c5b9b54f from "node:path";
66
import * as __rspack_external_node_process_786449bf from "node:process";
7-
import { __webpack_require__ } from "./rslib-runtime.js";
7+
var __webpack_modules__ = {};
8+
var __webpack_module_cache__ = {};
9+
function __webpack_require__(moduleId) {
10+
var cachedModule = __webpack_module_cache__[moduleId];
11+
if (void 0 !== cachedModule) return cachedModule.exports;
12+
var module = __webpack_module_cache__[moduleId] = {
13+
exports: {}
14+
};
15+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
16+
return module.exports;
17+
}
18+
__webpack_require__.m = __webpack_modules__;
19+
(()=>{
20+
__webpack_require__.add = function(modules) {
21+
Object.assign(__webpack_require__.m, modules);
22+
};
23+
})();
824
__webpack_require__.add({
925
"node:child_process" (module) {
1026
module.exports = __rspack_external_node_child_process_27f17141;
@@ -2950,3 +2966,4 @@ run().catch((error)=>{
29502966
console.error(message);
29512967
process.exit(1);
29522968
});
2969+
export { __webpack_require__ };

skills/rsdoctor-analysis/scripts/rslib-runtime.js

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

skills/rspress-v2-upgrade/SKILL.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: rspress-v2-upgrade
3+
description: Migrate Rspress projects from v1 to v2. Use when a user asks to upgrade Rspress, follow the v1-to-v2 guide, update configs/themes, or validate the upgrade.
4+
---
5+
6+
# Rspress v1 to v2 Upgrade
7+
8+
## Workflow
9+
10+
1. **Confirm current setup**
11+
- Read `package.json` to identify Rspress and plugin packages in use.
12+
- Locate the Rspress config file (commonly `rspress.config.(ts|js|mjs|cjs)`).
13+
- Check for custom theme files and MDX usage.
14+
15+
2. **Open the official upgrade guide**
16+
- Use the v1 → v2 guide as the source of truth:
17+
- <https://rspress.rs/guide/migration/rspress-1-x>
18+
19+
3. **Plan the upgrade path**
20+
- List breaking changes that apply to the project's current config, plugins, and theme.
21+
- Note any removed or renamed packages, options, and APIs.
22+
23+
4. **Update dependencies**
24+
- Replace `rspress` with `@rspress/core@^2.0.0`.
25+
- Remove packages now built into `@rspress/core` (e.g. `rspress`, `@rspress/plugin-shiki`, `@rspress/plugin-auto-nav-sidebar`, `@rspress/plugin-container-syntax`, `@rspress/plugin-last-updated`, `@rspress/plugin-medium-zoom`, `@rspress/theme-default`, `@rspress/runtime`).
26+
- Bump remaining Rspress plugins to latest versions via `npx taze major --include /rspress/ -w -r`.
27+
- Ensure Node.js >= 20.9.0.
28+
29+
5. **Apply config and code changes**
30+
- Update import paths (`rspress/runtime``@rspress/core/runtime`, `rspress/theme``@rspress/core/theme`, `@rspress/theme-default``@rspress/core/theme-original`).
31+
- If the project has a custom theme (in `theme` directory), use `@rspress/core/theme-original` to import the original theme components.
32+
- Update the Rspress config to match v2 options and defaults.
33+
- Remove deprecated or unsupported settings.
34+
35+
6. **Validate**
36+
- Run the build and dev server.
37+
- Fix any warnings or errors that appear in the new version. If errors or warnings occur, please refer to the [Official Upgrade Guide](https://rspress.rs/guide/migration/rspress-1-x) and first check if it's caused by any omitted or incomplete migration steps.

0 commit comments

Comments
 (0)