Three-Coin I Ching Divination in DeepSeek Harness

Introduction

In agent development, tools often require precise input/output structures. If a tool returns raw, unstructured text, the model must parse it on its own; conversely, if the tool embeds interpretation logic, it undermines the model’s autonomy. The Coin Oracle is a middle ground between the two: it provides the complete hexagram structure, changing-line rules, and classical texts, but does not supply modern interpretation. The model, drawing on the hexagram and context, performs the interpretation itself.

DeepSeek Harness (DSH) supports capability extension via plugins. This article introduces a plugin dedicated to I Ching divination: dsh-yijing. It handles the entire workflow—from tossing copper coins to generating classical texts—within the DSH environment.

Plugin Overview

dsh-yijing is a Coin Oracle plugin for the I Ching, designed for DeepSeek Harness and maintained by developer Kochere. It does not depend on any external network; it uses a local random number generator to produce hexagrams and returns complete classical texts (hexagram statements, Tuan commentary, Great Image, line statements, Small Image, Use Nine/Use Six, and the Wen Yan commentary on Qian/Kun), accompanied by a visualized animated casting card.

The core value of the plugin lies in:
- Returning classical texts only, without injecting modern translations or annotations
- Strictly following the changing-line rules from Zhu Xi’s Introduction to the Study of the Yijing · Examining Divination by Change
- Running locally with no network calls, making it privacy-friendly
- Containing all 64 hexagrams, 384 lines, and Wen Yan texts, with auditable text sources

Core Features

1. Casting and Hexagram Generation

The plugin uses three copper coins to simulate traditional coin-based divination. Each coin has a value of 3 on its tail side and 2 on its head side. Six independent tosses generate six lines from bottom to top, yielding Old Yin (6), Young Yang (7), Young Yin (8), or Old Yang (9), with probabilities of 1/8, 3/8, 3/8, and 1/8 respectively. Old Yin and Old Yang are the changing (moving) lines.

2. Primary Hexagram and Resulting Hexagram

Once the six lines are determined, the primary hexagram is established; flipping the changing lines yields the resulting hexagram. The plugin and the client display the Primary → Resulting hexagram transformation simultaneously.

3. Changing-Line Rules

The plugin follows Zhu Xi’s rules for divination by change, selecting interpretive texts based on the number of moving lines:

Moving Lines Returned Text
0 Primary hexagram statement
1 Primary hexagram’s moving line statement
2 Primary hexagram’s moving line statements; use the upper line
3 Primary hexagram statement + Resulting hexagram statement; primary hexagram is the “zheng”
4 Resulting hexagram’s static line statements; use the lower line
5 Resulting hexagram’s static line statements
6 Qian Use Nine / Kun Use Six; otherwise the resulting hexagram statement

4. Text Content

The texts returned by the plugin include:
- Hexagram statement
- Tuan commentary
- Great Image
- Line statements
- Small Image
- Use Nine / Use Six
- Qian / Kun Wen Yan

All texts are classical originals and do not include modern vernacular explanations. The model interprets them on its own based on the hexagram (upper and lower trigrams, line positions, temporal meaning, mutual/opposed/inverted relations).

5. Visualized Casting Card

The client renders an animated card at the top of the response, displaying the casting process:
- Three copper coins flipping
- Six lines drawn from bottom to top
- Primary → Resulting hexagram transition
- Theme adaptation support (light/dark/compact modes)
- Reduced-motion mode support
- Auto-replays when the card enters the viewport
- Replay button provided

Installation and Activation

Prerequisites

  • DeepSeek Harness (Desktop or CLI edition)
  • A configured Profile
  • Node.js 20 or higher (bundled with DSH)

Installation Steps

  1. Clone the plugin repository locally:
git clone https://github.com/Kochere/dsh-yijing.git
  1. Open DSH, go to Plugins → Add plugin, and select the newly cloned dsh-yijing directory.

  2. Enable I Ching · Coin Oracle / I Ching coin oracle in the plugin list.

  3. Start a new session (or refresh the current session), and you’re ready to use it.

The plugin can also be installed as a bundle by calling plugin_manager’s install_bundle method with an absolute path.

Typical Usage

Basic Conversation

Ask a question directly in DSH; the model will confirm the question and then invoke the yijing_cast tool:

Is this plan viable?

The model returns classical texts + a vernacular explanation, first quoting the original text, then interpreting its meaning.

Tool Calls

The plugin provides two model-facing tools:

Tool Returns
yijing_cast Six lines → primary hexagram, resulting hexagram, moving lines → hexagram/line statements selected per the change-divination rules, mutual/opposed/inverted hexagrams. Classical texts only.
yijing_hexagram Query a single hexagram by number, name, symbol, or six-digit code: hexagram statement, Tuan, Great Image, line statements. With detail: "full", includes Small Image and Wen Yan.

Command-Line Usage

The plugin ships with a CLI, useful for replaying or testing:

node bin/yijing.mjs cast "Can this collaboration be finalized?"
node bin/yijing.mjs cast --values 7,8,9,6,7,8 "Replay a fixed cast"
node bin/yijing.mjs hexagram 31 --full
node bin/yijing.mjs cast "Ask a question" --json

--values accepts six values from bottom to top (6/7/8/9) for replay or testing purposes only; it is not intended for formal divination.

Applicable Scenarios and Cautions

Applicable Scenarios

  • Scenarios requiring a structured divination flow within a conversation
  • Scenarios requiring complete classical texts rather than simplified results
  • Scenarios requiring local execution without reliance on the network or third-party services
  • Scenarios where text sources must be auditable and verifiable

Cautions

  • The plugin runs with the current DSH process’s permissions; it is recommended to review the source code and license before installation.
  • The plugin depends on @deepseek-ai/dsh-tools, with a version range of >=0.1.5-rc.1 <0.3.0-0.
  • The plugin includes 27 tests covering data, casting, rules, and UI.
  • Text sources are listed in docs/SOURCES.md, including 58 corrections and 2 known variants.

Summary

dsh-yijing provides DeepSeek Harness with a complete I Ching Coin Oracle toolchain—from casting to text generation, from rules to visualization—all built around the “classical text + model interpretation” paradigm. It does not preset interpretations; it only provides structured hexagrams and original texts, making it ideal for scenarios that require a structured divination workflow.

  • Plugin homepage: https://github.com/Kochere/dsh-yijing
  • SkillHub directory page: https://www.skillhub.cn/plugins/Kochere/dsh-yijing
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye