Agent SkillsAr9av/obsidian-wiki › daily-update

daily-update

GitHub

执行每日 Wiki 维护流程,包括检查源文件新鲜度、刷新索引、更新热点文档及状态文件,并可选运行健康检查。支持手动触发或定时任务自动执行。

.skills/daily-update/SKILL.md Ar9av/obsidian-wiki

Trigger Scenarios

用户发送 /daily-update, run the daily update, update everything, morning sync, refresh the wiki index launchd cron 在上午 9 点触发 用户请求设置或验证每日定时任务及终端通知基础设施

Install

npx skills add Ar9av/obsidian-wiki --skill daily-update -g -y
More Options

Non-standard path

npx skills add https://github.com/Ar9av/obsidian-wiki/tree/main/.skills/daily-update -g -y

Use without installing

npx skills use Ar9av/obsidian-wiki@daily-update

指定 Agent (Claude Code)

npx skills add Ar9av/obsidian-wiki --skill daily-update -a claude-code -g -y

安装 repo 全部 skill

npx skills add Ar9av/obsidian-wiki --all -g -y

预览 repo 内 skill

npx skills add Ar9av/obsidian-wiki --list

SKILL.md

Frontmatter
{
    "name": "daily-update",
    "description": "Run the daily wiki maintenance cycle: check all source freshness, update the index, and regenerate hot.md. Use this skill when the user says \"\/daily-update\", \"run the daily update\", \"update everything\", \"morning sync\", \"refresh the wiki index\", or when triggered by the launchd cron at 9 AM. Also use to set up or verify the cron + terminal notification infrastructure for the first time (\"set up the daily cron\", \"install the terminal notification\", \"how do I get the morning reminder?\")."
}

Daily Update — Wiki Maintenance Cycle

You run a lightweight maintenance pass over the wiki: check source freshness, refresh the index, update hot.md, and write the state file that the terminal notification reads.

Before You Start

  1. Resolve config — follow the Config Resolution Protocol in llm-wiki/SKILL.md (inline @name override → walk up CWD for .env → global config → prompt setup). This gives OBSIDIAN_VAULT_PATH and OBSIDIAN_WIKI_REPO.
  2. Derive vault-scoped state dir — all runtime state is scoped to the resolved vault, not global:
    VAULT_ID=$(echo "$OBSIDIAN_VAULT_PATH" | md5sum 2>/dev/null | cut -c1-8 || md5 -q - <<< "$OBSIDIAN_VAULT_PATH" | cut -c1-8)
    STATE_DIR="$(obsidian_wiki_config_dir)/state/$VAULT_ID"
    mkdir -p "$STATE_DIR"
    
  3. Read $OBSIDIAN_VAULT_PATH/.manifest.json.

Modes

Run Mode (default — triggered by cron or /daily-update)

Execute the maintenance cycle:

Step 1: Source freshness check

Compare each source in .manifest.json against its file's modification time. Classify as:

  • Freshmtime ≤ ingested_at
  • Stalemtime > ingested_at (new content exists, not yet ingested)
  • Missing — source file no longer exists

Step 2: Index refresh

Read $OBSIDIAN_VAULT_PATH/index.md. If any pages in the vault are missing from the index (or vice versa), update the index. Use find $OBSIDIAN_VAULT_PATH -name "*.md" -not -path "*/_*" to enumerate vault pages, then reconcile against the index.

Step 3: hot.md update

Read hot.md. If it's >48h old based on its updated: frontmatter, regenerate it: read the 10 most recently modified wiki pages and write a fresh ~500-word semantic snapshot of what the wiki covers. This keeps the next session's context warm without a full vault crawl.

Step 4: Write state

Write to the vault-scoped $STATE_DIR derived in "Before You Start":

date +%s > "$STATE_DIR/.last_update"
echo "<stale_count>" > "$STATE_DIR/.pending_delta"
echo "$OBSIDIAN_VAULT_PATH" > "$STATE_DIR/.vault_path"

Step 4a: Scheduled health check (wiki-lint)

LINT_SCHEDULE (default weekly) controls how often this cycle also runs wiki-lint:

  • manual — never auto-run; skip this step entirely.
  • daily — run wiki-lint every cycle.
  • weekly — run wiki-lint only if $STATE_DIR/.last_lint is missing or older than 7 days.
LINT_SCHEDULE="${LINT_SCHEDULE:-weekly}"
NOW=$(date +%s)
LAST_LINT=$(cat "$STATE_DIR/.last_lint" 2>/dev/null || echo 0)

If the schedule says to run, invoke the wiki-lint skill, then record the run:

date +%s > "$STATE_DIR/.last_lint"

Fold its summary (broken links, orphans, stale pages found) into Step 7's report as a Health check: line; omit the line entirely on a cycle where lint didn't run.

Step 5: Spawn impl-validator

After the cycle, spawn impl-validator as a subagent:

impl-validator check:
  goal: "Daily wiki maintenance — index reconciled, hot.md refreshed, state file written"
  artifacts:
    - $OBSIDIAN_VAULT_PATH/index.md
    - $OBSIDIAN_VAULT_PATH/hot.md
    - $STATE_DIR/.last_update
    - $STATE_DIR/.pending_delta
  checks:
    - Does .last_update contain a recent Unix timestamp (within the last 60 seconds)?
    - Does .pending_delta contain a non-negative integer?
    - Does hot.md have an updated: frontmatter field set to today?
    - Does index.md list at least as many pages as exist in the vault?

Apply any FAILs before logging.

Step 6: Log

Append to $OBSIDIAN_VAULT_PATH/log.md:

- [TIMESTAMP] DAILY-UPDATE fresh=N stale=N missing=N index_added=N hot_refreshed=true|false lint=ran|skipped

Step 7: Report to user

## Daily Wiki Update

- Sources: N fresh · N stale · N missing
- Index: N pages (N added, N removed)
- hot.md: refreshed / up to date
- Health check: N broken links, N orphans, N stale pages (omit this line if lint didn't run this cycle)

Stale sources (run to sync):
  /wiki-history-ingest claude   — N sessions since last ingest
  /wiki-history-ingest codex    — N sessions since last ingest

Setup Mode (triggered by "set up the daily cron" or "install terminal notification")

Walk the user through first-time setup:

Step 1: Verify script exists

Check that $OBSIDIAN_WIKI_REPO/scripts/daily-update.sh exists and is executable. If not, point the user to it.

Step 2: Install launchd plist

# Replace placeholder in plist
sed "s|OBSIDIAN_WIKI_REPO|$OBSIDIAN_WIKI_REPO|g" \
  "$OBSIDIAN_WIKI_REPO/scripts/com.obsidian-wiki.daily-update.plist" \
  > "$HOME/Library/LaunchAgents/com.obsidian-wiki.daily-update.plist"

# Load it
launchctl load "$HOME/Library/LaunchAgents/com.obsidian-wiki.daily-update.plist"

Step 3: Install terminal notification (optional)

Ask the user: "Do you want a terminal reminder when your wiki is stale? (y/n)" — skip this step if they say no, or if the environment is headless/VPS.

If yes, detect the user's shell and target the right rc file:

SHELL_NAME=$(basename "$SHELL")   # zsh, bash, fish, etc.
case "$SHELL_NAME" in
  zsh)  RC_FILE="$HOME/.zshrc" ;;
  bash) RC_FILE="$HOME/.bashrc" ;;
  *)    echo "Shell '$SHELL_NAME' not auto-detected. Add the source line manually to your shell rc file." ; return ;;
esac

Check if wiki-notify.sh is already sourced in that rc file. If not, append:

echo "" >> "$RC_FILE"
echo "# obsidian-wiki terminal notification" >> "$RC_FILE"
echo "source $OBSIDIAN_WIKI_REPO/scripts/wiki-notify.sh" >> "$RC_FILE"

For Fish shell, source syntax is different — provide the manual instruction:

# Add to ~/.config/fish/config.fish:
bass source $OBSIDIAN_WIKI_REPO/scripts/wiki-notify.sh
# (requires bass plugin, or copy the logic natively)

Step 4: Run the script once

bash "$OBSIDIAN_WIKI_REPO/scripts/daily-update.sh"

This initializes $STATE_DIR/.last_update so the terminal notification works immediately.

Step 5: Confirm

Tell the user:

  • The cron runs daily at 9 AM (or on next login if missed)
  • wiki-lint health checks run on the LINT_SCHEDULE cadence (default weekly) as part of that cycle — set LINT_SCHEDULE=daily or manual in .env to change it
  • Terminal notifications appear when the wiki is >20 hours stale
  • State is stored in <global config dir>/state/<vault-id>/ (XDG-style ~/.config/obsidian-wiki by default, or the legacy ~/.obsidian-wiki if that already exists) — supports multiple vaults independently
  • They can run /daily-update anytime to force a sync
  • Logs go to /tmp/obsidian-wiki-daily.log

QMD Refresh After Vault Writes

QMD is a search index, not the source of truth. If $QMD_WIKI_COLLECTION is empty or unset, skip this step. Run it only after this skill has written or rewritten vault markdown. If QMD refresh fails, do not roll back the vault changes; report the QMD status separately.

Use $QMD_CLI if set; otherwise use qmd.

${QMD_CLI:-qmd} update

If the output says vectors are needed or embeddings may be stale, run:

${QMD_CLI:-qmd} embed

Verify the collection with either:

${QMD_CLI:-qmd} ls "$QMD_WIKI_COLLECTION"

or, when a specific page path is known:

${QMD_CLI:-qmd} get "qmd://$QMD_WIKI_COLLECTION/<page>.md" -l 5

Record one of:

  • QMD refreshed: update + embed + verified
  • QMD refreshed: update only + verified
  • QMD skipped: QMD_WIKI_COLLECTION unset
  • QMD skipped: qmd CLI unavailable
  • QMD failed: <short error summary>

Version History

  • 37596cf Current 2026-08-27 13:03

    新增Step 4a:根据LINT_SCHEDULE配置定期运行wiki-lint并记录结果;修复wiki-ingest中页面规划上限读取环境变量的问题。

  • 8089bc7 2026-08-19 15:23

    配置解析逻辑升级为 XDG 标准路径,修复 setup 脚本覆盖用户自定义配置键的问题,并修正了 state_dir 的默认路径定义。

  • 1f290b0 2026-07-05 14:59

Same Skill Collection

.skills/codex-history-ingest/SKILL.md
.skills/hermes-history-ingest/SKILL.md
.skills/obsidian-layout-adjustment/SKILL.md
.skills/openclaw-history-ingest/SKILL.md
.skills/pi-history-ingest/SKILL.md
.skills/skill-creator/SKILL.md
.skills/wiki-context-pack/SKILL.md
.skills/wiki-dashboard/SKILL.md
.skills/wiki-history-ingest/SKILL.md
.skills/wiki-import/SKILL.md
.skills/wiki-narrate/SKILL.md
.skills/wiki-rebuild/SKILL.md
.skills/wiki-research/SKILL.md
.skills/wiki-setup/SKILL.md
.skills/wiki-stage-commit/SKILL.md
.skills/wiki-switch/SKILL.md
.skills/wiki-synthesize/SKILL.md
.skills/wiki-update/SKILL.md
.skills/claude-history-ingest/SKILL.md
.skills/code-understand/SKILL.md
.skills/copilot-history-ingest/SKILL.md
.skills/cross-linker/SKILL.md
.skills/graph-colorize/SKILL.md
.skills/impl-validator/SKILL.md
.skills/llm-wiki/SKILL.md
.skills/memory-bridge/SKILL.md
.skills/session-brain/SKILL.md
.skills/session-search/SKILL.md
.skills/tag-taxonomy/SKILL.md
.skills/vault-skill-factory/SKILL.md
.skills/wiki-agent/SKILL.md
.skills/wiki-capture/SKILL.md
.skills/wiki-dedup/SKILL.md
.skills/wiki-digest/SKILL.md
.skills/wiki-export/SKILL.md
.skills/wiki-ingest/SKILL.md
.skills/wiki-lint/SKILL.md
.skills/wiki-query/SKILL.md
.skills/wiki-status/SKILL.md

Metadata

Files
0
Version
37596cf
Hash
3cce8550
Indexed
2026-07-05 14:59

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-28 20:11
浙ICP备14020137号-1 $Carte des visiteurs$