Skip to content

Commit d6a5961

Browse files
committed
optimize the rsdoctor skills
1 parent b7b71d3 commit d6a5961

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

skills/rsdoctor-analysis/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ You are an AI assistant for Rsdoctor. Through the rsdoctor-skill JS CLI, read th
1818
- ✅ Allowed to modify `package.json` (add dependencies)
1919

2020
2. **When executing `config` command:**
21-
- ✅ Allowed to create or modify configuration files (`rspack.config.ts`, `webpack.config.js`, `rsbuild.config.ts`, `modern.config.ts`)
21+
- ✅ Allowed to create or modify configuration files (`rspack.config.*`, `webpack.config.js`, `rsbuild.config.ts`, `modern.config.ts`)
2222
- ✅ Allowed to add Rsdoctor plugin configuration
2323

2424
### ❌ Operations Prohibited from Modifying Code (All Other Commands)
@@ -46,7 +46,7 @@ You are an AI assistant for Rsdoctor. Through the rsdoctor-skill JS CLI, read th
4646

4747
- **Node.js:** Version 18 or higher
4848
- **Package versions:**
49-
- `@rsdoctor/rspack-plugin >= 1.1.2` (for Rspack/Rsbuild/Modern Rspack projects)
49+
- `@rsdoctor/rspack-plugin >= 1.1.2` (for Rspack/Rsbuild/Modern.js projects)
5050
- `@rsdoctor/webpack-plugin >= 1.1.2` (for Webpack projects)
5151

5252
**Note:** Prefer using the latest versions of the above dependencies when available.

skills/rsdoctor-analysis/reference/install-rsdoctor.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ This configuration ensures that only JSON data is generated, which is suitable f
7575

7676
### Rspack
7777

78-
Initialize the plugin in the [plugins](https://www.rspack.rs/config/plugins.html#plugins) of `rspack.config.ts`:
78+
Initialize the plugin in the [plugins](https://www.rspack.rs/config/plugins.html#plugins) of `rspack.config.*`:
7979

8080
```ts title="rspack.config.ts"
8181
import { RsdoctorRspackPlugin } from '@rsdoctor/rspack-plugin';
@@ -107,19 +107,16 @@ export default {
107107

108108
Rsbuild has built-in support for Rsdoctor, so you don't need to manually register plugins. See [Rsbuild - Use Rsdoctor](https://rsbuild.rs/guide/debug/rsdoctor) for more details.
109109

110-
To generate JSON data for tmates analysis, configure it in `rsbuild.config.ts`:
110+
To generate JSON data for AI tools analysis, configure it in `rsbuild.config.ts`:
111111

112112
```ts title="rsbuild.config.ts"
113113
import { RsdoctorRspackPlugin } from '@rsdoctor/rspack-plugin';
114-
import { defineConfig } from '@rsbuild/core';
115114

116-
export default defineConfig({
117-
// ... existing config
115+
export default {
118116
tools: {
119-
rspack(config, { appendPlugins }) {
120-
// Only register plugin when RSDOCTOR is true, as plugin will increase build time
121-
if (process.env.RSDOCTOR) {
122-
appendPlugins(
117+
rspack: {
118+
plugins: [
119+
process.env.RSDOCTOR === 'true' &&
123120
new RsdoctorRspackPlugin({
124121
disableClientServer: true, // Required: Prevent starting local server
125122
output: {
@@ -129,11 +126,10 @@ export default defineConfig({
129126
},
130127
},
131128
}),
132-
);
133-
}
129+
],
134130
},
135131
},
136-
});
132+
};
137133
```
138134

139135
**ELSE IF** `framework === 'webpack'`:

0 commit comments

Comments
 (0)