Wire the `reusable-npm-publish` reusable workflow from `jabranr/workflows` into a downstream JS/Node repo as a caller workflow file that publishes on push to `main` (job-level `uses:`). Load when the user asks to publish to npm on merge, set up automated releases, wire `jabranr/workflows` npm publish, or configure Lerna/conventional-commits versioning. Do not load for adding a step into an existing workflow (that's an action skill).
Ships in jabraf-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
jabraf-workflows-npm-publishWires the
reusable-npm-publish
reusable workflow from
jabranr/workflows into the current
repo as a caller workflow at .github/workflows/npm-publish.yml that runs on
push to main. Prose-only — you (the agent) read the file system, run the
commands, and confirm with the user before any irreversible step.
The canonical input/secret reference lives in
jabranr/workflows README → reusable-npm-publish.yml.
If this file and the README disagree, trust the README.
Load when the user's prompt mentions any of:
jabranr/workflows npm publish", "jabraf npm publish"Do not load for adding a step into an existing workflow file (use an action
skill instead). Do not load for unrelated release tooling (semantic-release,
release-please, changesets) unless the user also asks for jabranr/workflows.
Each numbered step is one agent message. Steps marked [wait for user] require a user response before continuing.
Brief acknowledge. One sentence: "I'll wire reusable-npm-publish from jabranr/workflows as .github/workflows/npm-publish.yml. That's: detect existing CI, detect inputs from package.json, confirm NPM_TOKEN is set, write the caller. Proceed?" [wait for user]
Detect existing CI. Grep .github/workflows/*.{yml,yaml} for an existing caller of the same reusable workflow:
grep -l 'jabranr/workflows/.github/workflows/reusable-npm-publish.yml' .github/workflows/*.{yml,yaml} 2>/dev/null
If a match is found, surface the file and ask: "An existing caller of reusable-npm-publish was found at <path>. Replace it, rename the new caller, or abort?" [wait for user] Never overwrite silently.
Detect consumer context. Read package.json once and probe the same signals as jabraf-workflows-pr-checks — surface as a single table:
| Input | Signal | Default if absent |
|---|---|---|
use-lerna | lerna.json present, or workspaces field, or a packages/ directory | false |
run-unit-test | scripts.test exists | false |
run-build | scripts.build exists | false |
run-lint | scripts.lint exists | false |
run-format-check | scripts["format:check"] exists | false |
run-typecheck | scripts.typecheck exists | false |
node-version | .nvmrc, volta.node in package.json, or engines.node (major version) | 24 |
Single consolidated confirmation. Present the detected values as a table and ask the user to confirm or override each. Then ask explicitly: "Confirm that NPM_TOKEN is set as a repo secret with publish permission for this package. Without it, every publish run will fail." [wait for user]
Write the caller YAML. Default path: .github/workflows/npm-publish.yml. If the path is occupied (and is not the existing caller surfaced in step 2), ask replace / rename / abort. [wait for user if conflict] Write the file with this exact body, substituting the confirmed values:
name: Publish to npm
on:
push:
branches: [main]
permissions:
contents: write # push version commit + tag
id-token: write # future-proof for npm provenance
# concurrency intentionally omitted — do not cancel mid-release
jobs:
publish:
uses: jabranr/workflows/.github/workflows/reusable-npm-publish.yml@main
with:
node-version: <detected>
use-lerna: <detected>
run-unit-test: <detected>
run-build: <detected>
run-lint: <detected>
run-format-check: <detected>
run-typecheck: <detected>
secrets:
npm-token: ${{ secrets.NPM_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Print required secrets. Tell the user, verbatim:
NPM_TOKEN — required. An npm automation token with publish permission for this package. Add via repo Settings → Secrets and variables → Actions → New repository secret.GITHUB_TOKEN — required. Bound automatically by GitHub Actions; no manual setup. The caller's permissions: contents: write block grants it the rights to push the version commit and tag.Validate. Recommend running npx @secureci/cli validate against the new file. If the secure-ci/cli action is already wired in another workflow, validation runs on the next PR. Otherwise, offer to wire it next with the secureci (secure-ci/cli) skill.
Default ref is @main, matching the source repo README. To pin to an
immutable SHA (recommended for production repos once jabranr/workflows
stabilises):
uses: jabranr/workflows/.github/workflows/reusable-npm-publish.yml@<full-40-char-sha>
Replace <full-40-char-sha> with the commit SHA from
https://github.com/jabranr/workflows/commits/main.
.github/workflows/npm-publish.yml without explicit confirmation.concurrency: block — releases must not be cancelled mid-flight.pull_request — this workflow only runs on push to main. Pre-release on PR is jabraf-workflows-pr-checks's job.permissions: contents: write — without it, the Lerna / npm version commit and tag push will fail.| Situation | Action |
|---|---|
Project has no package.json | Stop. Ask the user to initialise the project first. |
Default branch is not main | Detect via git symbolic-ref refs/remotes/origin/HEAD or git config init.defaultBranch; substitute the branch name in the branches: filter. [wait for user] |
package.json private: true | Surface this — npm publish will refuse. Ask whether to abort or proceed (user may flip private later). |
use-lerna: true but no lerna.json | Stop and ask the user to install/initialise Lerna first, or set use-lerna: false. |
Repo has branch protection that blocks the github-actions[bot] push | Surface this and recommend the user adds the bot as a bypass actor or uses a PAT-backed github-token. |
| Existing caller present | Per step 2: ask replace / rename / abort. Never silently overlay. |
.github/workflows/reusable-npm-publish.ymlreusable-npm-publish.ymljabraf-workflows-pr-checks (CI on PR + optional pre-release), secureci (secure-ci/cli) (validate this file)What SKILL.md sets; muted values are Claude Code's defaults
/jabraf-skills:jabraf-workflows-npm-publishfrom jabraf-skills
npx claudepluginhub jabranr/skills --plugin jabraf-skills17 skills in this plugin
/jabraf-app-config-setupSet up `@jabraf/app-config` end-to-end in a project — install the runtime dep, scaffold `config/make-config.ts`, augment the `FeatureMap`, gitignore the generated artifact, add `prebuild`/`predev` scripts, wire the bootstrap `setConfig` call, and (React apps) mount the in-app `FeatureFlagsPanel` toggle UI. Load when the user asks to add app config, set up feature flags, configure `@jabraf/app-config`, wire `jabraf-config build`, or add a feature flags toggle panel / floating button./jabraf-commitlintSet up commitlint in a project using `@jabraf/dev`'s shared base (conventional commits). Load when the user asks to add commitlint, enforce conventional commits, configure `commitlint.config.js`, or wire up `@jabraf/dev` commitlint specifically. Do not load for general commit-message-quality questions unrelated to `@jabraf/dev`./jabraf-Other plugins' skills for the same job