$npx -y skills add Codagent-AI/agent-skills --skill releaseCreates a release PR from merged PRs — gathers merged PRs since last tag (plus any unmerged current-branch PR), calculates semver bump from conventional commit titles, generates changelog entries, and opens a release PR. Works from any branch: includes both main and current branc
| 1 | Create a release PR by gathering merged PRs, calculating the version bump, writing changelog entries, and opening the PR. |
| 2 | |
| 3 | ## Out of Scope |
| 4 | |
| 5 | This skill does not resolve merge conflicts, create release PRs when required GitHub tooling is unavailable, or curate changelog content beyond the generated PR set. Stop and report the blocker when prerequisites fail. |
| 6 | |
| 7 | ## Steps |
| 8 | |
| 9 | ### 1. Gather release info |
| 10 | |
| 11 | Run the info script to collect merged PRs and calculate the version: |
| 12 | |
| 13 | ```bash |
| 14 | bash .agents/skills/release/scripts/release-info.sh |
| 15 | ``` |
| 16 | |
| 17 | Capture stdout as JSON. The script writes all structured responses, including errors, to stdout. If the output contains `"error"`, stop and report the message to the user. |
| 18 | |
| 19 | ### 2. Show the release summary |
| 20 | |
| 21 | Display to the user: |
| 22 | - Version bump: `current_version` → `new_version` |
| 23 | - Number of PRs by category |
| 24 | - List each PR number and title, grouped by Major / Minor / Patch |
| 25 | |
| 26 | ### 3. Write changelog descriptions |
| 27 | |
| 28 | For each PR in the JSON output, write a one-sentence description that is slightly more informative than the raw PR title. Strip the conventional commit prefix from the title (`feat:`, `fix:`, `chore:`, etc.) and expand it into a sentence that gives enough context to understand the change without clicking through. |
| 29 | |
| 30 | ### 4. Format the changelog section |
| 31 | |
| 32 | Build the changelog section for the new version. Only include sections that have entries. Sort entries by PR number ascending within each section. |
| 33 | |
| 34 | Format: |
| 35 | |
| 36 | ```markdown |
| 37 | ## <new_version> |
| 38 | |
| 39 | ### Major Changes |
| 40 | |
| 41 | - [#<number>](https://github.com/Codagent-AI/agent-skills/pull/<number>) <description> |
| 42 | |
| 43 | ### Minor Changes |
| 44 | |
| 45 | - [#<number>](https://github.com/Codagent-AI/agent-skills/pull/<number>) <description> |
| 46 | |
| 47 | ### Patch Changes |
| 48 | |
| 49 | - [#<number>](https://github.com/Codagent-AI/agent-skills/pull/<number>) <description> |
| 50 | ``` |
| 51 | |
| 52 | ### 5. Write the changelog section to a temp file |
| 53 | |
| 54 | Write the formatted changelog section (from step 4) to a temporary file: |
| 55 | |
| 56 | ```bash |
| 57 | TMPFILE=$(mktemp) |
| 58 | cat <<'CHANGELOG_EOF' > "$TMPFILE" |
| 59 | <paste the formatted changelog section here> |
| 60 | CHANGELOG_EOF |
| 61 | echo "$TMPFILE" |
| 62 | ``` |
| 63 | |
| 64 | ### 6. Create the release PR |
| 65 | |
| 66 | Run the release script with the new version and temp file path: |
| 67 | |
| 68 | ```bash |
| 69 | bash .agents/skills/release/scripts/create-release-pr.sh <new_version> <tmpfile_path> |
| 70 | ``` |
| 71 | |
| 72 | ### 7. Report |
| 73 | |
| 74 | Print the PR URL returned by the script. |
| 75 | |
| 76 | Clean up the temp file: |
| 77 | |
| 78 | ```bash |
| 79 | rm -f "$TMPFILE" |
| 80 | ``` |