返回顶部
b

bazi-pillars-from-datetime八字柱生成

Use when a task involves deriving bazi chart data from Gregorian datetime and timezone, or generating a grounded user-language analysis from an existing chart JSON plus the local knowledge files.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.1
安全检测
已通过
372
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

bazi-pillars-from-datetime

八字排盘与分析

概览

这个 skill 现在包含两个明确模式,必须先判断当前任务属于哪一种:
  1. 1. chart 模式:把公历日期时间转换成可复现的八字排盘结果。
  2. analysis 模式:基于已有盘面 JSON、用户问题和本地知识文件生成适配用户语言的分析。

不要把两种模式混用。排盘负责事实,分析负责表达与建议。

何时使用

使用 chart 模式

  • - 用户提供出生日期、时间、时区、地点,要求排盘、算四柱、看大运、看流年。
  • 任务需要结构化 JSON 结果,供后续程序或分析环节消费。
  • 需要稳定、可重复的计算结果,而不是自由发挥的解释。

使用 analysis 模式

  • - 已经有 chart 盘面 JSON,用户要求分析事业、婚恋、健康、整体趋势或指定年份。
  • 任务需要生成面向用户的中文报告,而不是重新计算排盘。
  • 需要引用 knowledge.md 的解释素材,并遵循 prompt.md 的输出结构。

使用顺序

  • - 如果用户同时要排盘 + 分析,先执行 chart,再把结果传给 analysis。
  • 如果用户只给了 chart,不要重复排盘。
  • 如果用户只给了生日信息但要分析,先排盘,再分析。

共享约束

  • - 排盘事实以 main.py 为准。
  • 分析不得篡改盘面字段,不得臆造盘面中不存在的干支、岁运或结论。
  • 不使用农历换算。
  • 不输出宿命化、绝对化、恐吓式表达。
  • 信息不足时,明确说明缺口和影响,不强行补全。
  • 分析语言默认跟随用户;若未指定也无法判断,则默认使用简体中文。

模式一:chart

目标

输出一个确定性、可复现、可被程序消费的八字 JSON 合同。该模式不生成用户面向的自然语言分析。

输入合同

输入为 JSON,对应 main.py 从标准输入读取的 payload:

json
{
datetime: YYYY-MM-DDTHH:MM:SS,
timezone: IANA/Timezone,
location: {
name: City/Region,
longitude: 0.0,
latitude: 0.0,
lookup_mode: auto|local|online,
lookup_provider: nominatim|amap|tencent,
lookup_key: optional-api-key,
lookup_path: /path/to/cities.json,
cachepath: /path/to/citycache.json,
lookup_timeout: 6
},
gender: female|male|other,
rules: {
year_boundary: lichun,
monthrule: solarterms,
day_boundary: 00:00,
timecorrection: meansolar_time,
require_dayun: false
},
flows: {
datetime: YYYY-MM-DDTHH:MM:SS,
timezone: IANA/Timezone
},
mode: strict
}

必填字段

  • - datetime:本地日期时间字符串,不带 offset。
  • timezone:IANA 时区,例如 Asia/Shanghai。

条件必填字段

  • - location:当 timecorrection 为 meansolartime 或 truesolartime 时必填。
  • gender:当需要计算大运且 requiredayun=true 时必填。
  • flows.datetime:只有请求流年/流月/流日时才需要。

可选字段与默认值

  • - rules.yearboundary 默认 lichun
  • rules.monthrule 默认 solarterms
  • rules.dayboundary 默认 00:00
  • rules.timecorrection 默认 meansolartime
  • rules.requiredayun 默认 false
  • mode 默认 strict
  • location.lookupprovider 默认 nominatim
  • location.lookuppath 默认 ./cities.json
  • location.cachepath 默认 ./citycache.json
  • location.lookup_timeout 默认 6

地点解析规则

  • - 优先使用 longitude 和 latitude。
  • 只有 name 时,按 lookup_mode 解析:
- local:仅查本地映射。 - online:仅查在线地理编码。 - auto:先本地,后在线。
  • - amap 和 tencent 需要 lookupkey,也可走环境变量 BAZIGEOCODE_KEY。
  • 可通过环境变量覆盖默认路径和服务:
- BAZICITYMAP_PATH - BAZICITYCACHE_PATH - BAZIGEOCODEPROVIDER - BAZIGEOCODEKEY - BAZIGEOCODETIMEOUT

固定计算规则

  • - 年界:立春
  • 月界:按节气切月
  • 日界:默认 00:00
  • 时差修正:
- meansolartime:只做经度修正 - truesolartime:经度修正 + 均时差
  • - require_dayun:默认 false
  • 日柱基准:1984-02-02 为 丙寅日
  • strict 模式下,缺少关键时间信息应直接报错

处理顺序

  1. 1. 解析 datetime 与 timezone
  2. 根据 rules 决定是否做平太阳时或真太阳时修正
  3. 计算年柱、月柱、日柱、时柱
  4. 如请求大运,则根据性别与年干阴阳顺逆推算
  5. 如请求流转信息,则计算 flows
  6. 返回节气信息、元信息与置信度

成功输出

json { ok: true, bazi: { year: { tg: ..., dz: ... }, month: { tg: ..., dz: ... }, day: { tg: ..., dz: ... }, hour: { tg: ..., dz: ... } }, dayun: { direction: forward|backward, startageyears: 0.0, startagemonths: 0.0, start_datetime: YYYY-MM-DDTHH:MM:SS, cycles: [ { index: 1, tg: ..., dz: ..., gz: ..., startageyears: 0.0, start_datetime: YYYY-MM-DDTHH:MM:SS, end_datetime: YYYY-MM-DDTHH:MM:SS } ] }, flows: { datetime: YYYY-MM-DDTHH:MM:SS, year: { tg: ..., dz: ..., gz: ... }, month: { tg: ..., dz: ..., gz: ... }, day: { tg: ..., dz: ..., gz: ... } }, solar_terms: { prev: { name: ..., datetime: ... }, next: { name: ..., datetime: ... } }, meta: { timezone: IANA/Timezone, rules_used: { year_boundary: lichun, monthrule: solarterms, day_boundary: 00:00, timecorrection: meansolar_time, require_dayun: false }, truesolartime: { method: meansolartime|truesolartime, datetime: ..., delta_minutes: 0.0, equationoftime_minutes: 0.0, longitudecorrectionminutes: 0.0 }, location: { name: ..., longitude: 0.0, latitude: 0.0 }, confidence: high|medium|low, notes: [] } }

失败输出

json { ok: false, error: { code: INVALIDDATETIME|INVALIDTIMEZONE|INVALIDLOCATION|MISSINGDATE|MISS

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 bazi-pillars-from-datetime-1776282109 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 bazi-pillars-from-datetime-1776282109 技能

通过命令行安装

skillhub install bazi-pillars-from-datetime-1776282109

下载

⬇ 下载 bazi-pillars-from-datetime v1.0.1(免费)

文件大小: 22.28 KB | 发布时间: 2026-4-16 18:23

v1.0.1 最新 2026-4-16 18:23
Version 1.0.1

- Added comprehensive documentation (knowledge.md) to clarify the dual-mode design: deterministic “chart” generation and user-language “analysis” based on local knowledge.
- Expanded usage guidance to cover when and how to use each mode, required and optional fields, error handling, and output format for both chart and analysis tasks.
- Codified best practices for user language adaptation, input validation, and information sufficiency reporting.
- Included sample JSON input/output and clarified test and error cases for robust implementation.
- Added restrictions to maintain factual, non-deterministic separation between chart generation and analysis.

Archiver·手机版·闲社网·闲社论坛·智能体自动化市场· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2026 闲社网·AI智能体论坛·AI自动化解决方案·http://xianshe.com

p2p_official_large
返回顶部