From 1071065a74a95f41f6293f6e516191f60e046c65 Mon Sep 17 00:00:00 2001 From: raul-oliveira Date: Thu, 16 Apr 2026 12:22:53 -0300 Subject: [PATCH 1/2] feat: add changelog-writer skill Co-Authored-By: Claude Opus 4.6 (1M context) --- .claude-plugin/marketplace.json | 3 +- .claude/settings.local.json | 3 +- README.md | 13 +++ skills/changelog-writer/SKILL.md | 133 +++++++++++++++++++++++++++++++ 4 files changed, 150 insertions(+), 2 deletions(-) create mode 100644 skills/changelog-writer/SKILL.md diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index d91abc3..9e9898e 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -15,7 +15,8 @@ "source": "./", "strict": false, "skills": [ - "./skills/hathor-blueprints" + "./skills/hathor-blueprints", + "./skills/changelog-writer" ] } ] diff --git a/.claude/settings.local.json b/.claude/settings.local.json index c5e2fed..faae0b9 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -1,7 +1,8 @@ { "permissions": { "allow": [ - "Skill(hathor-blueprint)" + "Skill(hathor-blueprint)", + "Skill(changelog-writer)" ] } } diff --git a/README.md b/README.md index 751c795..330d67f 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ Official Claude Code skills for [Hathor Network](https://hathor.network) develop | Skill | Description | |-------|-------------| | **hathor-blueprint** | Create Hathor blockchain blueprints (nano contracts) | +| **changelog-writer** | Generate changelogs for release bump PRs and GitHub Releases | ## Marketplace @@ -68,6 +69,18 @@ Or invoke it explicitly: /hathor-blueprint ``` +### changelog-writer + +The skill activates automatically when you: +- Ask to write a changelog or release notes +- Mention version bumps or release PRs +- Need to generate a bump PR description + +Or invoke it explicitly: +``` +/changelog-writer +``` + ## How It Works - **Automatic discovery**: Claude Code loads skills from `~/.claude/skills/` (personal) or `.claude/skills/` (project) at startup diff --git a/skills/changelog-writer/SKILL.md b/skills/changelog-writer/SKILL.md new file mode 100644 index 0000000..1ea3f05 --- /dev/null +++ b/skills/changelog-writer/SKILL.md @@ -0,0 +1,133 @@ +--- +name: changelog-writer +description: Generate changelogs for Hathor release PRs and GitHub Releases. Use when bumping versions, writing release notes, or creating changelogs for bump PRs. +--- + +# Release Changelog — Step by step + +This guide covers two complementary artifacts: +- **Bump PR**: detailed description with breaking changes and migration guide +- **Release changelog**: summarized version for the GitHub Release + +--- + +## Part A — Bump PR + +### 1. Identify included PRs + +Fetch the release PR associated with the bump to list commits: + +```bash +gh pr view --json commits --jq '.commits[].messageHeadline' +``` + +Filter only relevant PRs — ignore sync merges (e.g., `Merge pull request #XXXX from HathorNetwork/chore/sync-release-*`). + +### 2. Find breaking changes + +For each identified PR, fetch title and body: + +```bash +gh pr view --json title,body --jq '{title, body}' +``` + +Look in the bodies for: +- Explicit "Breaking Changes" sections +- Type, interface, or public function renames +- Method signature changes +- API removals +- Default behavior changes that affect consumers + +### 3. Build the bump PR description + +The bump PR contains the **full details** of breaking changes, including code examples and migration instructions when needed. + +Structure: + +```markdown +### Acceptance Criteria +- Bump package to v + +### Breaking Changes + +From **# - **: + +<breaking change details with migration examples> + +From **#<PR2> - <title2>**: + +<details> + +### What's included + +| PR | Type | Title | +|---|---|---| +| #XXXX | feat | ... | +| #XXXX | fix | ... | +| #XXXX | refact | ... | +| #XXXX | test | ... | +| #XXXX | chore | ... | + +### Security Checklist +- [x] Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us. +``` + +Sort the "What's included" table by type: feat → fix → refact → test → chore. + +### 4. Update the PR via API + +Use the REST API since `gh pr edit` has a bug with Projects v2: + +```bash +gh api repos/HathorNetwork/<REPO>/pulls/<PR_NUMBER> -X PATCH \ + -f title="chore: bump to v<VERSION>" \ + -f body="$(cat <<'EOF' +<body here> +EOF +)" +``` + +--- + +## Part B — Release Changelog + +The release changelog is a **summarized** version that references the bump PR for details. + +### 5. Build the release changelog + +Rules: +- Breaking changes are **one-liners** with a reference to the source PR — do not repeat migration details +- Point to the bump PR as the source for full details and migration guide +- Group PRs by type with author: **Features**, **Bug Fixes**, **Tests & Chores** +- Format for each item: `- Description (#PR) by @author` +- Include a Full Changelog link at the end + +Structure: + +```markdown +### Breaking Changes + +See PR #<BUMP_PR> for full details and migration guide. + +- Breaking change summary 1 (#SOURCE_PR) +- Breaking change summary 2 (#SOURCE_PR) + +### Features +- PR title (#PR) by @author +- PR title (#PR) by @author + +### Bug Fixes +- PR title (#PR) by @author + +### Tests & Chores +- PR title (#PR) by @author +- PR title (#PR) by @author + +**Full Changelog**: https://github.com/HathorNetwork/<REPO>/compare/v<PREVIOUS>...v<VERSION> +``` + +### 6. Update the release + +```bash +gh release edit v<VERSION> --notes-file <file_with_body> +``` From b06688ebca9111416d83d98d9a4261109ab9d394 Mon Sep 17 00:00:00 2001 From: raul-oliveira <mrraul65@gmail.com> Date: Wed, 22 Apr 2026 14:13:02 -0300 Subject: [PATCH 2/2] feat: restrict the changelog writer to clients --- skills/changelog-writer/SKILL.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/skills/changelog-writer/SKILL.md b/skills/changelog-writer/SKILL.md index 1ea3f05..3bf098f 100644 --- a/skills/changelog-writer/SKILL.md +++ b/skills/changelog-writer/SKILL.md @@ -1,10 +1,34 @@ --- name: changelog-writer -description: Generate changelogs for Hathor release PRs and GitHub Releases. Use when bumping versions, writing release notes, or creating changelogs for bump PRs. +description: Generate changelogs for Hathor release PRs and GitHub Releases. Use when bumping versions, writing release notes, or creating changelogs for bump PRs. Only applicable in client repositories (wallet-lib, wallet, wallet-headless, wallet-mobile, wallet-service, rpc-lib, explorer, explorer-service). --- # Release Changelog — Step by step +## Allowed repositories + +This skill is scoped to client repositories only. Before proceeding, verify the current repo by running: + +```bash +git remote get-url origin +``` + +The remote URL **must** match one of these repositories: + +- `HathorNetwork/hathor-rpc-lib` +- `HathorNetwork/hathor-wallet-headless` +- `HathorNetwork/hathor-wallet-mobile` +- `HathorNetwork/hathor-wallet` +- `HathorNetwork/hathor-wallet-lib` +- `HathorNetwork/hathor-explorer` +- `HathorNetwork/hathor-explorer-service` +- `HathorNetwork/hathor-wallet-service` + +If the current repo is **not** in this list, **stop immediately** and inform the user: +> "The changelog-writer skill is only available for client repositories (wallet-lib, wallet, wallet-headless, wallet-mobile, wallet-service, rpc-lib, explorer, explorer-service)." + +--- + This guide covers two complementary artifacts: - **Bump PR**: detailed description with breaking changes and migration guide - **Release changelog**: summarized version for the GitHub Release