docs: allow modular code and refresh the handoff state
- AGENTS.md: new files and module splits need no approval; bug fixes, refactors, tests and docs can be done directly with one commit each. Only out-of-repo changes, releases, new third-party code and invariant changes still stop for a decision. Adds the exe-size and readability invariants. - HANDOFF/STATUS/roadmap/README: correct the stale test count, file sizes, session-restore claims and session.json entry; record per-tab edit mode/scroll, the .txt removal, and the open editor-styling design question.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
1. **仓库根**:`D:\Scripts\md-preview\AgentLowWorking`(2026-11-02 迁移后)。只在这个目录内创建、修改、删除文件。
|
||||
- DSH 工作区是父目录 `D:\Scripts\md-preview`;代码仓库在其下的 `AgentLowWorking`。改代码/跑 git 前先 `cd AgentLowWorking`(或 `git -C AgentLowWorking`)。
|
||||
- 父目录只放用户指定的小文件(发布启动器、AGENTS 指针);不要放源码/构建产物。
|
||||
- 仓库内**新增文件不需要事先询问**:按职责拆模块、抽资源、加测试是正常的代码组织手段。
|
||||
2. **任何仓库外的修改都必须先停下询问用户**,包括但不限于:
|
||||
- `%TEMP%` / `%LOCALAPPDATA%` / 用户目录 / 其它磁盘;
|
||||
- 注册表、计划任务、服务、环境变量;
|
||||
@@ -26,16 +27,19 @@
|
||||
- 仓库内**不放成品 exe**;旧的 `D:\Scripts\md-preview\MD-Preview-windows-x64.exe` 已删除,不要再生成。
|
||||
- Agent 编译出的 `target\release\md-preview.exe` 是 **Low**,不能直接双击运行(会 os error 5);冒烟必须把 `MD_PREVIEW_CONFIG_DIR` 指到仓库内目录。
|
||||
- 离线:不引入联网、自动更新、遥测;外部链接交给系统浏览器。
|
||||
- 轻量:不为小功能引入新库;优先原生 JS/CSS 与已有依赖。
|
||||
- 轻量是硬约束:exe 体积以 `build.ps1` 输出为准(2026-11 约 5.5 MB)。不为小功能引入新库,优先原生 JS/CSS 与已有依赖;要 vendor 新的离线资源(>200 KB)先说明并确认。
|
||||
- 可读性优先:单文件按职责拆分,不为“少几个文件”把逻辑堆进 `main.rs`;模块边界以“改一个功能只需动一两个文件”为准。
|
||||
- 右键菜单保持禁用;缩放只用 Ctrl + 滚轮与工具栏/快捷键。
|
||||
|
||||
## 2. 改动流程
|
||||
|
||||
1. 一次只做一个功能;**加功能前先给方案,用户确认后再写代码**。
|
||||
2. 改动超出已确认范围(新增文件、改公共接口、动构建脚本、碰仓库外)时,立即停下询问。
|
||||
3. 写完先 `cargo test` 全绿。
|
||||
4. 每个功能一个 conventional commit,推送到 `origin main`。
|
||||
5. **发布只能由用户手动执行**:用户在普通 PowerShell(Medium)运行 `agent\scripts\publish.ps1`。Agent 不运行发布脚本、不改注册表、不碰 Nutstore。
|
||||
1. 一次只做一件事;**用户可感知的功能/行为变化先给方案,用户确认后再写代码**。
|
||||
2. bug 修复、纯重构、测试、文档、格式与静态检查可以直接处理:每项独立提交,`cargo test` 全绿,提交信息写清行为变化。
|
||||
3. 代码级决策(拆模块、新增文件、内部接口、命名)由 agent 自行决定,不需要逐项询问。
|
||||
4. 只有这些要先停下询问:仓库外的文件/注册表/环境变量;发布;新增第三方库或 >200 KB 的 vendored 资源;改变不变量(离线、轻量、右键禁用、只支持 Windows 等)。
|
||||
5. 写完先 `cargo test` 全绿(含新增测试);改动页面 JS 时额外做一次语法检查。
|
||||
6. 每个改动一个 conventional commit,推送到 `origin main`。
|
||||
7. **发布只能由用户手动执行**:用户在普通 PowerShell(Medium)运行 `agent\scripts\publish.ps1`。Agent 不运行发布脚本、不改注册表、不碰 Nutstore。
|
||||
|
||||
## 3. 构建与测试
|
||||
|
||||
|
||||
Reference in New Issue
Block a user