TopRank Skills

Home / Claw Skills / Git / GitHub / lunar-calendar
Official OpenClaw rules 36%

lunar-calendar

中国农历/阴历的专业查询工具。 核心能力: - 公历转农历(干支纪年、生肖、闰月标志) - 农历转公历(支持闰月精准转换) - 黄历宜忌查询(嫁娶、动土、开市等) - 节气查询(24节气精准到秒级) 触发场景:当用户询问"农历"、"黄历"、"宜忌"、"阴历"、"八字基础"、"春节日期"、"闰月"或需要处理中国传统历法计算时强制激活。 输出物:结构化日期信息 + 宜忌表 + 节气标识。

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 lunar-calendar 技能。 若已安装,则直接安装 lunar-calendar 技能。

Overview

Skill Key
hehuibiao/lunar-calendar
Author
hehuibiao
Source Repo
openclaw/skills
Version
v0.9.0
Source Path
skills/hehuibiao/lunar-calendar
Latest Commit SHA
b2b6075b70b1de56b7eb45d471e3297c498c6679

Extracted Content

SKILL.md excerpt

<skill_body>
## 🎯 Purpose
提供精确到秒级的中国传统农历(夏历)转换与查询服务。本技能是**确定性计算任务**,严禁依赖大模型内部参数化的农历记忆(该记忆存在闰月错位风险),必须通过脚本执行可靠算法。

## ⏰ When to Use
- ✅ 用户输入中包含"农历"、"阴历"、"黄历"、"宜忌"、"干支"、"生肖"、"节气"
- ✅ 需要将公历日期转换为"乙巳年、正月十五"等中式表述
- ✅ 需要判断某日是否"宜嫁娶"、"忌开市"
- ✅ 查询二十四节气的具体交节时刻
- ❌ 用户仅询问"今天是几号"(请留给通用对话能力)

## 🧠 Process (低自由度·严格模式)

### 步骤1:意图识别与参数提取
- 判断转换方向:`公历→农历` / `农历→公历` / `宜忌查询`
- 提取核心参数:
  - 公历日期(如 `2026-02-13`)
  - 农历表述(如 `二零二六年腊月廿三`、`闰七月`)
  - 具体需求(仅日历/仅宜忌/详细解读)

### 步骤2:调用专用脚本(严禁自行编写)
<critical_rule status="最高优先级">
你**不得**尝试用Python代码现场计算农历。农历涉及复杂置闰规则和定朔算法,运行时现场编写的代码存在计算错误风险。
你必须直接调用 `scripts/lunar_calculator.py`。
</critical_rule>

- 调用格式示例:
```bash
python scripts/lunar_calculator.py --solar 2026-02-13
python scripts/lunar_calculator.py --lunar "2026-07-23" --leap false
python scripts/lunar_calculator.py --solar 2026-02-13 --with-fortune true
```

### 步骤3:按需加载参考资源
- 如需输出"详细宜忌解读",必须先读取 references/fortune_rules.md
- 如需解释"节气原理",读取 references/solar_terms.md
- 严禁将上述Reference全文塞入上下文,仅读取所需章节。

### 步骤4:结构化组装输出
强制使用以下固定模板,禁止自由发挥格式:
```xml
<lunar_query_result>
<solar_date>{{输入或计算出的公历日期}}</solar_date>
<lunar_date>
  <year>{{干支年}}({{生肖}})</year>
  <month>{{农历月}}{{闰月标识}}</month>
  <day>{{农历日}}</day>
  <festival>{{若有传统节日}}</festival>
</lunar_date>
<solar_term>{{节气名称}}({{交节时间}})</solar_term>
<fortune>
  <suitable>{{宜:条目1、条目2}}</suitable>
  <avoid>{{忌:条目1、条目2}}</avoid>
</fortune>
</lunar_query_result>
```

## 🔍 Decision Logic
```mermaid
graph TD
A[用户输入] --> B{包含农历/黄历关键词?}
B -->|否| C[...

README excerpt

# 农历生日提醒系统 - 专业农历计算系统

![版本](https://img.shields.io/badge/版本-v0.9.0-blue)
![Python](https://img.shields.io/badge/Python-3.6%2B-green)
![授权](https://img.shields.io/badge/授权-MIT-lightgrey)
![作者](https://img.shields.io/badge/作者-夏暮辞青-orange)

## 🌟 项目简介

**农历生日提醒系统**是一个基于专业农历计算库的农历计算系统,提供公历与农历之间的精确转换。当前版本v0.9.0为参考版本,已通过多个关键日期验证,计算结果与华为手机等数据源一致。

## 🎯 核心特性

### ✅ 已验证功能
- **专业库集成**: 使用lunardate专业农历计算库
- **双向转换**: 公历↔农历精确转换
- **已知验证**: 5个春节日期100%准确验证
- **一致性**: 与华为手机数据一致

### 📊 验证示例
| 农历日期 | 公历日期 | 验证状态 |
|---------|---------|---------|
| 2037年九月初五 | 2037-10-13 | ✅ 与华为手机一致 |
| 2026年春节 | 2026-02-17 | ✅ 已验证 |
| 2025年春节 | 2025-01-29 | ✅ 已验证 |
| 2024年春节 | 2024-02-10 | ✅ 已验证 |

## 🚀 快速开始

### 安装
```bash
# 克隆仓库
git clone https://github.com/xiamuciqing/lunar-birthday-reminder.git
cd lunar-birthday-reminder

# 安装依赖
pip install lunardate cnlunar
```

### 基本使用
```python
# 公历转农历
python scripts/lunar_calculator.py --solar 2026-02-17

# 农历转公历
python scripts/lunar_calculator.py --lunar "2037-09-05"

# 运行演示
python scripts/demo_lunar.py

# 验证系统
python scripts/simple_validator.py
```

### 在OpenClaw中使用
当用户询问以下内容时自动激活:
- "农历"、"阴历"、"黄历"、"宜忌"
- "干支"、"生肖"、"节气"
- "春节日期"、"闰月"等

## 📁 项目结构

```
lunar-birthday-reminder/
├── SKILL.md                    # OpenClaw技能元数据
├── README.md                   # 项目文档
├── package.json               # 项目配置
├── RELEASE_v0.9.0.md          # 发布说明
├── scripts/
│   ├── lunar_calculator.py    # 农历计算核心
│   ├── validate_lunar.py      # 验证脚本
│   ├── simple_validator.py    # 简化验证
│   ├── demo_lunar.py          # 演示脚本
│   └── publish.sh             # 发布脚本
├── references/
│   ├── fortune_rules.md       # 黄历宜忌规则
│   └──...

Related Claw Skills