← Back to Skills Marketplace
cnyouker

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

by cnyouker · GitHub ↗ · v1.0.6 · MIT-0
cross-platform ✓ Security Clean
202
Downloads
1
Stars
0
Active Installs
7
Versions
Install in OpenClaw
/install xungu-query
Description
循古排盘查询 - 算命(古法算命,禄命法八字,盲人算命),给八字命盘打分,查询当日运势。基于循古排盘 (cdndns.org) 提供八字分析、命格评级、禄命法、每日运势等功能。当用户询问"八字"、"命盘"、"运势"、"今日运程"、"我的八字"等关键词时使用此技能。基于禄命古法,让算命变的简单。
README (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 "格式化结果"
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install xungu-query
  3. After installation, invoke the skill by name or use /xungu-query
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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 八字命盘打分、当日运势查询等基础功能,无需注册。 - 可保存用户出生信息档案,自动复用已保存信息,支持档案更新。 - 明确提示和引导用户注册解锁完整八字分析和详细每日运势。 - 返回结果严格按照示例格式输出,基础与高级数据分开展示。
Metadata
Slug xungu-query
Version 1.0.6
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 7
Frequently Asked Questions

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

循古排盘查询 - 算命(古法算命,禄命法八字,盲人算命),给八字命盘打分,查询当日运势。基于循古排盘 (cdndns.org) 提供八字分析、命格评级、禄命法、每日运势等功能。当用户询问"八字"、"命盘"、"运势"、"今日运程"、"我的八字"等关键词时使用此技能。基于禄命古法,让算命变的简单。 It is an AI Agent Skill for Claude Code / OpenClaw, with 202 downloads so far.

How do I install 循古测算 - 八字打分与今日运势?

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

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

Yes, 循古测算 - 八字打分与今日运势 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does 循古测算 - 八字打分与今日运势 support?

循古测算 - 八字打分与今日运势 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

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

It is built and maintained by cnyouker (@cnyouker); the current version is v1.0.6.

💬 Comments