
Wiki Context Pack
Package a token-bounded slice of your Obsidian wiki so another agent or skill can work with relevant notes without loading the whole vault.
Install
npx skills add https://github.com/ar9av/obsidian-wiki --skill wiki-context-packWhat is this skill?
- Token-bounded markdown context pack for a topic, project, or recent activity
- Invocation forms with explicit --budget flags (e.g. 4000, 8000, 16000 tokens)
- Config resolution via .env, ~/.obsidian-wiki/config, and vault hot.md + index.md bootstrap
- Contrasts with wiki-query: packs material for reuse instead of answering one question
- Supports --recent packs from hot.md for activity-focused agent sessions
Adoption & trust: 538 installs on skills.sh; 1.8k GitHub stars; 3/3 security scanners passed (skills.sh audits).
Recommended Skills
Journey fit
Context packs are infrastructure for agent workflows during product build, even though you also use them when operating on living documentation. The output is reusable procedural input for downstream agents—classic agent-tooling, distinct from wiki-query’s direct Q&A answer.
Common Questions / FAQ
Is Wiki Context Pack safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Wiki Context Pack
# Wiki Context Pack — Bounded Token Retrieval You are producing a focused, token-bounded context pack from the wiki. Unlike `wiki-query` (which answers a question), this skill packages the most relevant wiki knowledge into a single markdown block that a downstream agent, skill, or user can consume directly. ## Before You Start 1. **Resolve config** — follow the Config Resolution Protocol in `llm-wiki/SKILL.md` (walk up CWD for `.env` → `~/.obsidian-wiki/config` → prompt setup). This gives `OBSIDIAN_VAULT_PATH` and any QMD variables. 2. Read `$OBSIDIAN_VAULT_PATH/hot.md` if it exists — gives instant context on recent activity. 3. Read `$OBSIDIAN_VAULT_PATH/index.md` — the full page inventory. ## Invocation Forms ``` /wiki-context-pack "transformer attention mechanism" --budget 16000 /wiki-context-pack "my-project architecture decisions" --budget 8000 /wiki-context-pack --recent --budget 4000 # recent activity pack from hot.md /wiki-context-pack "authentication patterns" # default budget: 8000 tokens ``` Parse the user's invocation to extract: - **topic** — the query string (required unless `--recent`) - **`--budget N`** — token budget in tokens (default: `8000`; max: `100000`) - **`--recent`** — pack the most recently updated/ingested pages instead of a topic query ## Algorithm ### Step 1: Relevance Pass (cheap) Without opening page bodies: 1. Scan `index.md` and frontmatter for topic match. Score each page: - **+5** exact title or alias match - **+3** tag match - **+2** `summary:` field contains the query term - **+1** `index.md` entry description contains the query term 2. For `--recent` mode: sort pages by `updated:` frontmatter descending. Take top 20 as candidates. 3. For topic mode: collect the top 20 candidates by score. If QMD is configured (`QMD_WIKI_COLLECTION` set), run a semantic pass and merge with the frontmatter score (QMD rank adds **+4** to the page's score). ### Step 2: Tier-Aware Selection Within the candidate set, sort by relevance score, then apply tier ordering within each score bucket (see `llm-wiki/SKILL.md`, Importance Tiering section): 1. All `core`-tier matches first 2. Then `supporting` 3. Then `peripheral` (only if budget allows) Maintain this ordering when filling the budget in Step 3. ### Step 3: Compression For each selected page (in tier/relevance order), compute its **compressed representation** — not a full read, but a structured distillation: 1. **Required**: title, `tier:`, `tags:`, `summary:` (from frontmatter — cheap, no body read needed) 2. **If budget allows**: add the page body, but stripped of: - Frontmatter block (already captured above) - The `## Sources` section (keep source names in a one-liner instead) - Duplicate wikilinks that are already mentioned in included pages - Boilerplate headers with no content following them 3. **Dedup overlapping content** — if two selected pages share a paragraph (or near-identical claim), keep it only in the more relevant page. Mark the removal: `_(content also in [[other-page]])_`. Estimate tokens for each page representation as `len(text_chars) / 4`. ### Step 4: Budget Enforcement Fill the pack greedily in tier/relevance order until the budget is exhausted: 1. Always include the frontmatter summary block for every selected page, even if the body doesn't fit. 2. If a page body doesn't fit in full, include a compressed excerpt: the first non-header paragraph