hermes - 💡(How to fix) Fix Feature: China legal holiday / workday detection skill (with 调休 support)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Code Example

holiday_dates:          # 33 dates for 2026 (all 7 holidays)
  - "2026-01-01"        # 元旦
  - "2026-02-16"        # 除夕
  - "2026-05-01"        # 劳动节
  - ...
makeup_workdays:        # 6 dates for 2026 (调休补班)
  - "2026-01-04"        # Sunworkday (补元旦)
  - "2026-02-14"        # Satworkday (补春节)
  - ...

---

2026-01-01 元旦: holiday (correct)
2026-01-04 元旦补班(周日): workday (correct)
2026-02-14 春节补班(周六): workday (correct)
2026-02-16 除夕: holiday (correct)
2026-05-01 劳动节: holiday (correct)
2026-05-09 劳动节补班(周六): workday (correct)
2026-10-01 国庆节: holiday (correct)
2026-10-10 国庆补班(周六): workday (correct)
2026-05-26 周二: workday (correct)
2026-05-31 周日: holiday (correct)
RAW_BUFFERClick to expand / collapse

Problem

Cron jobs that use 0 * * * 1-5 (Mon-Fri) or simple date.weekday() < 5 checks don't handle China's legal holiday system correctly. China has:

  • Statutory holidays (春节, 国庆, 五一, etc.) — weekdays that are NOT workdays
  • 调休 (makeup workdays) — weekends (Sat/Sun) that ARE workdays to compensate for long holiday breaks

A simple "Mon-Fri = workday" check fails on both counts. Third-party APIs are unreliable (may go down, change pricing, or lag behind the annual update cycle).

Solution: china-holidays skill

I built and tested a skill + script that:

  1. Caches data locally from the single authoritative source — 国务院办公厅 (State Council) official notices published each November on www.gov.cn
  2. Zero network dependency at runtime — reads from ~/.hermes/knowledge/work/holidays-{year}.md
  3. Three-tier fallback: local file → chinesecalendar library → simple Mon-Fri
  4. Unified entry point: check-workday.py → exit 0 (workday) / exit 1 (holiday)

Data format (stored in knowledge file)

holiday_dates:          # 33 dates for 2026 (all 7 holidays)
  - "2026-01-01"        # 元旦
  - "2026-02-16"        # 除夕
  - "2026-05-01"        # 劳动节
  - ...
makeup_workdays:        # 6 dates for 2026 (调休补班)
  - "2026-01-04"        # Sun → workday (补元旦)
  - "2026-02-14"        # Sat → workday (补春节)
  - ...

Where it fits in Hermes

The skill document lives at ~/.hermes/skills/work/china-holidays/SKILL.md and the script at ~/.hermes/scripts/check-workday.py. It integrates with cron jobs via:

  • no_agent scripts: add import check_workday; if not is_workday(): sys.exit(0) at the top
  • agent cron jobs: run check-workday.py as the first step; exit 1 → skip silently

The atlas-workflow-os skill already references this as a cron constraint.

What I'm requesting

Consider adding this as a built-in feature or a hub skill in Hermes Agent. Specifically:

  1. A china-holidays skill in the skills hub
  2. Or native cronjob support for holiday-aware scheduling (e.g., schedule: "0 * * * *" + holiday_calendar: china)
  3. The annual update cycle (November each year) could be a community-maintained data file

Verification

Tested all 10 edge cases for 2026 and they pass:

✅ 2026-01-01 元旦: holiday (correct)
✅ 2026-01-04 元旦补班(周日): workday (correct)
✅ 2026-02-14 春节补班(周六): workday (correct)
✅ 2026-02-16 除夕: holiday (correct)
✅ 2026-05-01 劳动节: holiday (correct)
✅ 2026-05-09 劳动节补班(周六): workday (correct)
✅ 2026-10-01 国庆节: holiday (correct)
✅ 2026-10-10 国庆补班(周六): workday (correct)
✅ 2026-05-26 周二: workday (correct)
✅ 2026-05-31 周日: holiday (correct)

Happy to contribute the skill files if there is interest.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING