← Back to Skills Marketplace
manucode2000-max

Chinese Workdays

by manucode2000-max · GitHub ↗ · v2.0.0 · MIT-0
cross-platform ✓ Security Clean
141
Downloads
0
Stars
1
Active Installs
2
Versions
Install in OpenClaw
/install chinese-workdays
Description
Calculate legal working days in China according to official government holiday schedules. Uses State Council-published arrangements to exclude weekends, publ...
README (SKILL.md)

Chinese Workdays Calculator

Calculate the number of working days between two dates according to Chinese government holiday schedules.

Features

  • 📅 Uses official Chinese holiday schedules published by the State Council
  • 🔢 Calculates法定工作日 (legal working days) excluding weekends and public holidays
  • 📊 Supports holiday makeup workdays (调休补班)
  • 🗂️ Stores yearly holiday schedules in simple YAML data files
  • 🔄 Can be updated when new annual holiday arrangements are released
  • 📊 Provides monthly and yearly statistics
  • 🤖 CLI tool for quick calculations

Quick Start

Basic calculation

from chinese_workdays import ChineseWorkdays

calc = ChineseWorkdays()
workdays = calc.count_workdays("2026-01-01", "2026-12-31")
print(f"2026年全年工作日: {workdays}天")

Monthly statistics

march_workdays = calc.get_workdays_in_month(2026, 3)  # 22天

Usage Examples

How many working days are there in March 2026?
Working days in Q1 2026?
Calculate workdays between 2026-02-10 and 2026-03-20
How many workdays in 2026?

Command Line

# Quick calculations
python workdays_cmd.py 2026-03          # March 2026
python workdays_cmd.py 2026-Q1          # Q1 2026
python workdays_cmd.py 2026             # Full year
python workdays_cmd.py 2026-01-01 2026-06-30  # Custom range

Data Format

Holiday schedules are stored in YAML format in the data/ directory:

year: 2026
country: "China"
holidays:
  - name: "元旦"
    start: "2026-01-01"
    end: "2026-01-03"
    days_off: ["2026-01-01", "2026-01-02"]  #放假日期
    makeup_workdays: ["2025-12-28", "2026-01-04"]  # 调休上班
    note: "官方通知原文"

Updating Schedules

The State Council releases next year's holiday arrangement in November. Update the YAML file accordingly:

  1. Locate the official notice at https://www.gov.cn/gongbao/
  2. Extract dates and makeup workdays
  3. Edit data/2027.yaml (or the relevant year)

Implementation Details

  • Uses Python's datetime for date arithmetic
  • Holiday data stored as YAML for easy editing
  • Supports makeup workdays that override weekend status
  • Handles holidays that span multiple days

Limitations

  • Requires holiday schedules to be defined for the years being calculated
  • Only works for dates after 2000 (easily extendable)
  • Does not automatically fetch new schedules (manual update needed)
  • Data accuracy depends on correct YAML configuration

Examples of Output

📅 工作日统计
📊 期间: 2026-01-01 至 2026-12-31
📏 总天数: 365
💼 法定工作日: 248 天

工作日占比: 68.0%

📋 期间包含的节假日:
  • 元旦: 2026-01-01 ~ 2026-01-03
  • 春节: 2026-02-15 ~ 2026-02-23
  ...

Technical Notes

Calculation Priority

  1. Makeup workdays (highest priority) → always counted as working days
  2. Public holidays → excluded from working days
  3. Weekends (Saturday/Sunday) → excluded unless makeup workday
  4. Regular weekdays → counted as working days

Algorithm

for each day in date_range:
    if day in makeup_workdays:
        count += 1
    elif day in public_holidays:
        skip
    elif day is weekend:
        skip
    else:
        count += 1

Files Structure

chinese-workdays/
├── SKILL.md              # This file
├── __init__.py           # Package entry point
├── chinese_workdays.py   # Core calculation engine
├── workdays_cmd.py       # CLI tool
├── README.md             # User documentation (optional)
└── data/
    ├── 2026.yaml         # 2026 holiday schedule (official)
    └── 2027.yaml         # 2027 holiday schedule (template)

License

MIT License - Free to use and modify.

Usage Guidance
This skill appears coherent and implements a local calculator using the included YAML holiday schedules. Before installing: (1) be aware it requires PyYAML to parse the YAML files; (2) it may create or write YAML files under the package's data directory (this is not network I/O but will write to disk); (3) PUBLISH.md and subscription.json mention publishing/pricing and automated yearly updates, but the shipped code does not perform automatic network updates — updates are manual by editing the YAML files; (4) review the included YAML data for accuracy if you rely on it for official or business-critical calculations. No credentials or network endpoints are requested by the code, so there is no sign of data exfiltration.
Capability Analysis
Type: OpenClaw Skill Name: chinese-workdays Version: 2.0.0 The skill is a legitimate utility for calculating Chinese working days based on official government holiday schedules. The implementation uses security best practices such as `yaml.safe_load` to prevent deserialization attacks and contains no suspicious network calls, file system exfiltration, or malicious prompt injection instructions. The logic in `chinese_workdays.py` and the data in the `data/` directory are entirely consistent with the stated purpose.
Capability Assessment
Purpose & Capability
Name/description (calculate Chinese legal workdays) matches the code and included YAML data files. Required resources are local files and PyYAML; nothing requests unrelated cloud credentials or binaries.
Instruction Scope
SKILL.md instructions align with the implementation (manual update of YAML, local calculations, CLI examples). The code will create example YAML files under the package data directory if the data folder is missing — this is reasonable but worth noting because it writes files into the package path. PUBLISH.md mentions automated yearly updates, but the code contains no auto-update or network-fetch logic (the README/skill says manual update); this is an inconsistency in documentation/roadmap only.
Install Mechanism
No install spec provided; skill is a normal Python package with source files and YAML data. There are no remote downloads or extract steps, and no unusual install locations. PyYAML is used (declared in PUBLISH.md), so runtime dependency installation is required but expected.
Credentials
The skill requires no environment variables, credentials, or config paths. All data is local YAML. No secrets are requested or referenced by the code or SKILL.md.
Persistence & Privilege
always is false and the skill does not request persistent system privileges or modify other skills. It writes example YAML into its data directory if missing (normal for a data-driven package) but does not alter system-wide settings.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install chinese-workdays
  3. After installation, invoke the skill by name or use /chinese-workdays
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v2.0.0
Complete historical coverage: 21 years of official Chinese holiday data (2007-2019, 2020-2027). Added 2017 (National Day + Mid-Autumn merged). Covers complete evolution from 4-holiday system through 7-holiday revolution, all variations, to modern refinements. Extreme cases: highest 253 workdays (2008), lowest 246 (2017). Production-ready with authoritative government data. Pricing via subscription.json.
v1.0.0
Initial release with 2026 official holiday data (国办发明电〔2025〕7号)
Metadata
Slug chinese-workdays
Version 2.0.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 2
Frequently Asked Questions

What is Chinese Workdays?

Calculate legal working days in China according to official government holiday schedules. Uses State Council-published arrangements to exclude weekends, publ... It is an AI Agent Skill for Claude Code / OpenClaw, with 141 downloads so far.

How do I install Chinese Workdays?

Run "/install chinese-workdays" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Chinese Workdays free?

Yes, Chinese Workdays is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Chinese Workdays support?

Chinese Workdays is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Chinese Workdays?

It is built and maintained by manucode2000-max (@manucode2000-max); the current version is v2.0.0.

💬 Comments