lov-npm-publisher
为全新或已有 npm 包建立免重复登录的自动发布链,兼容 GitHub Actions OIDC(trusted publishing)与本地 granular NPM_TOKEN(bypass)两种平级方式,处理首次引导、发布审计与线上回读。Use when the user asks to 自动发布 npm…
от lovstudio★ 72 звезды на GitHub
Установить lov-npm-publisher в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
npm 发布助手 · npm Publisher
把 npm 包从“每次登录或维护长期 token”迁移到可审计的自动发布链。支持两种平级的认证方式:
- oidc — GitHub Actions trusted publishing,CI 免长期 token(推荐给 GitHub 仓库的持续发版);
- bypass — 本地 granular NPM_TOKEN,直接
npm publish(适合本地快速发布、无 CI 的包)。
输出必须区分首次引导、认证配置、发布执行和 registry 回读,不能把工作流生成等同于已经发布。
Triggers
Activate when
- 用户说“自动发布 npm 包”“发布新 npm 包但不要每次登录”“把 npm 发版改成 GitHub Actions”。
- 用户说“用 NPM_TOKEN 本地发布这个包”“publish this npm package locally without login”。
- User says “publish npm without login”, “automate npm releases”, or “set up tokenless npm publishing”.
- 用户需要批量判断包是否首次发布、选择 OIDC 还是 NPM_TOKEN,或验证发版是否真的上线。
Do not activate when
- 发布的是 Agent Skill 而不是 npm package;使用
lov-skill-publisher。 - 只做通用 GitHub Release、Tauri 签名或多平台 CI/CD;使用
lov-release-via-cicd。 - 用户只问 npm 认证原理而不要求配置或发布;直接解释,不修改仓库。
User Profile (cross-session)
Read skill.yaml on every invocation. Resolve the current request, project
context, Skill records, shared preferences, and the shared user/brand Profile in
that order. Keep repository names, workflow choices, and credentials out of the
portable source unless the user explicitly asks to persist a non-secret default.
Persist only direct durable statements through scripts/profile_store.py and
report the canonical Profile path. Never persist npm tokens, OTP values, cookies,
OIDC assertions, or secret-like environment values. See
references/user-profile.md for the full contract.
Skill Group Composition
Read references/skill-composition.md before invoking an adjacent Skill. Sibling
Skills are optional artifact-level handoffs, not hidden runtime dependencies.
Workflow (MANDATORY)
Follow these steps in order.
Step 0: Resolve runtime and current npm rules
- Resolve this source as
SKILL_DIRand the target package directory from the request or current working directory. - Read
references/npm-publishing-contract.mdand recheck the linked npm documentation when authentication behavior, supported runners, or deprecation dates could have changed. - Read
references/skill-composition.mdbefore choosing an optional handoff. - Verify
package.json, git, npm, andscripts/publish.pyexist. Do not request or print credentials during this read-only phase.
Step 1: Audit without changing external state
Run the planner first:
python3 "$SKILL_DIR/scripts/publish.py" PACKAGE_DIR --dry-run --json
The audit must establish:
- package name, version, visibility,
privateflag, registry, and repository URL; - GitHub owner/repository and the exact workflow filename;
- whether the package exists on the npm registry and whether this exact version already exists;
- whether an existing workflow contains
id-token: write,npm publish, and no long-lived publish secret; - whether the state is
bootstrap_required,package_exists, orregistry_unknown.
Do not turn a timeout, authorization error, or registry outage into “package does not exist”. Stop before publication when registry state is unknown.
Step 2: Select the authentication path
The planner emits auth.mode as oidc or bypass. With --auth-mode auto
(the default), it resolves to oidc when a GitHub repository resolves and
bypass otherwise; pass --auth-mode oidc|bypass to override inference. Both
modes are first-class and equal; prefer oidc for GitHub-repository continuous
releases and bypass for local, CI-less, or new-package publication.
oidc — GitHub trusted publishing
Trusted publishing cannot be registered for a name that does not yet exist. For
bootstrap_required, explain that one interactive identity proof is unavoidable,
then perform it only when the request authorizes publication:
npm login
npm publish --access public
Re-read the exact package and version from the npm registry. A successful command without registry visibility is not completion.
For package_exists, configure or verify the exact repository/workflow binding.
With a current npm CLI, the plan emits a command shaped like:
npm trust github PACKAGE --repo OWNER/REPO --file publish.yml --allow-publish
This management action requires interactive identity proof. If it was already configured, verify the existing binding rather than replacing it blindly.
bypass — local granular NPM_TOKEN
A granular (Bypass-2FA) npm_ token publishes directly, including new packages.
Detect the token without reading its value; auth.token reports whether
NPM_TOKEN or a ~/.npmrc _authToken is present. When it is missing, warn and
request a granular token before publishing. auth.publish_command carries the
exact command; never echo the token value.
Step 3: Generate the workflow or the publish command
After resolving blocking audit errors, materialize the mode-specific artifact:
python3 "$SKILL_DIR/scripts/publish.py" PACKAGE_DIR --write --json
For oidc, the writer emits the tokenless workflow. It is conservative:
- it preserves an equivalent
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- .gitignore
- CHANGELOG.md
- LICENSE
- README.md
- cases/cases.json
- pricing-card.yaml
- references/npm-publishing-contract.md
- references/skill-card-standard.md
- references/skill-composition.md
- references/user-profile.md
- scripts/profile_store.py
- scripts/publish.py
- scripts/validate_skill.py
- skill-card.md
- skill-card.yaml
- skill.yaml
FAQ
Что делает скилл lov-npm-publisher?
为全新或已有 npm 包建立免重复登录的自动发布链,兼容 GitHub Actions OIDC(trusted publishing)与本地 granular NPM_TOKEN(bypass)两种平级方式,处理首次引导、发布审计与线上回读。Use when the user asks to 自动发布 npm 包、publish npm without login、发布 npm 包不用登录。
Как установить скилл lov-npm-publisher?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл lov-npm-publisher запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…