Agent Skills › Shopify/product-taxonomy › taxonomy-release

taxonomy-release

GitHub

指导如何准备、审查和发布分类数据版本。涵盖范围界定、属性质量检查规范、退货原因处理及变更日志编写,确保发布流程标准化与数据一致性。

.claude/skills/taxonomy-release/SKILL.md Shopify/product-taxonomy

Trigger Scenarios

准备发布分类数据 审查分类数据PR 编写发布说明或变更日志 执行版本切割命令

Install

npx skills add Shopify/product-taxonomy --skill taxonomy-release -g -y
More Options

Non-standard path

npx skills add https://github.com/Shopify/product-taxonomy/tree/main/.claude/skills/taxonomy-release -g -y

Use without installing

npx skills use Shopify/product-taxonomy@taxonomy-release

指定 Agent (Claude Code)

npx skills add Shopify/product-taxonomy --skill taxonomy-release -a claude-code -g -y

安装 repo 全部 skill

npx skills add Shopify/product-taxonomy --all -g -y

预览 repo 内 skill

npx skills add Shopify/product-taxonomy --list

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 with gh release view --json tagName --jq .tagName, then check for later patch tags on the remote with git 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.md or 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 main after 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: inherit unless the release intends otherwise.

  • Generate dist/en/categories.json separately from clean origin/main and the release branch, then compare the ordered return-reason IDs for every category present on main; the JSON contains the effective inherited reasons. Do not compare committed dist/ files, which can be stale or absent, or use only the last release tag as the baseline. From dev/ 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

  1. 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 from dev/ 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. See dev/CHANGELOG_GENERATOR.md for optional reviewed manual notes; create a release-specific YAML file before passing it with --notes.

  2. 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_commit from step 1 rather than a local tag:

    git log --first-parent --oneline "$base_commit"..origin/main
    
  3. Put the draft in the Unreleased section of CHANGELOG.md. In the release data PR, turn that section into ## <version> and add a fresh ## Unreleased heading for subsequent changes. Merge that PR before step 8: the release command runs on a clean main and does not edit the changelog.

8. Release

  1. Confirm the version with the taxonomy owners.
  2. On a clean main, run bin/product_taxonomy release <version> <next-version>-unstable. It creates the release-v<version> branch, updates VERSION, mappings, dist/, the docs and the version badges, tags v<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 on main. If the release branch changes during review, move the local tag to the reviewed release commit before pushing it.
  3. Write the GitHub release body in the previous release's format: one intro line with the version and an explore link, then ## Changelog with 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.

Version History

  • ac0d5b9 Current 2026-12-05 15:35

Metadata

Files
0
Version
ac0d5b9
Hash
14c02354
Indexed
2026-12-05 15:35

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-12-06 12:58
浙ICP备14020137号-1