rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
PROJECT README
中文 | English
Antu · Legal Diagrams turns case JSON into one offline HTML diagram—timelines, procedures, relationships, and court reasoning—for AI agents and legal professionals. The page is one file of about 2.3 MB that makes no network request and needs no server; it opens offline and can be archived, printed or sent as an attachment. An AI Agent can read the case materials and write the JSON; the engine then draws the diagram from it, and the same JSON gives the same diagram. Antu is at version 0.x, and the formats of the relationship and justification diagrams are still drafts.
Four types of legal content, each drawn in several ways. A selector in the page switches between the ways; nothing in the JSON chooses one.
| Relationship | graph | focus view | relation matrix | equity tree |
|---|---|---|---|---|
authority chart | related-party list | relation path | ||
| Fact | timeline | chronicle | time scale | |
| Procedure | flowchart | route map | ||
| Justification (experimental) | reasoning tree |
Relationship diagrams (seven ways of drawing the same JSON) show parties, roles and legal relationships; fact diagrams the time, the participants and how events went; procedure diagrams a procedural path and its branches; justification diagrams a conclusion drawn from norms and facts. The relationship and justification schemas are still drafts, and justification is currently experimental and on hold.
Four looks, called themes: document (black and white and square, for print and filing; the default), modern
(rounded, pale), legal (navy) and dark (the modern look on a dark ground, for a dark host). The reader switches in
the page, or a call fixes a page to one. Only the diagram is themed; dark also darkens the shell round it. See
spec/theme.md.
npm install
npm run diagram -- examples/fact/neighbour-corridor-charging.en.json
The page is written beside the JSON file. The interface language of a page is set with ?lang=en or ?lang=zh; the case content is never translated.
Agent ──> key information ──> one JSON ──> engine ──> diagram
| Role | Does | Determinism |
|---|---|---|
| Model | reads documents, extracts facts, understands meaning | the result may differ from run to run |
| Engine | draws the diagram according to the specification | the same JSON gives the same diagram, whichever model wrote it |
| JSON specification | the only interface between the two | versioned (see spec/versioning.md) |
The engine does not write JSON, and the Agent does not draw. The model puts information into JSON; the engine draws. The JSON specification is a specification of its own, for four reasons:
The reference material for an Agent, for the fact diagram, is a field table of about 3.4k characters and a mechanism note of about 6.3k characters.
npx skills add zh-xx/Antu -g
The Skill is in skills/antu/; each release also carries it as antu-skill-<version>.zip.
The command line asks the npm registry once a day whether a newer Antu is out (one GET request, nothing of any diagram) and, if so, ends its output with a notice. ANTU_NO_UPDATE_NOTIFIER=1 turns it off.
The MCP server is the npm package @zh-xx/antu, registered as io.github.zh-xx/antu in the MCP registry.
{
"mcpServers": {
"antu": {
"command": "npx",
"args": ["-y", "-p", "@zh-xx/antu@latest", "antu-mcp"]
}
}
}
Tools: antu_schema, antu_guide, antu_examples, antu_validate, antu_layout, antu_render, antu_preview, antu_versions.
A native DSH plugin, @zh-xx/antu-dsh (Host tools + a chat card with a picker of the way of drawing), is on npm: dsh plugin --profile <name> add @zh-xx/antu-dsh, then restart DSH. It needs DSH 0.2.0-rc.2 or newer. How it works and how it is tested: docs/dsh/dsh-plugin.md and tools/dsh/README.md. A profile that cannot use the plugin can still attach antu-mcp with a configuration-only bundle; the recipe and its limits are in tools/dsh/README.md.
The same package has entries for an application's own code (spec/embed.md):
import { mount } from '@zh-xx/antu/embed' // draw a diagram inside your page, in a shadow root
import { validate } from '@zh-xx/antu/validate' // check the JSON your model wrote; each error names its field
import { renderHtml } from '@zh-xx/antu/html' // the self-contained page as a string (Node)
import type { ProcedureSpec } from '@zh-xx/antu/types' // TypeScript shapes for each diagram JSON
const diagram = mount(element, spec, { lang: 'en', onEvent: (e) => console.log(e) })
spec/ (what makes a JSON file or API call valid): versioning, themes, paper size, the MCP server, embedding, source types, and the diagram schemas (fact, procedure, relationship, justification). Agent mechanism notes: spec/agent/.docs/: architecture, layout engines, React Flow features, fact rendering, DSH plugin plan (install notes in tools/dsh/README.md).@zh-xx/antu and @zh-xx/antu-dsh on npm is published by GitHub Actions through npm's trusted publisher, with provenance: the page of the version on npm links back to the commit and the workflow run that made it. deps.dev shows the same record, with the known advisories (none at the time of writing) and the licence.ANTU_NO_UPDATE_NOTIFIER=1 turns that off).Copyright (C) 2026 Ji Cheng.
Antu is free software, licensed under the GNU Affero General Public License, version 3 or any later version (LICENSE, SPDX AGPL-3.0-or-later). In short: you may use, study, change and share it, including for commercial purposes. If you distribute a changed version, or let others use it over a network (for example as a hosted service), you must release your changes under the same licence, keep the copyright and licence notices, and make the source available. There is no warranty. This summary is not the licence; the licence text is.
skills/antu/THIRD-PARTY-NOTICES.md, and also inside every page and at the top of the command line, together with the licence of Antu and the place of the source of that version.examples/ and the judgment texts in examples/raw/ are fictional: the people, companies, dates, amounts and provisions are made up for Antu and match no real case. They are under the same licence.CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: mcp、model-context-protocol。