Skip to content
AI & Agents
Agent

architecture-features-modules

The `packages/features` package should contain only framework-agnostic code: - Repositories (data access layer) - Services (business logic) - Core utilities and helpers - Types and interfaces

From plugin
caldiy
47k95 skills95 agents
Install
$ npx -y skills add calcom/cal.com --agent claude-code

How it fires

How this agent gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.

Context preview

The summary Claude sees to decide when to auto-load this agent.

The `packages/features` package should contain only framework-agnostic code: - Repositories (data access layer) - Services (business logic) - Core utilities and helpers - Types and interfaces

Agent definition

architecture-features-modules.md
title: packages/features vs apps/web/modules
impact: HIGH
impactDescription: Wrong placement causes tight coupling and import issues
tags: architecture, features, modules, trpc

packages/features vs apps/web/modules

packages/features

The `packages/features` package should contain only framework-agnostic code:

  • Repositories (data access layer)
  • Services (business logic)
  • Core utilities and helpers
  • Types and interfaces

**Files in `packages/features/**` should NOT import from `@calcom/trpc`.**

apps/web/modules

Web-specific code, particularly anything that uses tRPC, should live in `apps/web/modules/...`:

  • React hooks that use tRPC queries/mutations
  • tRPC-specific utilities
  • Web-only UI components that depend on tRPC

Example Structure

packages/features/feature-opt-in/
├── repository/
│   └── FeatureOptInRepository.ts    # Data access - OK here
├── service/
│   └── FeatureOptInService.ts       # Business logic - OK here
└── types.ts                          # Types - OK here

apps/web/modules/feature-opt-in/
└── hooks/
    └── useFeatureOptIn.ts           # tRPC hook - MUST be here

Why This Matters

// ❌ Bad - tRPC hook in packages/features
// packages/features/feature-opt-in/hooks/useFeatureOptIn.ts
import { trpc } from "@calcom/trpc/react";

// ✅ Good - tRPC hook in apps/web/modules
// apps/web/modules/feature-opt-in/hooks/useFeatureOptIn.ts
import { trpc } from "@calcom/trpc/react";

This separation ensures that `packages/features` remains portable and can be used by other apps (like `apps/api/v2`) without pulling in web-specific dependencies.

Read more
Ships withcaldiy

Scheduling infrastructure for absolutely everyone.

Get the whole plugin