slot-engine
What it does
This skill describes the function that calculates which meeting slots are open, and the rules it always follows. It is for developers who need to build on it or find out why a time is missing.
When to use it
- ✓When a meeting time is missing from a booking page and you need to find out why.
- ✓When you change how open times are calculated.
- ✓When you need to know what the calculation guarantees, such as no past slots.
Skill link
https://github.com/BuilderIO/agent-native/blob/main/packages/scheduling/docs/skills/slot-engine/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Why isn't Tuesday at 2pm showing as open on my booking page? Help me find out.”
5 new skills a week. 1 minute to read.
How it works
The function takes the meeting rules, schedule, busy times, and existing booking counts, and returns a list of slots. Debugging means checking the weekly hours, date changes, and busy times for that day.
Technical content (original SKILL.md)
Original text by the author, straight from 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:
- No slot falls in the past (
now + minimumBookingNoticeis the floor). - No slot overlaps a busy interval (with buffers applied).
- No slot falls outside the schedule's available intervals for that day.
- No slot exceeds a booking limit.
- No slot falls outside the event's period (rolling/range).
- DST-safe: we convert to UTC using the schedule's timezone before doing any interval arithmetic.
Debugging
If a slot is unexpectedly missing:
- 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).
- Check date overrides for that local date (empty intervals = fully blocked).
- Check merged busy intervals for overlap, including the before/after buffer expansion.
- Check booking limits: a single existing booking can close a day.
- Check period caps: rolling periods restrict how far in the future slots appear.
If a slot is unexpectedly present:
- Check that
nowis being passed correctly (defaults tonew Date()). - Check that busy intervals from providers are in UTC.
- Confirm slot interval matches what you expect (default = duration).
FAQ
Can the function return slots in the past?
No. Times before the minimum notice period are never offered.
How is daylight saving time handled?
Times are converted using the schedule's timezone before any calculation.
What should I check first when a slot is missing?
The schedule's weekly hours for that day, in the schedule's own timezone.
Details
Original description by the author
The pure `computeAvailableSlots` function — inputs, outputs, invariants, and debugging guide.
repo: BuilderIO/agent-native
Popularity
- GitHub stars
- 7.6k
- Ranking position
- #13203
- License
- MIT
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
design-exploration
7.6kHelps your agent explore several UI design directions side by side, let you pick one, and then refine the chosen design.
visual-edit
7.6kHelps your agent open a running local app in a visual editor so you can review and edit its real screens together.
turn-into-app
7.6kTurns a workflow, spreadsheet or project into a polished visual app, with populated screens and an agent working behind the controls.
visual-plan
7.6kTurns a plain text plan into an interactive visual plan with diagrams, file maps, code snippets and open questions.
Similar skills
api-connector-builder
280kHas your agent build new API connections following the existing pattern. Use when you need to add one more integration without creating a new way of doing things.
api-design
280kHelps your agent design REST APIs following best practices. It's useful for defining how APIs communicate, how errors are shown, and how to organize data.
backend-patterns
280kHelps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.