index-at-creation

index-at-creation

熱門

在建立時進行索引

3940星標
303分支
更新於 2026/1/26
SKILL.md
唯讀
名稱
index-at-creation
描述

在建立時進行索引

在建立時進行索引 (Index at Creation Time)

在產出物 (artifacts) 建立時立即進行索引,而不是等到批次處理的時間點。

模式 (Pattern)

如果下游邏輯依賴產出物可被查詢,請務必在寫入時立即進行索引。

應該做 (DO)

  • 在 PostToolUse Write 掛鉤 (hook) 中進行交接索引(在建立後立即執行)
  • 使用 --file 標記來進行快速的單一檔案索引
  • 從建立產出物的同一個事件中觸發索引

不該做 (DON'T)

  • 等待 SessionEnd 才進行批次索引
  • 依賴 cron/預定任務來處理具有時效性的資料
  • 假設資料「很快」就會準備好

來源工作階段 (Source Sessions)

  • a541f08a: "Index at artifact creation time, not at SessionEnd"
  • 1c21e6c8: "If downstream logic depends on artifacts, index at the moment they're created"