---
name: wiki-export
description: >-
  Export the wiki as portable LLM context files. Use when the user says
  "export the wiki", "make the wiki portable", "generate llms.txt",
  "package for context", or "/wiki-export". Produces wiki/llms.txt (index
  with descriptions) and wiki/llms-full.txt (all pages inlined) so the
  entire compiled knowledge base can be loaded into any LLM conversation.
argument-hint: "[optional: --full for llms-full.txt only, --index for llms.txt only]"
user-invocable: true
disable-model-invocation: false
---

# Wiki Export

Packages the entire wiki as `llms.txt` and `llms-full.txt` — portable context files you can paste into any LLM conversation (Claude, ChatGPT, Gemini, etc.) to give it instant access to your compiled knowledge.

This is what deep-wiki calls "agent-discoverable output." Your wiki works for you even outside VS Code.

## llms.txt format (index — links + descriptions)

Place at `wiki/llms.txt`. Standard per the llms.txt spec:

```
# [Wiki Name / Domain]
> [Dense one-paragraph summary: what this wiki covers, its scope, key themes]

[Any important context that LLMs would get wrong without being told]

## Overview
- [Overview](overview.md): [One sentence on what it covers]

## Sources
- [Source Title](sources/slug.md): [One sentence on what it contributes]

## Entities
- [Entity Name](entities/Name.md): [One sentence description]

## Concepts
- [Concept Name](concepts/Name.md): [One sentence definition]

## Syntheses
- [Analysis Title](syntheses/slug.md): [One sentence on what it answers]

## Optional
- [Lint Report](lint-report.md): [Only if exists]
```

Rules (from the llms.txt spec):
- H1 = wiki name (exactly one)
- Blockquote = dense specific summary (required, unique to this wiki)
- Context paragraphs = non-obvious constraints, things LLMs would get wrong
- H2 sections = organized by topic
- "Optional" H2 = links that can be skipped for shorter context
- All paths relative to `wiki/` directory

## llms-full.txt format (all content inlined)

Place at `wiki/llms-full.txt`. Same header as llms.txt, then each page inlined:

```
# [Wiki Name]
> [Same summary]

[Same context]

## [Section Name]
<doc title="[Page Title]" path="[relative-path]">
[Full markdown content — frontmatter STRIPPED, everything else preserved]
</doc>
```

Strip YAML frontmatter (`---` blocks) from each page.
Preserve: Mermaid diagrams (keep ` ```mermaid ` fences), wikilinks, tables, `⚠️` contradiction flags, `<!-- Sources: -->` comments.

Section order: Overview → Sources (most recent first) → Concepts → Entities → Syntheses → Drafts (omit if empty)

## Steps

1. Read `wiki/index.md` to get the full page list and counts.
2. Read `wiki/overview.md` for the summary.
3. Compose the header summary from the overview — make it dense and specific, not generic.
4. Build `wiki/llms.txt` by reading each page's frontmatter for its title and writing one-line descriptions.
5. Build `wiki/llms-full.txt` by reading each page fully, stripping frontmatter, and inlining under `<doc>` tags.
6. Report file sizes and page counts.

## Log

```
## [YYYY-MM-DD HH:MM] export | Wiki exported
- llms.txt: N pages indexed, ~N KB
- llms-full.txt: N pages inlined, ~N KB
- Usage: paste wiki/llms-full.txt into any LLM conversation for full wiki context
```

## Usage tip to share with user

After generating, tell the user:
> "You can now load `wiki/llms-full.txt` into any LLM chat as context — it contains your entire compiled knowledge base in a format optimised for LLM consumption. For lighter context, use `wiki/llms.txt` (index only) and ask the LLM to request specific pages."
