Agent skill

Cross Package Types

by bitovi in bitovi/ai-enablement-prompts

Type flow patterns for tRPC + Prisma monorepos. An agent skill from bitovi/ai-enablement-prompts.

MITAuto-check passedDatabases

Install Cross Package Types

skills CLI
$ npx skills add bitovi/ai-enablement-prompts --skill cross-package-types -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install bitovi/ai-enablement-prompts cross-package-types --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/bitovi/ai-enablement-prompts.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/trpc-prisma/skills/cross-package-types .claude/skills/cross-package-types && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cross-package-types
GitHub stars
121
Token cost
~1.1k tokens
SKILL.md length
181 words
Files
1
Skills in repo
40
Repo updated
First seen
Licence
MIT

At a glance

Type flow patterns for tRPC + Prisma monorepos. An agent skill from bitovi/ai-enablement-prompts.

  • Works in 4 steps: Prisma is the single source of truth —… → Zod schemas derive from Prisma types —… → AppRouter types flow from server to… → …
  • Setting up types
  • SKILL.md covers Type Flow, Key Principles, Shared Package and Server Package, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Cross Package Types is an agent skill from bitovi/ai-enablement-prompts. Type flow patterns for tRPC + Prisma monorepos. Covers AppRouter type inference across shared, server, and client packages. Use when setting up types, fixing type errors across packages, or understanding the type chain.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Databases, covering gRPC and Protobuf, ORMs and data access and Monorepo tooling. It works with tRPC, Prisma and Zod. The repository describes itself as: Prompts Bitovi uses for software development. The licence is MIT.

When your agent uses it

  • Setting up types
  • Fixing type errors across packages
  • Understanding the type chain

Example prompts

  • “/cross-package-types”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Prisma is the single source of truth — all types derive from the Prisma schema
  2. Zod schemas derive from Prisma types — use .pick(), .omit(), .extend() on base schemas
  3. AppRouter types flow from server to client — never import server code in client
  4. No circular dependencies — shared → server → client (one direction only)

What it can do on your machine

Read from SKILL.md and the folder at commit df229b1. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cross Package Types loads about 1.1k tokens when it runs. Until then it costs about 60 tokens; SKILL.md has 181 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~60
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from bitovi/ai-enablement-prompts at commit df229b1, republished under its MIT licence (© bitovi). 181 words, ~1,109 tokens.

Download SKILL.mdSave it as .claude/skills/cross-package-types/SKILL.md (or your agent's skills folder).
name
cross-package-types
description
Type flow patterns for tRPC + Prisma monorepos. Covers AppRouter type inference across shared, server, and client packages. Use when setting up types, fixing type errors across packages, or understanding the type chain.

Skill: Cross-Package Types (tRPC + Prisma)

Defines how TypeScript types flow through a monorepo with tRPC and Prisma.

Type Flow

Prisma Schema → Prisma Client Types → Zod Schemas → tRPC Routers → Client Type Inference
Package Responsibilities
PackageOwnsExports
sharedZod schemas, enums, constantsSchemas for both server and client
servertRPC routers, Prisma clientAppRouter type
clientReact components, tRPC hooksConsumes AppRouter type

Key Principles

  1. Prisma is the single source of truth — all types derive from the Prisma schema
  2. Zod schemas derive from Prisma types — use .pick(), .omit(), .extend() on base schemas
  3. AppRouter types flow from server to client — never import server code in client
  4. No circular dependencies — shared → server → client (one direction only)

Shared Package

The shared package has two entry points:

typescript
// package.json
{
  "exports": {
    "./server": "./src/server/index.ts",  // Server-only: Prisma, DB utils
    ".": "./src/index.ts"                  // Browser-safe: Zod schemas, types, constants
  }
}
Schema Derivation
typescript
// shared/src/schemas/user.ts
import { z } from 'zod';

// Base schema matching Prisma model
export const UserSchema = z.object({
  id: z.string().uuid(),
  email: z.string().email(),
  name: z.string().min(1),
  role: z.enum(['ADMIN', 'USER', 'VIEWER']),
  createdAt: z.date(),
  updatedAt: z.date(),
});

// Auto-managed fields
const PRISMA_AUTO_FIELDS = ['id', 'createdAt', 'updatedAt'] as const;

// Input schema (for create)
export const CreateUserSchema = UserSchema.omit(
  Object.fromEntries(PRISMA_AUTO_FIELDS.map(f => [f, true])) as Record<string, true>
);

// Update schema (partial, without auto fields)
export const UpdateUserSchema = CreateUserSchema.partial();

// Form schema (client-friendly, no server-only fields)
export const UserFormSchema = UserSchema.pick({
  email: true,
  name: true,
  role: true,
});

export type User = z.infer<typeof UserSchema>;
export type CreateUserInput = z.infer<typeof CreateUserSchema>;
export type UpdateUserInput = z.infer<typeof UpdateUserSchema>;

Server Package

tRPC Router Pattern
typescript
// server/src/routers/user.ts
import { router, protectedProcedure } from '../trpc';
import { CreateUserSchema, UpdateUserSchema } from '@myapp/shared';
import { prisma } from '@myapp/shared/server';

export const userRouter = router({
  list: protectedProcedure.query(async () => {
    return prisma.user.findMany();
  }),

  create: protectedProcedure
    .input(CreateUserSchema)
    .mutation(async ({ input }) => {
      return prisma.user.create({ data: input });
    }),

  update: protectedProcedure
    .input(z.object({ id: z.string().uuid(), data: UpdateUserSchema }))
    .mutation(async ({ input }) => {
      return prisma.user.update({ where: { id: input.id }, data: input.data });
    }),
});
AppRouter Export
typescript
// server/src/routers/index.ts
import { router } from '../trpc';
import { userRouter } from './user';

export const appRouter = router({
  user: userRouter,
});

export type AppRouter = typeof appRouter;

Client Package

Type-Safe tRPC Client
typescript
// client/src/utils/trpc.ts
import { createTRPCReact } from '@trpc/react-query';
import type { AppRouter } from '@myapp/server';

export const trpc = createTRPCReact<AppRouter>();
Usage in Components
typescript
// client/src/components/UserList.tsx
import { trpc } from '../utils/trpc';

export function UserList() {
  const { data: users } = trpc.user.list.useQuery();
  // `users` is fully typed as User[] automatically
}

Common Mistakes

  • ❌ Importing server code in client (breaks browser bundle)
  • ❌ Defining types manually instead of deriving from Prisma/Zod
  • ❌ Circular imports between packages
  • ❌ Using any to silence cross-package type errors
  • ✅ Use type imports: import type { AppRouter } from '@myapp/server'
  • ✅ Derive all schemas from Prisma base types
  • ✅ Use shared package for browser-safe code

© bitovi, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/trpc-prisma/skills/cross-package-types of bitovi/ai-enablement-prompts.

Open the folder on GitHubat commit df229b1

Compare with similar skills

Cross Package Types next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cross Package Types compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cross Package Types this skillbitovi/ai-enablement-prompts121—~1.1kAutomated safety check: PassMIT
Backend Dev Guidelineslangfuse/langfuse36k—~1.9kAutomated safety check: PassCustom licence
Better Drizzlealmeidazs/better-drizzle348—~1.7kAutomated safety check: PassApache-2.0
Codebase Contexthomarr-labs/homarr5k—~679Automated safety check: PassApache-2.0
Backend Dev Guidelineslitefuse/litefuse1001 repos~5.8kAutomated safety check: PassCustom licence
Node Backend Development Guidelinesdiet103/claude-code-infrastructure-showcase10k2 repos~2kAutomated safety check: PassMIT

Similar skills

  • Backend Dev Guidelines

    langfuse/langfuse

    Build or review Langfuse backend code. An agent skill from langfuse/langfuse.

    36k GitHub stars~1.9k tokensUpdated today
    Backend & APIsAuto-check passed
  • Better Drizzle

    almeidazs/better-drizzle

    Write, review, and debug code that uses better-drizzle, the typed repository layer over Drizzle ORM 1.x (better(db), client.users.findMany, paginate, cursor, upsertMany, relation include/connect…

    348 GitHub stars~1.7k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Codebase Context

    homarr-labs/homarr

    Navigate Homarr's monorepo architecture and reuse shared packages.

    5k GitHub stars~679 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Backend Dev Guidelines

    litefuse/litefuse

    Comprehensive backend development guide for Litefuse's Next.js 14/tRPC/Express/TypeScript monorepo.

    100 GitHub starsUsed in 1 repo~5.8k tokens
    Backend & APIsAuto-check passed
  • Node Backend Development Guidelines

    diet103/claude-code-infrastructure-showcase

    Sets layered architecture and coding rules for Node.js, Express and TypeScript microservices, covering routes, controllers, services, repositories, Prisma, Sentry and Zod.

    10k GitHub starsUsed in 2 repos~2k tokens
    Backend & APIsAuto-check passed
  • Nestjs Trpc

    trycompai/crm

    Build end-to-end type-safe tRPC APIs inside NestJS using the nestjs-trpc adapter — @Router/@Query/@Mutation/@Subscription decorators, TRPCModule.forRoot, injectable middlewares and context, Zod…

    11k GitHub stars~2.8k tokensUpdated 28 days ago
    Backend & APIsAuto-check passed

More from bitovi/ai-enablement-prompts

All 40 skills in this repo
  • Component Registry

    bitovi/ai-enablement-prompts

    Track reusable UI components and unextracted patterns. An agent skill from bitovi/ai-enablement-prompts.

    121 GitHub stars~597 tokensUpdated 28 days ago
    Auto-check passed
  • Computed Styles

    bitovi/ai-enablement-prompts

    Extract and compare computed CSS styles between a baseline URL and a dev/Storybook URL using Playwright MCP evaluate calls.

    121 GitHub stars~2.4k tokensUpdated 28 days ago
    Auto-check passed
  • Create Plugin

    bitovi/ai-enablement-prompts

    A skill your agent uses when the user asks to "create a plugin", "add a plugin", "make a new plugin", "build a plugin", or wants to package skills into an installable plugin for this marketplace.

    121 GitHub stars~2k tokensUpdated 28 days ago
    Auto-check passed
  • Create React Modlet

    bitovi/ai-enablement-prompts

    Create React components, hooks, or utilities following the modlet pattern.

    121 GitHub stars~2.1k tokensUpdated 28 days ago
    Auto-check passed
  • Create Skill

    bitovi/ai-enablement-prompts

    A skill your agent uses when the user asks to "create a skill", "add a skill", "make a new skill", "build a skill", or wants to automate a repeated workflow into a reusable prompt.

    121 GitHub stars~1.6k tokensUpdated 28 days ago
    Auto-check passed
  • Create Skill

    bitovi/ai-enablement-prompts

    Create new Agent Skills for this project. An agent skill from bitovi/ai-enablement-prompts.

    121 GitHub stars~1.7k tokensUpdated 28 days ago
    Auto-check passed

Works with

Questions about Cross Package Types

What does Cross Package Types do?

Type flow patterns for tRPC + Prisma monorepos. An agent skill from bitovi/ai-enablement-prompts. Cross Package Types is an agent skill from bitovi/ai-enablement-prompts. Type flow patterns for tRPC + Prisma monorepos.

When should I use Cross Package Types?

Cross Package Types fits situations like: setting up types; fixing type errors across packages; understanding the type chain.

How do I install Cross Package Types in Claude Code?

Run `npx skills add bitovi/ai-enablement-prompts --skill cross-package-types -a claude-code`. Or copy the skill folder (plugins/trpc-prisma/skills/cross-package-types in bitovi/ai-enablement-prompts) into .claude/skills/cross-package-types in your project. Claude Code loads it when a task matches its description.

How do I install Cross Package Types in Codex?

Run `npx skills add bitovi/ai-enablement-prompts --skill cross-package-types -a codex`. Or copy the skill folder (plugins/trpc-prisma/skills/cross-package-types in bitovi/ai-enablement-prompts) into .agents/skills/cross-package-types in your project. Codex loads it when a task matches its description.

Can I use Cross Package Types in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add bitovi/ai-enablement-prompts --skill cross-package-types -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cross-package-types, .gemini/skills/cross-package-types, .github/skills/cross-package-types and .opencode/skills/cross-package-types in your project.

What does Cross Package Types need to run?

SKILL.md names no scripts, command-line tools or credentials: Cross Package Types is instructions for the agent only.

Does Cross Package Types access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Cross Package Types safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Cross Package Types use?

Cross Package Types is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cross Package Types use?

About 1.1k tokens (SKILL.md is roughly 4.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cross Package Types?

Skills that share tags, products or a category with Cross Package Types: Backend Dev Guidelines (langfuse/langfuse, 36k stars), Better Drizzle (almeidazs/better-drizzle, 348 stars), Codebase Context (homarr-labs/homarr, 5k stars) and Backend Dev Guidelines (litefuse/litefuse, 100 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cross Package Types?

bitovi (a GitHub organization) maintains it in bitovi/ai-enablement-prompts, which has 121 GitHub stars. The repository holds 40 skills in this directory. The repository was last updated on September 11, 2026.

Source: bitovi/ai-enablement-prompts on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.