Skill llm wiki

From infranodus/skills · View interactive version

Skill llm wiki is an AI agent skill from the GitHub repository infranodus/skills. Guide users through setting up a personal LLM-maintained wiki — a persistent, compounding knowledge base where the LLM incrementally builds and maintains interlinked markdown pages from raw sources. Use this skill when the user wants to: set up a personal knowledge base, create a research wiki, orga

How to use this skill

Skill file

LLM Wiki Setup Assistant

A guided, multi-phase workflow for designing and scaffolding a personal LLM-maintained wiki. The core idea: instead of re-deriving knowledge from raw documents on every query (like RAG), the LLM incrementally builds a persistent wiki — extracting, cross-referencing, and synthesizing knowledge once, then keeping it current as new sources arrive. The wiki compounds over time. The human curates sources and asks questions; the LLM does all the bookkeeping.

Preamble (run first)

_BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
echo "BRANCH: $_BRANCH"

Architecture (for context)

Every LLM Wiki has three layers:

  1. Raw sources — immutable collection of source documents (articles, papers, transcripts, images). The LLM reads but never modifies these. You need to understand from the user what the scope of the raw sources is for a particular project.
  2. The wiki — LLM-generated markdown files (summaries, entity pages, concept pages, comparisons, synthesis). The LLM owns this layer entirely. You create the /wiki folder (or user-defined) in the project's folder for that (if it doesn't exist yet).
  3. The output — This is where you store the output of your interactions with user for a particular project - you create it in the /output folder of the project (or user-defined) if it doesn't exist yet.
  4. The schema — a configuration document (CLAUDE.md for Claude and AGENTS.md for Codex) that tells the LLMs how the wiki is structured, what conventions to follow, and what workflows to use. Co-evolved by user and LLM over time. Create both files so the folder is compatible with most LLMs.

Phase Overview

1. DISCOVER    -> What domain? What's the goal? What sources?
2. SCOPE       -> How big? How deep? What outputs matter?
3. STRUCTURE   -> Directory layout, page types, naming conventions - see architecture above
4. SCHEMA      -> Write the CLAUDE.md and AGENTS.md of the local folder where the skill is invoked for configuration
5. WORKFLOWS   -> Define ingest, query, and lint operations
6. TOOLING     -> Obsidian plugins, InfraNodus tools for gap analysis, research, and text optimization, CLI tools, search, git
7. SCAFFOLD    -> Create the directory structure and starter files
8. ACQUIRE     -> Get sources into raw/ (hard-drive import, web fetch, transcription, PDF→md)
9. PROCESS     -> Ingest raw/ → wiki/ (summarize, update index, refresh ontologies)
10. PLAN       -> Analyze gaps, prioritize research directions, create actionable todos

Phases 8 and 9 are TWO DIFFERENT OPERATIONS. Phase 8 only touches raw/; Phase 9 only
reads raw/ and writes wiki/. Either can run without the other. Both are re-runnable.

Phase 1: DISCOVER — What Are You Building This For?

Start by understanding the user's domain and motivation. Ask conversationally — 2-3 questions max per message using the AskUserQuestion tool.

Core Questions

Contextual Probes

Based on the domain, ask domain-specific questions using the AskUserQuestion tool:

Don't overwhelm. Gather enough to move to Phase 2. You can refine as you go.


Phase 2: SCOPE — How Big and How Deep?

Now calibrate the wiki's scale and depth. This determines how much structure to build.

Scale Assessment

Ask the user to estimate:

Depth Assessment

Output Needs

Tier Classification

Based on answers, classify the wiki into a tier (share this with the user):

| Tier | Sources | Entities | Duration | Example |

| ---------- | ------- | -------- | ------------ | ----------------------------------------------------------------- |

| Light | 5-20 | Few/none | Days-weeks | Reading a single book, trip planning |

| Medium | 20-100 | Dozens | Weeks-months | Research project, course notes, competitive analysis |

| Heavy | 100+ | Hundreds | Months-years | Ongoing team wiki, long-term research program, personal life wiki |

The tier determines how much indexing infrastructure, how many page types, and how formal the schema needs to be.


Phase 3: STRUCTURE — Design the Directory Layout

Based on Phases 1-2, propose a directory structure. Present it to the user and iterate.

See Directory Structure Templates.

Knowledge Graphs

All ontology/knowledge-graph files live flat in infranodus/ at the project root, registered in infranodus/manifest.json (file → saved InfraNodus graph). This is a core part of the workflow — not optional. Rules:

  1. Curated ontologies are append-only — NEVER regenerate them from scratch. Read the existing file first, then append only lines covering genuinely new content, matching its format exactly; removing or editing a line is a deliberate, line-by-line editorial decision.
  2. Files with generated: true frontmatter belong to their generator script (e.g. the infranodus skill's repo/vault scans) — never append to or hand-edit them. Always check the frontmatter before touching any file in infranodus/.
  3. Generate with the ontology-generator skill (via /ontology-generator or the Skill tool) from the folder's page content; save as infranodus/<folder-name>-ontology.md with curated: true and wikilinksMode: wikilinksOnly. If the skill is missing, ask the user to install it from https://github.com/infranodus/skills.
  4. Upload with the bundled script, never via create_knowledge_graph calls: python3 <this skill's dir>/scripts/upload_wiki_ontology.py . --file infranodus/<folder-name>-ontology.md for a new file, plain python3 <this skill's dir>/scripts/upload_wiki_ontology.py . to sync appended lines — it records graphName + url in the manifest. Then save the graph analysis to output/<folder-name>-knowledge-graph-analysis.md and act on the gaps.

See Knowledge Graphs and Ontology Policy

Page Types to Consider

Propose page types based on the domain. Common ones:

See Directory Structure Templates.

Naming Conventions

Propose and confirm with the user:

Present and Iterate

Show the proposed structure as a tree diagram. Ask:


Phase 4: SCHEMA — Write the Configuration Document

This is the most important phase. The schema (CLAUDE.md / AGENTS.md) is what turns a generic LLM into a disciplined wiki maintainer.

Determine Which Schema File

Schema Sections to Include

Write the schema document with these sections, tailored to the user's domain:

1. Project Overview
2. Directory Structure
3. Page Templates
4. Ingest Workflow

1. Read the source

2. Discuss key takeaways with the user (optional — based on user preference)

3. Create a source summary page

4. Update or create entity/concept pages

5. Update the index

6. Update the overview if the new source significantly changes the picture

7. Append to the log

8. Flag any contradictions with existing wiki content

5. Query Workflow

1. Read the index to find relevant pages

2. Read the relevant pages

3. Synthesize an answer with citations to wiki pages

4. Optionally: file the answer as a new wiki page if it's valuable

6. Lint Workflow
7. Conventions

Present and Iterate

Show the user the draft schema. This is the document they'll live with, so get it right. Ask:


Phase 5: WORKFLOWS — Define the Operations

Flesh out the three core operations based on user preferences.

Ingest Preferences

Ask with AskUserQuestion tool:

Query Preferences

Ask using the AskUserQuestion tool:

Lint Preferences

Ask using the AskUserQuestion:

Document the Workflows

Add the agreed workflows to the schema document with enough detail that the LLM can follow them in future sessions without re-asking these questions.


Phase 6: TOOLING — Set Up the Environment

Based on the user's setup, recommend and configure tools.

Essential: File Viewer

Optional: Search

Assess search needs based on tier:

Optional: Version Control

Optional: CLI Tools

For power users or heavy-tier wikis, offer to build simple helper scripts:

Ask what the user already has installed and what they're comfortable with. Don't over-engineer the tooling for light-tier wikis.


Phase 7: SCAFFOLD — Create the Directory Structure

Now build it. Create the agreed directory structure with starter files.

Create directories and files:

  1. Directory tree — create all agreed directories
  2. CLAUDE.md / AGENTS.md — the schema document from Phase 4
  3. index.md — empty index with the agreed format and section headers
  4. log.md — initialized with a first entry: ## [YYYY-MM-DD] init | Wiki created
  5. overview.md — a placeholder noting the wiki's purpose and that it will be populated as sources are ingested
  6. Page templates — optionally create example template files in a _templates/ directory for reference
  7. .gitignore — if git was chosen
  8. Initialize git repo — if git was chosen

Present the Result

Show the user the created structure. Walk through each file briefly. Ask:


Phase 8: ACQUIRE — Get Sources Into `raw/`

Re-runnable. Touches only raw/ — never wiki/. Steps:

  1. Detect the mode: no wiki/sources/*.md yet → first run (acquire ONE source as a test drive); otherwise → ongoing bulk acquisition. If raw/ already holds unprocessed material, skip straight to Phase 9.
  2. Ask where the material is: a folder on disk, a list of URLs, a reference-manager export, a web search for new sources, or files the user dropped in manually.
  3. For each item: determine the source TYPE, convert if needed (PDF → markdown, YouTube → transcript, web page → markdown), place it in the typed raw/ subfolder (create on the fly), keep lossy originals in raw/assets/.
  4. Report what was acquired (counts, subfolders, failures) and hand off to Phase 9.

See Phase 8: ACQUIRE and Phase 9: PROCESS — mode-detection script, capture-channel table, and the exact prompts.

Phase 9: PROCESS — Ingest `raw/` → `wiki/`

Re-runnable. Reads raw/, writes wiki/ — no acquisition here. When the user says "ingest", "process raw/", or "update the wiki" on an existing wiki, jump directly here — do NOT re-run Phases 1–7. Steps:

  1. Show the confirmation prompt (verbatim wording in the reference) with scope options: all of raw/, one subfolder, or one file.
  2. Inventory unprocessed sources — every raw/ file without a matching wiki/sources/<slug>.md.
  3. Process each source per the schema's ingest workflow (source summary → system/concept/connection updates → question pages → index → log → contradiction flags), reporting one-line progress.
  4. After the batch: append new relations to the curated ontologies in infranodus/ (never regenerate — see the policy in Phase 3), sync with python3 <this skill's dir>/scripts/upload_wiki_ontology.py ., refresh output/<folder>-knowledge-graph-analysis.md, and re-invoke the infranodus skill for any generated scopes.
  5. First run only: flag schema adjustments. Then summarize the batch and suggest Phase 10 if ≥10 new sources came in or gaps shifted.

See Phase 8: ACQUIRE and Phase 9: PROCESS — full procedure, inventory script, and handoff text.


Phase 10: PLAN — Research Direction and Todo Planning

After the wiki has accumulated enough content (typically 10+ sources, or after a significant round of ingestion), help the user step back and plan what to research next. This phase analyzes the wiki's current state — using InfraNodus gap analysis and the wiki's own structure — to produce a prioritized todo list that lives in a todos/ folder at the project root.

This phase can be run at any time, not just during initial setup. It's the natural follow-up whenever the user asks "what should I work on next?" or after a batch of new sources has been ingested.

Step 9.1: Assess Current State

Read the wiki's structural health:

  1. Read wiki/index.md to understand what exists
  2. Read wiki/overview.md for the current synthesis
  3. Check for existing InfraNodus analyses in output/*-knowledge-graph-analysis.md — these contain identified content gaps, cluster structure, and recommendations
  1. Check wiki/questions/ for open research questions
  2. Check wiki/data/ for personal data pages (empty = a gap worth flagging)
  3. Check todos/ for existing todo files (to avoid duplicating or contradicting prior plans)

Summarize the state back to the user: how many sources, what's well-covered, what's thin.

Step 9.2: Identify Priorities

Using the InfraNodus analyses and wiki structure, identify the highest-value work to do next. Prioritize by convergence — gaps flagged by multiple analyses are more important than one-off mentions.

Common priority types:

| Priority Type | Description | Example |

| ------------------------ | --------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |

| Content gap | Two clusters in the knowledge graph are disconnected — a bridging concept or source is needed | "Criticality ↔ Metastability — no source connects these two frameworks" |

| Weak coverage | A topic has few sources relative to its importance | "Only 1 intervention study across 48 sources" |

| Empty section | A wiki section exists but has no content | "wiki/data/ has no personal data pages" |

| Naming/framework gap | A framework is partially built — some systems have labels/states, others don't | "HRV and movement states named, breathing states missing" |

| Source to find | A specific paper or source type is needed to fill a gap | "Need breathing-specific fractal variability studies" |

| Synthesis needed | Enough raw material exists but no synthesis page connects it | "Three connection pages mention trauma but no unified framework" |

Present the identified priorities as a ranked list. Ask the user via AskUserQuestion:

Here are the top priorities I see. Which ones do you want to work on?

Offer the priorities as multi-select options so the user can pick which ones matter to them. Include an option to add their own priorities.

Step 9.3: Create Todo Files

For each selected priority, create a markdown file in todos/ at the project root.

mkdir -p todos

Todo file format (todos/<priority-slug>.md):

# <Priority Title>

Deadline: <YYYY-MM-DD>

## Tasks

- [ ] <Task description>
          - <Sub-details, context, specific files to update>
          - Deadline: <YYYY-MM-DD>

- [ ] <Task description>
          - <Sub-details>
          - Deadline: <YYYY-MM-DD>

Guidelines for writing todos:

Step 9.4: Timeline (Optional)

If the user wants deadlines, ask via AskUserQuestion:

What timeframe are you working with for these priorities?

If they choose a timeframe, distribute deadlines across the period, respecting task dependencies (e.g., "ingest sources" must come before "write framework that synthesizes them").

Step 9.5: Connect to Actionize (Optional)

Check if the /actionize skill is available (listed in available skills). If it is, ask via AskUserQuestion:

Want to turn these priorities into a tracked plan with Telegram reminders? The /actionize skill can set up daily deadline nudges and progress tracking.

If yes, invoke the /actionize skill (via the Skill tool) and pass a summary of the selected priorities as input. Format the input as:

Priorities from wiki gap analysis:

1. **{Priority title}** — {description}. Tasks: {task list from todo file}. Deadline: {deadline if set}.
2. **{Priority title}** — ...
...

Priority order: #1 → #2 → #3. Schedule with reminders.

The /actionize skill will handle: co-designing the plan with the user, creating .plan/ with status tracking, setting up Telegram bot + daily cron reminders, and installing the done.sh CLI for marking tasks complete from the terminal.

The two systems are complementary — both should exist:

If /actionize is not available, mention that the user can install it for Telegram reminders and deadline tracking. The todo files work standalone without it.

Step 9.6: Present the Result

Show the user what was created:

RESEARCH PLAN CREATED
════════════════════════════════════════
Priorities:  {count} workstreams
Todo files:  todos/{list filenames}
Timeline:    {date range or "open-ended"}
════════════════════════════════════════

List each todo file with its task count. Remind the user:


Adaptation Rules

For Personal / Journal Wikis

For Academic Research

For Book Reading

For Business / Team Use

For Quick / Light Projects

User Wants More Structure

User Wants Less Structure


AskUserQuestion Format

ALWAYS follow this structure for every AskUserQuestion call:

  1. Re-ground: State the project, the current branch (use the _BRANCH value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences)
  2. Simplify: Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called.
  3. Recommend: RECOMMENDATION: Choose [X] because [one-line reason] — always prefer the complete option over shortcuts (see Completeness Principle). Include Completeness: X/10 for each option. Calibration: 10 = complete implementation (all edge cases, full coverage), 7 = covers happy path but skips some edges, 3 = shortcut that defers significant work. If both options are 8+, pick the higher; if one is ≤5, flag it.
  4. Options: Lettered options: A) ... B) ... C) ... — when an option involves effort, show both scales: (human: ~X / CC: ~Y)

Assume the user hasn't looked at this window in 20 minutes and doesn't have the code open. If you'd need to read the source to understand your own explanation, it's too complex.

Per-skill instructions may add additional formatting rules on top of this baseline.

--

Important Principles

Throughout all phases, keep these in mind:

  1. The user never writes the wiki. The LLM writes and maintains all wiki pages. The user curates sources, asks questions, and directs the analysis.
  1. Start simple, add complexity as needed. Don't build a heavy-tier structure for a light-tier project. The user can always add page types and conventions later.
  1. The schema is a living document. It will evolve as the user discovers what works. Encourage experimentation.
  1. Knowledge should compound. Good answers to questions should be filed back into the wiki. Explorations should become pages. The wiki should get richer with every interaction.
  1. The wiki replaces chat history. Insights that emerge in conversation should be captured in the wiki, not lost when the chat window closes.
  1. Make it concrete. Don't just describe what pages could look like — create actual examples during scaffolding so the user can see and react to real content.
  1. Obsidia (or a similar MD file viewer) is the IDE, the LLM is the programmer, the wiki is the codebase, InfraNodus is the researcher Frame it this way to help the user understand the workflow.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.