wiki-context-pack

ar9av/obsidian-wiki

Компактный контекст-пак из вики Obsidian с релевантными страницами для другого агента.

Звёзды3 768
Авторar9av
Установок1,7K

Установка

SKILL.md

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 (inline @name override → 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 plus the "Key Ideas" section (if present).
  3. Drop peripheral-tier pages first when trimming.
  4. Keep a running token count. Stop adding pages when the next page would exceed the budget.
  5. 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/token heuristic matches wiki-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."

Вставить в README

Ссылка на карточку для вашего README — без картинок и счётчиков.

[DarkPlay: wiki-context-pack](https://darkplay.ru/ai/skills/ar9av-obsidian-wiki-wiki-context-pack)

Похожие скиллы и другие разделы каталога

Популярное в разделе «Скиллы»

Самые востребованные скиллов раздела по установкам и звёздам.

find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
4 400 000 устан.
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
1 600 000 устан.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
1 600 000 устан.
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
1 600 000 устан.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
1 600 000 устан.
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
1 500 000 устан.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
1 400 000 устан.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
1 300 000 устан.
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
1 300 000 устан.
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.
1 300 000 устан.
Похожее в других разделах каталога

Соседние разделы каталога: возможно, нужный инструмент живёт там.

Docs Lookupaffaan-m · Получает актуальную документацию и примеры кода через Context7 MCP для вопросов по API и…
225 587 ★
Opensource Packageraffaan-m · Готовит open-source упаковку: CLAUDE.md, README, LICENSE, CONTRIBUTING и шаблоны.
225 587 ★
React Build Resolveraffaan-m · Чинит сборки React в Vite, webpack, Next.js и других: JSX, гидратация, типы.
225 587 ★
ui-ux-pro-maxnextlevelbuilder · Профессиональные знания по UI/UX-дизайну для ИИ-ассистентов программирования. Включает…
151 010 ★
claude-memthedotmack · Система постоянной памяти для Claude Code — сжатие контекста между сессиями.
20 комп.
MCP Memory Server (official)modelcontextprotocol · Эталонный сервер памяти на графе знаний из официального репозитория MCP-серверов.
88 019 ★
ruflo-dddruvnet · Каркас Domain-Driven Design: ограниченные контексты, агрегатные корни, доменные события и…
240 комп.
humanizerblader · Убирает из текста признаки ИИ-генерации, делая его более естественным и человечным…
70 489 ★
context7upstash · Актуальный поиск документации. Подтягивает документацию и примеры кода для конкретных…
3 комп.
bmad-analysisbmad-code-org · Пакет мышления BMad — структурированный брейншторминг, стресс-тестирование идей и…
39 комп.

Лучшие ИИ-инструменты для автоматизации и ассистентов

Ассистенты и автоматизация

Подборка ИИ-ассистентов для автоматизации рутины и ускорения рабочих процессов. Сервисы, которые берут на себя переписку, анализ данных, ведение базы знаний и подготовку продаж, эк

Give Me Public
Есть бесплатный тариф
5.0
AITunnelAitunnel
По запросу
5.0
STIVAStiva
По запросу
5.0
Wikibot (Викибот)Wikibot
По запросу
4.9
mymeet.aiMymeet
По запросу
4.9
InsighterInsighter
По запросу
4.9
TGHuntTghunt
Есть бесплатный тариф
4.9
LegiscanLegiscan
По запросу
4.9
RouterAIRouterai
По запросу
4.9
Wikibot 1.0 (Викибот)Wikibot
По запросу
4.9

Лучшие ИИ-инструменты для генерации текста и копирайтинга

Генерация текста и копирайтинг

Подборка нейросетей для генерации текстов и копирайтинга. Сервисы, которые помогают создавать статьи, посты и рекламные объявления с нуля или по черновику, экономя часы рутинной ра

NeuroscribeNeuroscribe
Есть бесплатный тариф
5.0
GoGPTGogpt
По запросу
5.0
ChatsonicChatsonic
По запросу
4.9
НейроТекстерNeuro-texter
По запросу
4.9
ChatGPTOpenAI
По подписке
4.9
Редактум
Есть бесплатный тариф
4.8
ChadGPTChadgpt
По запросу
4.8
Cosmo ScribeCosmoscribe
Есть бесплатный тариф
4.8
Memo HelperCopilot33
По запросу
4.8
LibraChatLibrachat
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации видео

Генерация видео

Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,

VEED.IOVeed
По запросу
5.0
MootionMootion
По запросу
5.0
FlyviFlyvi
Есть бесплатный тариф
4.9
Google Veo 3.1Google
Платно
4.9
Sora (OpenAI)OpenAI
Платно
4.9
PikaPika
Платно
4.9
captions space
Есть бесплатный тариф
4.8
Клайп
Есть бесплатный тариф
4.8
viralpulse.appViralpulse
По запросу
4.8
Viral Maker AIViral-maker
Есть бесплатный тариф
4.8