Calendar Scheduling Logicのロゴ

Calendar Scheduling Logic

組織
cxcscmu
calendar-scheduling-logic

カレンダーの空き時間を見つけ、条件を考慮してミーティングを設定する

概要

公開者cxcscmu
リポジトリSkillLearnBench
スキル名calendar-scheduling-logic
スター
91
フォーク
7
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    cxcscmuがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Calendar Scheduling Logic」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/cxcscmu/SkillLearnBench/tree/main/skills/b1-one-shot-claude-haiku-4-5/schedule-planning/calendar-scheduling-logic
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/cxcscmu/SkillLearnBench.git /tmp/SkillLearnBench
mkdir -p .claude/skills
cp -r /tmp/SkillLearnBench/skills/b1-one-shot-claude-haiku-4-5/schedule-planning/calendar-scheduling-logic .claude/skills/calendar-scheduling-logic
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでCalendar Scheduling Logicを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にCalendar Scheduling Logicを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Calendar Scheduling Logicは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Calendar Scheduling Logic Skill

Overview

This skill covers scheduling algorithms to find available time slots in a calendar, handle time conflicts, prioritize blue-colored flexible blocks, and match meeting requests with available time windows.

Key Concepts

Calendar Representation

python
# Event representation
event = {
    'name': 'Weekly Group Meeting',
    'start_hour': 10,
    'start_minute': 0,
    'end_hour': 11,
    'end_minute': 0,
    'color': 'red',           # 'red', 'blue', 'yellow', 'gray'
    'is_flexible': True/False # Only blue is True
}

# 15-minute interval representation
# 9:00am = index 0, 9:15am = index 1, etc.

Constraint Types

  1. User Availability Window: Person only available during specific hours
  2. Date Constraint: Meeting must be on specific date
  3. Duration Requirement: Meeting needs exact duration
  4. Block Overriding: Blue blocks can be overridden for higher priority meetings

Code Examples

Time Conversion to Minutes

python
def time_to_minutes(hour, minute):
    """Convert hour:minute to total minutes since midnight"""
    return hour * 60 + minute

def minutes_to_time(minutes):
    """Convert total minutes to (hour, minute) tuple"""
    hour = minutes // 60
    minute = minutes % 60
    return (hour, minute)

Convert Time Slots to Intervals

python
def time_range_to_intervals(start_hour, start_min, end_hour, end_min, interval_minutes=15):
    """Convert a time range to 15-minute interval indices"""
    start_total_min = time_to_minutes(start_hour, start_min)
    end_total_min = time_to_minutes(end_hour, end_min)

    intervals = []
    current = start_total_min
    while current < end_total_min:
        intervals.append(current // interval_minutes)
        current += interval_minutes

    return intervals

Track Busy Intervals

python
def mark_busy_intervals(calendar_events, day_start_hour=0, day_end_hour=24):
    """Mark all busy intervals in a day"""
    total_intervals = (day_end_hour - day_start_hour) * 60 // 15
    busy = [False] * total_intervals

    for event in calendar_events:
        intervals = time_range_to_intervals(
            event['start_hour'], event['start_minute'],
            event['end_hour'], event['end_minute']
        )
        for i in intervals:
            if 0 <= i < total_intervals:
                busy[i] = True

    return busy

Find Available Slots (Basic)

python
def find_available_slots(busy_array, duration_intervals):
    """Find all available slots of at least duration_intervals length"""
    available_slots = []
    consecutive = 0
    start_idx = None

    for i, is_busy in enumerate(busy_array):
        if not is_busy:
            if consecutive == 0:
                start_idx = i
            consecutive += 1

            if consecutive >= duration_intervals:
                available_slots.append((start_idx, i + 1))
        else:
            consecutive = 0

    return available_slots

Filter by User Availability Window

python
def filter_by_availability_window(available_slots, user_start, user_end, interval_minutes=15):
    """Filter slots to only those within user's available window"""
    user_start_intervals = time_to_minutes(user_start[0], user_start[1]) // interval_minutes
    user_end_intervals = time_to_minutes(user_end[0], user_end[1]) // interval_minutes

    filtered = []
    for start_idx, end_idx in available_slots:
        # Check if slot overlaps with user's availability
        if end_idx > user_start_intervals and start_idx < user_end_intervals:
            # Constrain to user's window
            constrained_start = max(start_idx, user_start_intervals)
            constrained_end = min(end_idx, user_end_intervals)
            filtered.append((constrained_start, constrained_end))

    return filtered

Select Earliest Valid Slot

python
def select_earliest_slot(available_slots, duration_intervals):
    """Select the earliest slot that can fit the duration"""
    for start_idx, end_idx in available_slots:
        slot_duration = end_idx - start_idx
        if slot_duration >= duration_intervals:
            return (start_idx, start_idx + duration_intervals)

    return None

Handle Blue Block Override

python
def create_busy_with_overrides(calendar_events, allow_blue_override=True):
    """Mark busy intervals, but allow blue blocks to be overridden"""
    total_intervals = 24 * 60 // 15
    busy = [False] * total_intervals
    blue_blocks = []

    for event in calendar_events:
        intervals = time_range_to_intervals(
            event['start_hour'], event['start_minute'],
            event['end_hour'], event['end_minute']
        )

        if event.get('color') == 'blue' and allow_blue_override:
            blue_blocks.append((intervals[0], intervals[-1]))
        else:
            for i in intervals:
                if 0 <= i < total_intervals:
                    busy[i] = True

    return busy, blue_blocks

Complete Scheduling Algorithm

python
def schedule_meeting(calendar_events, request):
    """
    Schedule a meeting respecting all constraints

    request = {
        'duration_hours': 1.0,
        'available_times': {'start': (10, 0), 'end': (14, 0), 'timezone': None},
        'timezone': 'US/Eastern'
    }
    """
    duration_minutes = request['duration_hours'] * 60
    duration_intervals = duration_minutes // 15

    # Get busy times and blue overridable blocks
    busy, blue_blocks = create_busy_with_overrides(calendar_events)

    # Find all available slots
    available_slots = find_available_slots(busy, duration_intervals)

    # Filter by user's availability window
    if request['available_times']:
        available_slots = filter_by_availability_window(
            available_slots,
            request['available_times']['start'],
            request['available_times']['end']
        )

    # Select earliest slot
    selected = select_earliest_slot(available_slots, duration_intervals)

    if selected:
        start_intervals, end_intervals = selected
        start_hour, start_min = minutes_to_time(start_intervals * 15)
        end_hour, end_min = minutes_to_time(end_intervals * 15)
        return {
            'start': (start_hour, start_min),
            'end': (end_hour, end_min),
            'success': True
        }

    return {'success': False, 'reason': 'No available slots'}

Advanced: Priority-Based Scheduling

python
def schedule_multiple_meetings(calendar_events, requests, priority_fn=None):
    """
    Schedule multiple meetings, resolving conflicts with priority function

    priority_fn: function that returns numeric priority (higher = more important)
    """
    # Sort by priority
    if priority_fn:
        requests = sorted(requests, key=priority_fn, reverse=True)
    else:
        # Default: earlier constraint window = higher priority
        requests = sorted(
            requests,
            key=lambda r: time_to_minutes(r['available_times']['end'][0], r['available_times']['end'][1])
        )

    scheduled = []
    working_events = calendar_events.copy()

    for request in requests:
        slot = schedule_meeting(working_events, request)
        if slot['success']:
            # Add booked meeting to calendar
            working_events.append({
                'name': f"Meeting: {request['sender']}",
                'start_hour': slot['start'][0],
                'start_minute': slot['start'][1],
                'end_hour': slot['end'][0],
                'end_minute': slot['end'][1],
                'color': 'booked'
            })
            scheduled.append({'request': request, 'slot': slot})

    return scheduled

Best Practices

  1. Always work with intervals to avoid floating-point time issues
  2. Store both interval indices and actual times for clarity
  3. Handle timezone conversions before scheduling
  4. Validate that proposed times fall within business hours
  5. Log which blue blocks were overridden for transparency
  6. Ensure slot duration exactly matches requirement (no partial hours unless specified)

よくある質問

AIスキル「Calendar Scheduling Logic」では何ができますか?

カレンダーの空き時間を見つけ、条件を考慮してミーティングを設定する

TypingMindでCalendar Scheduling Logicを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Calendar Scheduling Logicはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにCalendar Scheduling Logicをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/cxcscmu/SkillLearnBench/tree/main/skills/b1-one-shot-claude-haiku-4-5/schedule-planning/calendar-scheduling-logicを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Calendar Scheduling Logicを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Calendar Scheduling Logicで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもCalendar Scheduling Logicを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Calendar Scheduling Logic」は無料ですか?

はい。cxcscmuがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇