Imported from yangjh-xbmu/ddddddd (
llm-wiki-agent/AGENTS.md). Install upstream withnpx skills add yangjh-xbmu/ddddddd --skill llm-wiki-agent. Copyright stays with the author.
LLM Wiki Agent — Schema & Workflow Instructions
This wiki is maintained entirely by your coding agent. No API key or Python scripts needed — just open this repo in Codex, OpenCode, or any agent that reads this file, and talk to it.
How to Use
Describe what you want in plain English:
- "Ingest this file: raw/papers/my-paper.md"
- "What does the wiki say about transformer models?"
- "Check the wiki for orphan pages and contradictions"
- "Build the knowledge graph"
Or use shorthand triggers:
ingest <file>→ runs the Ingest Workflowquery: <question>→ runs the Query Workflowhealth→ runs the Health Workflow (fast, every session)lint→ runs the Lint Workflow (expensive, periodic)build graph→ runs the Graph Workflow
Directory Layout
raw/ # Immutable source documents — never modify these
wiki/ # Agent owns this layer entirely
index.md # Catalog of all pages — update on every ingest
log.md # Append-only chronological record
overview.md # Living synthesis across all sources
sources/ # One summary page per source document
entities/ # People, companies, projects, products
concepts/ # Ideas, frameworks, methods, theories
syntheses/ # Saved query answers
graph/ # Auto-generated graph data
tools/ # Standalone Python scripts
health.py # Structural checks (deterministic, no LLM calls)
lint.py # Content quality checks (uses LLM for semantic analysis)
build_graph.py # Knowledge graph generation
Page Format
Every wiki page uses this frontmatter:
---
title: "Page Title"
type: source | entity | concept | synthesis
tags: []
sources: [] # list of source slugs that inform this page
last_updated: YYYY-MM-DD
---
Use [[PageName]] wikilinks to link to other wiki pages.
Ingest Workflow
Triggered by: "ingest "
Supported formats: Markdown (.md) is ingested directly. Non-markdown
files are auto-converted to markdown via markitdown before ingestion.
Steps (in order):
- Read the source document fully
- Read
wiki/index.mdandwiki/overview.mdfor current wiki context - Write
wiki/sources/<slug>.md— use the source page format below - Update
wiki/index.md— add entry under Sources section - Update
wiki/overview.md— revise synthesis if warranted - Update/create entity pages for key people, companies, projects mentioned
- Update/create concept pages for key ideas and frameworks discussed
- Flag any contradictions with existing wiki content
- Append to
wiki/log.md:## [YYYY-MM-DD] ingest | <Title> - Post-ingest validation — check for broken
[[wikilinks]], verify all new pages are inindex.md, print a change summary
Source Page Format
---
title: "Source Title"
type: source
tags: []
date: YYYY-MM-DD
source_file: raw/...
---
## Summary
2–4 sentence summary.
## Key Claims
- Claim 1
- Claim 2
## Key Quotes
> "Quote here" — context
## Connections
- [[EntityName]] — how they relate
- [[ConceptName]] — how it connects
## Contradictions
- Contradicts [[OtherPage]] on: ...
Query Workflow
Triggered by: "query: "
Steps:
- Read
wiki/index.mdto identify relevant pages - Read those pages
- Synthesize an answer with inline citations as
[[PageName]]wikilinks - Ask the user if they want the answer filed as
wiki/syntheses/<slug>.md
Lint Workflow
Triggered by: "lint"
Check for:
- Orphan pages — wiki pages with no inbound
[[links]] - Broken links —
[[WikiLinks]]pointing to pages that don't exist - Contradictions — claims that conflict across pages
- Stale summaries — pages not updated after newer sources
- Missing entity pages — entities mentioned in 3+ pages but lacking a page
- Sparse pages — pages with fewer than 2 outbound
[[wikilinks]] - Data gaps — questions the wiki can't answer; suggest new sources
Output a lint report.
Health Workflow
Triggered by: "health"
Run: python tools/health.py (or --json).
Fast structural integrity checks — zero LLM calls, safe to run every session:
- Empty / stub files — pages with no content beyond frontmatter
- Index sync —
wiki/index.mdentries vs actual files on disk - Log coverage — source pages missing an
ingestentry inwiki/log.md
Run
healthfirst — linting an empty file wastes tokens.
Graph Workflow
Triggered by: "build graph"
- Search for all
[[wikilinks]]across wiki pages - Build nodes (one per page) and edges (one per link)
- Infer implicit relationships — tag
INFERRED/AMBIGUOUSwith confidence - Write
graph/graph.jsonwith{nodes, edges, built: date} - Write
graph/graph.htmlas a self-contained vis.js visualization
Naming Conventions
- Source slugs:
kebab-casematching source filename - Entity pages:
TitleCase.md(e.g.OpenAI.md,SamAltman.md) - Concept pages:
TitleCase.md(e.g.RAG.md,LLMWiki.md)
Index Format
# Wiki Index
## Overview
- [Overview](overview.md) — living synthesis
## Sources
- [Source Title](sources/slug.md) — one-line summary
## Entities
- [Entity Name](entities/EntityName.md) — one-line description
## Concepts
- [Concept Name](concepts/ConceptName.md) — one-line description
## Syntheses
- [Analysis Title](syntheses/slug.md) — what question it answers
Log Format
## [YYYY-MM-DD] <operation> | <title>
Operations: ingest, query, health, lint, graph, report
