用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/cxcscmu/SkillLearnBench --skill run2-time-formatting命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Handles reading, populating, and saving .docx files using the python-docx library. Use this skill for any tasks involving template filling or modifying Word documents.
Perform various data analysis on SEC 13-F and obtain some insights of fund activities such as number of holdings, AUM, and change of holdings between two quarters.
This skill includes search capability in 13F, such as fuzzy search a fund information using possibly inaccurate name, or fuzzy search a stock cusip info using its name.
基于 SOC 职业分类
正在显示 SKILL.md
| name | run2_time-formatting |
| description | Format dates and times with strict adherence to required formats |
Generate properly formatted date and time strings that exactly match requirements.
Required format: {day_name}, {month} {DD}, {YYYY}
from datetime import datetime
def format_date_strict(date_obj):
"""
Format date exactly as required.
Args:
date_obj: datetime.date or datetime.datetime
Returns:
str: "Monday, March 09, 2026"
Examples:
✓ Monday, March 09, 2026
✓ Thursday, January 08, 2026
✗ Monday, March 9, 2026 (missing leading zero)
✗ March 9, 2026 (missing day name)
✗ Monday, Mar 9, 2026 (abbreviated month)
"""
day_name = date_obj.strftime("%A") # Monday
month_name = date_obj.strftime("%B") # March
day_two_digit = date_obj.strftime("%d") # 09 (ensures leading zero)
year_four_digit = date_obj.strftime("%Y") # 2026
return f"{day_name}, {month_name} {day_two_digit}, {year_four_digit}"
# Test cases
test_dates = [
(datetime(2026, 3, 9), "Monday, March 09, 2026"),
(datetime(2026, 1, 8), "Thursday, January 08, 2026"),
(datetime(2026, 1, 1), "Thursday, January 01, 2026"),
(datetime(2026, 12, 31), "Thursday, December 31, 2026"),
]
for date, expected in test_dates:
result = format_date_strict(date)
assert result == expected, f"Expected '{expected}', got '{result}'"
Required format: {HH:MM AM/PM} - {HH:MM AM/PM}
- (space-dash-space)def format_time_12hr(hour_24, minute=0):
"""
Convert 24-hour time to 12-hour with AM/PM.
Args:
hour_24: 0-23
minute: 0-59
Returns:
(hour_12, minute, is_pm): (1-12, 0-59, bool)
Examples:
13 -> (1, is_pm=True) # 1:00 PM
0 -> (12, is_pm=False) # 12:00 AM
12 -> (12, is_pm=True) # 12:00 PM
"""
is_pm = hour_24 >= 12
hour_12 = hour_24 % 12
if hour_12 == 0:
hour_12 = 12
return (hour_12, minute, is_pm)
def format_time_strict(hour_24, minute=0):
"""
Format time exactly as required.
Args:
hour_24: 0-23 (24-hour format)
minute: 0-59
Returns:
str: "01:00 PM" format
Examples:
✓ 09:00 AM
✓ 01:00 PM
✓ 12:00 PM
✗ 9:00 AM (missing leading zero)
✗ 01:00 pm (lowercase)
✗ 1:00 PM (missing leading zero on hour)
"""
hour_12, minute, is_pm = format_time_12hr(hour_24, minute)
hour_str = str(hour_12).zfill(2) # Ensure 2 digits: 1 -> "01"
minute_str = str(minute).zfill(2) # Ensure 2 digits: 0 -> "00"
period = "PM" if is_pm else "AM"
return f"{hour_str}:{minute_str} {period}"
def format_time_range_strict(start_time, end_time):
"""
Format time range.
Args:
start_time: str "HH:MM" (24-hour) or (hour, minute) tuple
end_time: str "HH:MM" (24-hour) or (hour, minute) tuple
Returns:
str: "09:00 AM - 10:30 AM"
"""
# Parse inputs
(start_time, ):
h, m = (, start_time.split())
start_formatted = format_time_strict(h, m)
:
start_formatted = format_time_strict(*start_time)
(end_time, ):
h, m = (, end_time.split())
end_formatted = format_time_strict(h, m)
:
end_formatted = format_time_strict(*end_time)
format_time_strict() ==
format_time_strict(, ) ==
format_time_strict(, ) ==
format_time_strict(, ) ==
format_time_strict(, ) ==
format_time_range_strict(, ) ==
format_time_range_strict(, ) ==
When showing meeting duration, format as: {duration} hour(s)
def format_duration(hours):
"""
Format duration for display.
Args:
hours: float (1.0, 1.5, 0.75)
Returns:
str: "1 hour(s)" or "1.5 hour(s)"
"""
# Keep decimal if present, otherwise show integer
if hours == int(hours):
return f"{int(hours)} hour(s)"
else:
return f"{hours} hour(s)"
REPLY_TEMPLATE = """Hi,
Thank you for your meeting request.
I can be available:
Date: {date}
Time: {time_range}
Duration: {duration} hour(s)
If this time doesn't work, please let me know your preferred alternatives.
Best regards,
ConSkillBench"""
def generate_reply(date_obj, start_hour_24, start_minute, end_hour_24, end_minute, duration_hours):
"""Generate complete reply with all formatting correct."""
date_str = format_date_strict(date_obj)
time_str = format_time_range_strict((start_hour_24, start_minute), (end_hour_24, end_minute))
duration_str = format_duration(duration_hours)
return REPLY_TEMPLATE.format(
date=date_str,
time_range=time_str,
duration=duration_str
)