Cal.diy Agent Rules

A scheduling platform for bookings, availability, calendars, and integrations.

Overview

Cal.diy uses short do-and-don't lists, code examples, and firm pull-request size limits. It also covers security-sensitive field selection, one exception to direct imports, and larger workflows that need explicit approval.

Documents

├── 
├── CLAUDE.md · unavailable at this commit · symlink → agents.md (Symlink target is not in this snapshot)
├── .opencode
│   └── skill
│       └── vercel-react-best-practices
│           └── 
├── agents
│   ├── rules
│   │   ├── Modular engineering rules
│   │   ├── 
│   │   └── 
│   ├── skills
│   │   └── vercel-react-best-practices
│   │       └──  · same content as .opencode/skill/vercel-react-best-practices/AGENTS.md
│   ├── 
│   ├── 
│   └── 
├── specs
│   ├── _templates
│   │   ├── 
│   │   └──  · symlink → AGENTS.md
│   └── cancellation-reason-requirement
│       └── 
├── agents.md · unavailable at this commit
└── 

Techniques in this file

01 / Contribution etiquette

Make a size limit measurable and scoped

The guide counts additions plus deletions and code files, while excluding documentation, lockfiles, and generated artifacts. It then offers layer, feature, preparatory-refactor, and dependency-order splits.

Source excerpt starting at line 41.
- **Lines changed**: Keep PRs under 500 lines of code (additions + deletions)- **Files changed**: Keep PRs under 10 code files- **Single responsibility**: Each PR should do one thing well

02 / Good and bad pairs

Connect field selection to sensitive-data exposure

Prisma examples contrast explicit select fields with include fetching an entire related record. The prohibitions separately name credential.key as a field that must never be exposed.

Source excerpt starting at line 175.
// Bad - Include fetches all fields including sensitive onesconst booking = await prisma.booking.findFirst({  include: { user: true }});

03 / Behavioral framing

State the local exception to a repository-wide import rule

The root favors direct source imports, but API v2 lacks path mappings for two packages. Its section requires re-exporting through platform-libraries and shows both steps and the failing direct import.

Source excerpt starting at line 195.
When importing from `@calcom/features` or `@calcom/trpc` into `apps/api/v2`, **do not import directly** because the API v2 app's `tsconfig.json` doesn't have path mappings for these modules, which causes "module not found" errors.

04 / Router files

Keep a larger planning workflow opt-in

Spec-driven development is offered for complex features, but its presence does not make it mandatory. The guide names the explicit user trigger and points to the separate workflow document.

Source excerpt starting at line 231.
For complex features, you can use spec-driven development when explicitly requested.

Ideas for your repo

  1. Define what counts toward a PR-size limit and show decomposition examples.
  2. Explain which broad data-fetching patterns can expose sensitive fields.
  3. Put package-specific exceptions beside the general rule they refine.
  4. Make optional workflows conditional on an explicit trigger.
Sponsored byModem

Give your agents the whole story.

These instructions explain how to work in Cal.diy. Modem shows your agents what customers said, who is affected, and what changed.

See how Modem works