recon

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Recon

侦察

Flags

标志

Flag or argumentDefaultEffect
--refresh
offRebuild memory instead of patching it
positional focusnoneExplore and report that area in more depth
Without
--refresh
, use the warm path when memory exists and the cold path otherwise.
标志或参数默认值作用
--refresh
关闭重建内存而非修补内存
位置焦点深入探索并报告该区域
若未使用
--refresh
,则在已有内存时使用热路径,否则使用冷路径。

Memory

内存

Resolve
<anchor>
as the absolute directory containing this
SKILL.md
. Memory lives at
<anchor>/memory/<basename>-<hash8>.md
;
hash8
is the first eight SHA-256 characters of the repo's absolute root, and
basename
is that root directory's name. Create the directory when needed. Never write memory inside the target repo.
Frontmatter is
repo
, full commit
head
, and ISO date
updated
. The body has these headings: Layout, Entry points, Modules, Data flows, Commands, Conventions, Gotchas, Evidence. Every claim names one or more evidence paths. Keep at most 10 bullets per heading and 200 lines total. Merge duplicates and remove claims whose evidence no longer exists. Write to a sibling
.tmp
and rename it into place only after validation.
<anchor>
解析为包含此
SKILL.md
的绝对目录。内存存储于
<anchor>/memory/<basename>-<hash8>.md
hash8
是仓库绝对根目录SHA-256哈希值的前8个字符,
basename
是该根目录的名称。必要时创建目录。切勿在目标仓库内写入内存。
前置元数据包括
repo
、完整提交
head
和ISO格式的更新日期
updated
。正文包含以下标题:布局、入口点、模块、数据流、命令、约定、注意事项、证据。每项声明需标注一个或多个证据路径。每个标题最多保留10个项目符号,总内容不超过200行。合并重复项,并移除证据已不存在的声明。先写入同级的
.tmp
文件,仅在验证通过后再重命名为目标文件。

1. Locate

1. 定位

Resolve the repo root, memory path, current HEAD, and dirty paths. Record:
route | stored head | current head | changed | current item | pending | terminal
Persist it after each item through a sibling temporary file and atomic rename at
<memory-path>.ledger
; delete it on success. Done when paths and route are known.
解析仓库根目录、内存路径、当前HEAD和已变更路径。记录:
route | stored head | current head | changed | current item | pending | terminal
通过同级临时文件在每个项目后持久化记录,并通过原子重命名保存至
<memory-path>.ledger
;成功完成后删除该临时文件。当路径和路由已知时,此步骤完成。

2. Cold or refresh

2. 冷启动或刷新

Explore breadth first: manifests, top-level layout, entry points, dependency boundaries, commands, and conventions. Read at most three representative anchor files for at most 30 modules named by workspace manifests; go deeper only for the positional focus. Use non-overlapping read-only subagents when available. Write every required section and evidence path, then prune to the limits.
Done when the memory file exists, its
head
equals current HEAD, and every heading contains evidence or says
None found
.
广度优先探索:清单、顶层布局、入口点、依赖边界、命令和约定。最多读取工作区清单中命名的30个模块的最多3个代表性锚定文件;仅针对位置焦点进行深入探索。若有可用的非重叠只读子Agent,则使用它们。写入所有必填章节和证据路径,然后修剪至限制范围内。
当内存文件存在、其
head
与当前HEAD一致,且每个标题均包含证据或标注“未找到”时,此步骤完成。

3. Warm drift

3. 热更新漂移

Read memory before repo files. Take the cold path if
head
is absent or not a resolvable commit. Otherwise collect name-status changes from stored head to HEAD. Rebuild through Step 2 if more than 200 files changed or changes exceed 25% of tracked files.
Otherwise read committed HEAD blobs for changed paths and memory claims citing them; never use dirty worktree content. Follow renames, rewrite every evidence path through the rename map, remove deleted evidence, and inspect one-hop importers when a package root, manifest, or exported entry changed. Remove or rewrite claims contradicted by changed files. With a positional focus, reread that subtree within the same cap. Report dirty paths only as an overlay.
Done when each committed changed path is reflected, affected claims are revalidated or removed, limits hold, and frontmatter names current HEAD.
先读取内存,再读取仓库文件。若
head
不存在或无法解析为提交,则执行冷路径。否则收集从存储的head到当前HEAD的名称-状态变更。若变更文件超过200个或变更占跟踪文件的25%以上,则重新执行步骤2进行重建。
否则读取已提交的HEAD中变更路径的Blob,以及引用这些路径的内存声明;切勿使用未提交的工作区内容。跟踪重命名,通过重命名映射重写所有证据路径,移除已删除的证据,当包根目录、清单或导出入口变更时,检查一级导入者。移除或重写与变更文件矛盾的声明。若有位置焦点,在相同限制内重新读取该子树。仅将未提交路径作为覆盖层报告。
当每个已提交的变更路径均已反映、受影响的声明已重新验证或移除、符合限制条件,且前置元数据命名当前HEAD时,此步骤完成。

4. Resume and report

4. 恢复与报告

After interruption, recompute HEAD and changed paths. If they differ from the ledger, restart the affected cold or warm step. Resume the first pending item from the persisted ledger. Present the updated map without requiring the user to open the memory file. On warm runs, end with
Drift since last recon
.
Done when the report cites the memory snapshot, focus results, drift, and any unverified area; labels each heading rebuilt, patched, or representative-only; and discloses dirty paths.
中断后,重新计算HEAD和变更路径。若与记录文件(ledger)不同,则重新启动受影响的冷启动或热更新步骤。从持久化的记录文件中恢复第一个待处理项目。无需用户打开内存文件即可展示更新后的映射。在热更新运行结束时,显示“自上次侦察以来的漂移”。
当报告引用内存快照、焦点结果、漂移情况以及任何未验证区域;为每个标题标注“重建”“修补”或“仅代表性”;并披露未提交路径时,此步骤完成。

Constraints

约束条件

  • head
    always names an existing commit, never a dirty-tree placeholder.
  • Do not turn the memory into a file inventory or append-only history.
  • head
    始终指向现有提交,绝不是未提交树的占位符。
  • 切勿将内存变为文件清单或仅追加的历史记录。