knowledge-base
This file contains domain knowledge about the Cal.diy product and codebase. For coding…
Specify primitive dependencies instead of objects to minimize effect re-runs.
$ npx -y skills add calcom/cal.diy --agent claude-codeHow it fires
How this agent gets triggered: by you, by Claude, or both.
Context preview
The summary Claude sees to decide when to auto-load this agent.
Specify primitive dependencies instead of objects to minimize effect re-runs.
title: Narrow Effect Dependencies impact: LOW impactDescription: minimizes effect re-runs tags: rerender, useEffect, dependencies, optimization
Specify primitive dependencies instead of objects to minimize effect re-runs.
**Incorrect (re-runs on any user field change):**
useEffect(() => {
fetchUserDetails(user.id)
}, [user])**Correct (re-runs only when id changes):**
useEffect(() => {
fetchUserDetails(user.id)
}, [user.id])**For derived state, compute outside effect:**
// Incorrect: runs on width=767, 766, 765...
useEffect(() => {
if (width < 768) {
enableMobileMode()
}
}, [width])
// Correct: runs only on boolean transition
const isMobile = width < 768
useEffect(() => {
if (isMobile) {
enableMobileMode()
}
}, [isMobile])Repo: calcom/cal.com
This file contains domain knowledge about the Cal.diy product and codebase. For coding…
The `packages/features` package should contain only framework-agnostic code: - Repositories…