monorepo

Audit pnpm/tsup monorepo package boundaries and exports alignment.

2|Updated Apr 27, 2026
One-click install
npx skills add https://github.com/lunaticwithaduck/majstorbg-admin --skill monorepo-lunaticwithaduck
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: monorepo
Source: https://github.com/lunaticwithaduck/majstorbg-admin/tree/main/.claude/skills/monorepo
Command: npx skills add https://github.com/lunaticwithaduck/majstorbg-admin --skill monorepo-lunaticwithaduck

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Patterns and gotchas for extracting and maintaining workspace packages in this pnpm/tsup monorepo — package boundary design, dts emission, Tailwind v4 cross-package CSS, and the strict-mode / library-typing interactions that surface when primitives ship from a published package.

Core Features & Use Cases

  • Co-locate generator CLIs with the artifacts they produce, placing scripts in packages/<x>/scripts and ensuring the consumer's workflows map to the corresponding tsup/exports entries.
  • Align exports with tsup entry points, and document how to include scripts in the published package via the files field to ensure CLI and generator accessibility.
  • Detect and prevent misclassified primitives by following the project rule that design concerns used by 2+ consumers live in shared packages, and move app-specific concerns to apps/web when extracting.
  • Preserve client directive semantics (use client) across bundles to avoid server/client component resolution issues in Next.js-like environments.

Quick Start

Audit your monorepo against these guidelines and adjust package boundaries accordingly.

Frequently Asked Questions about monorepo

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

FAQPage Schema
How do I align tsup entry points with package exports in a pnpm monorepo?

To align tsup entry points with package exports in a pnpm monorepo, map your exports field directly to the generated bundle outputs. Ensure the files field includes these entries and any CLI scripts to maintain generator accessibility across published workspace packages.

How do I preserve use client directives when bundling React components with tsup?

Preserving use client directives when bundling with tsup requires configuring the build process to retain client directive semantics across bundles. This prevents server and client component resolution issues in Next.js-like environments within your monorepo.

How do I share Tailwind v4 CSS across workspace packages in a monorepo?

Sharing Tailwind v4 CSS across workspace packages involves configuring cross-package CSS resolution within the monorepo. Design concerns used by multiple consumers should live in shared packages to ensure proper style distribution.

When should I move app-specific concerns out of shared monorepo packages?

You should move app-specific concerns out of shared monorepo packages when they are only used by a single consumer like apps/web. Shared packages should strictly contain design primitives used by two or more consumers to maintain proper package boundaries.

Why do strict-mode and library-typing interactions break when shipping primitives from a published package?

Strict-mode and library-typing interactions break when shipping primitives because TypeScript type emission requires precise dts configuration. Resolving this involves aligning tsup dts generation with the package exports to ensure correct type resolution.

Where should I place generator CLIs for workspace packages in a monorepo?

Generator CLIs for workspace packages should be co-located with the artifacts they produce, placing scripts in packages/<x>/scripts. Ensure consumer workflows map to the corresponding tsup and exports entries for proper CLI accessibility.