Agent
knowledge-base
This file contains domain knowledge about the Cal.diy product and codebase. For coding…
Multiple `.filter()` or `.map()` calls iterate the array multiple times. Combine into one loop.
$ 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.
Multiple `.filter()` or `.map()` calls iterate the array multiple times. Combine into one loop.
title: Combine Multiple Array Iterations impact: LOW-MEDIUM impactDescription: reduces iterations tags: javascript, arrays, loops, performance
Multiple `.filter()` or `.map()` calls iterate the array multiple times. Combine into one loop.
**Incorrect (3 iterations):**
const admins = users.filter(u => u.isAdmin) const testers = users.filter(u => u.isTester) const inactive = users.filter(u => !u.isActive)
**Correct (1 iteration):**
const admins: User[] = []
const testers: User[] = []
const inactive: User[] = []
for (const user of users) {
if (user.isAdmin) admins.push(user)
if (user.isTester) testers.push(user)
if (!user.isActive) inactive.push(user)
}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…