jpskill.com
📦 その他 コミュニティ

daily-update

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?").

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o daily-update.zip https://jpskill.com/download/22825.zip && unzip -o daily-update.zip && rm daily-update.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/22825.zip -OutFile "$d\daily-update.zip"; Expand-Archive "$d\daily-update.zip" -DestinationPath $d -Force; ri "$d\daily-update.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して daily-update.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → daily-update フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[Skill 名] daily-update

日次更新 — Wikiメンテナンスサイクル

Wikiに対して軽量なメンテナンスパスを実行します。具体的には、ソースの鮮度チェック、インデックスの更新、hot.mdの更新、そしてターミナル通知が読み取るステータスファイルの書き込みを行います。

開始する前に

  1. 設定の解決llm-wiki/SKILL.md に記載されている設定解決プロトコルに従ってください(.env~/.obsidian-wiki/config → プロンプト設定の順にCWDを遡ります)。これにより、OBSIDIAN_VAULT_PATHOBSIDIAN_WIKI_REPO が得られます。
  2. Vaultスコープのステートディレクトリの導出 — すべてのランタイムステートは、グローバルではなく、解決されたVaultにスコープされます。
    VAULT_ID=$(echo "$OBSIDIAN_VAULT_PATH" | md5sum 2>/dev/null | cut -c1-8 || md5 -q - <<< "$OBSIDIAN_VAULT_PATH" | cut -c1-8)
    STATE_DIR="$HOME/.obsidian-wiki/state/$VAULT_ID"
    mkdir -p "$STATE_DIR"
  3. $OBSIDIAN_VAULT_PATH/.manifest.json を読み込みます。

モード

実行モード(デフォルト — cronまたは/daily-updateによってトリガーされます)

メンテナンスサイクルを実行します。

ステップ1: ソースの鮮度チェック

.manifest.json 内の各ソースを、そのファイルの変更時刻と比較します。以下のように分類します。

  • 新鮮 (Fresh)mtime ≤ ingested_at
  • 古い (Stale)mtime > ingested_at (新しいコンテンツが存在するが、まだ取り込まれていない)
  • 欠落 (Missing) — ソースファイルが存在しない

ステップ2: インデックスの更新

$OBSIDIAN_VAULT_PATH/index.md を読み込みます。Vault内のいずれかのページがインデックスにない場合(またはその逆の場合)、インデックスを更新します。find $OBSIDIAN_VAULT_PATH -name "*.md" -not -path "*/_*" を使用してVaultページを列挙し、インデックスと照合します。

ステップ3: hot.mdの更新

hot.md を読み込みます。その updated: フロントマターに基づいて48時間以上経過している場合、再生成します。最近変更されたWikiページの上位10件を読み込み、Wikiがカバーする内容の約500語のセマンティックなスナップショットを新しく書き込みます。これにより、Vault全体をクロールすることなく、次のセッションのコンテキストをウォームに保ちます。

ステップ4: ステートの書き込み

「開始する前に」で導出されたVaultスコープの $STATE_DIR に書き込みます。

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

ステップ5: impl-validatorの起動

サイクル後、impl-validator をサブエージェントとして起動します。

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?

ログを記録する前に、すべてのFAILを適用します。

ステップ6: ログの記録

$OBSIDIAN_VAULT_PATH/log.md に追記します。

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

ステップ7: ユーザーへの報告

## 日次Wiki更新

- ソース: N件新鮮 · N件古い · N件欠落
- インデックス: Nページ (N件追加, N件削除)
- hot.md: 更新済み / 最新

古いソース (同期するには実行してください):
  /wiki-history-ingest claude   — 前回取り込みからNセッション
  /wiki-history-ingest codex    — 前回取り込みからNセッション

セットアップモード(「日次cronを設定する」または「ターミナル通知をインストールする」によってトリガーされます)

ユーザーに初回セットアップの手順を案内します。

ステップ1: スクリプトの存在確認

$OBSIDIAN_WIKI_REPO/scripts/daily-update.sh が存在し、実行可能であることを確認します。存在しない場合は、ユーザーにその場所を伝えます。

ステップ2: launchd plistのインストール

# 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"

# ロード
launchctl load "$HOME/Library/LaunchAgents/com.obsidian-wiki.daily-update.plist"

ステップ3: ターミナル通知のインストール(オプション)

ユーザーに「Wikiが古くなったときにターミナルでリマインダーを受け取りますか? (y/n)」と尋ねます。ユーザーが「no」と答えた場合、または環境がヘッドレス/VPSの場合は、このステップをスキップします。

「yes」の場合、ユーザーのシェルを検出し、適切なrcファイルをターゲットにします。

SHELL_NAME=$(basename "$SHELL")   # zsh, bash, fishなど
case "$SHELL_NAME" in
  zsh)  RC_FILE="$HOME/.zshrc" ;;
  bash) RC_FILE="$HOME/.bashrc" ;;
  *)    echo "シェル '$SHELL_NAME' は自動検出されませんでした。ソース行を手動でシェルのrcファイルに追加してください。" ; return ;;
esac

wiki-notify.sh がそのrcファイルにすでにソースされているかを確認します。ソースされていない場合は、以下を追記します。

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

Fishシェルでは、ソースの構文が異なります。手動での指示を提供します。

# ~/.config/fish/config.fish に追加:
bass source $OBSIDIAN_WIKI_REPO/scripts/wiki-notify.sh
# (bassプラグインが必要、またはロジックをネイティブにコピー)

ステップ4: スクリプトを一度実行

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

これにより $STATE_DIR/.last_update が初期化され、ターミナル通知がすぐに機能するようになります。

ステップ5: 確認

ユーザーに以下を伝えます。

  • cronは毎日午前9時に実行されます(または見逃した場合は次回のログイン時に実行されます)。
  • Wikiが20時間以上古い場合、ターミナル通知が表示されます。
  • ステートは ~/.obsidian-wiki/state/<vault-id>/ に保存されます — 複数のVaultを独立してサポートします。
  • /daily-update をいつでも実行して強制的に同期できます。
  • ログは /tmp/obsidian-wiki-daily.log に出力されます。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

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 (walk up CWD for .env~/.obsidian-wiki/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="$HOME/.obsidian-wiki/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 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

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

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)
  • Terminal notifications appear when the wiki is >20 hours stale
  • State is stored in ~/.obsidian-wiki/state/<vault-id>/ — supports multiple vaults independently
  • They can run /daily-update anytime to force a sync
  • Logs go to /tmp/obsidian-wiki-daily.log