changeset-validation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Changeset Validation

Changeset验证

Overview

概述

This skill validates whether changesets correctly reflect package changes and follow the repository rules. It relies on the shared prompt in
references/validation-prompt.md
so local Codex reviews and GitHub Actions share the same logic. Experimental or preview-only feature additions that are explicitly labeled as such in the diff may remain a patch bump when they do not change existing behavior. Major bumps are only allowed after the first major release; before that, do not use major bumps for feature-level changes.
本Skill用于验证changeset是否准确反映了包的变更情况,且符合仓库规则。它依赖于
references/validation-prompt.md
中的共享提示词,因此本地Codex评审和GitHub Actions会使用相同的逻辑。 如果diff中明确标记为实验性或仅预览功能的新增内容未改变现有行为,那么版本升级级别可保持为patch(补丁级)。 首次正式大版本发布前,不允许使用major(主版本)升级;在此之前,功能级变更不应使用主版本升级。

Quick start

快速开始

Local (Codex-driven):
  1. Run:
    bash
    pnpm changeset:validate-prompt
  2. Apply the rules from
    references/validation-prompt.md
    to the generated prompt.
  3. Respond with a JSON verdict containing ok/errors/warnings/required_bump (English-only strings).
CI (Codex Action):
  1. Run:
    bash
    pnpm changeset:validate-prompt -- --ci --output .github/codex/prompts/changeset-validation.generated.md
  2. Use
    openai/codex-action
    with the generated prompt and JSON schema to get a structured verdict.
本地(由Codex驱动):
  1. 运行:
    bash
    pnpm changeset:validate-prompt
  2. references/validation-prompt.md
    中的规则应用到生成的提示词中。
  3. 返回包含ok/errors/warnings/required_bump的JSON判定结果(仅使用英文)。
CI(Codex Action):
  1. 运行:
    bash
    pnpm changeset:validate-prompt -- --ci --output .github/codex/prompts/changeset-validation.generated.md
  2. 使用
    openai/codex-action
    ,结合生成的提示词和JSON schema,获取结构化的判定结果。

Workflow

工作流程

  1. Generate the prompt context via
    pnpm changeset:validate-prompt
    .
  2. Apply the rules in
    references/validation-prompt.md
    to judge correctness.
  3. Provide a clear verdict and required bump (patch/minor/major/none).
  4. If the changeset needs edits, update it and re-run the validation.
  1. 通过
    pnpm changeset:validate-prompt
    生成提示词上下文。
  2. 应用
    references/validation-prompt.md
    中的规则来判断正确性。
  3. 提供清晰的判定结果和所需的版本升级级别(patch/minor/major/none)。
  4. 如果changeset需要修改,更新后重新运行验证。

Branch-level changeset rule (do not skip)

分支级changeset规则(请勿跳过)

  • If any
    .changeset/*.md
    file is already present in the current branch diff, treat it as the active changeset. Do not add a new changeset file.
  • Instead, update the existing changeset file by rewriting its summary to reflect the primary change relative to
    main
    . Do not try to capture every incremental update.
  • Keep the summary at one line; replace the line as needed rather than appending. If you must include multiple points, compress them into a single line.
  • 如果当前分支的diff中已存在任何
    .changeset/*.md
    文件,则将其视为当前有效的changeset。请勿添加新的changeset文件。
  • 相反,更新现有的changeset文件:重写其摘要,以反映相对于
    main
    分支的主要变更。无需记录每一次增量更新。
  • 摘要需保持为单行;必要时直接替换该行,而非追加内容。如果必须包含多个要点,请压缩为单行。

Shared source of truth

共享事实源

  • Keep the prompt file as the single source of validation rules.
  • Keep the script lightweight: it should only gather context and emit the prompt.
  • 将提示词文件作为验证规则的唯一事实源。
  • 保持脚本轻量化:仅需收集上下文并生成提示词即可。

Resources

资源

  • references/validation-prompt.md
  • references/validation-prompt.md