pnpm-upgrade

作者: openai

保持 pnpm 最新:运行 pnpm self-update/corepack prepare,对齐 package.json 中的 packageManager,并更新 pnpm/action-setup 及锁定的 pnpm 版本…

npx skills add https://github.com/openai/openai-agents-js --skill pnpm-upgrade

pnpm Upgrade

Use these steps to update pnpm and CI pins without blunt search/replace.

Steps (run from repo root)

  1. Resolve the target pnpm release

    • Query the npm registry before changing the local toolchain: PNPM_VERSION=$(curl -fsSL https://registry.npmjs.org/pnpm/latest | jq -r .version).
    • Abort if the version is missing.
    • Resolve the exact package integrity: curl -fsSL "https://registry.npmjs.org/pnpm/${PNPM_VERSION}" | jq -r .dist.integrity.
    • Store the result as PNPM_INTEGRITY.
    • Abort if the integrity is missing or does not start with sha512-.
    • Convert the base64 digest after sha512- to lowercase hex, for example:
      printf '%s' "${PNPM_INTEGRITY#sha512-}" | base64 -d | xxd -p -c 256
      
    • Store the result as PNPM_SHA512_HEX.
  2. Find the target pnpm/action-setup release

    • Query GitHub API: curl -fsSL https://api.github.com/repos/pnpm/action-setup/releases/latest | jq -r .tag_name.
    • Use GITHUB_TOKEN/GH_TOKEN if available for higher rate limits.
    • Store as ACTION_TAG (e.g., v4.2.0). Abort if missing.
  3. Resolve the action tag to an immutable commit SHA

    • Run git ls-remote https://github.com/pnpm/action-setup "refs/tags/${ACTION_TAG}^{}" and capture the SHA as ACTION_SHA.
    • If the dereferenced tag is missing, fall back to git ls-remote https://github.com/pnpm/action-setup "refs/tags/${ACTION_TAG}".
    • Abort if ACTION_SHA is empty.
  4. Preflight the release and CI installation path

    • Run node .agents/skills/pnpm-upgrade/scripts/preflight.mjs --version "${PNPM_VERSION}" --action-ref "${ACTION_SHA}".
    • The script first rejects published pnpm manifests with non-empty dependencies or devDependencies. pnpm bundles its runtime dependencies, so these fields indicate a broken publication such as pnpm@11.12.0.
    • It then reproduces both pnpm/action-setup installation paths in separate temporary directories: install the regular pnpm bootstrap from pnpm-lock.json and the standalone @pnpm/exe bootstrap from exe-lock.json, set isolated PNPM_HOME directories, and self-update each bootstrap to PNPM_VERSION.
    • Abort the upgrade on any failure. Do not bypass this check with a direct local install; the preflight exists to exercise the CI-only bootstrap path.
  5. Update pnpm locally

    • Run pnpm self-update "${PNPM_VERSION}".
    • If pnpm is missing or self-update fails only because the current installation cannot update itself, run corepack prepare "pnpm@${PNPM_VERSION}" --activate. Do not use this fallback to bypass a failed preflight.
    • Confirm pnpm -v exactly matches PNPM_VERSION.
  6. Align package.json

    • Open package.json and set packageManager to pnpm@${PNPM_VERSION}+sha512.${PNPM_SHA512_HEX} (preserve trailing newline and formatting).
  7. Update workflows carefully (no broad regex)

    • Files: everything under .github/workflows/ that uses pnpm/action-setup.
    • For each file, edit by hand:
      • Set uses: pnpm/action-setup@${ACTION_SHA}.
      • If a with: version: field exists, set it to ${PNPM_VERSION} (keep quoting style/indent).
    • Do not touch unrelated steps. Avoid multiline sed/perl one-liners.
  8. Verify

    • Run pnpm -v and confirm it matches the version portion of packageManager.
    • Confirm packageManager keeps the exact +sha512.${PNPM_SHA512_HEX} suffix.
    • git diff to ensure only intended workflow/package.json changes.
  9. Follow-up

    • If runtime code/build/test config was changed (not typical here), run $code-change-verification; otherwise, a light check is enough.
    • Commit with chore: upgrade pnpm toolchain and open a PR (automation may do this).

Notes

  • Tools needed: curl, jq, base64, xxd, node, npm, and pnpm/corepack. Install if missing.
  • Keep edits minimal and readable—prefer explicit file edits over global replacements.
  • GitHub Actions must stay pinned to commit SHAs, not tags. Use the latest release tag only to discover the commit SHA to pin.
  • If GitHub API is rate-limited, retry with a token or bail out rather than guessing the tag.

来自 openai 的更多技能

user-context
openai
加载或管理数据分析插件的持久化源路由偏好、引导逻辑、设置进度及语义层注册表。
official
notion-research-documentation
openai
研究Notion内容,并将其综合成带有引用的结构化简报、报告或对比。通过定向查询搜索并获取Notion页面,然后按主题组织发现,附带内联来源引用和参考文献部分。根据范围和用户目标,从四种输出格式(快速简报、研究摘要、对比、综合报告)中选择。使用内置模板创建和更新Notion页面;直接链接来源,并在新信息到达时跟踪变更...
official
rcsb-pdb-skill
openai
提交紧凑的RCSB PDB请求以获取核心元数据、Search API查询和FASTA下载。当用户需要简洁的RCSB摘要时使用;保存原始JSON或…
official
pdf
openai
PDF的读取、创建与验证,支持可视化渲染与程序化生成。使用Poppler(pdftoppm)将PDF页面渲染为PNG,以便在交付前直观检查布局、间距与排版;通过reportlab程序化生成PDF,确保格式可靠;利用pdfplumber或pypdf提取文本与元数据。执行质量标准:无文本裁剪、元素重叠、表格损坏或渲染伪影;仅使用ASCII连字符,引用内容需可读。使用...
official
test-coverage-improver
openai
改进OpenAI Agents JS mon
official
playwright
openai
基于终端驱动的浏览器自动化,支持元素快照与交互式UI工作流。通过playwright-cli包装脚本运行(需npx),支持无头模式与有头模式进行可视化调试。核心工作流:打开页面、获取快照以稳定元素引用、使用引用进行交互、在导航或DOM变更后重新快照。包含表单填写、点击、输入、多标签页管理、截图/PDF捕获及用于流程调试的追踪记录。元素引用(如e3、e15)...
official
ukb-topmed-phewas-skill
openai
通过接受rsID、GRCh37或GRCh38输入并解析为所需的GRCh38查询,获取单个变体的紧凑型UKB-TOPMed PheWAS摘要。当需要…时使用。
official
code-review-context
openai
模型可见上下文
official