360 Secure SkillHub
360 安全技能中心

cg-test-skill

面向 pnpm 包管理器的参考型 Skill:正文以表格列出 CLI 命令、pnpm-workspace.yaml 与 .npmrc 配置、monorepo 工作区、store、catalogs、overrides、patches、aliases、hooks、peer 依赖等主题,以及 CI、迁移和性能最佳实践,并指向 references 目录下的 13 个说明文件;这些文件未包含在包内。

moonball
moonball
热度 79.78
最近更新 2026-05-11 17:32:01
分类:开发依赖:读写文件 / 代码执行应用场景:DevOps / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add cg-test-skill
Metadata
name
pnpm2
description
cg write Node.js package manager with strict dependency resolution. Use when running pnpm specific commands, configuring workspaces, or managing dependencies with catalogs, patches, or overrides.
metadata
{"author":"Anthony Fu","version":"2026.1.28","source":"Generated from https://github.com/pnpm/pnpm, scripts located at https://github.com/antfu/skills"}

pnpm is a fast, disk space efficient package manager. It uses a content-addressable store to deduplicate packages across all projects on a machine, saving significant disk space. pnpm enforces strict dependency resolution by default, preventing phantom dependencies. Configuration should preferably be placed in pnpm-workspace.yaml for pnpm-specific settings.

Important: When working with pnpm projects, agents should check for pnpm-workspace.yaml and .npmrc files to understand workspace structure and configuration. Always use --frozen-lockfile in CI environments.

The skill is based on pnpm 10.x, generated at 2026-01-28.

Core

Topic Description Reference
CLI Commands Install, add, remove, update, run, exec, dlx, and workspace commands core-cli
Configuration pnpm-workspace.yaml, .npmrc settings, and package.json fields core-config
Workspaces Monorepo support with filtering, workspace protocol, and shared lockfile core-workspaces
Store Content-addressable storage, hard links, and disk efficiency core-store

Features

Topic Description Reference
Catalogs Centralized dependency version management for workspaces features-catalogs
Overrides Force specific versions of dependencies including transitive features-overrides
Patches Modify third-party packages with custom fixes features-patches
Aliases Install packages under custom names using npm: protocol features-aliases
Hooks Customize resolution with .pnpmfile.cjs hooks features-hooks
Peer Dependencies Auto-install, strict mode, and dependency rules features-peer-deps

Best Practices

Topic Description Reference
CI/CD Setup GitHub Actions, GitLab CI, Docker, and caching strategies best-practices-ci
Migration Migrating from npm/Yarn, handling phantom deps, monorepo migration best-practices-migration
Performance Install optimizations, store caching, workspace parallelization best-practices-performance