← 返回 Skills 市场
manucode2000-max

Chinese Workdays

作者 manucode2000-max · GitHub ↗ · v2.0.0 · MIT-0
cross-platform ✓ 安全检测通过
141
总下载
0
收藏
1
当前安装
2
版本数
在 OpenClaw 中安装
/install chinese-workdays
功能描述
Calculate legal working days in China according to official government holiday schedules. Uses State Council-published arrangements to exclude weekends, publ...
使用说明 (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.

安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install chinese-workdays
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /chinese-workdays 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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号)
元数据
Slug chinese-workdays
版本 2.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 2
常见问题

Chinese Workdays 是什么?

Calculate legal working days in China according to official government holiday schedules. Uses State Council-published arrangements to exclude weekends, publ... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 141 次。

如何安装 Chinese Workdays?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install chinese-workdays」即可一键安装,无需额外配置。

Chinese Workdays 是免费的吗?

是的,Chinese Workdays 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Chinese Workdays 支持哪些平台?

Chinese Workdays 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Chinese Workdays?

由 manucode2000-max(@manucode2000-max)开发并维护,当前版本 v2.0.0。

💬 留言讨论