MyKG Skills
An LLM-maintained personal knowledge graph. Incrementally build a structured wiki of markdown files — reading sources, extracting knowledge, updating pages, and keeping everything connected.
Based on the LLM Wiki pattern by Andrej Karpathy.
What is this?
MyKG provides tools for AI agents to maintain a persistent knowledge base:
- Universal Skill - General KG operations, ingestion, querying, linting
- Project Skills - Domain-specific instructions for research, reading, personal tracking
Three-layer architecture:
- Raw sources — immutable source documents (papers, articles, transcripts)
- Wiki — LLM-generated pages (entities, concepts, synthesis)
- Schema — configuration telling the LLM how to maintain the wiki
Installation
OpenCode
# 1. Install the skill
mkdir -p ~/.opencode/skills/mykg
cp SKILL.md ~/.opencode/skills/mykg/SKILL.md
# 2. Install commands
mkdir -p ~/.config/opencode/command
cp commands/*.md ~/.config/opencode/command/
Marketplace
/plugin marketplace add https://github.com/Ethics03/kgskill
/plugin install mykg@kgskill
npx skills
npx skills add https://github.com/Ethics03/kgskill.git
Manual
# Copy skills into your .claude folder
cp -r skills/ ~/.claude/skills/
# Copy commands
mkdir -p ~/.claude/commands
cp commands/*.md ~/.claude/commands/
Other AI Agents
The skill and commands are platform-agnostic markdown files. Adapt for your agent:
- Skill file (
SKILL.md) — Load as system instructions or context
- Commands (
commands/*.md) — Register as slash commands
The commands are shell scripts wrapped in markdown — extract the bash sections and adapt to your platform.
Initialize or Configure
/kg-init [path] # Create new KG
/kg-setup # Configure existing KG
Quick Start
Initialize New KG
/kg-init ~/MyKG
Creates:
MyKG/
├── index.md
├── log.md
├── Active.md
├── AGENTS.md
├── raw/
│ ├── articles/
│ ├── papers/
│ └── transcripts/
└── wiki/
├── entities/
├── concepts/
├── synthesis/
└── comparisons/
Ingest a Source
/kg-ingest raw/articles/my-article.md
The LLM will:
- Read the source
- Extract entities and concepts
- Create/update wiki pages
- Link related pages
- Update index and log
Query the Wiki
/kg search <term> # Search wiki pages
/kg recent # Recent changes
/kg entities # List entities
/kg concepts # List concepts
Create a Project
/kg-project research-paper-x "Research on quantum computing"
Creates project-specific workspace with custom SKILL.md.
Commands
| Command | Description |
|---|
/kg-setup | Configure KG path |
/kg-init [path] | Initialize new KG |
/kg-project <name> | Create project workspace |
/kg-ingest <source> | Ingest source into wiki |
/kg-lint | Health check wiki |
/kg recent | Recent changes |
/kg search <term> | Search wiki |
/kg entities | List entity pages |
/kg concepts | List concept pages |
/kg active | Current focus items |
Configuration
KG path resolved in order:
MYKG_PATH environment variable
~/.config/mykg/config file
- Common locations:
~/MyKG, ~/Dev/Obsidian/MyKG
Operations
Ingest
Read source → extract knowledge → update wiki:
- Create summary page
- Extract entities (people, orgs, tools)
- Extract concepts (ideas, topics, themes)
- Note contradictions with existing pages
- Update index and log
Query
Search wiki → synthesize answer → cite sources:
- Read index to find relevant pages
- Drill into specific pages
- Synthesize with
[[citations]]
- Optionally save answer as new page
Lint
Health check the wiki:
- Orphan pages (no inbound links)
- Contradictions between pages
- Missing cross-references
- Stale claims
- Gaps to investigate
Structure
kgskills/
├── .claude-plugin/plugin.json # Claude Code plugin manifest
├── SKILL.md # Universal skill
├── commands/ # Slash commands
├── skills/mykg/ # Plugin skill entry (symlink to SKILL.md)
├── templates/kg-init/ # New KG scaffold
├── project-templates/init/ # New project scaffold
└── docs/
├── concepts.md
└── examples.md
Two-Tier Architecture
Universal Skill
Loaded once. Teaches the agent:
- KG structure and conventions
- Ingest, query, lint operations
- Standard page types
- Wikilink syntax
Project Skill
Loaded per-project. Contains:
- Domain-specific page types
- Custom ingestion workflows
- Domain terminology
- Project-specific formatting