---
name: "pnpm-workspace-monorepo-filter"
description: "Manage large monorepos with hard-linked disk deduplication and targeted filtered execution."
metadata:
  author: "pnpm"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "configure pnpm-workspace.yaml"
  - "run filtered pnpm command"
  - "workspace protocol pnpm"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# pnpm Workspaces & Filtered Multi-Package Execution

Configures pnpm workspaces: authoring pnpm-workspace.yaml, workspace protocol dependencies (workspace:*), executing commands across dependency subtrees (--filter ...pkg), and catalog shared versions.

## When to Invoke
Invoke this skill whenever you need to:
- configure pnpm-workspace.yaml
- run filtered pnpm command
- workspace protocol pnpm

## Execution SOP & Rules
1. Create pnpm-workspace.yaml defining packages: ['apps/*', 'packages/*'].
2. Reference local packages in package.json: 'dependencies': { '@my-org/ui': 'workspace:*' }.
3. Run targeted build: pnpm --filter @my-org/web... build (builds web and all its dependencies).
4. Run tests in parallel across all packages: pnpm -r test.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
