协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
rstack-repo-maintain【开发与工程】Audit or modernize Rstack repository infrastructure, package manifests, build/test tooling, CI, and release configuration against maintained baselines.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Modernize RstackJS repositories without blindly copying config. Use the target's compatibility surface plus current exemplar repositories to make small, verifiable infrastructure upgrades.
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:
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.rstackjs/rslog.rstackjs/rsbuild-plugin-publint.rstackjs/rslog, after checking that its prose still matches its configs.rstackjs/rsbuild-plugin-arethetypeswrong.rstackjs/prebundle.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.
Inventory the target repo
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.files, bin, types, and every exports target to the source or generated artifact that provides it.Choose the migration target
Update the infrastructure in small layers
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.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.@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.oxfmt, while maintained standalone packages may use Prettier or dprint. Keep generated artifacts and lock files ignored where appropriate.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.engines, .node-version, CI, and release workflows. Update packageManager, pnpm engine constraints, lockfile, and CI together. Do not copy Rsbuild's Node 22 minimum into a Node 20-compatible package without a concrete runtime reason.catalogMode, unused-catalog cleanup, peer-install policy, build-script allowlists, minimumReleaseAge, and strict dependency-build settings. Adopt each option only after checking install behavior, native dependencies, trusted release exceptions, and the repository's pnpm version..github/workflows/* aligned with the chosen baseline repo. Pin third-party actions to commit hashes, not floating tags, and update action pins by copying or refreshing the baseline pattern instead of inventing new pins.target: "ES2023" for compatible Node packages, and keep module resolution consistent with runtime output. For TypeScript 7 packages, remove the old direct @typescript/native-preview dependency and manual tsgo selection from Rslib config. Current Rslib automatically uses tsgo when the installed TypeScript version is 7 or later, so keep declaration generation enabled and validate emitted declarations without adding preview-specific wiring.README.md focused on purpose, install, usage, options, supported runtimes, release/license links. Add a concise AGENTS.md in the rsbuild-style shape: Stack, Commands, Project structure, and Code style.pnpm stage and intentional legacy tsgo tool dependencies as known false positives when applicable.Preserve behavior while modernizing
Prepare the infra PR
origin/main unless the user asks for a different base.chore(infra):, for example chore(infra): adopt Rstack CLI and package validation or chore(infra): align build and lint tooling.chore(deps): update rslint, chore(infra/build): align declaration output, or chore(infra/ci): pin workflow actions.Validate before cleanup
pnpm pack --dry-run when the repository's pnpm version supports it. Otherwise, use pnpm pack --pack-destination <temporary-directory> and remove the temporary archive after inspection; use npm pack only when npm is the target repository's package manager. Skip the separate pack command only when package inclusion rules have been inspected, every published entry is provably included, and an enforcing pluginPublint in rslib.config.ts has completed in a successful non-watch build. Do not take this shortcut when inclusion is uncertain, the plugin is disabled, conditional activation was not satisfied, throwOn: 'never' is set, only a watch build ran, or the task explicitly requires tarball inspection. Never run pnpm pack without --dry-run, --pack-destination, or another explicit output path in the target working tree because it writes a .tgz there.When reporting back, include: