rxjs-next-migration
它能做什么
这个技能分阶段、经审阅地指导智能体把 RxJS 7 项目迁移到 RxJS Next 版本。适合维护基于 RxJS 的应用或库的开发者。
适用场景
- ✓当你想规划把应用或库从 RxJS 7 迁移到 RxJS Next 时。
- ✓当你在修改任何 RxJS 代码之前,需要一个通过的测试基线时。
- ✓当自动迁移工具生成的修改需要仔细审查时。
技能链接
https://github.com/ReactiveX/rxjs/blob/master/.agents/skills/rxjs-next-migration/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“能帮我规划把 RxJS 7 应用迁移到 RxJS Next 吗?从建立测试基线开始。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体按顺序完成各个阶段,记录一个通过的基线,只在有界的重写中使用迁移工具,并以测试结果进行核对。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
RxJS 7 to RxJS Next migration
Treat this as reviewed project work, not a codemod run. The objective is an intentional RxJS Next contract backed by the project's own build and behavior evidence. A transformed file, a clean diff, or one passing test is not proof that the migration is complete.
Work through all eight stages in order. Re-enter an earlier stage whenever new evidence changes scope, coverage, or lifecycle intent. Keep the developer involved at every explicit pause.
Non-negotiable rules
- Read and obey repository-local instructions before acting. Protect existing work and stay within the authorized repository and paths.
- Establish the RxJS 7 baseline before changing dependencies or source.
- Never infer platform sharing versus producer-per-direct-subscription behavior from syntax, filenames, operator names, or a currently passing output.
- Use the installed engine's versioned registry and schemas as authority. Do not reconstruct capability mappings from this Skill or from memory.
- Run the deterministic engine without writes first. A refusal is a successful safety outcome, not permission to improvise a mechanical rewrite.
- Preserve the project's test framework by default. Select a framework adapter only when the developer asked for that separate conversion.
- Do not weaken, skip, delete, or replace a behavioral expectation merely to make the migrated suite green.
- Do not add RxJS 7 compatibility shims, string-named platform methods, local substitute operators, or runtime generators unless the developer separately authorizes that product work.
- Keep changes in small coherent batches. Review and verify each batch before widening the scope.
- Do not call a migration complete while a required command is unknown, unapproved, skipped, or red without an explicitly accepted blocker.
Working record
Create or locate a checked-in migration contract manifest and a concise
human-readable report. Use the schema exported by the installed
@rxjs/migrate; schema validity and migration readiness are separate checks.
Use assets/migration-report.md for the report.
For every migration unit, preserve source locations and record:
- its current RxJS 7 behavioral claim;
- the target lifecycle selected by the developer;
- its evidence classification and supporting tests;
- approval state, diagnostics, and any intentional divergence; and
- verification or a named blocker.
Stage 1: Establish authority and scope
- Locate repository instructions, package and workspace metadata, lockfiles, CI configuration, RxJS versions, build/test commands, and current working tree state.
- Identify the repository root, migration boundary, permitted writes, package manager, network policy, and candidate verification commands.
- Record the installed
@rxjs/migrateversion and canonical Skill digest. If the installed Skill does not match its package, stop and synchronize it before trusting these instructions. - State the proposed read, write, dependency, and command scope before broad changes.
Pause for the developer if the target repository or allowed scope is unclear, existing changes overlap the migration, or destructive, networked, external, or broader actions require new authority.
Exit only when the scope, allowed writes, package manager, and candidate gates are recorded.
Stage 2: Assess usage, lifecycle risk, and coverage
Inventory installed RxJS versions and import forms, then locate Observable construction, custom producers, Subjects, subscription ownership, repeated subscriptions, retry/refresh/cache paths, schedulers and timing, test helpers, interop inputs, cancellation, teardown, and error handling. Include direct and transitive operator usage.
For each lifecycle-sensitive path, link exact source evidence and mark it as:
- covered by an existing baseline;
- requiring a characterization test;
- explicitly unsupported; or
- an uncovered risk the developer accepts.
Produce a risk and coverage report before proposing rewrites. Read references/assessment-and-contract.md for the inventory and characterization protocol.
Exit only when every in-scope lifecycle-sensitive use has one recorded coverage disposition. Missing coverage is not evidence that behavior is safe.
Stage 3: Establish the green RxJS 7 baseline
Run the agreed build, type, lint, unit, integration, and behavior checks against the un
常见问题
它只是运行一个代码转换工具吗?
不是。技能说明,一个干净的差异或一次测试通过,并不能证明迁移已经完成。
测试会被修改以便通过吗?
不会。技能说明,不得为了让迁移通过而削弱或删除行为测试。
开发者会参与其中吗?
会。技能包含明确的暂停点,供开发者审阅各项决定。
详情
作者的原始描述
Migrate an RxJS 7 application, library, or test suite to RxJS Next through an agent-led workflow that establishes a green behavioral baseline, makes Observable lifecycle choices explicit, uses @rxjs/migrate only for bounded fixture-proved rewrites, repairs without weakening evidence, and records a versioned migration contract. Use for repository assessment, migration planning or execution, lifecycle review, TestScheduler conversion, or migration closeout.
repo: ReactiveX/rxjs
热度
- GitHub 星标
- 32k
- 排名
- #9151
- 许可证
- Apache-2.0
- 更新时间
- 2026/8/8
评论
- …