shared-libraries-guidelines

Standardize TypeScript shared types, Zod schemas, and utilities across monorepo packages.

Updated Nov 9, 2025
One-click install
npx skills add https://github.com/ZeroGravitySkin-Ron/Claude --skill shared-libraries-guidelines
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shared-libraries-guidelines
Source: https://github.com/ZeroGravitySkin-Ron/Claude/tree/main/skills/shared-libraries-guidelines
Command: npx skills add https://github.com/ZeroGravitySkin-Ron/Claude --skill shared-libraries-guidelines

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill consolidates guidelines for TypeScript shared libraries (types, validation, and utilities) to ensure consistency, reduce duplication, and enable reliable cross-project contracts across frontend, backend, and data-access layers.

Core Features & Use Cases

  • Single Source of Truth: Centralizes types, validation schemas, and utilities.
  • DB vs App Type Separation: Promotes safe mapping between DB schemas and application models.
  • Type-First, Schema-Second: Encourages defining TS types first, then Zod schemas.
  • Reusable Enum Schemas: Provides consistent enum definitions and validation.
  • Cross-Project Consistency: Enables uniform contracts and naming across teams.

Quick Start

  • Add new types under libs/shared/types/src/lib/ and export from libs/shared/types/src/index.ts.
  • Create or update Zod validation schemas under libs/shared/validation/src/lib/ and export from libs/shared/validation/src/index.ts.
  • Build and publish the shared libraries, then update consuming apps if there are breaking changes.

Frequently Asked Questions about shared-libraries-guidelines

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

FAQPage Schema
How do I standardize TypeScript types and validation across multiple applications?

Standardize TypeScript types and validation by centralizing shared types, Zod schemas, and utilities in dedicated packages (@quantum/shared-types, @quantum/shared-validation, @quantum/shared-utils). Define types first, then derive Zod schemas from them, and export all definitions from index files to create a single source of truth across your monorepo.

What's the best way to separate database schemas from application types in TypeScript?

Separate database and application types by maintaining distinct type definitions in your shared libraries—DB schemas map to database models, application types represent domain logic. This prevents type leakage and ensures safe transformations between layers while keeping validation contracts explicit.

How do I create reusable Zod validation schemas for enums across projects?

Create reusable enum schemas in @quantum/shared-validation by defining TypeScript enums first, then generating corresponding Zod schemas that validate against those enums. Export schemas centrally so all consuming applications reference the same validation logic and maintain consistency.

Can I use shared TypeScript libraries across frontend, backend, and data-access layers?

Yes. Shared TypeScript libraries enable cross-project contracts by centralizing types, validation schemas, and utilities consumed across frontend, backend, and data-access layers. This requires consistent naming conventions, clear DB-vs-App separation, and integration with your monorepo build workflow.

What naming conventions should I follow for shared TypeScript types and utilities?

Follow consistent naming conventions documented in your shared libraries guidelines—use clear, predictable names for types, schemas, and utilities exported from @quantum/shared packages. Consistent naming reduces cognitive load across teams and prevents drift when multiple projects depend on the same contracts.

How do I integrate shared library updates with my monorepo build workflow?

Integrate shared libraries by building and publishing @quantum/shared packages centrally, then updating consuming applications when breaking changes occur. Document integration steps and use centralized exports to ensure all teams adopt updates consistently across the monorepo.