跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

rstack-repo-maintain

Audit and modernize RstackJS/Rspack ecosystem repositories against current infrastructure baselines. Choose between the Rsbuild-style Rstack CLI monorepo lane and the standalone Rslib/Rslint/Rstest package lane; maintain package.json metadata, exports, dependency placement and version freshness; align ESM or dual output, Node/pnpm/TypeScript versions, formatter, CI action pins, release validation, docs, dependencies, and infra PR conventions. Use when updating rstackjs repositories, refreshing infrastructure or package manifest baselines, copying patterns from Rsbuild or maintained exemplars, or reviewing package and tooling consistency.

rstackjs · 已有 AI 审核记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add rstackjs/agent-skills --skill rstack-repo-maintain

技能说明


name: rstack-repo-maintain description: 'Audit and modernize RstackJS/Rspack ecosystem repositories against current infrastructure baselines. Choose between the Rsbuild-style Rstack CLI monorepo lane and the standalone Rslib/Rslint/Rstest package lane; maintain package.json metadata, exports, dependency placement and version freshness; align ESM or dual output, Node/pnpm/TypeScript versions, formatter, CI action pins, release validation, docs, dependencies, and infra PR conventions. Use when updating rstackjs repositories, refreshing infrastructure or package manifest baselines, copying patterns from Rsbuild or maintained exemplars, or reviewing package and tooling consistency.' metadata: internal: true

Rstack Repo Maintain

Overview

Modernize RstackJS repositories without blindly copying config. Use the target's compatibility surface plus current exemplar repositories to make small, verifiable infrastructure upgrades.

Baseline Evidence

Read references/repo-baselines.md when choosing a template repo, explaining where the baseline came from, or deciding between pure ESM and dual output, standalone tools and Rstack CLI, runtime floors, TypeScript majors, formatters, package validation, or CI patterns.

Read references/package-json-baseline.md when auditing or changing package.json, checking whether dependencies are current, choosing an @rsbuild/core peer range, or validating published package contents.

Default starting points:

  • Large monorepo and integrated-tooling baseline: web-infra-dev/rsbuild. Use its Rstack CLI, pnpm catalog, supply-chain, oxfmt, and CI patterns selectively; do not treat it as a drop-in small-package template.
  • Primary standalone small-package baseline: rstackjs/rslog.
  • Pure ESM and Node 20 plugin package baseline: rstackjs/rsbuild-plugin-publint.
  • Concise AGENTS.md and publint reference: rstackjs/rslog, after checking that its prose still matches its configs.
  • Additional package validation reference: rstackjs/rsbuild-plugin-arethetypeswrong.
  • Generated-artifact CLI reference: rstackjs/prebundle.
  • Dual-package compatibility reference: rstackjs/rsbuild-plugin-virtual-module.

Always re-check the target repo and exemplar repo before editing. The reference file is a dated snapshot, not a permanent source of truth.

Workflow

  1. Inventory the target repo

    • Read package.json, lockfile, pnpm-workspace.yaml, .node-version, .rstack/**, rstack.config.*, rslib.config.*, rslint.config.*, rstest.config.*, vitest.config.*, jest.config.*, playwright.config.*, tsconfig*.json, .github/workflows/*, README.md, AGENTS.md, release config, and source entry points.
    • Identify package kind: library, Rsbuild/Rspack plugin, CLI, app template, test fixture, or docs package.
    • List current build, lint, typecheck, test, release, and package manager commands before changing them.
    • For published packages, map files, bin, types, and every exports target to the source or generated artifact that provides it.
  2. Choose the migration target

    • Use the standalone lane for focused packages that are already clear with direct Rslib, Rslint, and Rstest configs.
    • Consider the Rstack CLI lane for multi-package repositories that benefit from shared build/test config, unified type-aware linting, staged-file handling, and hook setup. Require each migrated command to have an equivalent Rstack CLI path; do not add the CLI merely to match Rsbuild.
    • Prefer pure ESM for modern libraries and plugins when consumers can support it.
    • Use dual package output only as a deliberate transition when existing CommonJS consumers or public exports require it.
    • Treat runtime support, package exports, CLI bins, side effects, and documented deep imports as compatibility constraints.
  3. Update the infrastructure in small layers

    • Package manifest: follow references/package-json-baseline.md. Select the matching core/CLI, plugin, or library profile; check metadata and published entry points; separate npm release freshness from compatibility ranges; and update the manifest and lockfile together. Use @rsbuild/core as live evidence, not as a field-for-field template for every package.
    • Build tooling: in the standalone lane, use Rslib, keep config minimal, set appropriate lib.syntax, emit declarations, and align package.json#exports with real output. In the integrated lane, use rstack.config.ts, define.lib, and shared rstack/lib config only when that reduces duplicated configuration. Add rsbuild-plugin-publint when the package should validate publish metadata during build. When upgrading @rslib/core from 0.x to 1.0.0-beta or another v1 prerelease, follow the official Rslib v0-to-v1 upgrade guide and audit every listed breaking default instead of treating it as a routine dependency bump.
    • Linting: in the standalone lane, use @rslint/core and ts.configs.recommended; add js.configs.recommended only when JavaScript source or config files are intentionally linted. In the integrated lane, use the repository's supported rs lint command and preserve type-check coverage.
    • Formatting: preserve the repository's formatter unless the migration explicitly includes formatter replacement. Current Rsbuild uses oxfmt, while maintained standalone packages may use Prettier or dprint. Keep generated artifacts and lock files ignored where appropriate.
    • Test tooling: prefer Rstest for JavaScript/TypeScript unit tests in Rstack repositories. When a repo still uses Vitest or Jest, use the migrate-to-rstest skill, map scripts and configs to @rstest/core, keep Playwright or other browser E2E tooling separate, and remove legacy runner deps/configs only after the migrated scope is green.
    • Runtime and package manager: verify Node support from code, dependencies, package `eng
阅读完整来源 ↗