rs-update

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
You are upgrading a RootSpec project to the latest framework version. Start by telling the developer what you're about to do:
"I'll check your project against the latest framework version and upgrade what's needed — framework files, prerequisites, and config."
你正在将RootSpec项目升级到最新的框架版本。首先告知开发者你即将执行的操作:
"我会对照最新的框架版本检查你的项目,并按需升级相关内容——包括框架文件、前置依赖和配置。"

Step 1: Detect the gap

步骤1:检测版本差距

Run the scanning and gap analysis scripts:
bash
bash "$(dirname "$0")/../rs-shared/scripts/scan-spec.sh" .
bash "$(dirname "$0")/../rs-shared/scripts/gap-analysis.sh" .
If these paths don't resolve, find the scripts by searching for
gap-analysis.sh
in the skills directory.
Based on the output:
  • GAP=no_project
    — No
    .rootspec.json
    found. Tell the developer: "No RootSpec project found. Run
    /rs-init
    first." Exit.
  • GAP=none
    — Already on the latest version. Tell the developer: "Project is already on version X.Y.Z. Nothing to update." Exit.
  • GAP=patch|minor|major
    — Upgrade needed. Continue.
运行扫描和差距分析脚本:
bash
bash "$(dirname "$0")/../rs-shared/scripts/scan-spec.sh" .
bash "$(dirname "$0")/../rs-shared/scripts/gap-analysis.sh" .
如果这些路径无法解析,可以在skills目录下搜索
gap-analysis.sh
找到对应的脚本。
根据输出结果处理:
  • GAP=no_project
    — 未找到
    .rootspec.json
    文件。告知开发者:"未检测到RootSpec项目,请先运行
    /rs-init
    。" 然后退出。
  • GAP=none
    — 已经是最新版本。告知开发者:"项目已经处于X.Y.Z版本,无需更新。" 然后退出。
  • GAP=patch|minor|major
    — 需要升级,继续后续操作。

Step 2: Show what changed

步骤2:展示变更内容

Read the update guide:
skills/rs-update/UPDATE.md
Find it relative to this skill file:
"$(dirname "$0")/UPDATE.md"
Extract all version sections between PROJECT_VERSION (exclusive) and BUNDLED_VERSION (inclusive). Present:
  • The version gap (e.g., "6.2.1 → 6.2.3")
  • Summary of each version's changes
  • Any manual instructions
  • Whether there are breaking changes
读取更新指南:
skills/rs-update/UPDATE.md
基于本skill文件的相对路径查找:
"$(dirname "$0")/UPDATE.md"
提取PROJECT_VERSION(不含)到BUNDLED_VERSION(含)之间的所有版本章节,展示以下内容:
  • 版本差距(例如:"6.2.1 → 6.2.3")
  • 每个版本的变更摘要
  • 所有手动操作说明
  • 是否存在破坏性变更

Step 3: Present the upgrade plan

步骤3:展示升级计划

Based on the gap analysis output, present a clear plan:
Upgrade plan (6.2.1 → 6.2.3):

Will update:
  - rootspec/00.FRAMEWORK.md (replace with vX.Y.Z)
  - rootspec/00.AXIOMS.md (replace with latest)
  - .rootspec.json version field

Will create (new prerequisites):
  - [list from NEW_PREREQUISITES, if any]

Needs reconciliation (changed prerequisites):
  - [list from CHANGED_PREREQUISITES, if any]

Will NOT touch:
  - Spec files (01.PHILOSOPHY.md through 05.IMPLEMENTATION/)
  - CONVENTIONS/ (owned by /rs-impl)

[If HAS_BREAKING=true]
⚠ Breaking changes detected — see details above.
Wait for the developer to confirm. They can exclude items (e.g., "skip dev.sh").
基于差距分析的输出,展示清晰的升级计划:
升级计划 (6.2.1 → 6.2.3):

将更新:
  - rootspec/00.FRAMEWORK.md (替换为vX.Y.Z版本)
  - rootspec/00.AXIOMS.md (替换为最新版本)
  - .rootspec.json的version字段

将创建(新增前置依赖):
  - [NEW_PREREQUISITES中的列表,若存在]

需要对账调整(已变更的前置依赖):
  - [CHANGED_PREREQUISITES中的列表,若存在]

不会修改:
  - 规范文件(01.PHILOSOPHY.md到05.IMPLEMENTATION/目录下的内容)
  - CONVENTIONS/(由/rs-impl负责管理)

[若HAS_BREAKING=true]
⚠ 检测到破坏性变更——查看上方详情了解。
等待开发者确认。开发者可以选择排除部分项(例如:"跳过dev.sh")。

Step 4: Execute the upgrade

步骤4:执行升级

For each item in the confirmed plan:
针对确认后的计划中的每一项执行操作:

Framework files

框架文件

  1. 00.FRAMEWORK.md
    — Read from
    ../rs-shared/00.FRAMEWORK.md
    (relative to this skill), write to
    {specDirectory}/00.FRAMEWORK.md
    .
  2. 00.AXIOMS.md
    — Read from
    ../rs-shared/00.AXIOMS.md
    , write to
    {specDirectory}/00.AXIOMS.md
    .
  1. 00.FRAMEWORK.md
    — 从本skill的相对路径
    ../rs-shared/00.FRAMEWORK.md
    读取内容,写入到
    {specDirectory}/00.FRAMEWORK.md
  2. 00.AXIOMS.md
    — 从
    ../rs-shared/00.AXIOMS.md
    读取内容,写入到
    {specDirectory}/00.AXIOMS.md

Config

配置

  1. .rootspec.json
    — Read the current file, update only the
    version
    field to BUNDLED_VERSION. Preserve all other fields (specDirectory, prerequisites).
  1. .rootspec.json
    — 读取当前文件,仅更新
    version
    字段为BUNDLED_VERSION,保留所有其他字段(specDirectory、prerequisites)。

New prerequisites

新增前置依赖

  1. For each entry in
    NEW_PREREQUISITES
    : check if the file/config exists in the project. If missing, create it using the same logic as
    /rs-init
    . Read
    ../rs-shared/fragments/prerequisites.md
    for creation instructions.
  1. 遍历
    NEW_PREREQUISITES
    中的每一项:检查项目中是否存在对应的文件/配置,如果缺失,使用与
    /rs-init
    相同的逻辑创建。读取
    ../rs-shared/fragments/prerequisites.md
    获取创建指引。

Changed prerequisites

已变更前置依赖

  1. For each entry in
    CHANGED_PREREQUISITES
    : the prerequisite exists but has updated requirements. Show the developer what changed and why (from UPDATE.md). Do NOT auto-overwrite — the developer's copy may have project-specific customizations.
    For template scripts (e.g.,
    scripts/dev.sh
    ): show a diff between the project's copy and the bundled template. Let the developer decide how to reconcile.
    For config wiring (e.g.,
    cypress.config.ts
    ): describe the required change and let the developer confirm before applying.
  1. 遍历
    CHANGED_PREREQUISITES
    中的每一项:该前置依赖已存在但要求有更新。向开发者展示变更内容和变更原因(来自UPDATE.md)。不要自动覆盖——开发者的副本可能包含项目特有的自定义内容。
    对于模板脚本(例如:
    scripts/dev.sh
    ):展示项目副本与打包模板之间的差异,让开发者决定如何调整。
    对于配置关联项(例如:
    cypress.config.ts
    ):描述需要的变更,在应用前先获得开发者确认。

Spec status

规范状态

  1. Run
    write-spec-status.sh
    to update the version in spec-status.json:
bash
bash "$(dirname "$0")/../rs-shared/scripts/write-spec-status.sh" {specDirectory}
If breaking changes were detected (
HAS_BREAKING=true
): pass
false
as the second argument to mark the spec as invalid, and tell the developer to re-run
/rs-spec
.
bash
bash "$(dirname "$0")/../rs-shared/scripts/write-spec-status.sh" {specDirectory} false
  1. 运行
    write-spec-status.sh
    更新spec-status.json中的版本:
bash
bash "$(dirname "$0")/../rs-shared/scripts/write-spec-status.sh" {specDirectory}
如果检测到破坏性变更(
HAS_BREAKING=true
):传入
false
作为第二个参数将规范标记为无效,并告知开发者重新运行
/rs-spec
bash
bash "$(dirname "$0")/../rs-shared/scripts/write-spec-status.sh" {specDirectory} false

Step 5: Report

步骤5:结果报告

Summarize what was done:
Update complete (6.2.1 → 6.2.3).

Updated:
  - rootspec/00.FRAMEWORK.md
  - rootspec/00.AXIOMS.md
  - .rootspec.json version

Created:
  - [any new prerequisites]

Flagged for review:
  - [any changed prerequisites with reconciliation notes]

Next steps:
  - [Re-run /rs-impl to update conventions if needed]
  - [Any manual instructions from UPDATE.md]
总结已完成的操作:
更新完成 (6.2.1 → 6.2.3)。

已更新:
  - rootspec/00.FRAMEWORK.md
  - rootspec/00.AXIOMS.md
  - .rootspec.json版本

已创建:
  - [所有新增的前置依赖]

标记待审核:
  - [所有需要对账调整的已变更前置依赖及说明]

后续步骤:
  - [如果需要,重新运行/rs-impl更新约定]
  - [UPDATE.md中的所有手动操作说明]

Focus

特殊参数说明

If the developer passes an argument:
  • A version number (e.g.,
    "6.2.2"
    ) → show what changed in that specific version only
  • "check"
    → run gap analysis only, don't execute any changes (dry run)
  • "prerequisites"
    → only handle prerequisite updates (skip framework files)
如果开发者传入了参数:
  • 版本号(例如:
    "6.2.2"
    )→ 仅展示该特定版本的变更内容
  • "check"
    → 仅运行差距分析,不执行任何变更(干运行)
  • "prerequisites"
    → 仅处理前置依赖更新,跳过框架文件更新

Scope

操作范围

  • CAN read: all project files, all bundled skill files
  • CAN write:
    {specDirectory}/00.FRAMEWORK.md
    ,
    {specDirectory}/00.AXIOMS.md
    ,
    {specDirectory}/spec-status.json
    ,
    .rootspec.json
    , new prerequisite files
  • SHOULD NOT write: spec files (01-05), application source code, existing test files
  • SHOULD NOT overwrite: existing prerequisite files without developer confirmation
  • 允许读取: 所有项目文件、所有打包的skill文件
  • 允许写入:
    {specDirectory}/00.FRAMEWORK.md
    {specDirectory}/00.AXIOMS.md
    {specDirectory}/spec-status.json
    .rootspec.json
    、新增的前置依赖文件
  • 不应写入: 规范文件(01-05)、应用源代码、现有测试文件
  • 不应覆盖: 未经开发者确认的现有前置依赖文件