Saltar al contenido
Skillpedia
APIs y servidores (backend)7,6 mil · #13203

slot-engine

Qué hace

Esta skill describe la función que calcula qué horarios de reunión están libres, y las reglas que siempre cumple. Está pensada para desarrolladores que necesitan construir sobre ella o averiguar por qué falta una hora.

Cuándo usarla

  • ✓Cuando falta un horario en una página de reservas y necesitas averiguar por qué.
  • ✓Cuando cambias la forma en que se calculan los horarios libres.
  • ✓Cuando necesitas saber qué garantiza el cálculo, por ejemplo que no ofrece horarios pasados.

Link de la skill

https://github.com/BuilderIO/agent-native/blob/main/packages/scheduling/docs/skills/slot-engine/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/BuilderIO/agent-native/blob/main/packages/scheduling/docs/skills/slot-engine/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“¿Por qué no aparece el martes a las 14:00 como libre en mi página de reservas? Ayúdame a averiguarlo.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

La función recibe las reglas de la reunión, el horario, las horas ocupadas y el número de reservas existentes, y devuelve una lista de horarios. Para depurar, hay que revisar el horario semanal, los cambios de fecha y las horas ocupadas de ese día.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de GitHub.

Slot engine

import { computeAvailableSlots } from "@agent-native/scheduling/core"

Inputs

  • Event type config (duration, buffers, minimum notice, period, limits, slot interval)
  • Schedule (timezone + weekly availability + date overrides)
  • Busy intervals (UTC, aggregated from external calendars + existing bookings)
  • Booking counts by bucket (day/week/month/year) for limit enforcement
  • Time range to compute over
  • Optional seats-per-slot + seats-taken map
  • Viewer timezone (for limit bucketing, if it differs from the schedule)

Output

  • Array of Slot { start: ISO, end: ISO, available: boolean, seatsRemaining?, hostEmail? }

Invariants

The function guarantees, in order:

  1. No slot falls in the past (now + minimumBookingNotice is the floor).
  2. No slot overlaps a busy interval (with buffers applied).
  3. No slot falls outside the schedule's available intervals for that day.
  4. No slot exceeds a booking limit.
  5. No slot falls outside the event's period (rolling/range).
  6. DST-safe: we convert to UTC using the schedule's timezone before doing any interval arithmetic.

Debugging

If a slot is unexpectedly missing:

  1. Check the schedule's weekly availability for that day-of-week in the schedule's timezone (not UTC — weekends can shift across the date line).
  2. Check date overrides for that local date (empty intervals = fully blocked).
  3. Check merged busy intervals for overlap, including the before/after buffer expansion.
  4. Check booking limits: a single existing booking can close a day.
  5. Check period caps: rolling periods restrict how far in the future slots appear.

If a slot is unexpectedly present:

  1. Check that now is being passed correctly (defaults to new Date()).
  2. Check that busy intervals from providers are in UTC.
  3. Confirm slot interval matches what you expect (default = duration).
Preguntas frecuentes

¿Puede la función devolver horarios pasados?

No. Nunca se ofrecen horas anteriores al plazo mínimo de aviso.

¿Cómo se maneja el horario de verano?

Las horas se convierten usando la zona horaria del horario antes de cualquier cálculo.

¿Qué debo revisar primero cuando falta un horario?

El horario semanal de la agenda para ese día, en la zona horaria propia del horario.

Detalles

Descripción original del autor

The pure `computeAvailableSlots` function — inputs, outputs, invariants, and debugging guide.

repo: BuilderIO/agent-native

Popularidad

Estrellas en GitHub
7,6 mil
Posición en el ranking
#13203
Licencia
MIT
Actualizada
2/11/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas