本文へスキップ
Skillpedia
APIとサーバー(バックエンド)7.6k · #13203

slot-engine

できること

このスキルは、空いている打ち合わせの時間枠を計算する機能と、それが常に守るルールを説明します。その機能を基に開発する人や、時間が表示されない理由を調べる人向けです。

使う場面

  • ✓予約ページに打ち合わせの時間が表示されず、理由を調べる必要があるとき。
  • ✓空いている時間の計算方法を変更するとき。
  • ✓計算が何を保証するか、例えば過去の時間枠を出さないことを確認したいとき。

スキルのリンク

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

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/BuilderIO/agent-native/blob/main/packages/scheduling/docs/skills/slot-engine/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“予約ページで火曜日の午後2時が空きとして表示されないのはなぜですか。原因を一緒に調べてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

この機能は、打ち合わせのルール、スケジュール、予定が入っている時間、既存の予約数を受け取り、時間枠のリストを返します。不具合の調査では、その日の週ごとの勤務時間、日付の変更、予定が入っている時間を確認します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)を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).
よくある質問

この機能は過去の時間枠を返すことがありますか?

いいえ。最低の通知期間より前の時間は、決して提示されません。

夏時間はどのように扱われますか?

計算の前に、時間はスケジュールのタイムゾーンを使って変換されます。

時間枠が表示されないときは、まず何を確認すべきですか?

スケジュールのその日の週ごとの勤務時間を、スケジュール自身のタイムゾーンで確認します。

詳細

作者による元の説明

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

repo: BuilderIO/agent-native

人気

GitHubのスター
7.6k
ランキング
#13203
ライセンス
MIT
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル