--- description: pnpm workspaces, dependency rules, and shared package direction alwaysApply: true --- Shared package and dependency standards for the monorepo. ## Package management - Use `pnpm` workspaces. - Prefer workspace packages for shared logic rather than duplication between apps. - Reusable logic should be extracted into `packages/*` only when there is a clear second use case or a foundational shared concern. ## Dependency rules - Prefer fewer dependencies. - Do not introduce a package solely for convenience if existing platform APIs or current project dependencies can solve the problem cleanly. - Any new dependency must be justified briefly in code comments, PR notes, or task summary when it is not obvious. - Use the latest stable non-beta version when adding dependencies. - Prefer mature, actively maintained packages with strong TypeScript support. ## Shared package direction Prefer dedicated packages for: - UI primitives - shared types - shared schemas - configuration - internationalization helpers - eslint config - tsconfig - test utilities when broadly reused