AgentSkillsCN

changeset

为软件包版本管理创建变更集文件。当用户需要记录发布变更、撰写变更日志条目,或提升软件包版本时,可使用此方法。

SKILL.md
--- frontmatter
name: changeset
description: Create a changeset file for versioning packages. Use when the user wants to document changes for release, create a changelog entry, or bump package versions.
allowed-tools: Read, Write, Glob, Grep, AskUserQuestion

Changeset Creation Skill

Create changeset files for projects using @changesets/cli.

Context

  • Existing changesets: !ls .changeset/*.md 2>/dev/null | head -5
  • Workspace packages: !for dir in packages/* plugins/*; do [ -f "$dir/package.json" ] && jq -r '.name' "$dir/package.json"; done 2>/dev/null | sort

Instructions

Step 1: Detect Packages

  1. This is a monorepo with workspaces in packages/* and plugins/*
  2. Find all package.json files in workspace directories and extract names
  3. IMPORTANT: Never use the root package name ("root") - only use actual workspace package names
  4. Common packages for app-wide changes: app, backend

Step 2: Gather Information

Use AskUserQuestion tool to ask:

  1. Package Selection (if multiple packages): Which packages should be included? Use multiSelect: true to allow selecting multiple packages.
  2. Version Bump Type: For each selected package - patch, minor, or major?
  3. Summary: Brief description of changes for the changelog

Step 3: Generate Unique Filename

Generate human-readable ID: {adjective}-{noun}-{verb}

Word lists:

Adjectives: ancient, bright, calm, deep, eager, fair, gentle, happy, icy, jolly, kind, light, mild, noble, odd, plain, quick, rare, soft, tall, unique, vast, warm, young, zesty, bold, clean, dark, empty, fresh, grand, humble, ideal, keen, loud, merry, neat, open, proud, quiet, rich, sharp, sweet, tidy, vivid, wise, witty, brave, clever

Nouns: apple, beach, cloud, eagle, flame, grape, heart, island, jewel, kite, lemon, maple, night, ocean, pearl, river, stone, tiger, violet, water, bamboo, canyon, desert, ember, forest, garden, harbor, jungle, kingdom, lagoon, meadow, nebula, oasis, planet, rainbow, sunset, thunder, valley, willow, bridge, castle, dolphin, falcon, glacier, horizon, lantern, mirror, orchard, phoenix

Verbs: bloom, climb, dance, explore, float, glide, hover, ignite, jump, kindle, launch, melt, nestle, orbit, ripple, shine, travel, unfold, venture, wander, adapt, blend, create, drift, emerge, flow, grow, heal, inspire, journey, learn, mingle, observe, persist, reflect, soar, thrive, twist, unite, whisper

Pick one word randomly from each list. Check if .changeset/{id}.md exists; if so, regenerate.

Step 4: Write Changeset File

Create .changeset/{id}.md:

code
---
"package-name": patch
---

Summary description here.

Rules:

  • Package names MUST be quoted
  • Only use actual workspace package names (e.g., app, backend, @giantswarm/backstage-plugin-gs)
  • NEVER use the root package name ("root") - it will break yarn changeset version
  • End file with newline
  • Create .changeset/ directory if missing

Step 5: Confirm

Display:

  1. Path to created changeset
  2. File contents
  3. Remind user to commit the file