decodie-overview
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDecodie — Overview Mode
Decodie — 概览模式
Generate a high-level overview of a file, directory, or project — answering "what is this and how is it organized" rather than line-by-line explanations. Produces a single summary entry per target, intended as an onboarding starting point.
This mode persists by default — overviews are saved as learning entries. Re-running on the same target overwrites the existing overview rather than accumulating versions.
This mode is read-only with respect to source code. You only read source files and write to the directory.
.decodie/生成文件、目录或项目的高级概览——重点回答“这是什么以及它的组织结构是怎样的”,而非逐行解释。每个目标生成单个摘要条目,作为入门的起点。
此模式默认会持久化存储——概览会保存为学习条目。对同一目标重新运行会覆盖现有概览,而非累积版本。
此模式对源代码是只读的。你仅会读取源文件,并写入到目录中。
.decodie/Activation and Argument Parsing
激活与参数解析
- Extract the target path. If none provided, use the project root.
- Validate the target. Confirm it exists and is a file or directory.
- Determine target scope:
- File — and
entry_pointsmay be omitted.dependencies - Directory — and
entry_pointsare usually meaningful.dependencies - Project root — all four overview fields apply.
- File —
- Canonicalize the target path for regeneration lookup:
- File: relative path (e.g., )
src/utils/helpers.ts - Directory or project root: relative path with trailing slash (e.g., ,
src/auth/)./
- File: relative path (e.g.,
- 提取目标路径。如果未提供,则使用项目根目录。
- 验证目标。确认目标存在且为文件或目录。
- 确定目标范围:
- 文件 — 可省略和
entry_points。dependencies - 目录 — 和
entry_points通常有意义。dependencies - 项目根目录 — 四个概览字段均适用。
- 文件 — 可省略
- 规范化目标路径以便重新生成时查找:
- 文件:相对路径(例如:)
src/utils/helpers.ts - 目录或项目根目录:带尾部斜杠的相对路径(例如:,
src/auth/)./
- 文件:相对路径(例如:
Setup
设置步骤
-
Check ifexists at the project root. If not, create it:
.decodie/- with
.decodie/index.json{ "version": "1.0", "project": "<directory-name>", "entries": [] } - with default preferences
.decodie/config.json - directory
.decodie/sessions/
-
Load the index summary. Run:bash
bash scripts/summarize-index.sh "$(pwd)"If unavailable, readdirectly..decodie/index.json -
Determine session ID. Find the highestfor today in
NNNmatching.decodie/sessions/, then increment.overview-YYYY-MM-DD-NNN
-
检查项目根目录下是否存在。如果不存在,则创建:
.decodie/- ,内容为
.decodie/index.json{ "version": "1.0", "project": "<directory-name>", "entries": [] } - ,包含默认偏好设置
.decodie/config.json - 目录
.decodie/sessions/
-
加载索引摘要。运行:bash
bash scripts/summarize-index.sh "$(pwd)"如果不可用,则直接读取。.decodie/index.json -
确定会话ID。在中找到今日最高的
.decodie/sessions/,匹配格式NNN,然后递增。overview-YYYY-MM-DD-NNN
Regeneration vs Fresh Entry
重新生成 vs 全新条目
Before generating, check for an existing overview:
- Read .
.decodie/index.json - Find any entry where and
decision_type === "overview"issources.[<canonicalized-target-path>] - If found (regeneration): reuse the existing , generate fresh content, update the index entry in place. The previous session file is left on disk but no longer referenced.
id - If not found: generate a new entry with a fresh ID.
生成前,检查是否存在现有概览:
- 读取。
.decodie/index.json - 查找任何满足且
decision_type === "overview"为sources的条目。[<规范化目标路径>] - 如果找到(重新生成):复用现有,生成新内容,就地更新索引条目。之前的会话文件会保留在磁盘上,但不再被引用。
id - 如果未找到:生成带有新ID的全新条目。
Generation Process
生成流程
-
Read the target:
- File: read in full.
- Directory: list top-level entries, read structural files (,
package.json,composer.json,pyproject.toml, etc.), sample representative source files.README.md - Project root: additionally inspect entry-point manifests and dependency manifests.
-
Identify four overview dimensions:
- (required) — 2-4 sentences describing what this code is for. Lead with intent, not implementation.
purpose - (required) — how the code is organized (sections, modules, key directories and their roles).
structure - (optional) — callable surfaces: exported functions, CLI commands, HTTP routes, framework hooks. Omit if not meaningful.
entry_points - (optional) — notable internal or external dependencies and what they provide. Omit trivia.
dependencies
-
Write in plain prose. Avoid jargon-heavy bullet lists; the goal is human onboarding. Calibrate length to scope.
-
读取目标:
- 文件:完整读取。
- 目录:列出顶层条目,读取结构文件(,
package.json,composer.json,pyproject.toml等),以及代表性的示例源文件。README.md - 项目根目录:额外检查入口点清单和依赖项清单。
-
识别四个概览维度:
- (必填)——2-4句话描述此代码的用途。重点说明意图,而非实现细节。
purpose - (必填)——代码的组织方式(章节、模块、关键目录及其作用)。
structure - (可选)——可调用的接口:导出函数、CLI命令、HTTP路由、框架钩子。如果无意义则省略。
entry_points - (可选)——重要的内部或外部依赖项及其提供的功能。忽略无关紧要的依赖。
dependencies
-
使用平实的散文风格撰写。避免充满术语的项目符号列表;目标是帮助用户快速入门。根据范围调整内容长度。
Entry Generation
条目生成
Index entry metadata
索引条目元数据
- : Reuse existing for regeneration; generate fresh otherwise. Format:
identry-{unix-timestamp}-{random-4-hex-chars} - : e.g., "Overview:
title— token issuance and verification"src/auth/ - :
experience_level(overviews are onboarding entry points)."foundational" - :
decision_type"overview" - : Lowercase kebab-case tags. Reuse existing tags.
topics - :
lifecycle"active" - : Array with exactly one entry — the canonicalized target path.
sources - : For single-file overviews, one reference to the file. For directory/project, empty array.
references - : relative path to session file, e.g.
content_filesessions/overview-2026-03-27-001.json
- :重新生成时复用现有ID;否则生成新ID。格式:
identry-{unix-timestamp}-{random-4-hex-chars} - :例如:"概览:
title— 令牌签发与验证"src/auth/ - :
experience_level(概览是入门起点)"foundational" - :
decision_type"overview" - :小写短横线分隔的标签。复用现有标签。
topics - :
lifecycle"active" - :仅包含一个条目的数组——规范化后的目标路径。
sources - :单文件概览时,包含一个指向该文件的引用;目录/项目概览时,为空数组。
references - :会话文件的相对路径,例如
content_filesessions/overview-2026-03-27-001.json
Session entry content (overview shape)
会话条目内容(概览结构)
Use the overview shape — different from standard entries:
- :
decision_type"overview" - (required) — what the target code is for
purpose - (required) — how the target is organized
structure - (optional) — callable surfaces
entry_points - (optional) — notable dependencies
dependencies
使用概览结构——与标准条目不同:
- :
decision_type"overview" - (必填)——目标代码的用途
purpose - (必填)——目标的组织方式
structure - (可选)——可调用接口
entry_points - (可选)——重要依赖项
dependencies
Session Closure
会话结束
- Set .
timestamp_end - Write a noting the target and whether this was fresh or regenerated.
summary - Confirm:
- Fresh: "Generated overview for as entry
<target>in session<id>."<session_id> - Regeneration: "Regenerated overview for (entry
<target>)."<id>
- Fresh: "Generated overview for
- 设置。
timestamp_end - 写入,注明目标以及此次是全新生成还是重新生成。
summary - 确认内容:
- 全新生成:"为生成概览,作为会话
<target>中的条目<session_id>。"<id> - 重新生成:"重新生成的概览(条目
<target>)。"<id>
- 全新生成:"为
Data Format
数据格式
See references/schema.md for the full data format.
.decodie/完整的数据格式请参见references/schema.md。
.decodie/Important Notes
重要说明
- Always-latest, not append-only. Re-running overwrites the index entry.
- One entry per target. Do not fan out to per-file entries — that is analyze mode's job.
- Be honest about uncertainty. If the target's purpose is ambiguous, say so.
- Language-agnostic. Adapt to whatever language and framework the project uses.
- Self-contained data. The directory can be removed without affecting the project.
.decodie/
- 始终保留最新版本,而非追加式存储。重新运行会覆盖索引条目。
- 每个目标对应一个条目。不要拆分为单个文件条目——这是分析模式的工作。
- 如实说明不确定的内容。如果目标的用途不明确,请直接说明。
- 语言无关。适配项目所使用的任何语言和框架。
- 数据独立。删除目录不会影响项目本身。
.decodie/