一键导入
wiki-finalize-ingest
Use when the user asks to finalize an ingest, merge batch logs, or rebuild Wiki indexes after a batch import.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when the user asks to finalize an ingest, merge batch logs, or rebuild Wiki indexes after a batch import.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | wiki-finalize-ingest |
| description | Use when the user asks to finalize an ingest, merge batch logs, or rebuild Wiki indexes after a batch import. |
When running as an agent (dispatched by
wiki-ingest, no user interaction available): at Step 0, abort with an error message if unclaimed batch files exist instead of usingAskUserQuestion. At Step 5, run All steps without prompting.
Before doing anything, verify there is something to finalize:
ls .import/batch-log-*.jsonl 2>/dev/null
ls .import/batch-import-[0-9]*.txt 2>/dev/null | grep -v '\.claimed\.'
.import/batch-log-N.jsonl files AND no .import/batch-import-N.txt files: nothing to finalize. Tell the user: "No batch import logs or files found. Nothing to finalize — run wiki-ingest to start a new import.".import/batch-import-N.txt files still exist (not .claimed.): warn the user: "Some batches have not been processed yet. Make sure all wiki-ingest-next-batch sessions have finished before finalizing." Ask: "Proceed anyway (partial finalization) or abort?" Use AskUserQuestion when available; otherwise ask a concise plain-text question and wait for the answer..import/batch-log-N.jsonl files exist: all batches are done — proceed to Step 1 of finalizing.Append all .import/batch-log-*.jsonl to wiki/log.jsonl (create wiki/log.jsonl if it doesn't exist), then delete all .import/batch-log-*.jsonl and any remaining .import/batch-import-*.txt:
# Wrapped in `bash -c` with `shopt -s nullglob` so unmatched globs expand to
# nothing instead of aborting (zsh nomatch) or being passed as a literal pattern.
# This runs identically whether the caller is bash or zsh (the Bash tool uses zsh).
bash -c '
shopt -s nullglob
logs=(.import/batch-log-*.jsonl)
imports=(.import/batch-import-*.txt)
[ ${#logs[@]} -gt 0 ] && cat "${logs[@]}" >> wiki/log.jsonl
[ ${#logs[@]} -gt 0 ] && rm -f "${logs[@]}"
[ ${#imports[@]} -gt 0 ] && rm -f "${imports[@]}"
true # always exit 0 when cleanup completes without error
'
Then stamp content hashes onto the merged log, and repoint any entries whose note was renamed (both deterministic and idempotent — safe to run every finalize). Run stamp first; relink matches orphans by the hashes stamping records:
python3 scripts/system/wiki-stamp-log-hashes.py
python3 scripts/system/wiki-relink-log-renames.py
Stamping records a hash (SHA-256 of the source bytes) and mtime on each entry so that renaming a raw note later in Obsidian does not cause it to be re-ingested; notes whose content changed are still re-ingested. The relink pass rewrites the file of any entry whose note was renamed to its current path, so the log stays accurate and prune_log does not later orphan-drop it.
Run the index-page script from the project root:
python3 scripts/system/wiki-create-index-pages.py
This rebuilds wiki/index.md and all wiki/<topic>/_index.md files.
Run the freshness pass so every wiki and raw page carries up-to-date date / date_span / date_confidence frontmatter (newly ingested pages get dated; existing pages get refreshed if newer sources were added):
python3 scripts/system/wiki-assign-dates.py --apply
This is deterministic and idempotent — safe to run on every finalize. It resolves each page's content date from source-note filenames, parent-folder years, source frontmatter, and (for raw pages) body text, recording date_confidence (high/medium/low) so stale or capture-only dates are flagged. Report its summary line (resolved / no-date / confidence distribution). Pages with no datable source are intentionally left without a date field.
Use this command to scan Markdown files for stubs:
find wiki -name "*.md" -exec awk '/^---/{p++} p==1{print FILENAME": "$0} p==2{p=0; nextfile}' {} + | grep "stub:.*true"
If any exist, list them in a "Stubs still needing expansion" section so the user knows what gaps remain.
Present a table of all pages created/updated across all sessions (read from the just-merged session log data).
Then run the one-command freshness check:
scripts/wiki-freshness.sh --root .
This command does not rewrite wiki/ pages. It writes .wiki-scratch/freshness-curation-candidates.md and .wiki-scratch/provenance-coverage-backlog.md; mention whether there are one-page curation candidates.
Ask which post-processing steps to run. Use AskUserQuestion with multiSelect: true when available; otherwise ask a concise plain-text question and wait for the answer. Always run QMD before lint.
Always re-index QMD via scripts/system/qmd-sync-collections.sh — never call raw qmd update / qmd embed. The script also (re)registers the vault root as the single tomtom collection, removes stale wiki-*/raw-* collections, and loops qmd embed until no embeddings remain pending.
bash scripts/system/qmd-sync-collections.sh --skip-embed) — fast, keywords onlybash scripts/system/qmd-sync-collections.sh) — slow, ~2 GB models; supersedes text-only if both selectedAfter running the lint check or QMD do not suggest to run finalize again. If any problems were found during the lint check, suggest the user runs python3 scripts/wiki-doctor.py (interactive mode, without --batch-mode) to review and fix the remaining problems one by one.
Use when the user notices a system, concept, person, project, decision, competitor, or problem is missing from the Wiki and wants to create a page for it.
Use when the user asks any question, requests research, or wants information from the knowledge base. This is the default action in this repository — when in doubt, search the Wiki. Use for "find me...", "what do we know about...", "tell me about...", "who is...", "what is...", or any general research question.
Use when the user asks to ground this conversation in the knowledge base, says "wiki-ground", asks to treat the KB as source of truth, or wants domain answers backed by the Wiki. Optional topic front-loads relevant knowledge base pages.
Use when the user asks for a health check, lint, audit, or wants to check for orphan pages, contradictions, or data gaps in the Wiki.
Use when about to process individual notes during Wiki ingestion — loaded as a required background skill by wiki-ingest and wiki-ingest-next-batch. Contains file conversion rules, topic assignment rules, WikiLink rules, and the session log format.
Use when the user asks to ingest, import, or process one or more notes; mentions a raw note file path; provides a Confluence URL or page title; or says "ingest note", "ingest notes", "ingest new notes", or "ingest files". NOT for Slack messages — use wiki-fetch-slack instead.