← 返回 Skills 市场
crystalchen1017

易经起卦

作者 CrystalChen1017 · GitHub ↗ · v1.0.2 · MIT-0
cross-platform ✓ 安全检测通过
137
总下载
0
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install gua
功能描述
基于中国《易经》(东方神秘玄学)的起卦解卦技能。当用户希望起卦、解卦、占卜、解读易经卦象,或希望根据自然语言问题调用 `qi_gua.py` 得到本卦与变卦,再结合联网检索给出针对问题的解卦时使用。适用于:解析用户提问、运行本地 `qi_gua.py`、提取卦象、卦名、卦辞、爻位、变爻,并检索卦义与爻辞后生成结构...
使用说明 (SKILL.md)

易经起卦解卦

使用这个 skill 将用户的自然语言问题转成完整的起卦与解卦结果。

问卦前提醒

当用户是来“起卦/问卦/占卜”时,不要立刻调用 qi_gua.py。先阅读 references/pre-divination-guidance.md,再用简洁中文告知用户问卦前的注意事项,等用户确认继续,或给出最终占问句后,再开始起卦。

如果用户只是讨论卦义、解释结果、分析某一卦,不是真的要现场起卦,则不需要这一步前置提醒。

提醒用户时,可将古人的说法转述为更容易接受的现代解释:这些规矩的核心作用,不一定要理解为“敬神”,也可以理解为帮助求卦者清除杂念、集中意念、减少外界干扰,让潜意识更稳定地投射到卦象中。

如果用户已经在第一句话里直接给出了占问问题,也要先完成上述提醒,再请用户确认是否仍以这个问题起卦;未确认前不要直接运行脚本。

工作流程

  1. 如果用户是来起卦,先完成“问卦前提醒”,并等待用户确认继续或给出最终占问句。
  2. 在不改变原意的前提下,将用户输入整理成简洁明确的占问句。
  3. 直接调用当前 skill 目录下 scripts/qi_gua.py 获取本卦、变卦、卦象与变爻信息。
  4. 在组织最终回答前,先阅读 references/output-format.md
  5. 如需本卦、变卦的原文、象辞、爻辞与白话基础释义,先按需读取 references/zhouyi-64-gua.md
  6. 在拿到卦名后,再联网检索该卦的卦义、卦辞、爻辞与常见解释,用于校对、补充与交叉验证。
  7. 将本地起卦结果、本地参考与检索到的资料结合,输出面向该问题的解读。

本地工具

运行:

python3 ./scripts/qi_gua.py "我最近是否适合换工作?"

这个文件位于 skill 的 scripts/ 目录下,运行后会直接打印:

  • 问题
  • 本卦与变卦信息
  • 卦象图形
  • 六爻详情
  • 上下卦与所属宫

如果需要结构化字段,可直接导入 scripts/qi_gua.py 并调用 qi_gua(question) 函数,不要再依赖额外包装脚本。

优先使用 skill 内的 ./scripts/qi_gua.py,不要回退去调用仓库根目录里的其他副本,避免结果来源不一致。

联网检索规则

  • 如果只是需要 64 卦的基础原文、白话、象辞或爻辞,优先先查本地参考 references/zhouyi-64-gua.md
  • 必须在拿到脚本输出的卦名之后再开始搜索。
  • 优先检索保留原文的中文权威来源;如果没有原始文本来源,可使用可信的解读来源,并在回答中说明。
  • 有变爻时,同时检索本卦与变卦。
  • 有动爻时,检索对应爻位的爻辞。
  • 最终回答里要附上来源链接。
  • 明确区分“来源中的信息”和“结合用户问题做出的解读”。

解卦规则

得到一卦后,先看本卦卦辞。卦辞是对卦象内容的整体概括,提示的哲理通常带有抽象性、包容性、多维性与启示性,不要拘泥于字面意思,也不要机械照搬原文。由于《易经》原文常较为简奥,最终解读优先用白话解释卦义,再结合用户问题落到具体语境。

除卦辞外,还可以根据爻辞占断吉凶。如何取用卦辞与爻辞,按变爻数量遵循下面规则:

  1. 六爻不变:这是“静卦”,用本卦卦辞解卦。
  2. 一个爻变:用这个变爻的爻辞解卦。
  3. 两个爻变:用这两个变爻的爻辞解卦,以上爻为主。
  4. 三个爻变:用本卦卦辞结合变卦卦辞综合解读。
  5. 四个爻变:用另外两个静爻的爻辞解卦,以下爻爻辞为主。
  6. 五个爻变:用变卦的静爻爻辞解卦。
  7. 六爻皆变:如果本卦是乾卦或坤卦,分别用“用九”或“用六”解卦;其他卦用变卦卦辞解卦。

组织最终回答时,要先判断本次属于哪一种情况,再决定应该重点检索和引用哪些卦辞、爻辞,不要默认把所有动爻逐条堆砌出来。

输出要求

返回内容分为两个部分:

第一部分:起卦结果

qi_gua.py 的完整执行结果原样输出给用户,包括问题、本卦与变卦信息、卦象图形、六爻详情、上下卦与所属宫等。不要省略或改写脚本输出内容。

第二部分:卦象解读

在起卦结果之后,基于联网检索到的卦义、卦辞、爻辞,结合用户的具体问题给出针对性解读。要求:

  • 除非用户另有要求,否则用中文回答。
  • 至少包含:本卦名、动爻情况、本次采用的解卦依据(卦辞或爻辞)、变卦名(如有)、针对提问的解读。
  • 先用白话概括本卦卦辞的整体意义,再按变爻规则决定是否进一步引用爻辞或变卦卦辞。
  • 如果没有变爻,明确说明,并以本卦卦辞与整体含义为主。
  • 如果有多个变爻,严格按“七种变爻取辞规则”选择解卦依据,不要机械罗列全部动爻爻辞。
  • 不要把解卦表述成确定结论,应明确它是解释性参考。
  • 明确区分"来源中的信息"和"结合用户问题做出的解读"。
  • 附上参考来源链接。

参考

准备最终回答时,加载 references/output-format.md

如需 64 卦原文与白话基础内容,按需加载 references/zhouyi-64-gua.md

安全使用建议
This skill appears coherent for its stated purpose, but consider the following before installing or using it: (1) it expects a Python runtime (SKILL.md calls 'python3') even though no binary dependency is listed — ensure python3 is available in the execution environment; (2) the agent will run the included scripts locally (review scripts/qi_gua.py yourself if you want to inspect behavior or audit output); (3) the skill instructs the agent to perform online searches and include source links, so your question text will be sent to whoever the agent's browsing/search tool contacts — avoid submitting sensitive personal data in divination queries if you care about privacy; (4) the SKILL.md requires returning the script's full raw output (which includes timestamps and generated seed information), so be aware that those details will be shown; (5) no credentials or installs are requested, which lowers risk. If you want extra caution: (a) run the script locally yourself first to confirm output and behavior, (b) verify python availability, and (c) restrict or review the agent's web-access permissions if you don't want queries sent externally.
功能分析
Type: OpenClaw Skill Name: gua Version: 1.0.2 The skill bundle provides a functional and well-documented I Ching divination tool. The core logic in `scripts/qi_gua.py` is a self-contained simulation of the traditional 'three-coin method' using standard Python libraries (random, hashlib, datetime) without any network calls, file system modifications, or sensitive data access. The instructions in `SKILL.md` and the various reference files are strictly aligned with the stated purpose of providing structured cultural interpretations and do not contain any malicious prompt injection, exfiltration attempts, or unauthorized execution commands.
能力评估
Purpose & Capability
The skill name/description (I Ching divination) aligns with the included files and runtime instructions: it invokes a local hexagram generator (scripts/qi_gua.py), reads the local 64‑gua reference, and asks the agent to perform web searches for verification. Minor mismatch: SKILL.md tells the agent to run 'python3 ./scripts/qi_gua.py' but the skill metadata declares no required binaries — so the script assumes a Python runtime is available even though no binary dependency is listed.
Instruction Scope
SKILL.md stays within the stated purpose: it requires (1) showing pre-divination guidance to the user, (2) calling the local qi_gua.py to produce a hexagram, (3) consulting local references, and (4) performing online searches after obtaining the hexagram name to cross-check interpretations. It explicitly requires returning the full raw script output and including source links for any online material. Nothing in the instructions directs reading unrelated system files, environment variables, or sending data to unexpected endpoints.
Install Mechanism
No install spec is present — the skill is instruction-only with one included Python script and local reference files. No remote downloads, package installs, or archive extraction are specified. The agent will execute the included script locally (so code on disk will run), but there is no installation mechanism that pulls arbitrary external code.
Credentials
The skill declares no required environment variables, credentials, or config paths, and none of the provided files attempt to access secrets. The script and docs use only local data (question, timestamp, references) and standard libraries; web lookups are performed by the agent as ordinary browsing/search operations. No disproportionate credential access is requested.
Persistence & Privilege
The skill is not always-enabled and does not request persistent or elevated privileges. It does not modify other skills' configs. Autonomous invocation is allowed (default) but that is the platform norm; nothing in the package gives this skill unusual system presence.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install gua
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /gua 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.2
Version 1.0.2 of the gua skill - 增加了 description 的英文说明,强调技能基于《易经》与东方神秘玄学,并明确支持英中文使用场景和自然语言提问说明。 - description 现包含技能适用场景与调用方法的中英文简要介绍,提升了可读性及国际用户理解便利性。 - 其它内容无更改,核心用法与流程保持一致。
v1.0.1
No visible changes detected in this version. - No code or documentation changes found between versions. - Functionality remains the same as previous release.
v1.0.0
# 易经起卦解卦 Skill / I Ching Divination Skill [中文](#中文) | [English](#english) --- <a id="中文"></a> ## 中文 ### 简介 这是一个基于《周易》的起卦与解卦技能(Skill)。用户只需用自然语言提出问题,即可自动完成起卦、获取卦象,并结合联网检索给出针对用户问题的解卦结果。 ### 功能特性 - **自动起卦**:根据用户问题与当前时间生成伪随机种子,模拟"三硬币法"(铜钱起卦)得出本卦与变卦 - **卦象可视化**:输出卦象图形(▅▅▅▅▅ / ▅▅ ▅▅),标注动爻(○ ×) - **变爻识别**:自动识别老阳、老阴等变爻,生成对应的变卦 - **64 卦本地参考**:内置完整的六十四卦卦辞、象辞、爻辞与白话释义 - **联网校对**:在拿到卦名后联网检索,交叉验证卦义与爻辞 - **结构化解卦**:严格按照变爻数量遵循七种取辞规则,给出针对性解读 ### 项目结构 ``` gua-skill/ ├── SKILL.md # Skill 主指令文件(定义工作流程与规则) ├── README.md # 本文件 ├── scripts/ │ └── qi_gua.py # 起卦脚本(三硬币法模拟) ├── references/ │ ├── zhouyi-64-gua.md # 六十四卦本地参考(卦辞、象辞、爻辞、白话) │ ├── pre-divination-guidance.md # 问卦前提醒要点 │ └── output-format.md # 输出格式规范 └── agents/ └── openai.yaml # OpenAI 兼容 Agent 配置 ``` ### 使用方法 #### 命令行起卦 ```bash python3 ./scripts/qi_gua.py "我最近是否适合换工作?" ``` 输出包含:问题、起卦时间、本卦与变卦信息、卦象图形、六爻详情、上下卦与所属宫。 #### 作为 Skill 使用 将本项目作为 opencode skill 加载后,直接用自然语言提问即可。工作流程: 1. **问卦前提醒**:若用户要起卦,先转述注意事项,等待用户确认 2. **整理占问句**:将用户输入整理为简洁明确的占问句 3. **调用起卦脚本**:运行 `qi_gua.py` 获取卦象 4. **检索卦义**:先查本地参考,再联网校对补充 5. **解卦输出**:按变爻规则结合用户问题给出结构化解读 ### 解卦规则(变爻取辞) | 变爻数量 | 取用依据 | |---------|---------| | 0(静卦) | 本卦卦辞 | | 1 | 该变爻的爻辞 | | 2 | 两个变爻的爻辞,以上爻为主 | | 3 | 本卦卦辞 + 变卦卦辞 | | 4 | 两个静爻的爻辞,以下爻为主 | | 5 | 变卦的静爻爻辞 | | 6(全变) | 乾/坤用"用九/用六",其他用变卦卦辞 | ### 技术细节 - 起卦种子由 `MD5(问题 + 时间戳)` 生成,同一问题在不同时间会产生不同卦象 - 每爻由三枚硬币(2 或 3)求和:6=老阴(变)、7=少阳、8=少阴、9=老阳(变) - 卦象由下往上排列,对应初爻到上爻 --- <a id="english"></a> ## English ### Introduction This is an I Ching (Yi Jing) divination skill. Users can ask questions in natural language, and the system will automatically generate hexagrams, retrieve relevant interpretations, and provide structured readings tailored to the user's question. ### Features - **Automated Hexagram Generation**: Uses the question text and current timestamp to create a pseudo-random seed, simulating the traditional "three-coin method" to produce the primary and changed hexagrams - **Visual Hexagram Display**: Outputs hexagram graphics using text symbols (▅▅▅▅▅ / ▅▅ ▅▅) with moving lines marked (○ ×) - **Moving Line Detection**: Automatically identifies old yin and old yang as moving/changing lines and derives the resultant hexagram - **Local 64-Hexagram Reference**: Built-in complete reference for all 64 hexagrams including judgments, image texts, line texts, and plain-language explanations - **Online Verification**: Searches online after obtaining the hexagram name to cross-check interpretations - **Structured Readings**: Follows the classic seven-fold moving-line rules to deliver targeted interpretations ### Project Structure ``` gua-skill/ ├── SKILL.md # Main skill instruction file (workflow & rules) ├── README.md # This file ├── scripts/ │ └── qi_gua.py # Divination script (three-coin simulation) ├── references/ │ ├── zhouyi-64-gua.md # Local 64-hexagram reference │ ├── pre-divination-guidance.md # Pre-divination guidance notes │ └── output-format.md # Output format specification └── agents/ └── openai.yaml # OpenAI-compatible agent configuration ``` ### Usage #### Command Line ```bash python3 ./scripts/qi_gua.py "Is it a good time for me to change jobs?" ``` Output includes: the question, divination timestamp, primary and changed hexagram details, hexagram graphics, six-line details, upper/lower trigrams, and palace assignment. #### As a Skill Load this project as an opencode skill, then simply ask questions in natural language. The workflow: 1. **Pre-divination Guidance**: If the user intends to divine, share preparation tips and wait for confirmation 2. **Question Refinement**: Condense the user's input into a clear divination question 3. **Run Script**: Execute `qi_gua.py` to obtain the hexagram 4. **Retrieve Interpretations**: Check local references first, then verify online 5. **Reading Output**: Follow the moving-line rules and deliver a structured reading relevant to the user's question ### Divination Rules (Moving Line Selection) | Moving Lines | Source for Reading | |---|---| | 0 (static) | Primary hexagram judgment | | 1 | The moving line's text | | 2 | Both moving lines' texts; upper line takes priority | | 3 | Primary hexagram judgment + changed hexagram judgment | | 4 | Two static lines' texts; lower line takes priority | | 5 | Changed hexagram's static line text | | 6 (all moving) | Qian/Kun use "Use of Nine / Use of Six"; others use changed hexagram judgment | ### Technical Details - The divination seed is generated via `MD5(question + timestamp)`, so the same question at different times produces different hexagrams - Each line is determined by the sum of three coins (2 or 3): 6 = old yin (moving), 7 = young yang, 8 = young yin, 9 = old yang (moving) - Lines are arranged bottom to top, corresponding to the 1st through 6th positions
元数据
Slug gua
版本 1.0.2
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 3
常见问题

易经起卦 是什么?

基于中国《易经》(东方神秘玄学)的起卦解卦技能。当用户希望起卦、解卦、占卜、解读易经卦象,或希望根据自然语言问题调用 `qi_gua.py` 得到本卦与变卦,再结合联网检索给出针对问题的解卦时使用。适用于:解析用户提问、运行本地 `qi_gua.py`、提取卦象、卦名、卦辞、爻位、变爻,并检索卦义与爻辞后生成结构... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 137 次。

如何安装 易经起卦?

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

易经起卦 是免费的吗?

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

易经起卦 支持哪些平台?

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

谁开发了 易经起卦?

由 CrystalChen1017(@crystalchen1017)开发并维护,当前版本 v1.0.2。

💬 留言讨论