.agents/skills/add-changeset/SKILL.md
Add one Markdown file under .changeset/ whose front matter lists every changed publishable Rust crate in the PR, plus swc_core when any Rust crate changes.
Resolve the PR context.
gh auth status to succeed and require a clean git status --porcelain before changing the checkout. Never stash or discard local changes automatically.gh pr view <pr> --json number,url,state,baseRefName,baseRefOid,headRefName,headRefOid,headRepository. Require an open PR and a non-null headRepository.nameWithOwner; record the URL, base and head OIDs, head repository, and head branch.gh pr checkout <pr> --detach, then require git rev-parse HEAD to equal the recorded headRefOid.https://github.com/<headRepository.nameWithOwner>.git directly. Record this as the push target without changing any upstream.git push --dry-run <push-target> HEAD:refs/heads/<headRefName>. Stop on failure.Find the PR base and changed files.
baseRefOid and checked-out PR head for all diff and helper commands.gh pr view --json baseRefName,headRefName,body when the branch has a GitHub PR.git diff against the PR merge base; include staged and unstaged local changes only when preparing an unpushed current-branch PR.scripts/changed-rust-crates.mjs from this skill to get a first pass of directly touched Rust crates.Read the code, not only the helper output.
Cargo.toml, Cargo.lock, rust-toolchain, .cargo/, and release tooling manually; they may affect crates without changing files inside the crate directory.publish = false crates.Classify every changed publishable Rust crate.
major for every crate whose public API, behavior contract, feature semantics, serialized output, CLI-visible behavior, or documented compatibility is breaking.major for a crate when one of its runtime dependencies changed in a breaking way. Check that crate's [dependencies], target-specific runtime dependencies, and relevant Cargo.lock changes; do not apply this rule to dev-only or build-only dependencies.major through SWC's reverse internal dependency graph just because another crate depends on a breaking crate; SWC's bump command handles that internal propagation after reading the changeset.minor for non-breaking new public functionality, new supported syntax, new options, new public exports, or meaningful user-visible capability.patch for bug fixes, performance work, refactors, internal-only changes, tests, fixtures, documentation, or dependency bumps that do not add a non-breaking capability.major.Check swc_core exposure explicitly.
swc_core or exposed through a swc_core feature, list swc_core: major.swc_core exposes, list swc_core: minor.swc_core files or feature mappings changed directly and the change is not breaking or additive, list swc_core: patch.swc_core bump is required, include swc_core: patch even when swc_core files did not change.Write the changeset.
.changeset/<short-kebab-summary>.md.fix(es/parser): ..., feat(es/parser): ..., perf(es/parser): ..., or refactor(es/parser): ....Validate, commit, and push the changeset.
git status --short and the changeset contents before staging.git add -- .changeset/<short-kebab-summary>.md; never include unrelated worktree changes.git diff --cached --check and inspect git diff --cached before committing.git commit -m "chore: Add changeset"; never use --no-verify.headRefOid to remain equal to the original recorded head OID.git push <push-target> HEAD:refs/heads/<headRefName>. Never set an upstream or substitute the current local branch name.headRefOid to equal the new commit and report the PR URL, commit hash, and pushed repository and branch.git branch --show-current is empty, stop and ask the user which branch to use.git push when the branch has an upstream. When no upstream exists, identify the PR head remote and branch with gh pr view and repository remotes, then use git push --set-upstream <remote> <branch>. Stop and ask the user if the target is ambiguous.---
swc_core: minor
swc_ecma_parser: minor
---
perf: Optimize es parser comment finalization
Run this helper from the repository root:
node .agents/skills/add-changeset/scripts/changed-rust-crates.mjs
Useful options:
node .agents/skills/add-changeset/scripts/changed-rust-crates.mjs --base origin/main
node .agents/skills/add-changeset/scripts/changed-rust-crates.mjs --json
node .agents/skills/add-changeset/scripts/changed-rust-crates.mjs --include-private
Treat the helper as an inventory aid. It does not decide breaking changes, does not understand public API exposure, and cannot fully interpret workspace-level changes.