Skip to content
cccskills
FreePublished on GitHub

slot-engine

Understand and debug `computeAvailableSlots`, a function that calculates bookable time slots from event settings, schedules, busy periods, and booking limits. Learn its output and guarantees, including timezone handling, and trace why an expected slot is missing or present.

OriginalShow the original description

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

BuilderIO/agent-native7,526 stars(GitHub 7,526 + cccskills 0)

Run score Not tested

See how to install

Good for

  • Understand inputs and results for slot calculations
  • Find why a bookable time is missing
  • Check whether a slot should have been blocked
  • Review timezone and booking limit behavior

Files included (1)

  • SKILL.md2.0 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

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).

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

a2a-assets

FreeSummary

Generate, refine, export, and place brand images or videos from an Assets library into another app. The skill covers choosing a library, handling image batches and video runs, and updating selected assets after feedback.

  • Generate brand images for slides or another app
  • Refine an existing asset after feedback
  • Create and export a video asset
BuilderIO/agent-native7.5KUpdated Oct 26, 2026

account-health

FreeSummary

Prepare a customer account health, renewal, or contract usage readout. Verify the account identity, use approved metric definitions, compare contracted capacity with actual usage, and trace findings to sources, time windows, and known gaps.

  • Preparing a named customer's account health review
  • Comparing contracted seats or capacity with usage
  • Gathering adoption signals before a renewal or QBR
BuilderIO/agent-native7.5KUpdated Oct 26, 2026

actions

FreeSummary

Create focused app actions that agents can call as tools and frontend code can use through client hooks. Use them to add provider integrations or fetch UI data, with validated inputs and structured results.

  • Adding a new app operation
  • Connecting an external provider API
  • Fetching data for a frontend view
BuilderIO/agent-native7.5KUpdated Oct 26, 2026

adding-a-feature

FreeSummary

Use this checklist when adding a feature or integration to an agent-native app. It covers the user interface, agent-callable actions, instructions, and app-state sync so both the user and agent can work with the capability consistently.

  • Planning a new feature across UI and agent actions
  • Checking that agent changes appear in the UI
  • Documenting actions and feature state for the agent
BuilderIO/agent-native7.5KUpdated Oct 26, 2026

adhoc-analysis

FreeSummary

Investigate complex questions by combining data from multiple sources, then summarize patterns, metrics, and evidence in a clear report. Save requested analyses as dashboards with instructions for future refreshes.

  • Comparing CRM deals with call records
  • Investigating customer health across systems
  • Saving a repeatable performance analysis
BuilderIO/agent-native7.5KUpdated Oct 26, 2026

admin-surfaces

FreeSummary

Use the Analytics admin surfaces to inspect and change workspace feature flags, review dashboard ownership and usage activity, or browse and edit databases connected from other agent-native apps. The skill guides administrators to the relevant view and actions.

  • Review dashboard owners, views, and edits
  • Change a workspace feature flag for an app
  • Browse or edit a connected app database
BuilderIO/agent-native7.5KUpdated Oct 26, 2026

See all skills by BuilderIO

Report a problem with this skill