.cursor/skills/weekday-skip-days/SKILL.md
Compute weekdays correctly for calendars where some days (intercalary/epagomenal) are excluded from the weekday cycle. Use when implementing or debugging weekday logic with “skipped days”, “epagomenal”, “intercalary”, or “non-weekday” days.
npx skillsauth add CodapopKSP/LibraryOfTime weekday-skip-daysInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
When a calendar defines a weekday cycle but explicitly excludes certain days (for example: intercalary days, mid-year days, festival-only epagomenal days), compute weekdays using the count of regular days that participate in the cycle—not using the raw day index.
Identify, for the calendar rules you’re implementing:
Record your “skipped day set” in terms of the calendar’s internal indexing (e.g., specific dayIndex values within a year, or rule-based offsets like “the extra leap intercalary day”).
Find the weekday anchor (examples):
dayIndex = 0 (year start) is known.Let anchorWeekdayIndex be an integer in [0..6] for the weekday name order used by the calendar implementation.
Compute how many days have elapsed since the anchor, but subtract any skipped days that occurred in that span:
regularDaysElapsed = totalDaysElapsed - skippedDaysInSpan
Then:
weekdayIndex = (anchorWeekdayIndex + regularDaysElapsed) % 7
dayIndex % 7 on skipped daysAvoid patterns like:
weekdayNames[dayIndex % 7]weekdayNames[(dayIndex + k) % 7]These implicitly advance weekdays across skipped days and will be wrong whenever skipped days occur between the anchor and the target date.
Choose a consistent display strategy and keep it stable:
Regardless of display choice: the next regular day must resume weekday progression as if the skipped day did not exist.
Add/ensure tests at minimum:
Also test with at least one leap-year (if leap days change which days are skipped).
If your UI supports timezone offsets, ensure that:
MIDNIGHT adjustment).dayIndex / day boundary.If the project supports BCE/negative years, ensure your modulus logic works for negative regularDaysElapsed (normalize with ((n % 7) + 7) % 7 style normalization).
const weekdayIndex = ((anchorWeekdayIndex + regularDaysElapsed) % 7 + 7) % 7;
return weekdayNames[weekdayIndex];
if (isSkippedDay) return `${specialDayLabel}\nWeekday: (skipped)`;
return `${specialDayLabel}\nWeekday: ${weekdayNames[weekdayIndex]}`;
development
Catalogs common implementation patterns used by existing calendars and timekeeping systems in the Library of Time, with examples and guidance on when to use each pattern. Use when choosing how to structure a new calendar’s algorithm.
tools
Use user-provided month names or labels in calendar implementations and output. Use when implementing or updating a calendar and the user has given a list of month names (including for leap months), so the implementation does not default to numeric-only output.
development
Designs and implements complete calendar and timekeeping calculation modules for the Library of Time project, including algorithms, date conversions, and tests. Use when working on calendar logic, adding a new calendar, or one-shotting an entire calendar implementation from a prompt. Treat `CalendarAPI/Calendars/*`, `CalendarAPI/Timekeeping/*`, and `CalendarAPI/Other/*` as a single Calendar API layer.
development
Encodes conventions and logic patterns for building calendars and timekeeping systems in the Library of Time project, including preferred use of utilities like createAdjustedDateTime, timezone handling, and epoch selection. Use when implementing or refactoring calendar logic so behavior matches existing systems.