Loading...
Loading...
Pre-release review and changeset generation for npm packages using @changesets/cli. Use when: preparing a release, generating changelogs, pre-release checklist, version bump, writing release notes, reviewing README before publish. Triggers: "prepare release", "pre-release", "generate changelog", "write changesets", "release checklist".
npx skill4agent add marcfargas/skills pre-releasenpm publish@changesets/clinpm install --save-dev @changesets/cli @changesets/changelog-github
npx changeset init| # | Check | How |
|---|---|---|
| 1 | README.md exists with: purpose, install, usage, prerequisites, license | Read and verify sections |
| 2 | LICENSE file present and matches | Compare files |
| 3 | No hardcoded credentials, API keys, or personal paths in tracked files | |
| 4 | No TODO/FIXME/HACK in shipped code | |
| 5 | Tests pass | |
| 6 | Lint passes | |
| 7 | Build succeeds | |
| 8 | Git working tree clean | |
| 9 | On correct branch | |
| 10 | .gitignore covers: | Read |
| 11 | | Read and verify |
| 12 | | Read and verify |
| 13 | GitHub Actions release workflow uses Trusted Publishers (OIDC), not | Read |
| 14 | Trusted Publisher configured on npmjs.com for this package | Ask user to confirm (cannot be checked programmatically) |
| 15 | History scan clean (gitleaks + trufflehog) | |
| 16 | Workflow security audit | Read all |
| 17 | Template-only values in examples | |
| 18 | No | |
| 19 | Redaction review for docs & screenshots | Scan README, docs/, and any images for: internal domains ( |
| 20 | Skills discovery (if project ships skills) | Only if |
# Last release tag
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
# If no tags, use first commit
if [ -z "$LAST_TAG" ]; then
RANGE="$(git rev-list --max-parents=0 HEAD)..HEAD"
echo "No previous tags found — covering entire history"
else
RANGE="${LAST_TAG}..HEAD"
echo "Changes since $LAST_TAG"
fi# Commits with files changed
git log $RANGE --pretty=format:'%h %s' --no-merges
# For more context on what changed
git log $RANGE --pretty=format:'### %h %s%n%b' --no-merges
# Files changed (to understand scope)
git diff --stat $LAST_TAG..HEAD 2>/dev/null || git diff --stat $(git rev-list --max-parents=0 HEAD)..HEADls .changeset/*.md 2>/dev/null | grep -v README.md.changeset/.changeset/<descriptive-name>.md---
"package-name": patch
---
Brief, user-facing description of what changed.| Type | Bump | Examples |
|---|---|---|
| Breaking API changes | | Removed function, changed signature, dropped Node version |
| New features, capabilities | | New command, new option, new API |
| Bug fixes, docs, internal | | Fix crash, update README, refactor internals |
--verboseadd-verbose-flag.mdfix-auth-crash.mdinitial-release.md---
"package-name": minor
---
Initial release.
- Feature 1: brief description
- Feature 2: brief description
- Feature 3: brief descriptionminorrun-agents{ "tasks": [
{ "agent": "_arch-reviewer", "task": "Read the README.md in <project-path>. You are a developer who has NEVER seen this project. Can you answer: (1) What does it do? (2) How to install? (3) How to use? (4) Prerequisites? (5) Where to get help? For each: quote relevant text or say MISSING. Then list anything confusing or that assumes prior knowledge.", "model": "google/gemini-3-pro" },
{ "agent": "_arch-reviewer", "task": "Read the README.md in <project-path>. You are a developer who has NEVER seen this project. Can you answer: (1) What does it do? (2) How to install? (3) How to use? (4) Prerequisites? (5) Where to get help? For each: quote relevant text or say MISSING. Then list anything confusing or that assumes prior knowledge.", "model": "github-copilot/gpt-5.3" }
]}# Pre-Release Report: <package-name>
## Version: <current> → <proposed>
## Date: <today>
### Checklist
| # | Check | Status | Notes |
|---|-------|--------|-------|
| 1 | README | ✅/❌ | ... |
| ... |
### Changesets Generated
| File | Bump | Summary |
|------|------|---------|
| `add-feature-x.md` | minor | Add feature X |
| ... |
### README Review
(If Step 3 was run)
- **Gaps**: ...
- **Confusing**: ...
### Blockers (must fix)
1. ...
### Suggestions (can wait)
1. ...
### Ready to Release?
**YES** / **NO — N blockers remain**git add .changeset/*.md
git commit -m "chore: add changesets for next release" -m "Co-Authored-By: Pi <noreply@pi.dev>"npm install --save-dev @changesets/cli @changesets/changelog-github
npx changeset init.changeset/config.json{
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
"changelog": "@changesets/changelog-github",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}"access": "public"@scope/name"baseBranch"package.json{
"scripts": {
"changeset": "changeset",
"version-packages": "changeset version",
"release": "changeset publish"
}
}.github/workflows/release.ymlname: Release
on:
push:
branches: [main]
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: write
pull-requests: write
id-token: write # Required for npm Trusted Publishing (OIDC)
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24 # npm >= 11.5.1 required for Trusted Publishing
cache: npm
registry-url: https://registry.npmjs.org
- run: npm ci
- run: npm run build
- run: npm test
- name: Create Release PR or Publish
id: changesets
uses: changesets/action@v1
with:
publish: npx changeset publish
title: "chore: version packages"
commit: "chore: version packages"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}NPM_TOKENrelease.ymlid-token: writeNPM_TOKENNPM_TOKEN