workspace-management

Manage pnpm workspaces and cross-package dependencies across monorepo packages.

21|2|Updated Nov 5, 2023
One-click install
npx skills add https://github.com/sgcarstrends/sgcarstrends --skill workspace-management
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: workspace-management
Source: https://github.com/sgcarstrends/sgcarstrends/tree/main/.claude/skills/workspace-management
Command: npx skills add https://github.com/sgcarstrends/sgcarstrends --skill workspace-management

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps manage the pnpm monorepo workspace, including adding packages, configuring dependencies, and organizing project structure.

Core Features & Use Cases

  • Package Onboarding: Create new package scaffolds and set up tsconfig paths.
  • Dependency Coordination: Align internal dependencies across apps and packages.
  • Workspace Refactor: Reorganize structure while preserving cross-package imports.

Quick Start

Create a new package directory under packages/, add a package.json, and configure path mappings in tsconfig.json.

Frequently Asked Questions about workspace-management

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new package to a pnpm monorepo workspace?

Create a new package directory under packages/, add a package.json with your package configuration, then update pnpm-workspace.yaml to include the new package path. Configure TypeScript path mappings in tsconfig.json to enable cross-package imports.

How do I manage dependencies between packages in a monorepo?

Align internal dependencies by updating package.json files in each package to reference other workspace packages using workspace protocol syntax. pnpm automatically resolves these cross-package dependencies within your monorepo structure.

What's the best way to restructure a pnpm workspace without breaking imports?

Reorganize package directories while preserving cross-package imports by updating pnpm-workspace.yaml with new paths and adjusting TypeScript path mappings in tsconfig.json to reflect the new structure. Test imports across packages before finalizing the restructure.

How do I share code between multiple packages in a monorepo?

Create shared packages in your workspace and establish TypeScript path mappings in tsconfig.json to enable straightforward imports. Configure package.json dependencies to reference shared packages using workspace dependencies, making code available across all apps and packages.

Can I use pnpm workspace configuration for both apps and shared packages?

Yes. pnpm workspace management supports mixed structures with both application packages and shared library packages. Configure pnpm-workspace.yaml to include all package paths, then use package.json dependencies and TypeScript path mappings to coordinate interactions between apps and shared code.