Zhijing (织经)
English | 中文
Formerly XSkill. Zhijing (织经) means "weaving the warp": scattered Skills and Experiences are woven into one shared fabric for every agent. The legacy
XSKILL_ROOTenvironment variable is still honored.
Zero-dependency, two-tier shared knowledge & skill hub for multi-agent workflows — exposed over standard MCP.
Zhijing lets multiple AI coding & research agents (Claude Code, Codex, Cursor, OpenCode, Gemini CLI, etc.) share a single source of truth for Skills (reusable workflows) and Experiences (contextual decision rules) without duplicating files across tools.
Highlights
- Zero third-party dependencies: pure Python 3.10+ standard library.
- Two-tier retrieval:
projects/<project>/(1.5x priority boost) +global/fallback. - Dual skill formats (no symlinks required): natively discovers both single-file entries (
*.md) and folder-based standard Agent Skills (<name>/SKILL.md), safe on Linux, macOS, and Windows. - Import quality gate:
auditchecks path traversal, symlinks, file count/size, read/write permissions, frontmatter types, and destination conflicts.importruns the same checks and skips existing entries unless--overwriteis explicit. - Read-only MCP Server with path lock:
zhijing_mcp.pyexposeszhijing_search(BM25),zhijing_list, andzhijing_readover stdio JSON-RPC 2.0, preventing unintended writes or directory traversal outsideZHIJING_ROOT. - Dual-repo ready: keep the framework public (
zhijing) while pointingZHIJING_ROOTor--rootto your private knowledge vault (zhijing-vault).
Repository Layout
zhijing/
├── zhijing_core.py # Search, index, and CRUD engine
├── zhijing_mcp.py # Read-only stdio MCP server
├── scripts/
│ └── zhijing_doctor.py # Knowledge base health check
├── global/
│ ├── skills/ # Bundled starter skills (*.md and <name>/SKILL.md)
│ └── experiences/ # Contextual decision rules & lessons learned
├── projects/ # Project-scoped overrides (projects/<name>/{skills,experiences})
├── tests/
│ └── test_zhijing.py # Core & MCP test suite
└── _index.json # Generated index
Bundled Starter Skills (Academic & Engineering)
| Skill | Format | Domain | Purpose |
|---|---|---|---|
anti-defensive-writing |
Folder | Academic | Eliminate defensive hedging in papers, protocols, and rebuttals |
paper-claim-audit |
Single | Academic | Context-free number-by-number audit between manuscript and raw outputs |
citation-integrity-check |
Single | Academic | Dual-source DOI/metadata verification, chimera & retraction checks |
claim-safety-gates |
Single | Academic | Three hard gates (no fabrication, no unapproved promises, full coverage) |
review-rebuttal |
Single | Academic | Structured peer-review triage, evidence binding, and commitment ledger |
figure-creation-standards |
Folder | Academic | Journal dimensions, colorblind-safe palettes, vector export, honest encoding |
figure-review-gate |
Single | Academic | Post-render PDF figure QA and visual honesty checklist |
minimal-code-ladder |
Single | Engineering | Anti-over-engineering ladder with non-negotiable safety boundaries |
code-review-beyond-diff |
Single | Engineering | Impact-first code review beyond changed lines + shortcut debt ledger |
Quick Start
1. Install the Engine from PyPI
python3 -m pip install zhijing
export ZHIJING_ROOT=/path/to/zhijing-vault
zhijing stats
The PyPI distribution intentionally contains only the engine and the zhijing / zhijing-mcp commands. Starter Skills and the doctor script remain in the source repository. For an installed engine, always point ZHIJING_ROOT or --root at a writable knowledge base instead of storing entries in site-packages.
2. Run Source Health Check & Tests
python3 scripts/zhijing_doctor.py
python3 -m unittest discover -s tests -v
3. CLI Usage
# Search with a full-sentence task description
python3 zhijing_core.py search "论文里的数字和原始结果文件对不上,怎么逐数字核对"
# Rebuild _index.json after adding or editing entries
python3 zhijing_core.py index
# Inspect counts
python3 zhijing_core.py stats
# Preflight without importing; exits 1 on errors
python3 zhijing_core.py audit /path/to/skill-or-pack
# Import through the same checks; existing entries are skipped
python3 zhijing_core.py import /path/to/skill-or-pack
# Add --overwrite only when replacing existing entries is intended
python3 zhijing_core.py import /path/to/skill-or-pack --overwrite
Tip on querying: Full-sentence task descriptions usually provide more useful terms for weighted BM25 over
name / description / tags / body. Short distinctive terms such asRoBandR语言are also supported.
4. Dual-Repo Setup (Framework + Private Vault)
Keep this repo as your framework, and store your private global/ and projects/ entries in a separate private repository (e.g. zhijing-vault). Point Zhijing at your vault via --root or ZHIJING_ROOT:
export ZHIJING_ROOT=/path/to/zhijing-vault
python3 zhijing_mcp.py
# or explicitly:
python3 zhijing_mcp.py --root /path/to/zhijing-vault
MCP Integration
Point any MCP-compatible client to zhijing_mcp.py (optionally passing --root /path/to/your/vault).
Claude Code
claude mcp add zhijing -s user -- python3 /path/to/zhijing/zhijing_mcp.py --root /path/to/zhijing-vault
Codex CLI (~/.codex/config.toml)
[mcp_servers.zhijing]
command = "python3"
args = ["/path/to/zhijing/zhijing_mcp.py", "--root", "/path/to/zhijing-vault"]
Cursor / Gemini CLI (mcp_config.json)
{
"mcpServers": {
"zhijing": {
"command": "python3",
"args": ["/path/to/zhijing/zhijing_mcp.py", "--root", "/path/to/zhijing-vault"]
}
}
}
OpenCode
opencode mcp add zhijing --global -- python3 /path/to/zhijing/zhijing_mcp.py --root /path/to/zhijing-vault
Writing a New Entry
Every Skill or Experience uses a lightweight YAML frontmatter block:
---
type: skill
name: my-workflow
description: One-sentence description used for retrieval matching.
metadata:
domain: academic
tools: ["read_file", "terminal"]
success_count: 1
tags: ["workflow", "audit"]
author: your-name
created: 2026-11-20
updated: 2026-11-20
---
## Steps
...
Place it at global/skills/my-workflow.md (or global/skills/my-workflow/SKILL.md for folder-based skills with bundled scripts/assets), then run python3 zhijing_core.py index.
License
MIT
Metadata
Release files for zhijing 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| zhijing-1.3.0.tar.gz | 26.1 kB | Without provenance | Details for zhijing-1.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| zhijing-1.3.0-py3-none-any.whl | Python 3 | none | any | Details for zhijing-1.3.0-py3-none-any.whl |
Total release size: 47.0 kB
Release files / zhijing-1.3.0.tar.gz
| Download URL | zhijing-1.3.0.tar.gz |
|---|---|
| Size | 26.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5df151b23d9724fefa2f88ddbd608f25f7d03af930130a942d9656b5f44563df
|
|
BLAKE2b-256 checksum How to use checksums |
b22eb125b21dddfc7b83846c4827498ad1844eaebe8a91dfc0728d20cd307b22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / zhijing-1.3.0-py3-none-any.whl
| Download URL | zhijing-1.3.0-py3-none-any.whl |
|---|---|
| Size | 21.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eeb737e8334b7d7a21ae24b7d361bc08590b7c177340a397981ec925205c3219
|
|
BLAKE2b-256 checksum How to use checksums |
3f3dc67b49e3661e654996dbdefc631055f54076a670002421853ecbfd135ad5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for zhijing 1.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.