Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问clear审计通过

pnpmpnpm 包管理

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

6,487

周安装

265

GitHub Stars

87

下载量

2,078
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:pnpm(pnpm 包管理)
来源仓库:https://github.com/mindrally/skills
仓库路径:skills/pnpm
安装命令:
npx skills add https://github.com/mindrally/skills --skill pnpm
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/mindrally/skills --skill pnpm

简介

pnpm 用于辅助前端依赖管理与 monorepo 包安装,提升模块复用和构建效率。

  • 适用于需要统一版本控制、加速安装或优化磁盘占用的项目。
  • 通过 npx skills add 命令从 GitHub 安装,需确认项目是否已适配 pnpm workspace 结构。
  • 建议在使用前备份 node_modules,并在隔离环境中验证命令兼容性。
  • 涉及私有包源时应配置正确的 registry 地址和身份验证机制。

SKILL.md

pnpm Development

You are an expert in pnpm, the fast, disk space efficient package manager for JavaScript and TypeScript projects.

Core Principles

  • Always use pnpm (not npm or yarn) for package management
  • Leverage pnpm's strict dependency resolution for better security
  • Use the content-addressable store for disk space efficiency
  • Maintain consistent lockfile (pnpm-lock.yaml)

Installation and Setup

  • Install pnpm globally: npm install -g pnpm
  • Or use corepack: corepack enable && corepack prepare pnpm@latest --activate
  • Specify pnpm version in package.json: {"packageManager": "pnpm@9.0.0"}

Workspace Configuration

Create pnpm-workspace.yaml for monorepo setup:

packages:
  - 'apps/*'
  - 'packages/*'
  - 'tooling/*'
  • Use glob patterns to define workspace package locations
  • All matched directories with package.json become workspace packages

Dependency Management

  • Install dependencies: pnpm install
  • Add dependencies to specific workspace: pnpm add lodash --filter @org/my-app pnpm add -D typescript --filter @org/my-lib
  • Use workspace protocol for internal dependencies: {"dependencies": {"@org/shared-utils": "workspace:*", "@org/ui": "workspace:^"}}
  • Protocol options:

- workspace:* - Any version, replaced with actual version on publish - workspace:^ - Compatible versions - workspace:~ - Patch versions only

Filtering Commands

Run commands in specific packages:

pnpm --filter @org/my-app dev
pnpm --filter "./apps/*" build
pnpm --filter "...@org/my-lib" test  # Include dependents
pnpm --filter "@org/my-lib..." build  # Include dependencies
  • Filter patterns:

- --filter <package-name> - Specific package - --filter "./path/*" - By path - --filter "...<pkg>" - Package and its dependents - --filter "<pkg>..." - Package and its dependencies

Scripts and Task Running

  • Run scripts across workspaces: pnpm -r run build # Run in all packages pnpm -r --parallel run dev # Run in parallel pnpm -r --stream run test # Stream output
  • Define root-level scripts for common operations: {"scripts": {"build": "pnpm -r run build", "dev": "pnpm --filter @org/web dev", "lint": "pnpm -r run lint", "test": "pnpm -r run test"}}

Dependency Hoisting

Configure hoisting in .npmrc:

# Strict mode - no hoisting
hoist=false

# Selective hoisting
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*prettier*

# Shamefully hoist everything (not recommended)
shamefully-hoist=true
  • Prefer strict mode for better dependency isolation
  • Use public hoisting for tools that need flat node_modules

Peer Dependencies

Configure peer dependency handling in .npmrc:

auto-install-peers=true
strict-peer-dependencies=false
  • Resolve peer dependency warnings appropriately
  • Document required peer dependencies clearly

Overrides and Resolutions

Override dependencies in root package.json:

{
  "pnpm": {
    "overrides": {
      "lodash": "^4.17.21",
      "foo@1.x": "npm:bar@^2.0.0"
    }
  }
}
  • Use overrides to fix security vulnerabilities
  • Pin problematic transitive dependencies

Publishing Workspaces

  • Configure publishable packages with proper fields
  • Publish with pnpm publish
  • Workspace protocol references are replaced with actual versions

Performance Optimization

  • Use pnpm fetch in Docker for better caching: COPY pnpm-lock.yaml./ RUN pnpm fetch COPY../ RUN pnpm install --offline
  • Configure store location for CI caching
  • Use --frozen-lockfile in CI environments

Best Practices

  • Always commit pnpm-lock.yaml
  • Use .npmrc for consistent team configuration
  • Prefer workspace:* for internal dependencies
  • Keep root package.json minimal
  • Use pnpm dedupe to optimize lockfile
  • Audit regularly with pnpm audit
  • Use pnpm why <package> to debug dependency issues
  • Integrate with Turborepo or Nx for advanced task running
  • Set engine-strict=true to enforce Node.js version requirements

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Antigravity

28.01%
按下载量换算582

Gemini CLI

23.41%
按下载量换算486

Cursor

18.68%
按下载量换算388

OpenCode

12.88%
按下载量换算268

Claude Code

7.78%
按下载量换算162

Codex

3.51%
按下载量换算73

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills