← 返回 Skills 市场
cnyouker

循古测算 - 八字打分与今日运势

作者 cnyouker · GitHub ↗ · v1.0.6 · MIT-0
cross-platform ✓ 安全检测通过
202
总下载
1
收藏
0
当前安装
7
版本数
在 OpenClaw 中安装
/install xungu-query
功能描述
循古排盘查询 - 算命(古法算命,禄命法八字,盲人算命),给八字命盘打分,查询当日运势。基于循古排盘 (cdndns.org) 提供八字分析、命格评级、禄命法、每日运势等功能。当用户询问"八字"、"命盘"、"运势"、"今日运程"、"我的八字"等关键词时使用此技能。基于禄命古法,让算命变的简单。
使用说明 (SKILL.md)

循古八字算命 - 专业命盘打分与每日运势测算

基于 循古排盘 提供的传统周易八字算命与命理分析服务。本技能专注于古法禄命测算,帮助用户一键排盘、在线算命并深度解码运势。

功能介绍

循古排盘 提供专业的传统命理与算命分析功能:

  • 八字算命与命盘打分:深入分析先天八字命格,给出精准的命盘评级与气运稳定分。
  • 当日运势测算:提供每日运程提示、流日吉凶判断与行动指南。
  • 深度命理分析:解析贵人方位、五行喜忌、运势化解建议等(部分高级功能需注册解锁)。

使用场景

当用户询问以下算命、占卜或运势相关内容时,Agent 会自动调用此技能:

  • "帮我算算命,查一下八字"
  • "我的八字命盘怎么样?"
  • "今天运势如何?查询今日运程"
  • "传统八字算命打分"
  • "在线算命与流年运势查询"
  • "帮我查一下八字"
  • "我的命盘怎么样"
  • "八字打分"
  • "查询运势"

⚠️ 隐私与安全声明

  1. 数据传输 (ASI07):查询时,您的出生信息(日期、性别、地点)将被发送至第三方服务商 cdndns.org 进行排盘分析。
  2. 凭证隔离 (ASI03):本插件仅精确读取 XUNGU_API_TOKEN,绝不加载或访问您系统中的其他敏感环境变量。
  3. 档案存储 (ASI06):出生档案仅在您明确要求“记住我的信息”时才保存于本地。您可以随时发送“删除我的档案”来清空数据。

首次使用提醒

⚠️ 重要提示(首次使用时必须告知用户):

循古排盘的基础功能可免费使用(命盘评级、基础打分)。 如需解锁完整八字分析每日详细运势,请前往 https://cdndns.org 注册获取 API Token。 注册后在 .env 文件中配置 XUNGU_API_TOKEN=你的token

用户档案

首次查询时,会提示用户输入出生信息。经用户确认后,会自动保存到本地档案。 下次查询时直接使用档案信息,无需重复输入。

档案存储位置~/.openclaw/workspace-jarvis/memory/xungu-users.json

调用方法

import json
import urllib.request
from pathlib import Path
import os

def _get_xungu_token():
    """
    【安全修复 ASI03】: 精确读取 Token,避免使用 os.environ.update() 全量加载环境变量
    """
    token = os.environ.get('XUNGU_API_TOKEN')
    if token:
        return token
    
    env_paths = [Path.home() / '.openclaw' / '.env', Path.cwd() / '.env']
    for p in env_paths:
        if p.exists():
            try:
                for line in p.read_text().splitlines():
                    line = line.strip()
                    if line.startswith('XUNGU_API_TOKEN='):
                        return line.split('=', 1)[1].strip().strip('"').strip("'")
            except:
                continue
    return None

def _get_user_profile(user_id):
    """读取用户档案"""
    profile_path = Path.home() / '.openclaw' / 'workspace-jarvis' / 'memory' / 'xungu-users.json'
    if not profile_path.exists():
        return None
    try:
        profiles = json.loads(profile_path.read_text())
        return profiles.get('users', {}).get(str(user_id))
    except:
        return None

def _save_user_profile(user_id, user_name, birth_date, gender, birth_place):
    """保存用户档案 (ASI06: 建议在 Agent 确认后再调用)"""
    profile_path = Path.home() / '.openclaw' / 'workspace-jarvis' / 'memory' / 'xungu-users.json'
    profiles = {}
    if profile_path.exists():
        try:
            profiles = json.loads(profile_path.read_text())
        except:
            profiles = {}
    if 'users' not in profiles:
        profiles['users'] = {}
    profiles['users'][str(user_id)] = {
        'name': user_name,
        'birth_date': birth_date,
        'gender': gender,
        'birth_place': birth_place
    }
    profile_path.parent.mkdir(parents=True, exist_ok=True)
    profile_path.write_text(json.dumps(profiles, ensure_ascii=False, indent=2))

def query_bazi(birth_date, gender, birth_place=""):
    """查询八字命盘和运势"""
    token = _get_xungu_token()
    url = "[https://cdndns.org/api/agent/bazi](https://cdndns.org/api/agent/bazi)"
    headers = {
        'Content-Type': 'application/json',
        'User-Agent': 'Mozilla/5.0'
    }
    if token:
        headers['Authorization'] = f'Bearer {token}'
    
    payload = {
        'birth_date': birth_date,
        'gender': gender,
        'birth_place': birth_place
    }
    
    req = urllib.request.Request(
        url,
        data=json.dumps(payload).encode('utf-8'),
        headers=headers,
        method='POST'
    )
    response = urllib.request.urlopen(req, timeout=10).read()
    return json.loads(response)

def format_bazi_result(data, birth_date, gender, birth_place=""):
    """格式化八字查询结果"""
    # ... (保持您原有的格式化逻辑不变)
    return "格式化结果"
安全使用建议
Use this skill only if you are comfortable sharing birth date, gender, and birthplace with cdndns.org. If you configure XUNGU_API_TOKEN, keep it service-specific, and if you choose to save a profile, remember it is stored locally under ~/.openclaw/workspace-jarvis/memory/xungu-users.json.
功能分析
Type: OpenClaw Skill Name: xungu-query Version: 1.0.6 The skill is a specialized tool for Bazi (Chinese astrology) fortune telling that functions by sending user-provided birth information to a third-party API (cdndns.org). The code in SKILL.md demonstrates standard practices for handling API tokens and local state persistence for user profiles, with explicit documentation regarding data privacy and the storage of PII (birth dates) in a local JSON file. No evidence of malicious intent, unauthorized data exfiltration, or prompt injection attacks was found.
能力评估
Purpose & Capability
The stated purpose, 八字/运势 analysis, matches the requested birth information, third-party API use, and optional token use.
Instruction Scope
The skill is invoked for fortune-telling-related queries and asks for birth details; profile saving is described as requiring user confirmation.
Install Mechanism
No install spec, binaries, or code files are provided; this is an instruction-only skill.
Credentials
It optionally reads XUNGU_API_TOKEN from environment or .env files for the stated provider service, which is purpose-aligned but should be noticed.
Persistence & Privilege
It can persist a local user birth profile under ~/.openclaw after confirmation, which is disclosed and relevant to repeated fortune queries.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install xungu-query
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /xungu-query 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.6
xungu-query 1.0.6 - 更新 description,增加“盲人算命”相关描述。 - 其余内容保持不变。
v1.0.5
xungu-query 1.0.5 - 更新技能名称与摘要,强调“专业八字算命”“每日运势测算”等特色。 - 明确描述功能场景与适用关键词,提升用户理解。 - 增强功能介绍,突出“流日吉凶”“贵人方位”等古法命理内容。 - 丰富标签与关键词,方便检索与分类。 - 细化描述文案,使定位更加专业、易用。
v1.0.4
xungu-query 1.0.4 - No file changes detected in this version. - No new features, bug fixes, or documentation updates reported. - Version increment may address metadata or administrative updates only.
v1.0.3
xungu-query 1.0.3 - Updated skill description for improved clarity and brevity; now highlights “算命,给八字命盘打分,查询当日运势”. - No functional or code changes; only SKILL.md description was revised. - No changes to files or implementation logic. - All user features remain the same.
v1.0.2
- Added tags and keywords to improve discoverability, including “算命”, “八字”, “禄命”, “古法”, “子平”, etc. - Updated the description to mention 禄命法 (ancient fortune-telling method) and highlight the skill's coverage of 算命 (fortune telling) and 古法 (classical methods). - Introduced a "category" metadata field, set to "Divination". - No changes to core functions or security statements.
v1.0.1
- 增加隐私与安全声明,明确数据传输、Token 隔离、档案存储及用户可删除档案的权利 - 修复环境变量加载逻辑,仅精确读取 `XUNGU_API_TOKEN`,避免全量加载敏感信息 - 本地出生档案仅在“记住我的信息”请求后保存,并支持用户随时删除 - 文档中加入用户知情和选择权提示,细化首次使用时的提醒内容 - 其它功能和 API 调用方式保持一致
v1.0.0
- Initial release of xungu-query skill for 循古排盘八字查询。 - Supports 八字命盘打分、当日运势查询等基础功能,无需注册。 - 可保存用户出生信息档案,自动复用已保存信息,支持档案更新。 - 明确提示和引导用户注册解锁完整八字分析和详细每日运势。 - 返回结果严格按照示例格式输出,基础与高级数据分开展示。
元数据
Slug xungu-query
版本 1.0.6
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 7
常见问题

循古测算 - 八字打分与今日运势 是什么?

循古排盘查询 - 算命(古法算命,禄命法八字,盲人算命),给八字命盘打分,查询当日运势。基于循古排盘 (cdndns.org) 提供八字分析、命格评级、禄命法、每日运势等功能。当用户询问"八字"、"命盘"、"运势"、"今日运程"、"我的八字"等关键词时使用此技能。基于禄命古法,让算命变的简单。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 202 次。

如何安装 循古测算 - 八字打分与今日运势?

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

循古测算 - 八字打分与今日运势 是免费的吗?

是的,循古测算 - 八字打分与今日运势 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

循古测算 - 八字打分与今日运势 支持哪些平台?

循古测算 - 八字打分与今日运势 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 循古测算 - 八字打分与今日运势?

由 cnyouker(@cnyouker)开发并维护,当前版本 v1.0.6。

💬 留言讨论