/write-notes-like-deepseek:write-notes-like-deepseekfrom write-notes-like-deepseek
Use when a change is non-trivial by DSH standards (behavior, architecture, cross-file contracts, process/tooling, testing strategy, or on-disk/wire/config formats), when choosing between technical alternatives, superseding a decision, or writing a postmortem. Records the why and rejected options in .agents/notes/ with script-enforced gates; skips purely mechanical edits (CRUD, styling, patches, tagging, formatting).
Ships in write-notes-like-deepseek. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
方法提炼自 DeepSeek Harness 的工程实践。聊天里的 Agent 负责拆任务、排计划;本 Skill 只做一件事:为什么这样改、放弃了什么、怎么证明改对了,都留在一处,给下一个改这段代码的人用。
模型有迎合强迫症,动不动就想立 Note。先过这道闸:
快速返回——以下属于 DSH 定义的"纯机械或局部改动",严禁立 Note,直接改代码:
判定对齐 DSH:非平凡改动必须写。 命中以下任何一项即非平凡——改了行为、改了架构、改了跨文件契约、改了流程与工具链、改了测试策略、改了落盘 / 网络 / 配置格式——或其他维护者日后可能重访的决定。
写之前,对照三个方向想清楚这篇笔记守住什么:
一句话记住:代码和单测说不出来的意图、边界、取舍,就是非平凡。 判不准时,从严。
对 AI 来说,写在散文里的规矩等于没有规矩——能机械检查的纪律都有脚本兜底(见 §6);决定翻转、当场审计、现在时正文靠操作流,不靠词法扫描。 优先级:宿主项目的
AGENTS.md/CLAUDE.md与用户的直接指令高于本 Skill;本 Skill 是默认契约,不是更高法律。
| 内心的借口 | 现实 |
|---|---|
| "只是改个默认值/重命名" | 默认值和命名都是决策事实;原地更新老笔记只要 30 秒 |
| "先合并,以后再补" | 以后 = 永远不会;腐化从每一篇"以后补"开始 |
| "代码即文档" | 代码只说是什么,说不出为什么和放弃了什么 |
| "改动很小,犯不着" | 规模小 ≠ 不用记;一个重试参数曾引发全网故障 |
| "不确定要不要写" | 对照上面的非平凡清单:命中就写,不命中就不写。别拿这句话当挡箭牌 |
## Decision 改写成反面,禁止只靠 git 当旧理由的唯一副本。Status: rejected — <原因>(严禁归档);无防坑价值的被否记录直接物理删除。「决定」不重——个人项目里就是「为什么选 A 没选 B」。选型、取舍、踩过的坑,都值得写下。
别一上来建全套目录。按这个仓库现在的样子选:
AGENTS.md / CLAUDE.md / 贡献指南 → 读它;有 docs/adr/、docs/decisions/、Issue 模板等现成的决定记录 → 沿用,状态和种类按本 Skill 的文件夹来即可。.agents/notes/{proposed,implemented,rejected,archived} × 6 class,用到哪个目录就建哪个,空目录不必预建——个人写、不用 git 也照此建全套结构,别精简成单目录。CONTRIBUTING.md / PR 模板加一句「重要改动必带一篇笔记」,并把校验脚本接进 CI。每条 Note 的路径就是身份:{lifecycle}/{class}/yyyy-mm-dd-topic.md
Lifecycle(一层文件夹,这篇走到哪一步):
proposed — 想法阶段,有了方案但还没落地implemented — 已落地,与代码同批改动保持同步rejected — 审慎否掉的提案,仅当能防止重犯时保留,否则删整组archived — 已完成且未来参考价值低的 implemented 记录,冻结不可改Class(二层文件夹,就这 6 个;再加要改检查脚本):
feature 新能力 — 用户或模型看得见的选择(不显然的行为也算)bug-fix 修缺陷 — 修好了什么,或补上复盘里暴露的缺口simplification 只删不增 — 不增加能力,只删代码、行为或表面architecture 结构怎么搭 — 发出去的源码怎么组织、包怎么连process 工具和流程 — 检查、发布、怎么协作(围着代码转,不是运行时行为)testing 测试怎么写 — 测试策略和基建
refactor不单列:能看见的行为变了,归到对应类;没变就是simplification。不建INDEX.md。细判据见references/classification.md。
正文一律用简体中文撰写(代码、命令、专有名词除外),与触发任务的输入语言无关。
前三行固定:
# Agent Note: <标题>
Status: <状态>
状态必须与所在 lifecycle 文件夹一致(rejected 带一句话原因);文件名日期是首次提出日。Body 骨架:
proposed:## Problem → ## Proposal → …自由节… → ## Alternatives considered → ## Acceptance criteria → ## Risksimplemented:## Problem → ## Decision(现在时) → …自由节… → ## Alternatives considered → ## Consequencesrejected:冻结的 proposal 形态,结论在 Status: 行备选方案必填:只记录真实考虑过的对手方案,先写它最强的理由再否定。没有过的选项不要编。「不做 / 复用现状」仅当当时真的权衡过才写。脚本只检查有没有
## Alternatives considered。确实没有真实备选时,保留节标题、正文写「无」即可过检,不要为凑数编造。implemented的## Decision用现在时;门禁只拒提案标题(## Proposal/## Plan/## Migration plan/## Acceptance criteria及其中文别名)。展开见references/note-format.md。
模板见 templates/。
动手重构或选型前,先查历史约束,防止重复踩坑或破坏前人妥协:
// Note: ... 见 .agents/notes/...,顺着它读。没有就走下面三法,不要为了检索去补锚点。implemented/architecture/,避坑看 rejected/)。--hidden 并排除 archived/:
rg --hidden --glob '!.agents/notes/archived/**' "<机制名或关键词>" .agents/notes/
问用户之前,先自己查。 以上四法能答的事实,不要抛给用户;只有真正的决策才占用用户时间。
对话里的触发信号——用户或自己说出这类话,就该动笔(文首红线清单里的机械改动除外,别拿这些短语当过度记录的理由):
判定与操作流:
## Decision 核心理由不变;理由变了就走新建。proposed(为什么想这么做、考虑过哪几条路),评审完再动手。交互纪律见下。implemented/<class>/,文件名日期不动;② Status: proposed → Status: implemented;③ ## Proposal → 现在时 ## Decision;④ ## Acceptance criteria / ## Risks 折进 ## Consequences(或现在时 ## Testing);⑤ 删计划段。与代码同批落盘——git 场景即同一 commit/PR。archive-agent-note.ts。指针写在新笔记里,不写进归档篇。交互协议(向用户提问时):
➡️ <推荐>;用户按编号批量应答("1 yes,2 第二个选项"),不挤牙膏、不来回试探。判定细则见
references/when-to-write.md,归档与删除见references/archiving.md。
## Consequences 同时写代价和收益,不是只写"放弃了什么"。Decision 与 Alternatives 之间,保持可检索的机制名与 must / may / never 时序强调。[topic](../../implemented/architecture/2026-…-….md),不要裸数字,以便机械可校验。// Note: ... 见 .agents/notes/...;不是门禁。决定被取代时,这些注释是要同步的代码清单。references/prose-checklist.md;简化机会见 references/simplification-checklist.md。references/quality-gate.md 的语义自检,只向用户报缺口和写得好的地方(≤5 行),缺口给具体修法。结构靠脚本,意思靠人点头。在仓库根目录直接运行(已配置 npm script 时):
npm run verify-agent-note-tree # 目录合法性、分类、文件名、笔记间相对链接
npm run verify-agent-note-format # 头块、状态、必备节、备选方案、implemented 禁用提案标题
npm run verify-archived # 归档封印:头部布局、manifest 哈希、只增不改(无 git 自动降级)
npm run verify-notes # 以上三线串跑(CI 用这个)
npm run archive-agent-note -- <path> [--superseded-by <新笔记>] # 一键归档;可选在新笔记插入互链 + 入站死链报告
npm run check-anchors # 软报告:若代码里有 // Note: 锚点,做双向体检;不当 CI 门
npm run init-board # 生成 ~69KB 轻量看板 board.html(日常开发推荐)
npm run bundle-board # 打包内嵌全量数据的自包含 demo.html
脚本位于本 Skill 的 scripts/,从宿主项目根目录调用,默认检查当前目录下的 .agents/notes/。先根据已加载的 SKILL.md 路径确定 Skill 位置,不要假定宿主根目录存在 scripts/,也不要切换到 Skill 目录执行。安装不会自动配置宿主的 npm scripts。
写完或改完任何笔记后必须运行验证:有 npm script 用 npm run verify-notes,没有就用下方 npx tsx 命令——不得以「未配置校验入口」为由跳过。
项目级安装到 .agents/skills/ 时,可直接执行:
npx tsx .agents/skills/write-notes-like-deepseek/scripts/verify-agent-note-tree.ts
npx tsx .agents/skills/write-notes-like-deepseek/scripts/verify-agent-note-format.ts
npx tsx .agents/skills/write-notes-like-deepseek/scripts/verify-archived-agent-notes.ts
npx tsx .agents/skills/write-notes-like-deepseek/scripts/build-board.ts --init board.html "项目决策看板"
安装到 .claude/skills/ 或全局目录时,用实际 Skill 路径替换上述前缀。看板打包参数为 --bundle <notes目录> <输出.html> "名字";参数与免疫规则见 references/verification.md。
团队可将本 Skill 的 templates/verify-notes.yml 复制到宿主仓库 .github/workflows/verify-notes.yml,调整为实际安装路径,并将项目级 Skill 文件一起提交;模板在 Skill 目录内不会执行。可在 CONTRIBUTING.md / PR 模板加一句「重要改动必带一篇笔记」。
按需加载:
references/note-format.md — 头块与 body 骨架展开references/classification.md — 6 class 判定与边界references/when-to-write.md — 何时新建 / 更新 / 流转(含与 DSH 判定对齐关系的说明)references/archiving.md — 归档与合并删除(含"未来参考价值"判定)references/prose-checklist.md — 行文与去泄露自检references/simplification-checklist.md — 简化机会自检references/quality-gate.md — 写后语义自检:Problem / Alternatives / Consequences / Verification 判定 + 汇报形态references/verification.md — 校验脚本说明assets/agent-notes-board.html (opens in a new tab)references/archiving.md (opens in a new tab)references/classification.md (opens in a new tab)references/note-format.md (opens in a new tab)references/prose-checklist.md (opens in a new tab)references/quality-gate.md (opens in a new tab)references/simplification-checklist.md (opens in a new tab)references/verification.md (opens in a new tab)references/when-to-write.md (opens in a new tab)scripts/agent-note-tree.ts (opens in a new tab)scripts/archive-agent-note.ts (opens in a new tab)scripts/build-board.ts (opens in a new tab)scripts/check-note-anchors.ts (opens in a new tab)scripts/verify-agent-note-format.ts (opens in a new tab)scripts/verify-agent-note-tree.ts (opens in a new tab)scripts/verify-archived-agent-notes.ts (opens in a new tab)templates/implemented.md (opens in a new tab)templates/proposed.md (opens in a new tab)templates/rejected.md (opens in a new tab)templates/verify-notes.yml (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub treasuregooldove/personal-skills --plugin write-notes-like-deepseek