{
  "markdown": "<p align=\"center\">\n  <img src=\"assets/imgs/logo.png\" width=\"600\" />\n</p>\n\n# wiki-wonka\nLLM Wiki\n**A persistent, LLM-maintained knowledge base inspired by [Karpathy's LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f).**\n\n## 🧭 Overview\n\nwiki-wonka is an agent-driven system for building and maintaining a structured, evolving wiki of knowledge. Instead of relying on stateless retrieval (RAG) for every query, wiki-wonka compiles and curates knowledge into a persistent, interlinked set of Markdown pages. The LLM agent handles all the summarizing, cross-referencing, and bookkeeping—so your knowledge base compounds and improves over time.\n\n## 🛠️ How it works\n\n- **Raw sources**: Immutable documents (papers, articles, data) are added to the `raw/` folder. The LLM never edits these files.\n- **Wiki**: The agent generates and maintains Markdown pages in `wiki/`, including summaries, entity pages, concepts, and an evolving synthesis. All cross-references and updates are handled automatically.\n- **Schema**: The structure and conventions are defined in a schema file (see `wiki/SCHEMA.md`). This ensures consistency and enables the LLM to act as a disciplined maintainer, not just a chatbot.\n\n## ✨ Features\n\n- **Persistent knowledge base** — wiki pages compound over time; no rediscovery from scratch on every query\n- **Structured ingestion** — two-phase flow (analysis + confirmation) before any file is written\n- **Cross-referencing** — wikilinks (`[[slug]]`) connect sources, entities, and concepts automatically\n- **Query with citations** — answers always sourced from wiki pages, never from model memory alone\n- **Lint & health checks** — detects contradictions, orphan pages, outdated claims, and missing cross-references\n- **Append-only log** — full audit trail of every ingest, query, and lint operation in `wiki/log.md`\n- **Callout system** — `[!contradiction]`, `[!gap]`, `[!outdated]`, `[!deprecated]` flag issues for human review\n- **Language support** — all generated prose follows the locale set in `wiki/config.md` (e.g. `pt-BR`, `en-US`)\n- **Git auto-commit** — hook commits wiki page writes automatically, keeping history clean\n- **Immutable raw sources** — `raw/` is write-protected; the agent can never modify original documents\n- **Schema-driven** — conventions defined in `wiki/SCHEMA.md` keep every page consistent and predictable\n\n---\n\n## ⚡ Main operations\n\n- **Ingest**: Add a new source to `raw/` and instruct the agent to process it. The agent reads, summarizes, updates relevant pages, and logs the operation.\n- **Query**: Ask questions against the wiki. The agent synthesizes answers from existing pages, always citing sources. New insights can be filed back into the wiki.\n- **Lint**: Periodically check the wiki for contradictions, stale claims, orphan pages, and missing cross-references. The agent suggests fixes and keeps the knowledge base healthy.\n\n## 🌐 Language support\n\nwiki-wonka generates all wiki content in the language configured in `wiki/config.md`:\n\n```yaml\n---\nlanguage: pt-BR   # e.g. en-US, pt-BR, es\n---\n```\n\nThe orchestrator reads this file at startup and enforces the language across every operation — ingest summaries, query answers, concept definitions, lint reports, and free-conversation responses. To switch languages, edit the file and continue working; existing pages are not rewritten automatically.\n\nWhat always stays in English regardless of the setting:\n- Frontmatter field names (`title`, `slug`, `type`, `tags`, …)\n- File slugs (`attention-mechanism.md`)\n- Callout types (`[!contradiction]`, `[!gap]`, `[!outdated]`, `[!deprecated]`)\n\n## 🗂️ Indexing and logging\n\n- `wiki/index.md`: Catalog of all wiki pages, organized by category, with summaries and links.\n- `wiki/log.md`: Chronological log of all ingests, queries, and maintenance actions.\n\n## 🤔 Why this approach?\n\nTraditional RAG systems force the LLM to rediscover knowledge from scratch on every query. By maintaining a persistent, evolving wiki, wiki-wonka enables deeper synthesis, better cross-referencing, and a continuously improving knowledge base. The LLM does the grunt work; you curate sources and guide the process.\n\n## 💡 Usage\n\nBefore interacting, start the agent server in claude code:\n\n```bash\n# 1. navigate to the project root\ncd wiki-wonka\n\n# 2. start the agent server with the current directory as the plugin source\nclaude --plugin-dir .\n```\n>[!NOTE]\n> You can then interact with the agent `wiki-wonka` through any interface that supports the plugin, such as a chat UI or Copilot.\n\nThe user interacts directly in natural language—no special commands to memorize. The orchestrator interprets intent and routes to the right skill.\n\nHere are the main interaction patterns:\n\n---\n\n### Ingest\n\nThe user mentions a source—file path, pasted URL, or direct content:\n\n```\n\"process this article: raw/attention-is-all-you-need.md\"\n\n\"I just saved a PDF in raw/, it's called transformers-survey.pdf\"\n```\n\nThe agent confirms, executes the ingest, and reports how many pages were touched:\n\n```\nIngesting \"Attention Is All You Need\"...\n\nCreated: sources/attention-is-all-you-need\nUpdated: entities/vaswani-ashish, concepts/self-attention,\n\t\t concepts/transformer, overview\nLog updated. 4 pages touched.\n\nWould you like to discuss any point before continuing?\n```\n\n---\n\n### Query\n\nThe user asks questions as they would to a domain expert:\n\n```\n\"what's the difference between self-attention and cross-attention?\"\n\n\"what do my sources say about transformer scalability?\"\n\n\"is there any contradiction between Vaswani's paper and the survey?\"\n```\n\nThe agent reads relevant pages from `wiki/` before answering—never from memory—and cites sources. At the end, it offers to archive:\n\n```\n[answer with citations from wiki/concepts/self-attention and wiki/sources/...]\n\nWould you like me to archive this analysis as a new concept page?\n```\n\n---\n\n### Lint\n\nThe user asks explicitly or the agent may suggest periodically:\n\n```\n\"run a lint on the wiki\"\n\n\"are there any orphan pages?\"\n\n\"what is outdated after the last ingest?\"\n```\n\nThe agent returns a structured report and asks what to fix:\n\n```\nLint complete. Found:\n- 2 contradictions (concepts/attention vs concepts/self-attention)\n- 1 orphan page (entities/lecun-yann — no inbound links)\n- 3 concepts mentioned without their own page\n\nWould you like me to resolve everything now or review item by item?\n```\n\n---\n\n### Free conversation\n\nThe user can also just chat—the orchestrator decides if a skill is needed or responds directly:\n\n```\n\"what do I already have in the wiki about LLMs?\"\n→ orchestrator reads index.md and responds without invoking a skill\n\n\"what were the last 3 ingests?\"\n→ orchestrator reads log.md and responds\n\n\"what should I ingest next about attention?\"\n→ orchestrator synthesizes wiki gaps and suggests sources\n```\n\n---\n\n### For Copilot specifically\n\nIn VS Code with Copilot, the user opens the chat panel and uses `@workspace` to give repository context. Interactions are the same, but Copilot is more helpful when the user mentions files explicitly:\n\n```\n@workspace process the file raw/my-paper.md as a wiki ingest\n```\n\nCompatibility works because `.github/copilot-instructions.md` contains the same routing rules as `CLAUDE.md`—the user doesn't need to change vocabulary between the two agents.\n\n## 🛠️ Troubleshooting\n\n### Problem: hook scripts lack execution permission\n\nIf you get an error about permission denied when running any hook-related command, it means the scripts do not have execution permission.\n\nTo fix this, run:\n\n```bash\nchmod +x hooks/*.sh\n```\n\nThen reload the hooks:\n\n```bash\n/reload-plugins\n```\n\nTo confirm it worked before reloading:\n\n```bash\nls -la hooks/*.sh\n```\n\nThe output should show `-rwxr-xr-x` at the start of each line. If it still shows `-rw-r--r--`, the `chmod` was not applied in the correct folder—make sure you are in the project root (`wiki-wonka/`) before running the command.\n\n## 📚 References\n\n- Read the original pattern: [Karpathy's LLM Wiki gist](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f)\n- See the schema and skills in the `wiki/` and `skills/` folders\n\n---\n\n*Inspired by the ideas and community around LLM-powered knowledge management. See the gist for more discussion, extensions, and related projects.*\n",
  "bytes": 8302,
  "sha": "d495c0e239702d86acc0e9395f248de67df507167f632521a1cc7daaf1a2fdc9",
  "repo_slug": "cooperacode/wiki-wonka",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_cooperacode_wiki_wonka_wiki_wonka_db44dd54/readme"
}