---
name: polish-release
description: Polish an existing GitHub release's body into the project's bilingual (English + Chinese) template format with a References section built from merged PRs. Use when 修改 release、整理发布说明、release notes、编辑 release 内容、发版后整理、polish release、edit release body.
title: polish-release
canonical_url: https://skilld.dev/gh/samanhappy/mcphub
last_updated: 2026-10-15T14:31:16.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install samanhappy/mcphub/polish-release`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/polish-release`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/samanhappy/mcphub/polish-release) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/polish-release`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/polish-release --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/polish-release --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Polish Release

Rewrite an existing GitHub release's body into the project's bilingual template, then push it back. The repo's release pipeline auto-generates a raw body on tag push (`generate_release_notes: true`) that does not match the bilingual template — this skill cleans it up.

## Structure contract

The required structure lives in exactly one place: `.github/release-notes-template.md` (read it). It is enforced by `scripts/validate-release-notes.js` (CI runs it on publish/edit). The rules:

- Section order must match the template.
- `Summary`, `摘要`, `References` must be present and non-empty.
- Each optional English section (`Features`/`Fixes`) and its Chinese pair must appear together — never one without the other.
- Optional sections with no content are omitted entirely — never an empty section, never `None`/`无` placeholders.
- `References` bullets use the exact format `<title> by @<login> in <pull url>`, followed by one `Full changelog:` line.
- `New Contributors` bullets use `@<login> made their first contribution in #<number>`.

## Workflow

1. **Resolve the target release.** Use the tag the user gave (e.g. `v1.0.14`), else the latest: `gh release list --limit 1`.

2. **Generate the deterministic parts.**
   ```
   node scripts/build-release-notes.js <tag>
   ```
   This resolves the previous tag (compare line in the existing body, else `git describe`), fetches merged PRs in the range, and prints a draft skeleton to stdout with `<<FILL: ...>>` markers where you must write content. It reuses the existing body's `## New Contributors` when present and falls back to detecting new contributors itself. It never writes files.

3. **Write the draft in the conversation** (not in the working tree). From the PR list in the skeleton:
   - `## Summary` — one English paragraph on why this release matters.
   - `## 摘要` — Chinese translation of the Summary.
   - `## Features`/`## 功能` — user-facing additions (omit if none).
   - `## Fixes`/`## 修复` — bug fixes, reliability, dependency bumps (omit if none).
   - Translate each bullet into Chinese: PR title in Chinese, then `by @<author>` and URL as-is.
   - Keep `## New Contributors` and `## References` as printed, replacing every `<<FILL: ...>>` marker. Drop any section whose content is empty.

4. **Validate locally before pushing.** Write the finished draft to a throwaway temp file (e.g. `/tmp/release-notes-<tag>.md`, never inside the repo), then:
   ```
   node scripts/validate-release-notes.js /tmp/release-notes-<tag>.md
   ```
   On failure: report which section is missing/empty/asymmetric/out-of-order/malformed, fix the draft, re-validate.

5. **Push directly (no confirmation round).**
   ```
   gh release edit <tag> --notes-file /tmp/release-notes-<tag>.md
   ```

6. **Clean up.** Delete the temp file.

## Notes

- Editing a release is externally visible and re-triggers the `release: edited` GitHub event (which runs the validator in CI). Always validate locally first.
- The temp file is only for validation input — keep iteration in the conversation.
- If the existing body already partially follows the template (e.g. a prior run already edited it), reuse the good parts rather than regenerating from scratch.
