Skip to content
Back to skills

Next Deployer

ASecurity

Use after merging an issue PR to dev on apijack — fast-forwards the rolling next branch from dev, waits for the publish-next workflow, and comments the @next install command on the issue

  • 7 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added May 27, 2026
toolsbashgitapi

Works with

  • terminal
  • api

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned May 27, 2026

npx -y skills add normalled/apijack --skill next-deployer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Next Deployer?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Next Deployer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/normalled-next-deployer/badge)](https://www.skillsdirectory.com/skills/normalled-next-deployer)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: next-deployer
description: Use after merging an issue PR to dev on apijack — fast-forwards the rolling next branch from dev, waits for the publish-next workflow, and comments the @next install command on the issue
---

# Next Deployer

Phase 4 (terminal) of the apijack issue workflow. Roll `next` forward to `dev` and announce the pre-release on the issue.

## Background

`next` is the "nightly" / edge rolling branch. Pushing to `next` triggers the `publish-next` job in `.github/workflows/publish.yml`, which computes and publishes a `X.Y.Z-next.N` version to npm under the `@next` dist-tag.

## When to Use

- Invoked by `review-issue` immediately after merging an issue PR to `dev`
- User explicitly asks to deploy the current `dev` state to `next`

## Steps

### 1. Check if next is behind dev

```bash
git fetch origin dev next
BEHIND=$(git rev-list --count origin/next..origin/dev)
echo "next is behind dev by $BEHIND commits"
```

If `BEHIND` is `0`: `next` is already up to date — skip to step 4.

### 2. Fast-forward next from dev and push

Run:

```bash
.claude/skills/next-deployer/scripts/ff-next-from-dev.sh
```

The script fetches origin, pulls `dev`, checks out `next` (creating it from `origin/next` if missing), fast-forwards it from `origin/dev`, pushes, and returns to `dev`. It exits non-zero on a non-fast-forward — no force-push.

If it exits non-zero (next has diverged or push failed), STOP and ask the user how to proceed.

### 3. Capture the published commit SHA

```bash
NEXT_SHA=$(git rev-parse origin/next)
echo "next is at $NEXT_SHA"
```

### 4. Wait for the publish-next workflow

Run:

```bash
.claude/skills/next-deployer/scripts/wait-for-publish-next.sh "$NEXT_SHA"
```

Inputs:
- `$NEXT_SHA` — the commit SHA on `next` whose `publish.yml` run we want to watch.

The script polls `gh run list` (handling the race where the workflow hasn't registered yet), then `gh run watch --exit-status`. On failure it dumps `gh run view --log-failed` and propagates the non-zero code.

If the script exits non-zero, STOP, report the failure to the user, and do not comment on the issue.

### 5. Get the published version

```bash
NEXT_VERSION=$(npm view @apijack/core@next version)
echo "Published: $NEXT_VERSION"
```

Expect a value like `1.8.0-next.1`.

### 6. Comment on the issue and label it

Run:

```bash
.claude/skills/next-deployer/scripts/comment-deployed.sh <issue-number> "$NEXT_VERSION"
```

Inputs:
- `<issue-number>` — passed in from `review-issue`, or parsed from the merge commit body (`Closes #NN`).
- `$NEXT_VERSION` — the version string from step 5.

The script writes the install-instructions markdown to a tempfile, posts it via `gh issue comment --body-file` (avoiding the inline-`--body` backtick-escape footgun), and applies the `deployed to next` label.

### 7. STOP

Report to the user:
- `next` was advanced (or was already current)
- Published version
- Issue comment URL
- Issue labeled `deployed to next`

Do not chain into further skills. The workflow is complete.

## Red Flags

- `next` has diverged from `dev` (non-fast-forward) → STOP, ask user; never force-push
- Publish workflow failed → STOP, do not comment on issue
- Cannot determine issue number → STOP, ask user

Files in this skill

  • SKILL.md3.2 KB
  • scripts/comment-deployed.sh933 B
  • scripts/ff-next-from-dev.sh693 B
  • scripts/wait-for-publish-next.sh1.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.