lov-search-chat
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese会话寻踪 · Chat Finder
Conversation Tracing · Chat Finder
在本机已有的 AI 会话历史里找出与当前问题相关的过去记录,交回两样能直接用的
东西:带稳定标识(Project / Session / Message)的排序命中,以及围绕某个命中的一段
原文。索引的构建与修复属于 。
lov-ataru-indexingFind past records in the locally available AI conversation history that are relevant to the current question, and return two things that can be used directly: ranked hits with stable identifiers (Project / Session / Message), and an original passage surrounding a specific hit. Index construction and repair are handled by .
lov-ataru-indexingTriggers
Triggers
Activate when
Activate when
- “我上次是怎么解决这个报错的?”
- “找出讨论过会话恢复方案的那次记录。”
- Help me recall what was decided about this module in an earlier session.
- “How did I resolve this error last time?”
- “Find the session where we discussed the conversation recovery approach.”
- Help me recall what was decided about this module in an earlier session.
Do not activate when
Do not activate when
- 用户要的是「把索引重建一下」「索引是不是坏了」 —— 交给 。
lov-ataru-indexing - 用户要在当前代码库里找某个符号或文件 —— 用普通的 grep 与文件搜索,那是代码检索 而不是会话记忆检索。
- The user wants to “rebuild the index” or asks whether “the index is broken” — hand this off to .
lov-ataru-indexing - The user wants to find a symbol or file in the current codebase — use regular grep and file search. That is code retrieval, not conversation memory retrieval.
User Profile (cross-session)
User Profile (cross-session)
skill.yamluser-profile/v1skills.lov-search-chat值得长期保存的记录有两项:(本机可用的 Ataru 可执行文件路径)与
(用户偏好的检索粒度)。用户直接说出这类值时,用
写回并报告保存路径。检索词、项目 ID 这类一次性
输入不写入 Profile。完整契约见
。
records.ataru_binrecords.default_levelscripts/profile_store.py recordreferences/user-profile.mdskill.yamluser-profile/v1skills.lov-search-chatThere are two records worth persisting: (the path to a locally available Ataru executable) and (the user's preferred retrieval granularity). When the user directly provides such a value, write it back using and report the storage path. One-off inputs such as search terms and project IDs are not written to the Profile. See the full contract in .
records.ataru_binrecords.default_levelscripts/profile_store.py recordreferences/user-profile.mdSkill Group Composition
Skill Group Composition
见 。本源码是
独立 Single Skill,与 之间只有制品级交接(索引状态)。
references/skill-composition.mdlov-ataru-indexingSee . This source is a standalone Single Skill, with only an artifact-level handoff (index status) between it and .
references/skill-composition.mdlov-ataru-indexingWorkflow (MANDATORY)
Workflow (MANDATORY)
You MUST follow these steps in order.
You MUST follow these steps in order.
Step 0: Resolve the binary, then confirm the index
Step 0: Resolve the binary, then confirm the index
bash
export SKILL_DIR="$HOME/.claude/skills/lov-search-chat"
python3 "$SKILL_DIR/scripts/ataru_recall.py" index-status解析顺序是 → → PATH → 已安装 App bundle → 从当前目录向上查找的
本地 dev build,每个候选先跑一次 。低于 0.41.3 的旧版不认识 index 子命令,
会把它当成桌面启动参数打开一个窗口并永不返回。
--binATARU_BIN--versionsearchATARU_INDEX_NOT_READYATARU_INDEX_BUILDINGlov-ataru-indexing能检索不等于跟得上磁盘: 只汇报 manifest 里存的总数,停更几个月的
索引照样报 。所以 和 都按 Ataru 自己的规则把
manifest 与磁盘上的会话文件逐一比对,给出 、(新增或
改动、还没进索引)与 (索引里有、磁盘上已删)。 为真时
照常返回命中, 第一条是 :这时零命中不能
当作「没找到」,先用 的 补建再重试,或明确告诉用户
索引已过期。这里给警告而不报错,是因为正在进行的会话(包括发起检索的这一个)一直在
追加,少量 pending 是常态,报错会让检索几乎永远不可用。
index statusreadyindex-statussearchindexStalependingSessionsremovedSessionsindexStalesearchwarningsATARU_INDEX_STALElov-ataru-indexingensurebash
export SKILL_DIR="$HOME/.claude/skills/lov-search-chat"
python3 "$SKILL_DIR/scripts/ataru_recall.py" index-statusThe resolution order is → → PATH → installed App bundle → local dev build found by walking upward from the current directory. Each candidate is first run once with . Versions older than 0.41.3 do not recognize the index subcommand; they treat it as a desktop launch argument, open a window, and never return.
--binATARU_BIN--versionsearchATARU_INDEX_NOT_READYATARU_INDEX_BUILDINGlov-ataru-indexingBeing able to search does not mean the index is keeping up with disk state: only reports the totals stored in the manifest, so an index that is months out of date still reports . Therefore, both and compare the manifest with the session files on disk one by one, following Ataru's own rules, and report , (new or changed sessions that have not yet been indexed), and (sessions present in the index but deleted from disk). When is true, still returns hits, and the first item in is : in this case, zero hits cannot be treated as “not found.” First use 's to rebuild the index and retry, or clearly tell the user that the index is stale. This Skill emits a warning rather than an error because active conversations—including the one initiating the search—are continually being appended to. A small number of pending sessions is normal, and an error would make retrieval almost permanently unusable.
index statusreadyindex-statussearchindexStalependingSessionsremovedSessionsindexStalesearchwarningsATARU_INDEX_STALElov-ataru-indexingensureStep 1: Choose the level before querying
Step 1: Choose the level before querying
| level | 一条命中代表 | 什么时候用 |
|---|---|---|
| 单条消息 | 默认。要精确定位某句话、某个报错、某个决定 |
| 一轮用户请求到回答 | 想看一个来回的完整语境 |
| 整个会话 | 想找「哪次会话在讨论这件事」 |
| 一个项目 | 想知道这个话题主要发生在哪个项目里 |
bash
python3 "$SKILL_DIR/scripts/ataru_recall.py" search "会话恢复方案" --level turn --limit 10限定项目时用等号形式,因为项目 ID 本身以短横线开头:
bash
python3 "$SKILL_DIR/scripts/ataru_recall.py" search "索引没有更新" \
--level session --project-id=-Users-me-projects-app命中里的 / / / 是稳定标识,可以直接
喂给下一步。 是 manifest 写入时间,即索引上次构建完成的时刻。
默认截断到 600 字符,需要完整 CLI 响应时加 ,它同样带上述
新鲜度字段与警告。
projectIdsessionIdmessageIdlineNumberindexUpdatedAtsnippet--full命令行检索只走关键词模式: 与 都会是 ,
通常为 false。不要向用户承诺命令行能拿到语义或 hybrid 排序,
也不要因为关键词没命中就断言「历史里没有这件事」——换同义词、换 level 再试。
moderequestedModekeywordsemanticAvailable在万级会话的真实语料上,一次 turn 级检索是数十秒量级。不要为了「快速失败」压低
。
--timeout| level | What one hit represents | When to use |
|---|---|---|
| A single message | Default. Use it to pinpoint an exact statement, error, or decision. |
| One user request through its answer | Use it to view the complete context of an exchange. |
| An entire conversation | Use it to find “which session discussed this topic.” |
| A project | Use it to determine which project the topic primarily belongs to. |
bash
python3 "$SKILL_DIR/scripts/ataru_recall.py" search "会话恢复方案" --level turn --limit 10When restricting the search by project, use the equals form because the project ID itself begins with a hyphen:
bash
python3 "$SKILL_DIR/scripts/ataru_recall.py" search "索引没有更新" \
--level session --project-id=-Users-me-projects-appThe / / / values in a hit are stable identifiers and can be passed directly to the next step. is the manifest write time, meaning the moment when the index was last built. is truncated to 600 characters by default; add for the complete CLI response, which also includes the freshness fields and warnings described above.
projectIdsessionIdmessageIdlineNumberindexUpdatedAtsnippet--fullCLI retrieval only supports keyword mode: both and will be , and is usually false. Do not promise users that the CLI can provide semantic or hybrid ranking, and do not conclude that something “never appeared in the history” merely because a keyword search missed; try synonyms or a different level.
moderequestedModekeywordsemanticAvailableOn a real corpus of tens of thousands of sessions, a single turn-level search takes tens of seconds. Do not lower to “fail fast.”
--timeoutStep 2: Read the original transcript around a hit
Step 2: Read the original transcript around a hit
排序命中只够定位,不够下判断。拿到候选后,围绕它读一段原文:
bash
python3 "$SKILL_DIR/scripts/ataru_recall.py" read \
--project-id=-Users-me-projects-app \
--session-id=<session uuid> \
--around=<message uuid or line number> \
--window 6--window--message-chars--around--window--aroundATARU_MESSAGE_NOT_FOUNDRanked hits are enough to locate a passage, but not enough to make a judgment. Once you have candidates, read an original passage around one:
bash
python3 "$SKILL_DIR/scripts/ataru_recall.py" read \
--project-id=-Users-me-projects-app \
--session-id=<session uuid> \
--around=<message uuid or line number> \
--window 6--window--message-chars--around--window--aroundATARU_MESSAGE_NOT_FOUNDStep 3: Answer with citations, not with impressions
Step 3: Answer with citations, not with impressions
回答里必须带得回原处的东西:会话标题、时间戳,以及必要时的 。截断过的
正文要说明是截断的。检索没命中、且 为 false,才说没命中,并说明用了
哪些词和哪个 level; 为真时要说「索引已过期,这次没查到」,而不是
「没有」。不要用当前上下文的推测去填补历史空白。
sessionIdindexStaleindexStaleAnswers must include enough information to trace them back to the source: the conversation title, timestamp, and when necessary. If a body was truncated, say so. Only state that there was no match if retrieval returned no hits and is false, and explain which terms and level were used. If is true, say, “The index is stale, so this search did not find a match,” rather than “There is no match.” Do not fill gaps in the historical record with speculation from the current context.
sessionIdindexStaleindexStaleDependencies
Dependencies
- Python 3.8+(仅标准库)
- 本机安装的 Ataru 0.41.3 或更新版本,且索引已就绪
- Python 3.8+ (standard library only)
- Ataru 0.41.3 or later installed locally, with a ready index
通用反馈闭环
General Feedback Loop
用户在 Skill 驱动任务中提出修改意见时,继续当前产物前必须执行:
- 先判断意见是 (仅本次)还是
task-specific(可跨任务复用)。reusable - 只修改当前任务,不改 Skill。
task-specific - 先确定作用域:领域规则先更新对应 canonical Skill;适用于所有 Skill 的规则先更新共享规范。
reusable - 完成规则更新、版本、lint 与分发核验后,再把修改应用到当前任务。
- 修改会使此前的“确认”“继续”“发吧”失效;完成当前产物修改和回读后必须停下,等待用户下一步指示,不自动进入发布、提交或其他外部写入。
reusable
When a user provides revision feedback during a Skill-driven task, you MUST perform the following steps before continuing the current deliverable:
- Determine whether the feedback is (this task only) or
task-specific(usable across tasks).reusable - For feedback, modify only the current task, not the Skill.
task-specific - For feedback, determine the scope first: for domain rules, update the corresponding canonical Skill; for rules that apply to all Skills, update the shared specification first.
reusable - After completing rule updates, versioning, linting, and distribution verification, apply the change to the current task.
- A change invalidates earlier “confirm,” “continue,” and “ship” approvals. After modifying and reading back the current deliverable, you must stop and wait for the user's next instruction; do not automatically proceed to publishing, committing, or any other external write.
reusable