/maia:build <topic> | --corpus <paths...> [--lang en|zh|both] [--depth <n>]from maia
Build an interactive bilingual knowledge graph from a subject (web research) or your own documents
Ships in maia. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Build a Maia knowledge graph. Two modes: web research or your own documents. No API key required — you ARE the model. Python only validates and exports.
From $ARGUMENTS:
--corpus <paths...> — one or more file/directory paths → corpus mode--lang en|zh|both — graph language(s), default en--depth <n> — 1 ≈ 25 nodes, 2 ≈ 50, 3 ≈ 80 (auto-decide if omitted)--title <text> — graph title for corpus mode (optional)If no arguments given, ask:
What would you like to map? Give a topic (e.g. "Wittgenstein") or pass
--corpus <paths>to map your own documents.
PLUGIN_ROOT="$HOME/.claude/plugins/cache/maia/maia/1.0.0"
[ -f "$PLUGIN_ROOT/.claude-plugin/plugin.json" ] || { echo "Plugin root not found"; exit 1; }
BACKEND="$PLUGIN_ROOT/backend"
OUTPUT="$PLUGIN_ROOT/output"
mkdir -p "$OUTPUT"
VENV="$BACKEND/.venv"
[ -f "$VENV/bin/python" ] || (cd "$BACKEND" && python3 -m venv .venv && .venv/bin/pip install -q -r requirements.txt)
You are the research engine. Use your knowledge + WebSearch. No Python LLM calls needed.
Do 3-5 targeted web searches:
"<topic>" core concepts overview — broad orientation, identify pillar ideas"<topic>" <most important concept> — depth on the top concept"<topic>" 核心概念 简介 — Chinese-language sources for bilingual content"<topic>" <second important concept> — if more depth neededSkim 2-3 authoritative pages with WebFetch. Collect real URLs for sources fields.
Build the complete graph structure from your research + knowledge. Schema:
{
"schema": "bilingual-v2",
"expert": {"en": "Topic Name", "zh": "主题中文名"},
"domain": {"en": "core concepts", "zh": "核心概念"},
"nodes": [ ...see node schema below... ],
"edges": [ ...see edge schema below... ],
"meta": {
"foundational": ["id1", "id2"],
"tour": ["id1", "id2", "id3", "...ordered learning path..."]
},
"lang_default": "<lang>"
}
Node schema:
{
"id": "language-game",
"name": {"en": "Language-Game", "zh": "语言游戏"},
"type": "concept",
"summary": {"en": "One clear paragraph.", "zh": "一段话中文摘要。"},
"tags": [{"en": "core", "zh": "核心"}],
"difficulty": "foundational",
"relevance": 0.95,
"sources": ["https://example.com/..."],
"depth": 0,
"aliases": [],
"explored_by": "main",
"profile": {
"what": {"en": "2-3 real sentences on what this IS.", "zh": "2-3句说明这是什么。"},
"why": {"en": "Why it matters in this body of knowledge.", "zh": "在此知识体系中为何重要。"},
"position": {"en": "Its structural place: what it grounds, what depends on it.", "zh": "结构位置:它奠定了什么,又依赖什么。"},
"quote": {"en": "Exact canonical quotation OR concrete example.", "zh": "原文引用或具体示例。"},
"quote_source": "Work title, §section or chapter"
}
}
Edge schema:
{
"source": "source-node-id",
"target": "target-node-id",
"relation": {"en": "depends_on", "zh": "依赖于"},
"evidence": "brief phrase from source"
}
ID rules:
id = EN name, lowercase, spaces→hyphens, strip non-alphanumeric (e.g. "language-game")difficulty values: foundational / intermediate / advanced
depth: 0 = seed concept, 1 = first expansion, 2 = second expansion
Valid relation types with Chinese labels:
| en | zh |
|---|---|
depends_on | 依赖于 |
part_of | 属于 |
contrasts_with | 对立于 |
leads_to | 导向 |
applies | 应用于 |
subtype_of | 子类型 |
Quality targets:
profile.what in both languagesmeta.tour: ordered from bedrock foundations → applications (the learning path)profile.quote: real quotations only — if none available, use a concrete canonical exampleUse the Write tool to save the assembled JSON to $OUTPUT/graph.json.
If --corpus was given:
sources field = filename with chunk reference (e.g. "notes.md#3")--title as expert.en/zh; infer Chinese title if not given$OUTPUT/graph.json, then continue at Step 6cd "$BACKEND" && .venv/bin/python validate.py "$OUTPUT/graph.json"
This normalizes node IDs, removes broken edges, and fills missing fields. If it fails, inspect the error and fix graph.json before continuing.
SLUG=$(python3 -c "import re,sys; s=sys.argv[1].lower(); s=re.sub(r'[^a-z0-9一-鿿]+','-',s).strip('-'); print(s)" "<topic>")
cd "$BACKEND" && .venv/bin/python export_html.py "$OUTPUT/graph.json" "$OUTPUT/${SLUG}.html"
open "$OUTPUT/${SLUG}.html"
Report:
Graph built:
<full path to .html>Press F to present · ← → to walk the tour · EN / 中 to switch language
validate.py fails → inspect error, patch graph.json, re-run validateexport_html.py fails → report raw graph.json path; graph exists even without HTML--lang both: build one graph with bilingual content (both en and zh filled in every node); set lang_default to enWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub bitqs/maia --plugin maia2 skills in this plugin
Other plugins' skills for the same job