taxonomy-release
GitHub指导如何准备、审查和发布分类法版本,包括确定变更范围、验证属性质量规则、处理退货原因及生成发布说明。
触发场景
安装
npx skills add Shopify/product-taxonomy --skill taxonomy-release -g -y
SKILL.md
Frontmatter
{
"name": "taxonomy-release",
"description": "Prepare, review, or publish a taxonomy release in this repository. Use when opening or reviewing a release data PR, writing the changelog or GitHub release notes, or cutting a release with bin\/product_taxonomy release."
}
Taxonomy release
Follow these steps for every release so each one is prepared and checked the
same way. Run commands from dev/ unless noted.
1. Scope
- Start from the latest
main. Find the last GitHub release withgh release view --json tagName --jq .tagName, then check for later patch tags on the remote withgit ls-remote --tags origin. Use the latest applicable published tag as the changelog base, including patches; a local tag of the same name may point to a different commit. - The release data PR changes only taxonomy data, localizations, mappings and
the changelog. Do not edit
data/integrations/README.mdor other docs unless the release changes what they describe.VERSION,dist/, the docs and the version badges are updated later by the release command (step 8). - Never renumber, reuse or reassign a category, attribute or value ID, including IDs from retired records.
- Keep published content unless its removal is intended and disclosed: values, the order of custom-sorted values, category assignments and translations of records that still exist. When removing an attribute, remove its category references, values that are no longer referenced by any attribute, and its attribute/value localizations. Preserve unrelated records and their order.
- Disclose every rename and removal of a published category, attribute or value in the changelog.
2. Attribute quality
Check these invariants across the resulting taxonomy, not only new attributes. Review every new or changed attribute and category assignment against them; compare with the PR base to identify pre-existing exceptions and do not add new violations:
| Rule | Example |
|---|---|
Every base attribute except Color has an Other value, <friendly_id>__other, listed last |
Assembly required: No, Yes, Other |
An attribute for a part or component's color extends Color (values_from: color), rather than adding a new base attribute |
D ring color |
Every X color extension has an X pattern extension (values_from: pattern) on the same categories; new or changed assignments must include the pair |
D ring pattern |
| Names use sentence case and do not repeat the category name | Garment length type, not Capes Garment length type |
| Avoid gendered attributes and unnecessarily granular brand/model-specific attributes when a general compatibility model is more appropriate | Not Her size or Compatible Samsung The Frame TV model year |
3. Return reasons
-
Existing categories keep their return reasons exactly as on the release PR's base (the latest
mainafter fetching). Compare the base with the release branch, not the last release tag; tag-to-head is a separate changelog check. -
New categories use
return_reasons: inheritunless the release intends otherwise. -
Generate
dist/en/categories.jsonseparately from cleanorigin/mainand the release branch, then compare the ordered return-reason IDs for every category present onmain; the JSON contains the effective inherited reasons. Do not compare committeddist/files, which can be stale or absent, or use only the last release tag as the baseline. Fromdev/on the release branch:bin/product_taxonomy dist --locales en base_root=$(mktemp -d) git worktree add --detach "$base_root/main" origin/main (cd "$base_root/main/dev" && bin/product_taxonomy dist --locales en) reasons() { jq '[.verticals[].categories[] | {key: .id, value: [.return_reasons[].id]}] | from_entries' "$1" } reasons "$base_root/main/dist/en/categories.json" > "$base_root/base.json" reasons ../dist/en/categories.json > "$base_root/head.json" jq -rn --slurpfile base "$base_root/base.json" --slurpfile head "$base_root/head.json" \ '$base[0] | to_entries[] | select($head[0][.key] != .value) | .key' git worktree remove --force "$base_root/main" rm -rf "$base_root"The comparison prints the ID of each changed or missing category; it must print nothing unless the release intends the change.
4. Mappings
- Keep all existing mapping rules and exclusions unchanged.
- Map new categories with the existing policy (the nearest mapped ancestor), keeping existing exclusions for their descendants.
5. Localizations
- Every locale covers every English name and description.
- Records that still exist keep their translations. Remove translations only
for records the release retires or attribute/value records removed during
cleanup. Preserve YAML scalar quoting where needed: Polish
'ON'must continue to parse as a string rather than a boolean. - Describe in the PR which translations are new, changed or not yet reviewed by language owners.
6. Generate and test
bin/product_taxonomy dist --locales all
bundle exec rake test
bundle exec rake test:orphan
bundle exec rake schema:vet
test:orphan is non-blocking in CI (continue-on-error). Fix orphans the
release introduces and note any pre-existing ones in the PR.
7. Changelog
-
Generate a draft from the last published tag (including later patch tags) and the release branch. Commit the release changes first: the head worktree uses
HEAD, so uncommitted edits are not included. Run fromdev/on that branch:git fetch origin main last_published_tag=$(git ls-remote --tags --refs origin 'v*' | awk -F/ '{print $NF}' | grep -E '^v[0-9]{4}-[0-9]{2}(-patch(-[0-9]+)?)?$' | sort -V | tail -n 1) base_commit= git fetch --no-tags origin "refs/tags/${last_published_tag:?no published tag found}" && base_commit=$(git rev-parse 'FETCH_HEAD^{commit}') echo "Base: $last_published_tag ${base_commit:?could not fetch the base tag}" worktree_root=$(mktemp -d) draft_path=$(mktemp) git worktree add --detach "$worktree_root/base" "$base_commit" git worktree add --detach "$worktree_root/head" HEAD bin/generate_changelog \ --base "$worktree_root/base" \ --head "$worktree_root/head" \ --output "$draft_path" git worktree remove "$worktree_root/base" git worktree remove "$worktree_root/head" rmdir "$worktree_root" echo "Changelog draft: $draft_path"Stop if the
Base:line is not printed, and confirm the selected tag against the published releases. Fetching the remote tag without changing local tags avoids a stale or moved local tag. Seedev/CHANGELOG_GENERATOR.mdfor optional reviewed manual notes; create a release-specific YAML file before passing it with--notes. -
List every PR merged since the last tag and add notes for changes the draft cannot infer, such as disclosures, return reasons and removals. In the same shell, reuse
base_commitfrom step 1 rather than a local tag:git log --first-parent --oneline "$base_commit"..origin/main -
Put the draft in the
Unreleasedsection ofCHANGELOG.md. In the release data PR, turn that section into## <version>and add a fresh## Unreleasedheading for subsequent changes. Merge that PR before step 8: the release command runs on a cleanmainand does not edit the changelog.
8. Release
- Confirm the version with the taxonomy owners.
- On a clean
main, runbin/product_taxonomy release <version> <next-version>-unstable. It creates therelease-v<version>branch, updatesVERSION, mappings,dist/, the docs and the version badges, tagsv<version>, then commits the next unstable version on the same branch. Follow the next steps it prints: push the branch, open and merge the PR, push the tag, create the GitHub release, publish the release assets and spot-check one. The repository merges PRs with merge commits, so the tagged release commit stays onmain. If the release branch changes during review, move the local tag to the reviewed release commit before pushing it. - Write the GitHub release body in the previous release's format: one intro
line with the version and an explore link, then
## Changelogwith the sections that apply: 📚 Taxonomy Tree, ⚠️ Disclosures, 🔄 Return Reasons, 🌐 Localization, 📦 Distribution.
9. Public text
PR descriptions, the changelog and release notes describe changes for taxonomy users. Do not link private resources or describe work that is not part of the release.
版本历史
- ac0d5b9 当前 2026-12-05 15:35


