Introduction¶
When developing agents with DeepSeek Harness (DSH), you sometimes need a set of local tools that don’t depend on external binaries and don’t require MCP transport. If you’ve already been casting hexagrams via odin-gua in environments like Claude Code / Codex / Cursor, and want to migrate that capability into DSH while keeping logs and rules consistent with the upstream, you might want to consider dsh-plugin-odin-gua.
What Is This¶
dsh-plugin-odin-gua is a native DeepSeek Harness plugin that rewrites odin-gua (an MCP server written in Odin) as a set of DSH tools. It requires no compilation, no MCP transport, and no external binaries — install it via dsh plugin add and it’s ready to use in your DSH sessions.
- Maintainer: vajraimb
- Category: Workflow
- License: MIT
Core Features¶
The plugin provides five tools for casting hexagrams, looking up hexagrams, computing relationships, viewing logs, and recording interpretations.
cast: Casting a Hexagram¶
Casting uses the three-coin method / Great Derivation method, returning the primary hexagram, changing lines, the resulting hexagram, and the mutual hexagram. It returns the corresponding hexagram text / line texts (in both Chinese and English originals) according to Zhu Xi’s rules, and automatically records the result to the log.
lookup: Hexagram Lookup¶
Supports looking up hexagrams by number, Chinese name, pinyin, English name, Unicode hexagram symbol, or six-bit binary code, with the hexagram text included.
relations: Relationship Computation¶
Provides the mutual, opposite (polar), and reversed (mirror) hexagrams. When a changing line is present, it also returns the resulting hexagram and the line text to use.
journal: Log & Status¶
Displays recent hexagram entries and their status (pending interpretation / pending review / review due / excessive). Setting due:true shows only entries that are due for review.
annotate: Interpretation Record¶
Records the model’s interpretation for each hexagram: tendency, confidence (0–1), testable predictions, and review date. One entry per hexagram; immutable once written.
Rules & Conventions¶
- Hexagram arrangement is handled by code; interpretation is handled by the model: Random numbers, mutual/opposite/reversed transformations, and which line text to select are all determined by code and recorded in the log; the model is responsible for relating the result to the question and providing an explanation.
- Line text selection follows the common rules from Zhu Xi’s Introduction to the Study of the Changes: Examining Transformations in Divination, determined by the number of changing lines.
- No more than three casts: For the same question (character bigram similarity ≥ 0.7 after removing punctuation), no re-casting within 72 hours — the original hexagram is returned directly. If a re-cast is truly necessary, include
recast:trueand areason; the new hexagram is marked as “excessive” and excluded from statistics.GUA_RECAST_HOURSis adjustable; set to 0 to disable. - Ink dries and doesn’t change: Only the first
annotateper hexagram is accepted. - Review reminders: Due hexagram entries are appended to the end of the
castresult and counted at the top ofjournal.
Logs & Data¶
- Log path and format are fully consistent:
$GUA_HOME/journal.jsonl, defaulting to~/.gua/journal.jsonl, append-only, permissions 0600. - Hexagrams previously cast via odin-gua in Claude Code / Codex / Cursor will be visible in
journalafter installing this plugin, and vice versa. - Classical text data is sourced from the upstream repository: Chinese uses the standard edition (Traditional characters), English uses Legge 1882. See
data/README.mdand the upstreamdata/provenance.tsvfor sources and per-entry provenance.
Installation & Activation¶
Installation commands from the README:
# Install into the profile you're using (web / tui / headless or a custom name)
dsh plugin --profile web add dsh-plugin-odin-gua
# Install from a local checkout (before it's published on npm)
dsh plugin --profile web add ./dsh-plugin-odin-gua
After installation, open a new session and say “Cast a hexagram for me, asking about next week’s negotiation” and you’re good to go.
Configuration¶
All optional, configured via environment variables:
| Variable | Purpose |
|---|---|
GUA_HOME |
Log directory, defaults to ~/.gua |
GUA_TZ |
Timestamp timezone (IANA name, e.g. Asia/Shanghai), defaults to system timezone |
GUA_RECAST_HOURS |
Re-cast window for the same question, defaults to 72; 0 disables |
GUA_SEED |
Fixed random seed (testing only) |
Development & Testing¶
node tools/gen-texts.mjs # Regenerate lib/texts.generated.js from data/zhouyi.txt, data/legge.txt
node test/engine.test.mjs # Engine and workflow tests (node:test, runs in-process)
The plugin runs tests via node:test and, before generating texts, verifies that all 64 hexagrams are present, that line labels “nine/six” match the hexagram lines, and that English undivided/divided matches the hexagram lines.
Use Cases & Caveats¶
- Suited for DSH users who need a local, lightweight I Ching divination toolchain.
- The plugin runs with the permissions of the current dsh process; it’s recommended to review the source code and license before installing.
- This port does not include MCP Apps coin-flip replay (
ui://odin-gua/coins); coin results are still authoritative as returned bycast’scoinsfield. - When mixing the Odin binary and this JS port on the same machine, the same
seedwill not produce the same hexagram (different PRNGs), but results are already logged, so the hexagram entries themselves are unaffected.
In Closing¶
dsh-plugin-odin-gua packages a full I Ching toolkit into a native DSH toolset, arranging hexagrams per Zhu Xi’s rules with automatic logging and status tracking. It’s well suited for decision support and retrospective record-keeping within the DSH ecosystem. See:
- Directory page: https://www.skillhub.cn/plugins/vajraimb/dsh-plugin-odin-gua
- GitHub: https://github.com/vajraimb/dsh-plugin-odin-gua