ship-release-skill 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +3 -2
- package/package.json +1 -1
- package/skills/ship-release/SKILL.md +34 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ship-release",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Ships a release end to end: bump manifests, changelog, README badges, tag, GitHub release, npm publish and check.",
|
|
5
5
|
"author": { "name": "joezhuo2" },
|
|
6
6
|
"repository": "https://github.com/joezhuo2/ship-release-skill",
|
package/README.md
CHANGED
|
@@ -58,12 +58,13 @@ Restart Claude Code afterwards. The skill needs `git` and the
|
|
|
58
58
|
| Step | What happens |
|
|
59
59
|
|------|--------------|
|
|
60
60
|
| Pick the version | Uses the one you gave, or proposes patch / minor / major from the commits since the last tag. |
|
|
61
|
-
| Preflight | Clean tree, default branch, up to date, tag is free, `gh` and `npm` logged in, version not on npm, tests pass. |
|
|
61
|
+
| Preflight | Clean tree, default branch or a release branch, up to date, tag is free, `gh` and `npm` logged in, version not on npm, tests pass. |
|
|
62
62
|
| Bump manifests | Greps the old version and bumps `package.json`, lockfile, `.claude-plugin/plugin.json`, `marketplace.json`, `pyproject.toml`, `Cargo.toml` and version constants. |
|
|
63
63
|
| Changelog | Adds a dated section in the file's own format, written from the commits. |
|
|
64
64
|
| README | Updates hardcoded version badges and pinned install lines; leaves dynamic badges alone. |
|
|
65
65
|
| Confirm | Shows the version, files and changelog section, and asks once before anything goes public. |
|
|
66
|
-
| Commit,
|
|
66
|
+
| Commit, land, tag | Release commit in the repo's style, pushed directly or through a pull request, then an annotated tag. Never `--force`. |
|
|
67
|
+
| Pull request route | On a branch, in a worktree or with a protected default branch: pre-PR check, open the PR, fix conflicts, wait for checks, merge, then remove the worktree and branch. |
|
|
67
68
|
| GitHub release | Waits for a tag-triggered release workflow if the repo has one, otherwise `gh release create` with the changelog section. |
|
|
68
69
|
| npm | Publishes unless a workflow does or the package is private, then checks the registry shows the new version. |
|
|
69
70
|
| Report | Version, tag, release URL, npm URL, and anything skipped or failed. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ship-release
|
|
3
|
-
description: Use when the user asks to release, ship, publish, cut or tag a version of a project ("release v0.2.0", "ship a patch", "bump and publish"). Bumps every version manifest, updates CHANGELOG and README badges, commits, tags, creates the GitHub release, and publishes to or verifies npm.
|
|
3
|
+
description: Use when the user asks to release, ship, publish, cut or tag a version of a project ("release v0.2.0", "ship a patch", "bump and publish"). Bumps every version manifest, updates CHANGELOG and README badges, commits, lands it directly or through a pull request (pre-PR check, conflict fixes, merge, worktree cleanup), tags, creates the GitHub release, and publishes to or verifies npm.
|
|
4
4
|
argument-hint: "[version | patch | minor | major]"
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -22,7 +22,7 @@ Run the steps in order. Stop and report as soon as a step fails; never skip ahea
|
|
|
22
22
|
All of these must pass before any file changes:
|
|
23
23
|
|
|
24
24
|
- `git status --porcelain` is clean, or holds only changes meant for this release. Ask about anything else.
|
|
25
|
-
-
|
|
25
|
+
- After `git fetch`, you are on the default branch and not behind its upstream. On any other branch, or in a linked worktree (`git worktree list`), the release goes through the PR route in step 7.
|
|
26
26
|
- The tag does not exist: `git tag -l <tag>` and `git ls-remote --tags origin <tag>` are both empty.
|
|
27
27
|
- `gh auth status` succeeds.
|
|
28
28
|
- If `package.json` exists and is not `"private": true`: `npm whoami` succeeds and `npm view <name>@<version> version` finds nothing.
|
|
@@ -70,12 +70,38 @@ Read each grep hit before changing it: bump the project's own version, not a dep
|
|
|
70
70
|
- `git diff --stat` and read the diff for secrets (tokens, `.env`, keys).
|
|
71
71
|
- Show the user the version, the changed files and the new changelog section. Ask once before step 7, unless they already told you to release without asking. Everything after this point is public and cannot be undone.
|
|
72
72
|
|
|
73
|
-
## 7. Commit,
|
|
73
|
+
## 7. Commit, land, tag
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
Stage only the release files. Use the message style of earlier release commits (`git log --oneline -20`); default `Release v<new>`.
|
|
76
|
+
|
|
77
|
+
Pick one route to get the commit onto the default branch:
|
|
78
|
+
|
|
79
|
+
- **Direct:** you are on the default branch, it is not protected and the repo does not release through PRs. `git push origin <branch>`.
|
|
80
|
+
- **PR:** anything else. Follow the PR route below.
|
|
81
|
+
|
|
82
|
+
Then tag the commit that is on the default branch: `git tag -a <tag> -m "<tag>"` and `git push origin <tag>`. Never `--tags`, never `--force`.
|
|
83
|
+
|
|
84
|
+
### PR route
|
|
85
|
+
|
|
86
|
+
1. **Branch.** If you are on the default branch, `git switch -c release/v<new>` before committing. Otherwise keep the branch you are on.
|
|
87
|
+
2. **Pre-PR check.** All must pass before the push:
|
|
88
|
+
- `git fetch origin`, then `git merge origin/<default>`. Resolve conflicts as in step 4 below.
|
|
89
|
+
- `git diff origin/<default>...HEAD --stat` lists only files meant for this release. Read the diff for secrets and leftover debug code.
|
|
90
|
+
- The tests pass on the merged result.
|
|
91
|
+
- `gh pr list --head <branch>` shows no open PR for this branch. If one exists, reuse it.
|
|
92
|
+
3. **Open the PR.** `git push -u origin <branch>`, then `gh pr create --base <default> --title "Release v<new>" --body-file <file>` with the new changelog section as the body.
|
|
93
|
+
4. **Fix conflicts.** `gh pr view --json mergeable,mergeStateStatus`. If it reports `CONFLICTING`:
|
|
94
|
+
- `git fetch origin && git merge origin/<default>`. Never rebase or force-push a pushed branch.
|
|
95
|
+
- Version manifests take the new version. In the changelog, keep the entries from both sides, the new section on top.
|
|
96
|
+
- In code, keep the intent of both sides. If you cannot tell what the other side meant, stop and ask.
|
|
97
|
+
- Run the tests, commit the merge, push.
|
|
98
|
+
5. **Checks.** `gh pr checks --watch`. If one fails, read `gh run view --log-failed`, fix, push, and watch again.
|
|
99
|
+
6. **Merge.** Use the method earlier PRs used (`gh pr list --state merged --limit 5 --json mergeCommit,title`); default `gh pr merge --squash --delete-branch`. In a linked worktree leave out `--delete-branch` and run `git push origin --delete <branch>` afterwards. If a review is required, stop and ask the user for it. Never `--admin`.
|
|
100
|
+
7. **Sync.** In the main checkout: `git switch <default>` and `git pull --ff-only`. This is the commit to tag.
|
|
101
|
+
8. **Delete the worktree, if the branch lived in one.** From the main checkout:
|
|
102
|
+
- `git worktree remove <path>`. No `--force`: if git refuses, show the user the files left in it and ask.
|
|
103
|
+
- `git branch -d <branch>`. After a squash merge git refuses; confirm `gh pr view <number> --json state` says `MERGED`, then use `-D`.
|
|
104
|
+
- `git worktree prune`.
|
|
79
105
|
|
|
80
106
|
## 8. GitHub release
|
|
81
107
|
|
|
@@ -101,5 +127,6 @@ Give the version, the tag, the release URL, the npm URL, and anything skipped, f
|
|
|
101
127
|
|
|
102
128
|
- Before the push: fix it and amend freely.
|
|
103
129
|
- After the push: never move or delete a pushed tag, never force-push, never `npm unpublish`. Fix forward with a patch release.
|
|
130
|
+
- PR merged but not tagged: tag the merge commit on the default branch and carry on from there. Do not open a second PR.
|
|
104
131
|
- Tag pushed but `npm publish` failed: fix the cause and publish again from the tagged commit. Do not retag.
|
|
105
132
|
- Release workflow failed: read `gh run view --log-failed`, fix forward, and tell the user what state the tag, the release and the registry are in.
|