Skip to content
Agentmart
Submit a tool

calendar-scheduling-logic

Find available time slots in a calendar and schedule meetings while respecting constraints

Skill by cxcscmu

IndexedMIT★ 91
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/cxcscmu-calendar-scheduling-logic

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Find available time slots in a calendar and schedule meetings while respecting constraints

Use cases: productivity

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/calendar-scheduling-logic

What's inside

Skill name
calendar-scheduling-logic
Description
Find available time slots in a calendar and schedule meetings while respecting constraints
License
MIT
Instructions
249 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# 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

From cxcscmu/SkillLearnBench, MIT.

More from cxcscmu/SkillLearnBench

Signals

Stars
91
Forks
7
Open issues
6
Last commit (this folder)
Apr 24, 2026 (6 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from cxcscmu

Cite this page

calendar-scheduling-logic skill. Agent Mart. https://agentmart.dev/skills/cxcscmu-calendar-scheduling-logic (last updated 2026-10-24)