Files
2026-03-24 16:51:59 +08:00

219 lines
7.4 KiB
Markdown

# Agent Skills
<p>
<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>
<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>
<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>
<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>
</p>
A collection of Agent Skills for [Rstack](https://rspack.rs/guide/start/ecosystem#rstack).
> AI-powered skills for debugging, tracing, upgrading, and analyzing Rstack projects.
## Table of Contents
- [Usage](#usage)
- [Rspack Skills](#rspack-skills)
- [Rsbuild Skills](#rsbuild-skills)
- [Rslib Skills](#rslib-skills)
- [Rspress Skills](#rspress-skills)
- [Rsdoctor Skills](#rsdoctor-skills)
- [Rstest Skills](#rstest-skills)
- [Storybook Skills](#storybook-skills)
- [Contribution Workflow Skills](#contribution-workflow-skills)
- [Contributing](#contributing)
- [License](#license)
## Usage
Install any skill with:
```bash
npx skills add rstackjs/agent-skills --skill <skill-name>
```
## Rspack Skills
### rspack-best-practices
```bash
npx skills add rstackjs/agent-skills --skill rspack-best-practices
```
Rspack best practices for config, CLI workflow, type checking, CSS, bundle optimization, assets and profiling. Use when writing, reviewing, or troubleshooting Rspack projects.
### rspack-v2-upgrade
```bash
npx skills add rstackjs/agent-skills --skill rspack-v2-upgrade
```
Use when upgrading a Rspack 1.x project to v2, including dependency and configuration updates.
### rspack-debugging
```bash
npx skills add rstackjs/agent-skills --skill rspack-debugging
```
Helps Rspack users and developers debug crashes or deadlocks/hangs in the Rspack build process using LLDB.
Use this Skill when users encounter "Segmentation fault" errors during Rspack builds or when the build progress gets stuck.
### rspack-tracing
```bash
npx skills add rstackjs/agent-skills --skill rspack-tracing
```
Comprehensive guide and toolkit for diagnosing Rspack build issues. Quickly identify where crashes/errors occur, or perform detailed performance profiling to resolve bottlenecks.
Use when the user encounters build failures, slow builds, or wants to optimize Rspack performance.
### rspack-split-chunks
```bash
npx skills add rstackjs/agent-skills --skill rspack-split-chunks
```
Diagnose and optimize Rspack `optimization.splitChunks` configuration. Use when tuning production chunking, reducing duplicated modules, improving cache behavior, or debugging over-fetch caused by `name` and `cacheGroups`.
## Rsbuild Skills
### rsbuild-best-practices
```bash
npx skills add rstackjs/agent-skills --skill rsbuild-best-practices
```
Rsbuild best practices for config, CLI workflow, type checking, bundle optimization, assets, and debugging. Use when writing, reviewing, or troubleshooting Rsbuild projects.
### rsbuild-v2-upgrade
```bash
npx skills add rstackjs/agent-skills --skill rsbuild-v2-upgrade
```
Use when upgrading a Rsbuild 1.x project to v2, including dependency and configuration updates.
### migrate-to-rsbuild
```bash
npx skills add rstackjs/agent-skills --skill migrate-to-rsbuild
```
Migrate webpack, Vite, create-react-app (CRA/CRACO), or Vue CLI projects to Rsbuild.
## Rslib Skills
### rslib-best-practices
```bash
npx skills add rstackjs/agent-skills --skill rslib-best-practices
```
Rslib best practices for config, CLI workflow, output, declaration files, dependency handling, build optimization and toolchain integration. Use when writing, reviewing, or troubleshooting Rslib projects.
### migrate-to-rslib
```bash
npx skills add rstackjs/agent-skills --skill migrate-to-rslib
```
Migrate tsc or tsup library projects to Rslib.
## Rspress Skills
### rspress-v2-upgrade
```bash
npx skills add rstackjs/agent-skills --skill rspress-v2-upgrade
```
Migrate Rspress projects from v1 to v2. Use when a user asks to upgrade Rspress, follow the v1-to-v2 guide, update packages/configs/themes, or validate the upgrade.
### rspress-custom-theme
```bash
npx skills add rstackjs/agent-skills --skill rspress-custom-theme
```
Customize Rspress themes using CSS variables, Layout slots, component wrapping, or component ejection. Use when a user wants to change the look and feel of an Rspress site, override theme components, add custom navigation/sidebar/footer content, inject global providers, or modify the default Rspress theme in any way.
### rspress-description-generator
```bash
npx skills add rstackjs/agent-skills --skill rspress-description-generator
```
Generate and maintain description frontmatter for Rspress documentation files (.md/.mdx). Use when adding SEO descriptions, improving search engine snippets, generating llms.txt metadata, preparing docs for AI summarization, or batch-updating frontmatter across an Rspress doc site.
```md
---
description: A concise summary of the page content for SEO and AI consumption.
---
# Page Title
```
## Rsdoctor Skills
### rsdoctor-analysis
```bash
npx skills add rstackjs/agent-skills --skill rsdoctor-analysis
```
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.
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.
## Rstest Skills
### migrate-to-rstest
```bash
npx skills add rstackjs/agent-skills --skill migrate-to-rstest
```
Migrate Jest or Vitest tests to Rstest. Use when a user asks to migrate Jest/Vitest tests to Rstest, follow migration guides, update test files, or validate the migration.
### rstest-best-practices
```bash
npx skills add rstackjs/agent-skills --skill rstest-best-practices
```
Rstest best practices for config, CLI workflow, test writing, mocking, snapshot testing, DOM testing, coverage, multi-project setup, CI integration, performance and debugging. Use when writing, reviewing, or troubleshooting Rstest test projects.
## Storybook Skills
### storybook-rsbuild
```bash
npx skills add rstackjs/agent-skills --skill storybook-rsbuild
```
Set up or migrate Storybook to use the Rsbuild builder. Handles fresh setup for React, Vue 3, HTML, Web Components, and React Native Web, migration from webpack5 or Vite frameworks, and integrations with Rslib, Modern.js, and Rspack.
## Contribution Workflow Skills
Skills in this section are mainly intended for contribution workflows in repositories across the Rstack ecosystem.
### pr-creator
```bash
npx skills add rstackjs/agent-skills --skill pr-creator
```
Use when asked to create a pull request for this repository. It helps the PR follow the repository's branch safety rules, title convention, pull request template, and concise English writing style.
## Contributing
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).
## License
[MIT](./LICENSE)