Publish release

From ItsBenCodes/cookies · View interactive version

Publish release is an AI agent skill from the GitHub repository ItsBenCodes/cookies. Create a GitHub release and publish to NPM.

How to use this skill

Skill file

Publish Release

1. Sync main

git fetch origin main --tags
git checkout main
git pull origin main

2. Compute release version

Highest version across publishable packages on origin/main:

VERSION=$(node -p "
  ['react-cookie','universal-cookie','universal-cookie-express','universal-cookie-koa']
    .map(p => JSON.parse(require('child_process').execSync('git show origin/main:packages/'+p+'/package.json')).version)
    .sort((a,b) => a.split('.').map(Number).reduce((_,n,i)=>_||n-b.split('.').map(Number)[i],0))
    .pop()
")
echo "v$VERSION"

Abort if v$VERSION tag already exists:

git rev-parse "v$VERSION" >/dev/null 2>&1 && { echo "Tag v$VERSION already exists"; exit 1; }

3. Tag, push, release

Always create an annotated tag with a message (some local configs enable tag.gpgsign, which makes a plain git tag NAME fail without a message):

git tag -a "v$VERSION" -m "v$VERSION"
git push origin "v$VERSION"
gh release create "v$VERSION" --title "v$VERSION" --generate-notes
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.