一键导入
npm-doctor
Read-only diagnosis of npm ↔ 1Password ↔ GitHub Actions credential drift for a package. Reports what's stale and what to do. Side-effect free.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Read-only diagnosis of npm ↔ 1Password ↔ GitHub Actions credential drift for a package. Reports what's stale and what to do. Side-effect free.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
One-time per-package setup — writes an entry in `~/.config/npm-helper/state.json` mapping a package to its 1Password item, GitHub repo, publish workflow, GH secret, and optional Vercel mirrors. Run this once before `/npm-publish` will work on a new package.
One-shot npm publish — detects package, syncs credentials, bumps version, tags, pushes, tails the workflow, classifies failures, recovers automatically where possible. Use when the user says "publish this", "ship it", "release npm", or similar.
Rotate the npm publish token for a package to a fresh granular+bypass-2fa token, update 1Password and the GitHub Actions secret. Use when publishes hit E403/EOTP and /npm-doctor says the token needs replacing.
Change the npm account 2FA level between disabled, auth-only, and auth-and-writes. Use when /npm-doctor reports account 2FA is blocking automation tokens.
Invoked after a failed npm publish to classify the failure, take the right recovery action, and retry once. Called automatically by the PostToolUse hook — the user rarely invokes this directly.
| name | npm-doctor |
| description | Read-only diagnosis of npm ↔ 1Password ↔ GitHub Actions credential drift for a package. Reports what's stale and what to do. Side-effect free. |
Tell the user exactly where their credentials are out of sync. Never writes anything — recommendations only.
npm whoami — which account is the CLI logged in as? Does it match state?npm profile get — what's the account 2FA level? (disabled, auth-only, auth-and-writes)npm token list — which tokens currently exist? Cross-ref against state's token_id.npm access get @scope/pkg (or scrape /access page) — is the package set to require granular+bypass or accept automation tokens?curl -X PUT .../-/user/org.couchdb.user:<user> (401 = stale).Print a per-package table:
@capitalthought/highfives-mcp · doctor
npm account: capitalthought ✅
account 2FA: disabled ✅ (publishes bypass OTP)
package policy: granular+bypass required ⚠ current NPM_TOKEN is classic automation → E403
1Password pw: stale (401 from registry) ❌ reset at npmjs.com/settings/capitalthought/account
1Password token: sha256:abc… (last rotated 2 hr) ✅
GH secret NPM_TOKEN: set, updated 2 hr ago ✅
Vercel mirror: not configured —
Recommendation: rotate to granular+bypass token (/npm-rotate-token),
reset the npm password (human-in-browser), then re-run /npm-publish.