Wiki graph index
一套将 PDF/LaTeX 自动转化为 Obsidian 结构化 Markdown 知识图谱的 AI 智能体技能。
npx -y skills add Misaka16384/Wikify --skill wiki_graph_indexAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Extract Obsidian-style relationships (wikilinks, tags, aliases) into a structured AI-friendly SQLite graph database.
SKILL.md
2.9 KB, 686 tokens by cl100k_base, as published. Nobody here has run it
LLM Wiki — Graph Index Skill (wiki_graph_index)
Resolving script paths (read first): Commands below invoke scripts as
<BIN>/X.py(and a few as<SKILLS>/...). Resolve these to absolute paths once before running anything:
<SKILL_DIR>= the directory thisSKILL.mdlives in.<SKILLS>= theskills/folder containing this skill =<SKILL_DIR>/..<BIN>= thebin/folder beside it =<SKILL_DIR>/../../binDo not hardcode a fixed prefix like
.agents/binor../bin: shell relative paths resolve against the current working directory (usually the topic root), not this skill's location. Once resolved,<BIN>is typically.agents/binwhen invoked from the hub root, or.claude/binfrom inside a topic directory.
This skill extracts the Markdown-based knowledge graph (comprised of [[wikilinks]], tags, and aliases) into a structured SQLite database (output/graph.db) that an AI agent can easily query using standard SQL.
Usage
When the user asks to extract, index, or query the knowledge graph of their wiki:
1. Build the Graph Database
Run the deterministic python script to extract the graph from the markdown files:
python <BIN>/llm-wiki.py graph <TOPIC_DIR>
This will parse all markdown files under wiki/ (ignoring _index.md), extract frontmatter (tags, aliases) and body links, and rebuild the SQLite database located at output/graph.db.
2. Query the Graph Database
Once built, you (the AI) can query output/graph.db using Python's sqlite3 module to traverse the graph and answer the user's questions.
The database schema is as follows:
nodes(id, path, title, type, category, summary, created, updated)id: The file path without extension (e.g., 'concepts/concept_name') or a tag (e.g., 'tag:machine-learning').
edges(source_id, target_id, type)typecan be 'wikilink' (between files) or 'has_tag' (from file to tag node).
tags(node_id, tag)aliases(node_id, alias)
Use python <BIN>/query-graph.py "<SQL>" --db <TOPIC_DIR>/output/graph.db to query the knowledge graph. Do not use direct sqlite3 command line execution.
Example:
python <BIN>/query-graph.py "SELECT source_id FROM edges WHERE target_id = 'Transformer';" --db <TOPIC_DIR>/output/graph.db
Or via a temporary Python script if you need complex graph traversal.
3. Report
Present the findings of your graph queries to the user.
Error Handling
- If any script exits with non-zero code, report the full stderr output to the user and stop.
- If a file cannot be read or parsed, log a warning and continue with remaining files.
- Do NOT silently skip errors or proceed with partial results without reporting.
Gives 0 of the 12 instructions most databases sql skills give in 686 tokens
Counted across 589 of the 662 authors here whose files we hold, read 2026-08-06
- use parameterized queriesin 36 of 589, across 32 files
- use timestamptz for timestampsin 30 of 589, across 12 files
- create indexes concurrentlyin 29 of 589, across 23 files
- index foreign keysin 28 of 589, across 17 files
- use numeric type for moneyin 25 of 589, across 8 files
- select only required columnsin 24 of 589, across 19 files
- use cursor pagination instead of OFFSETin 23 of 589, across 15 files
- add indexes manually on foreign key columnsin 22 of 589, across 11 files
- read individual rule files for detailed explanationsin 18 of 589, across 4 files
- configure connection poolingin 18 of 589, across 16 files
- put equality columns before range columns in indexesin 17 of 589, across 9 files
- normalize to third normal formin 17 of 589, across 8 files
Said here and by no other author read
- resolve script paths to absolute paths once before running
- build the graph database from markdown files
- query the database using the query script
- present graph query findings to the user
- report full stderr and stop on non-zero exit code
- log a warning and continue on file parse failure
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.