wiki-context-pack
Skill3 starsChanged 11 days agoMITView on GitHub
Produce a token-bounded context pack from the Obsidian wiki — a compact, structured slice of the most relevant pages for a topic or recent activity, designed for downstream consumption by another agent or skill. Use when the user says "/wiki-context-pack", "make a context pack", "give me a context slice for X", "pack the wiki for my agent", or "bounded context for Y". Different from wiki-query (which answers a question) — this produces reusable input material for a downstream task.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Ar9av/obsidian-wikitheir own version, first seen Nov 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Ar9av/obsidian-wiki★ 3.7ksame name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository30 other files it gives its agents.
- claude-history-ingestSkill
- cross-linkerSkill
- daily-updateSkill
- graph-colorizeSkill
- hermes-history-ingestSkill
- impl-validatorSkill
- llm-wikiSkill
- memory-bridgeSkill
- skill-creatorSkill
- tag-taxonomySkill
- vault-skill-factorySkill
- wiki-agentSkill
- wiki-captureSkill
- wiki-dashboardSkill
- wiki-dedupSkill
- wiki-digestSkill
- wiki-exportSkill
- wiki-history-ingestSkill
- wiki-importSkill
- wiki-ingestSkill
- wiki-lintSkill
- wiki-querySkill
- wiki-rebuildSkill
- wiki-researchSkill
- wiki-setupSkill
- wiki-stage-commitSkill
- wiki-statusSkill
- wiki-switchSkill
- wiki-synthesizeSkill
- wiki-updateSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Read $OBSIDIAN_VAULT_PATH/hot.md if it exists — gives instant context on recent activity.
- Very specific: line 19
Read $OBSIDIAN_VAULT_PATH/index.md — the full page inventory.
- Distinctive: line 66
If budget allows: add the page body, but stripped of:
- Distinctive: line 79
Always include the frontmatter summary block for every selected page, even if the body doesn't fit.
- Distinctive: line 80
If a page body doesn't fit in full, include a compressed excerpt: the first non-header paragraph plus the "Key Ideas" section (if present).
- Distinctive: line 82
Keep a running token count.
- Very specific: line 109
If --recent mode, the header reads:
- Very specific: line 114
Empty result: If no pages scored above 0 and --recent produced no results, output:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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
- Resolve config — follow the Config Resolution Protocol in
llm-wiki/SKILL.md(inline@nameoverride → walk up CWD for.env→~/.llm-wiki/config→ prompt setup). This givesOBSIDIAN_VAULT_PATHand any QMD variables. - Read
$OBSIDIAN_VAULT_PATH/hot.mdif it exists — gives instant context on recent activity. - 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 tokensParse 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:
- Scan
index.mdand 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.mdentry description contains the query term
- For
--recentmode: sort pages byupdated:frontmatter descending. Take top 20 as candidates. - For topic mode: collect the top 20 candidates by score. If QMD is configured (
QMD_WIKI_COLLECTIONset), 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):
- All
core-tier matches first - Then
supporting - 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:
- Required: title,
tier:,tags:,summary:(from frontmatter — cheap, no body read needed) - If budget allows: add the page body, but stripped of:
- Frontmatter block (already captured above)
- The
## Sourcessection (keep source names in a one-liner instead) - Duplicate wikilinks that are already mentioned in included pages
- Boilerplate headers with no content following them
- 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:
- Always include the frontmatter summary block for every selected page, even if the body doesn't fit.
- If a page body doesn't fit in full, include a compressed excerpt: the first non-header paragraph plus the "Key Ideas" section (if present).
- Drop
peripheral-tier pages first when trimming. - Keep a running token count. Stop adding pages when the next page would exceed the budget.
- Track how many pages were dropped and note it in the header.
Step 5: Render Output
Emit a single markdown block:
# Context Pack: <topic>
# Generated: <ISO timestamp>
# Budget: <budget> tokens | Actual: <actual> tokens | Pages: <N included> / <M candidates>
# Methodology: 4 chars/token estimate
---
## [[<category/page-name>]] (<tier>, ~<tokens> tokens)
tags: #tag1 #tag2
summary: <summary field text>
<compressed body or excerpt>
---
## [[<next-page>]] (<tier>, ~<tokens> tokens)
...If --recent mode, the header reads:
# Context Pack: Recent Activity (last N pages)Empty result: If no pages scored above 0 and --recent produced no results, output:
# Context Pack: <topic>
No relevant pages found. Consider running /wiki-ingest to add sources about this topic.Step 6: Log
Append to $OBSIDIAN_VAULT_PATH/log.md:
- [TIMESTAMP] CONTEXT_PACK topic="<topic>" budget=<N> actual_tokens=<M> pages_included=<K> pages_dropped=<D>Use Cases
- Feed into
/wiki-research— pass the pack as context to avoid re-discovering known facts - Pass to
/wiki-synthesize— scoped input for a specific synthesis task - Provide to external agents via MCP or clipboard — bounded, structured, citation-ready
- Checkpoint context before a long multi-step task — know what the wiki already knows before starting
Notes
- The
4 chars/tokenheuristic matcheswiki-status's token footprint estimate — consistent across skills - The pack is a snapshot; it is not written to the vault. Re-run to refresh.
- For very large budgets (> 50K tokens), warn the user: "This pack is large. Consider narrowing your topic or using wiki-query for a targeted answer instead."
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

