원클릭으로
util-resolve-date
Resolve flexible time expressions (tomorrow, next monday, last week) to concrete dates
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Resolve flexible time expressions (tomorrow, next monday, last week) to concrete dates
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Ada, your Executive Assistant. Runs planning and reflection rituals by coordinating domain assistants.
Calendar assistant. Meeting prep, day shape analysis, and post-meeting reflection.
Projects assistant. Tracks project status, blockers, and next actions.
Relationships assistant. Tracks people touchpoints, connection intentions, and relationship health.
Obsidian CLI for vault search, backlinks, links, tags, and file operations. Use when fetching related content or interacting with Obsidian programmatically. Requires Obsidian v1.12+ with CLI enabled.
Achievements assistant. Captures wins, accomplishments, and evidence of impact.
| name | _util-resolve-date |
| description | Resolve flexible time expressions (tomorrow, next monday, last week) to concrete dates |
| disable-model-invocation | true |
Parse flexible time expressions and resolve to concrete dates for skill execution.
$1 (time_expression) — Optional. Time expression to resolve. Can be:
$2 (session_dir) — Required. Session directory path where dates.md will be writtenResolve the time expression using macOS date commands and write results to dates.md in the session directory.
#!/bin/bash
set -euo pipefail
time_expr="${1:-today}"
session_dir="${2:?Error: session directory required}"
# Ensure session directory exists
if [[ ! -d "$session_dir" ]]; then
echo "Error: Session directory does not exist: $session_dir" >&2
exit 1
fi
# Initialize variables
target_date=""
scope="day"
relative=""
day_of_week=""
week_start=""
week_end=""
declare -a workdays=()
# Normalize input: lowercase and trim whitespace
time_expr_lower=$(echo "$time_expr" | tr '[:upper:]' '[:lower:]')
time_expr_lower="${time_expr_lower#"${time_expr_lower%%[![:space:]]*}"}" # trim leading
time_expr_lower="${time_expr_lower%"${time_expr_lower##*[![:space:]]}"}" # trim trailing
# Resolve based on expression
case "$time_expr_lower" in
""|"today")
target_date=$(date +"%Y-%m-%d")
scope="day"
relative="today"
;;
"tomorrow")
target_date=$(date -v+1d +"%Y-%m-%d")
scope="day"
relative="tomorrow"
;;
"next monday"|"next tuesday"|"next wednesday"|"next thursday"|"next friday"|"next saturday"|"next sunday")
# Extract day name
day_name=$(echo "$time_expr_lower" | cut -d' ' -f2)
# Validate day name is not empty
if [[ -z "$day_name" ]]; then
echo "Error: Day name required after 'next' (e.g., 'next monday')" >&2
exit 1
fi
# Map day names to macOS date -v weekday flags
case "$day_name" in
"sunday") target_date=$(date -v+sunday +"%Y-%m-%d"); day_of_week="Sunday" ;;
"monday") target_date=$(date -v+monday +"%Y-%m-%d"); day_of_week="Monday" ;;
"tuesday") target_date=$(date -v+tuesday +"%Y-%m-%d"); day_of_week="Tuesday" ;;
"wednesday") target_date=$(date -v+wednesday +"%Y-%m-%d"); day_of_week="Wednesday" ;;
"thursday") target_date=$(date -v+thursday +"%Y-%m-%d"); day_of_week="Thursday" ;;
"friday") target_date=$(date -v+friday +"%Y-%m-%d"); day_of_week="Friday" ;;
"saturday") target_date=$(date -v+saturday +"%Y-%m-%d"); day_of_week="Saturday" ;;
*)
echo "Error: Invalid day name: $day_name" >&2
exit 1
;;
esac
# macOS date -v+weekday returns current day if today is that weekday
# For "next monday", we want the NEXT occurrence, so add 7 days if result is today
if [[ "$target_date" == "$(date +"%Y-%m-%d")" ]]; then
target_date=$(date -j -f "%Y-%m-%d" -v+7d "$target_date" +"%Y-%m-%d")
fi
scope="day"
relative="next $day_name"
;;
"last week")
# Calculate previous week's Monday-Friday range
# Strategy: Go to most recent Monday, then back 7 days to get last week's Monday
week_start=$(date -v-monday -v-7d +"%Y-%m-%d")
week_end=$(date -v-monday -v-7d -v+4d +"%Y-%m-%d")
target_date="$week_start"
scope="week"
relative="last week"
# Generate array of workdays (Monday through Friday of last week)
base_date="$week_start"
workdays+=($(date -j -v+0d -f "%Y-%m-%d" "$base_date" +"%Y-%m-%d"))
workdays+=($(date -j -v+1d -f "%Y-%m-%d" "$base_date" +"%Y-%m-%d"))
workdays+=($(date -j -v+2d -f "%Y-%m-%d" "$base_date" +"%Y-%m-%d"))
workdays+=($(date -j -v+3d -f "%Y-%m-%d" "$base_date" +"%Y-%m-%d"))
workdays+=($(date -j -v+4d -f "%Y-%m-%d" "$base_date" +"%Y-%m-%d"))
;;
[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9])
# Validate ISO date format
if date -j -f "%Y-%m-%d" "$time_expr_lower" >/dev/null 2>&1; then
target_date="$time_expr_lower"
scope="day"
relative="$time_expr_lower"
else
echo "Error: Invalid date format: $time_expr_lower (expected YYYY-MM-DD)" >&2
exit 1
fi
;;
*)
echo "Error: Unsupported time expression: $time_expr_lower" >&2
echo "Supported: today, tomorrow, next <weekday>, last week, YYYY-MM-DD" >&2
exit 1
;;
esac
# Write dates.md
dates_file="$session_dir/dates.md"
{
echo "# Date Context"
echo ""
echo "target_date: $target_date"
echo "scope: $scope"
echo "relative: $relative"
if [[ -n "$day_of_week" ]]; then
echo "day_of_week: $day_of_week"
fi
if [[ -n "$week_start" ]]; then
echo "week_start: $week_start"
fi
if [[ -n "$week_end" ]]; then
echo "week_end: $week_end"
fi
if [[ ${#workdays[@]} -gt 0 ]]; then
echo "workdays:"
for workday in "${workdays[@]}"; do
echo " - $workday"
done
fi
} > "$dates_file"
# Output confirmation
echo "Resolved '$time_expr' to dates.md:"
cat "$dates_file"
The skill writes dates.md to the session directory with this structure:
# Date Context
target_date: 2026-02-15
scope: day
relative: today
For "next monday":
# Date Context
target_date: 2026-02-17
scope: day
relative: next monday
day_of_week: Monday
For "last week":
# Date Context
target_date: 2026-02-03
scope: week
relative: last week
week_start: 2026-02-03
week_end: 2026-02-07
workdays:
- 2026-02-03
- 2026-02-04
- 2026-02-05
- 2026-02-06
- 2026-02-07
The skill exits with non-zero status and writes to stderr for:
# Today
session_dir=$(mktemp -d)
claude skill run resolve-dates -- "" "$session_dir"
# Tomorrow
session_dir=$(mktemp -d)
claude skill run resolve-dates -- "tomorrow" "$session_dir"
# Next Monday
session_dir=$(mktemp -d)
claude skill run resolve-dates -- "next monday" "$session_dir"
# Last week
session_dir=$(mktemp -d)
claude skill run resolve-dates -- "last week" "$session_dir"
# Specific date
session_dir=$(mktemp -d)
claude skill run resolve-dates -- "2026-03-15" "$session_dir"
date -v flags for date arithmetic-v+monday syntax finds the next Monday, OR returns current day if today is Monday