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-indexing
。
Find 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-indexing
.

Triggers

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.yaml
声明
user-profile/v1
。每次运行开始时读取共享的 user、brand、 workspace、preferences 以及本 Skill 的
skills.lov-search-chat
命名空间。
值得长期保存的记录有两项:
records.ataru_bin
(本机可用的 Ataru 可执行文件路径)与
records.default_level
(用户偏好的检索粒度)。用户直接说出这类值时,用
scripts/profile_store.py record
写回并报告保存路径。检索词、项目 ID 这类一次性 输入不写入 Profile。完整契约见
references/user-profile.md
。
skill.yaml
declares
user-profile/v1
. At the start of every run, read the shared user, brand, workspace, and preferences, as well as this Skill's
skills.lov-search-chat
namespace.
There are two records worth persisting:
records.ataru_bin
(the path to a locally available Ataru executable) and
records.default_level
(the user's preferred retrieval granularity). When the user directly provides such a value, write it back using
scripts/profile_store.py record
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
references/user-profile.md
.

Skill Group Composition

Skill Group Composition

见
references/skill-composition.md
。本源码是 独立 Single Skill,与
lov-ataru-indexing
之间只有制品级交接(索引状态)。
See
references/skill-composition.md
. This source is a standalone Single Skill, with only an artifact-level handoff (index status) between it and
lov-ataru-indexing
.

Workflow (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
解析顺序是
--bin
→
ATARU_BIN
→ PATH → 已安装 App bundle → 从当前目录向上查找的 本地 dev build,每个候选先跑一次
--version
。低于 0.41.3 的旧版不认识 index 子命令, 会把它当成桌面启动参数打开一个窗口并永不返回。
search
自己会先确认索引。索引未就绪时它以
ATARU_INDEX_NOT_READY
或
ATARU_INDEX_BUILDING
失败并指向
lov-ataru-indexing
,不会返回零结果—— 「没找到」和「索引没建好」必须是两种可区分的回答。本 Skill 不替用户构建索引。
能检索不等于跟得上磁盘:
index status
只汇报 manifest 里存的总数,停更几个月的 索引照样报
ready
。所以
index-status
和
search
都按 Ataru 自己的规则把 manifest 与磁盘上的会话文件逐一比对,给出
indexStale
、
pendingSessions
(新增或 改动、还没进索引)与
removedSessions
(索引里有、磁盘上已删)。
indexStale
为真时
search
照常返回命中,
warnings
第一条是
ATARU_INDEX_STALE
:这时零命中不能 当作「没找到」,先用
lov-ataru-indexing
的
ensure
补建再重试,或明确告诉用户 索引已过期。这里给警告而不报错,是因为正在进行的会话(包括发起检索的这一个)一直在 追加,少量 pending 是常态,报错会让检索几乎永远不可用。
bash
export SKILL_DIR="$HOME/.claude/skills/lov-search-chat"
python3 "$SKILL_DIR/scripts/ataru_recall.py" index-status
The resolution order is
--bin
→
ATARU_BIN
→ PATH → installed App bundle → local dev build found by walking upward from the current directory. Each candidate is first run once with
--version
. 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.
search
verifies the index itself before running. When the index is not ready, it fails with
ATARU_INDEX_NOT_READY
or
ATARU_INDEX_BUILDING
and points to
lov-ataru-indexing
. It does not return an empty result set—“not found” and “the index has not been built” must be distinguishable answers. This Skill does not build the index for the user.
Being able to search does not mean the index is keeping up with disk state:
index status
only reports the totals stored in the manifest, so an index that is months out of date still reports
ready
. Therefore, both
index-status
and
search
compare the manifest with the session files on disk one by one, following Ataru's own rules, and report
indexStale
,
pendingSessions
(new or changed sessions that have not yet been indexed), and
removedSessions
(sessions present in the index but deleted from disk). When
indexStale
is true,
search
still returns hits, and the first item in
warnings
is
ATARU_INDEX_STALE
: in this case, zero hits cannot be treated as “not found.” First use
lov-ataru-indexing
's
ensure
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.

Step 1: Choose the level before querying

Step 1: Choose the level before querying

level一条命中代表什么时候用
turn
单条消息默认。要精确定位某句话、某个报错、某个决定
run
一轮用户请求到回答想看一个来回的完整语境
session
整个会话想找「哪次会话在讨论这件事」
project
一个项目想知道这个话题主要发生在哪个项目里
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
命中里的
projectId
/
sessionId
/
messageId
/
lineNumber
是稳定标识,可以直接 喂给下一步。
indexUpdatedAt
是 manifest 写入时间,即索引上次构建完成的时刻。
snippet
默认截断到 600 字符,需要完整 CLI 响应时加
--full
,它同样带上述 新鲜度字段与警告。
命令行检索只走关键词模式:
mode
与
requestedMode
都会是
keyword
,
semanticAvailable
通常为 false。不要向用户承诺命令行能拿到语义或 hybrid 排序, 也不要因为关键词没命中就断言「历史里没有这件事」——换同义词、换 level 再试。
在万级会话的真实语料上,一次 turn 级检索是数十秒量级。不要为了「快速失败」压低
--timeout
。
levelWhat one hit representsWhen to use
turn
A single messageDefault. Use it to pinpoint an exact statement, error, or decision.
run
One user request through its answerUse it to view the complete context of an exchange.
session
An entire conversationUse it to find “which session discussed this topic.”
project
A projectUse it to determine which project the topic primarily belongs to.
bash
python3 "$SKILL_DIR/scripts/ataru_recall.py" search "会话恢复方案" --level turn --limit 10
When 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-app
The
projectId
/
sessionId
/
messageId
/
lineNumber
values in a hit are stable identifiers and can be passed directly to the next step.
indexUpdatedAt
is the manifest write time, meaning the moment when the index was last built.
snippet
is truncated to 600 characters by default; add
--full
for the complete CLI response, which also includes the freshness fields and warnings described above.
CLI retrieval only supports keyword mode: both
mode
and
requestedMode
will be
keyword
, and
semanticAvailable
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.
On a real corpus of tens of thousands of sessions, a single turn-level search takes tens of seconds. Do not lower
--timeout
to “fail fast.”

Step 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
控制单条正文截断(默认 2000)。 不传
--around
时返回会话末尾
--window
条。给出的
--around
在该会话里找不到时, 脚本报
ATARU_MESSAGE_NOT_FOUND
而不是静默返回别的位置。
Ranked 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
is the number of messages retained on each side, and
--message-chars
controls the truncation of each message body (default: 2000). If
--around
is omitted, the final
--window
messages are returned. If the supplied
--around
cannot be found in that session, the script reports
ATARU_MESSAGE_NOT_FOUND
rather than silently returning a different location.

Step 3: Answer with citations, not with impressions

Step 3: Answer with citations, not with impressions

回答里必须带得回原处的东西:会话标题、时间戳,以及必要时的
sessionId
。截断过的 正文要说明是截断的。检索没命中、且
indexStale
为 false,才说没命中,并说明用了 哪些词和哪个 level;
indexStale
为真时要说「索引已过期,这次没查到」,而不是 「没有」。不要用当前上下文的推测去填补历史空白。
Answers must include enough information to trace them back to the source: the conversation title, timestamp, and
sessionId
when necessary. If a body was truncated, say so. Only state that there was no match if retrieval returned no hits and
indexStale
is false, and explain which terms and level were used. If
indexStale
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.

Dependencies

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 驱动任务中提出修改意见时,继续当前产物前必须执行:
  1. 先判断意见是
    task-specific
    (仅本次)还是
    reusable
    (可跨任务复用)。
  2. task-specific
    只修改当前任务,不改 Skill。
  3. reusable
    先确定作用域:领域规则先更新对应 canonical Skill;适用于所有 Skill 的规则先更新共享规范。
  4. 完成规则更新、版本、lint 与分发核验后,再把修改应用到当前任务。
  5. reusable
    修改会使此前的“确认”“继续”“发吧”失效;完成当前产物修改和回读后必须停下,等待用户下一步指示,不自动进入发布、提交或其他外部写入。
When a user provides revision feedback during a Skill-driven task, you MUST perform the following steps before continuing the current deliverable:
  1. Determine whether the feedback is
    task-specific
    (this task only) or
    reusable
    (usable across tasks).
  2. For
    task-specific
    feedback, modify only the current task, not the Skill.
  3. For
    reusable
    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.
  4. After completing rule updates, versioning, linting, and distribution verification, apply the change to the current task.
  5. A
    reusable
    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.