shared-types-add

Adds types to the @renovation/shared-types package with barrel export and build management.

Updated Jan 23, 2026
One-click install
npx skills add https://github.com/songyinggoh/renovation-agent-monorepo --skill shared-types-add
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shared-types-add
Source: https://github.com/songyinggoh/renovation-agent-monorepo/tree/main/.claude/skills/shared-types-add
Command: npx skills add https://github.com/songyinggoh/renovation-agent-monorepo --skill shared-types-add

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures that types shared between the frontend and backend are correctly defined, exported, and built, preventing type mismatches and build errors.

Core Features & Use Cases

  • Type Definition: Adds new types, interfaces, or constants to the shared types package.
  • Barrel Export Management: Automatically updates the main export file (index.ts) for the shared package.
  • Build Step Enforcement: Ensures the shared package is rebuilt so the backend can consume the new types from its dist/ directory.
  • Consumer Verification: Provides commands to type-check both the backend and frontend consumers.
  • Use Case: When adding a new event payload for Socket.io communication between the server and client, use this skill to define the payload type in shared-types and ensure both sides can correctly import and use it.

Quick Start

Use the shared-types-add skill to add a new interface for DocumentPayload to the shared types package.

Frequently Asked Questions about shared-types-add

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

FAQPage Schema
How do I share TypeScript types between frontend and backend in a monorepo?

Sharing Socket.io event types requires defining the payload interfaces in a shared package. Doing this synchronizes the event shapes between server and client, ensuring both sides correctly import and strictly type-check the data being transmitted.

Why does my backend not pick up new shared types from the monorepo package?

To add new REST API shapes, define the interface or constants in the shared package and update the main barrel file. This automatically synchronizes the API shapes across frontend and backend boundaries for cross-consumer compatibility.

Does this approach work when the frontend reads source files but the backend reads compiled output?

Yes, this approach explicitly handles asymmetric resolution where the frontend reads source and the backend reads compiled distribution files. It manages the necessary build steps and barrel exports to maintain compatibility across these different consumption methods.

How do I safely add UI-surfacing database enums to a shared types package?

To safely add UI-surfacing database enums, add them as constants to the shared types package and update the index exports. This guarantees both the database layer and the UI surface import the exact same enum values, avoiding runtime mismatches.