Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
oakoss avatar

Pnpm Workspace

  • 142 installs
  • 14 repo stars
  • Updated March 2, 2026
  • oakoss/agent-skills

Set up pnpm workspaces, shared internal packages, filters, and hoisting rules for TypeScript monorepos.

About

Teaches agents to initialize and maintain pnpm monorepos: workspace manifests, inter-package dependencies, filter-based scripts, and hoisting conventions so multi-package SaaS and CLI repos stay fast and consistent for teams.

  • Workspace layout
  • Shared packages
  • pnpm filters
  • Hoisting rules
  • Internal deps

Pnpm Workspace by the numbers

  • 142 all-time installs (skills.sh)
  • +1 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #467 of 1,435 DevOps & CI/CD skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/oakoss/agent-skills --skill pnpm-workspace

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs142
repo stars14
Last updatedMarch 2, 2026
Repositoryoakoss/agent-skills

What it does

Set up pnpm workspaces, shared internal packages, filters, and hoisting rules for TypeScript monorepos.

Files

SKILL.mdMarkdownGitHub ↗

pnpm Workspace

Overview

pnpm workspaces provide built-in monorepo support through pnpm-workspace.yaml, the workspace: protocol for local package linking, and powerful filtering to run commands across specific packages. Catalogs enforce consistent dependency versions across all workspace packages.

When to use: Multi-package repositories, shared libraries with consuming apps, consistent dependency management across packages, running commands on subsets of packages.

When NOT to use: Single-package projects, projects already using npm/yarn workspaces (migration required), projects that need floating dependency versions per package.

Quick Reference

PatternAPI / ConfigKey Points
Define workspacepnpm-workspace.yaml with packages globsGlobs match directories containing package.json
Link local package"dep": "workspace:*"Always resolves to local workspace package
Link with version range"dep": "workspace:^1.0.0"Fails install if local version does not satisfy range
Default catalogcatalog: key in pnpm-workspace.yamlSingle source of truth for dependency versions
Named catalogcatalogs: key with named groupsMultiple version sets (e.g., react18, react17)
Use catalog in package"dep": "catalog:" or "dep": "catalog:name"Resolved to actual version on pnpm publish
Filter by name--filter <name> or -F <name>Exact name or glob pattern (@scope/*)
Filter with dependencies--filter "foo..."Package and all its dependencies
Filter with dependents--filter "...foo"Package and all packages that depend on it
Filter by directory--filter "./packages/app"All packages under a directory path
Filter by git changes--filter "[origin/main]"Packages changed since a commit or branch
Exclude from filter--filter "!foo"Remove matching packages from selection
Run script in packagepnpm --filter <pkg> <script>Runs script only in matched packages
Recursive runpnpm -r run <script>Runs script in all workspace packages
Install allpnpm installSingle lockfile for entire workspace
Publish workspace pkgpnpm publishReplaces workspace: and catalog: with real versions
Inject workspace depsinject-workspace-packages=true in .npmrcHard-links instead of symlinks; required for deploy
Script security (v10+)allowBuilds in package.jsonLifecycle scripts blocked by default; opt-in per dep

Common Mistakes

MistakeCorrect Pattern
Using workspace:* then publishing as-ispnpm automatically replaces workspace:* with real versions on publish
Forgetting to list directory in packages:Every package directory must match a glob in pnpm-workspace.yaml
Using npm install in workspace packagesAlways use pnpm install from the workspace root
Hardcoding versions duplicated across packagesUse catalog: to centralize version definitions
Running pnpm install inside a sub-packageRun from workspace root; use --filter to target packages
Expecting --filter to match directory names--filter matches package.json name field, not directory names
Not escaping ! in zsh for exclude filtersUse \! or quote the filter: --filter="!foo"
Using workspace: for non-workspace depsworkspace: protocol only works for packages defined in the workspace
Lifecycle scripts failing after pnpm 10 upgradepnpm 10 blocks scripts by default; add deps to allowBuilds in config
Using pnpm deploy without inject-workspace-packagesSet inject-workspace-packages=true in .npmrc (required in pnpm 10)

Delegation

  • Workspace scaffolding: Use Explore agent to discover existing package structure
  • Dependency auditing: Use Task agent to check version consistency across packages
If the turborepo skill is available, delegate build orchestration, task caching, and CI optimization to it.
If the changesets skill is available, delegate versioning, changelog generation, and npm publishing to it.

References

  • Workspace setup, workspace protocol, and catalogs
  • Filtering packages for targeted commands
  • Shared configuration across workspace packages
  • Monorepo integration: pnpm + Turborepo + Changesets pipeline

Related skills

DevOps & CI/CDdevopsintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.