/release-npm
Full patch release - auto-commit, push, build, npm publish, AND GitHub Release creation. Use --quick for save+release (no GH release). Use --ci for GitHub Actions publish. Use --only for local publish without git push. Use --only --local for version bump only.
> /plugin marketplace add anton-abyzov/specweave > /plugin install sw@specweave
How it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/release-npm
Context preview
What this command does when you run it.
Full patch release - auto-commit, push, build, npm publish, AND GitHub Release creation. Use --quick for save+release (no GH release). Use --ci for GitHub Actions publish. Use --only for local publish without git push. Use --only --local for version bump only.
Command definition
release-npm.mddescription: Full patch release - auto-commit, push, build, npm publish, AND GitHub Release creation. Use --quick for save+release (no GH release). Use --ci for GitHub Actions publish. Use --only for local publish without git push. Use --only --local for version bump only.
sw-release:npm - NPM Release Automation
You are the NPM Release Assistant. Your job is to automate the patch version release process.
STOP! READ THIS FIRST - MANDATORY GITHUB RELEASE
**FOR DEFAULT MODE (no flags): GitHub Release creation is MANDATORY!**
The workflow is NOT complete until you run `gh release create`.
**DEFAULT MODE requires ALL these steps - none are optional:** 1. Auto-commit → 2. Push → 3. Version bump → 4. Build → 5. npm publish → 6. Push tag → **7. `gh release create`** → 8. Verify release exists
**AFTER npm publish and pushing tags, you MUST:**
gh release create "v$NEW_VERSION" --title "v$NEW_VERSION" --notes-file /tmp/release-notes.md --latest
gh release view "v$NEW_VERSION" # VERIFY it exists!
---
CRITICAL: Prerelease Version Handling
**⚠️ NEVER use `npm version patch` on prerelease versions!**
`npm version patch` converts `1.0.0-rc.1` → `1.0.0` (WRONG!)
**CORRECT behavior:**
- `1.0.0-rc.1` → `1.0.0-rc.2` (increment prerelease)
- `1.0.0-beta.5` → `1.0.0-beta.6` (increment prerelease)
- `1.0.0` → `1.0.1` (increment patch - stable version)
**Use `--stable` flag ONLY when intentionally promoting to stable release!**
Version Detection Algorithm
# Get current version
CURRENT=$(node -p "require('./package.json').version")
# Check if it's a prerelease (contains hyphen: 1.0.0-rc.1, 1.0.0-beta.2, etc.)
if [[ "$CURRENT" == *"-"* ]]; then
IS_PRERELEASE=true
else
IS_PRERELEASE=false
fiVersion Bump Command Selection
| Current Version | Flag | Command | Result | |-----------------|------|---------|--------| | `1.0.0-rc.1` | (none) | `npm version prerelease` | `1.0.0-rc.2` | | `1.0.0-rc.5` | `--stable` | `npm version patch` | `1.0.1` | | `1.0.0` | (none) | `npm version patch` | `1.0.1` | | `1.0.0` | `--stable` | `npm version patch` | `1.0.1` |
**Rule**: If prerelease AND no `--stable` flag → use `npm version prerelease`
Command Modes
| Command | Flow | Use Case | |---------|------|----------| | `sw-release:npm` | Auto-commit → **PUSH** → Bump → Build → **Publish** → Push tag → **GH Release** → **Deploy all** | **DEFAULT: FULL RELEASE + Deploy** | | `sw-release:npm --quick` | Auto-commit → **PUSH** → Bump → Build → **Publish locally** → **Deploy all** → NO GH release | **QUICK: Save + Release + Deploy** | | `sw-release:npm --ci` | Bump → Push → **CI publishes + GH Release** | Let GitHub Actions handle everything | | `sw-release:npm --only` | Bump → Build → **Publish locally** → NO push | Quick local release, push later | | `sw-release:npm --only --local` | **Bump ONLY** → NO build, NO publish, NO git | FASTEST: Local testing only | | `sw-release:npm --stable` | Same as default, but promotes prerelease to stable | **PROMOTE TO STABLE** |
Detecting Mode
Check flags in the command invocation:
--quick → QUICK MODE: save (commit+push) + local npm publish (NO GH workflow trigger)
--ci → CI MODE: push to git, GitHub Actions publishes (requires clean working tree)
--only --local → Version bump ONLY (no build, no publish, no git) - FASTEST
--only → Direct publish to npm (bypass CI), no git push
--stable → Force promote prerelease to stable (use with any mode)
(no flags) → DEFAULT: INSTANT RELEASE (auto-commit, push, build, publish, push tag)
**Flag Detection Order:** 1. Check for `--stable` flag → Set PROMOTE_TO_STABLE=true (affects version bump command) 2. Check for `--quick` flag → QUICK MODE (save + local publish, NO GH workflow) 3. Check for `--ci` flag → CI MODE (GitHub Actions publishes) 4. Check for `--only` flag 5. If `--only` present, check for `--local` flag → LOCAL MODE (fastest) 6. If `--only` only → DIRECT MODE 7. No flags → **DEFAULT: INSTANT RELEASE** (auto-commit dirty, push, build, publish)
**If `--quick`**: Use QUICK MODE (section "Quick Mode Workflow") **If `--ci`**: Use CI MODE (section "CI Mode Workflow") **If `--only --local`**: Use LOCAL MODE (section "Local Mode Workflow") - FASTEST! **If `--only` only**: Use DIRECT MODE (section "Direct Mode Workflow") **If no flags**: Use DEFAULT MODE = INSTANT RELEASE (section "Default Mode Workflow")
---
STEP 0: REPOSITORY DISCOVERY (Multi-Repo Aware) — ALWAYS RUN FIRST!
**This step runs BEFORE any workflow mode.** It determines which npm package to release.
Detection Logic
# Check if we're in an umbrella repo with nested repositories
if [ -d "repositories" ]; then
UMBRELLA=true
else
UMBRELLA=false
fi
If NOT an umbrella repo (`UMBRELLA=false`)
Operate on CWD as normal. Set:
UMBRELLA_ROOT=""
PKG_DIR="."
PKG_NAME=$(node -p "require('./package.json').name")
PKG_VERSION=$(node -p "require('./package.json').version")If umbrella repo (`UMBRELLA=true`)
UMBRELLA_ROOT="$(pwd)"
Scan for all publishable npm packages:
# Find all package.json files under repositories/ (skip node_modules)
# For each one, check:
# 1. Has "name" field
# 2. Has "version" field
# 3. NOT "private": true
# Collect: directory path, package name, version
**Scanning script:**
PUBLISHABLE=()
for pkg in $(find repositories -name "package.json" -not -path "*/node_modules/*" -not -path "*/docs-site/*" -maxdepth 4); do
IS_PRIVATE=$(node -p "try { require('./$pkg').private || false } catch(e) { true }")
if [ "$IS_PRIVATE" = "false" ]; then
NAME=$(node -p "require('./$pkg').name")
VERSION=$(node -p "require('./$pkg').version")
DIR=$(dirname "$pkg")
PUBLISHABLE+=("$DIR|$NAME|$VERSION")
fi
done**Decision:**
| Found | Action | |-------|--------| | **0 packages** | STOP with error: "No publishable npm packages found under repositories/" | | **1 package** | Auto-s
Read more
description: Full patch release - auto-commit, push, build, npm publish, AND GitHub Release creation. Use --quick for save+release (no GH release). Use --ci for GitHub Actions publish. Use --only for local publish without git push. Use --only --local for version bump only.
sw-release:npm - NPM Release Automation
You are the NPM Release Assistant. Your job is to automate the patch version release process.
STOP! READ THIS FIRST - MANDATORY GITHUB RELEASE
**FOR DEFAULT MODE (no flags): GitHub Release creation is MANDATORY!**
The workflow is NOT complete until you run `gh release create`.
**DEFAULT MODE requires ALL these steps - none are optional:** 1. Auto-commit → 2. Push → 3. Version bump → 4. Build → 5. npm publish → 6. Push tag → **7. `gh release create`** → 8. Verify release exists
**AFTER npm publish and pushing tags, you MUST:**
gh release create "v$NEW_VERSION" --title "v$NEW_VERSION" --notes-file /tmp/release-notes.md --latest gh release view "v$NEW_VERSION" # VERIFY it exists!
---
CRITICAL: Prerelease Version Handling
**⚠️ NEVER use `npm version patch` on prerelease versions!**
`npm version patch` converts `1.0.0-rc.1` → `1.0.0` (WRONG!)
**CORRECT behavior:**
- `1.0.0-rc.1` → `1.0.0-rc.2` (increment prerelease)
- `1.0.0-beta.5` → `1.0.0-beta.6` (increment prerelease)
- `1.0.0` → `1.0.1` (increment patch - stable version)
**Use `--stable` flag ONLY when intentionally promoting to stable release!**
Version Detection Algorithm
# Get current version
CURRENT=$(node -p "require('./package.json').version")
# Check if it's a prerelease (contains hyphen: 1.0.0-rc.1, 1.0.0-beta.2, etc.)
if [[ "$CURRENT" == *"-"* ]]; then
IS_PRERELEASE=true
else
IS_PRERELEASE=false
fiVersion Bump Command Selection
| Current Version | Flag | Command | Result | |-----------------|------|---------|--------| | `1.0.0-rc.1` | (none) | `npm version prerelease` | `1.0.0-rc.2` | | `1.0.0-rc.5` | `--stable` | `npm version patch` | `1.0.1` | | `1.0.0` | (none) | `npm version patch` | `1.0.1` | | `1.0.0` | `--stable` | `npm version patch` | `1.0.1` |
**Rule**: If prerelease AND no `--stable` flag → use `npm version prerelease`
Command Modes
| Command | Flow | Use Case | |---------|------|----------| | `sw-release:npm` | Auto-commit → **PUSH** → Bump → Build → **Publish** → Push tag → **GH Release** → **Deploy all** | **DEFAULT: FULL RELEASE + Deploy** | | `sw-release:npm --quick` | Auto-commit → **PUSH** → Bump → Build → **Publish locally** → **Deploy all** → NO GH release | **QUICK: Save + Release + Deploy** | | `sw-release:npm --ci` | Bump → Push → **CI publishes + GH Release** | Let GitHub Actions handle everything | | `sw-release:npm --only` | Bump → Build → **Publish locally** → NO push | Quick local release, push later | | `sw-release:npm --only --local` | **Bump ONLY** → NO build, NO publish, NO git | FASTEST: Local testing only | | `sw-release:npm --stable` | Same as default, but promotes prerelease to stable | **PROMOTE TO STABLE** |
Detecting Mode
Check flags in the command invocation:
--quick → QUICK MODE: save (commit+push) + local npm publish (NO GH workflow trigger) --ci → CI MODE: push to git, GitHub Actions publishes (requires clean working tree) --only --local → Version bump ONLY (no build, no publish, no git) - FASTEST --only → Direct publish to npm (bypass CI), no git push --stable → Force promote prerelease to stable (use with any mode) (no flags) → DEFAULT: INSTANT RELEASE (auto-commit, push, build, publish, push tag)
**Flag Detection Order:** 1. Check for `--stable` flag → Set PROMOTE_TO_STABLE=true (affects version bump command) 2. Check for `--quick` flag → QUICK MODE (save + local publish, NO GH workflow) 3. Check for `--ci` flag → CI MODE (GitHub Actions publishes) 4. Check for `--only` flag 5. If `--only` present, check for `--local` flag → LOCAL MODE (fastest) 6. If `--only` only → DIRECT MODE 7. No flags → **DEFAULT: INSTANT RELEASE** (auto-commit dirty, push, build, publish)
**If `--quick`**: Use QUICK MODE (section "Quick Mode Workflow") **If `--ci`**: Use CI MODE (section "CI Mode Workflow") **If `--only --local`**: Use LOCAL MODE (section "Local Mode Workflow") - FASTEST! **If `--only` only**: Use DIRECT MODE (section "Direct Mode Workflow") **If no flags**: Use DEFAULT MODE = INSTANT RELEASE (section "Default Mode Workflow")
---
STEP 0: REPOSITORY DISCOVERY (Multi-Repo Aware) — ALWAYS RUN FIRST!
**This step runs BEFORE any workflow mode.** It determines which npm package to release.
Detection Logic
# Check if we're in an umbrella repo with nested repositories if [ -d "repositories" ]; then UMBRELLA=true else UMBRELLA=false fi
If NOT an umbrella repo (`UMBRELLA=false`)
Operate on CWD as normal. Set:
UMBRELLA_ROOT=""
PKG_DIR="."
PKG_NAME=$(node -p "require('./package.json').name")
PKG_VERSION=$(node -p "require('./package.json').version")If umbrella repo (`UMBRELLA=true`)
UMBRELLA_ROOT="$(pwd)"
Scan for all publishable npm packages:
# Find all package.json files under repositories/ (skip node_modules) # For each one, check: # 1. Has "name" field # 2. Has "version" field # 3. NOT "private": true # Collect: directory path, package name, version
**Scanning script:**
PUBLISHABLE=()
for pkg in $(find repositories -name "package.json" -not -path "*/node_modules/*" -not -path "*/docs-site/*" -maxdepth 4); do
IS_PRIVATE=$(node -p "try { require('./$pkg').private || false } catch(e) { true }")
if [ "$IS_PRIVATE" = "false" ]; then
NAME=$(node -p "require('./$pkg').name")
VERSION=$(node -p "require('./$pkg').version")
DIR=$(dirname "$pkg")
PUBLISHABLE+=("$DIR|$NAME|$VERSION")
fi
done**Decision:**
| Found | Action | |-------|--------| | **0 packages** | STOP with error: "No publishable npm packages found under repositories/" | | **1 package** | Auto-s
Spec-first AI development: describe a feature → AI creates spec + plan + tasks, builds autonomously, syncs to GitHub/JIRA. Domain-expert skills for PM, Architect, Frontend, QA learn your patterns permanently. Claude Code, Codex, Cursor, Copilot & more.
Repo: anton-abyzov/specweave
Other commands on specweave.
- /abandon
Abandon an incomplete increment (requirements changed, obsolete)
Open command - /ado-cleanup-duplicates
Clean up duplicate Azure DevOps work items for a Feature. Finds work items with duplicate titles and closes all except the first created item.
Open command - /ado-clone
Clone Azure DevOps repositories to local workspace. Use after init if cloning was skipped, or to add repos later.
Open command - /ado-close
Close Azure DevOps work item when increment complete
Open command - /ado-create
Create Azure DevOps work item from SpecWeave increment
Open command - /ado-import-areas
Import Azure DevOps area paths from a project and map them to SpecWeave projects. Creates 2-level directory structure with area path-based organization.
Open command

