cot-lint
Lint your repo for chain-of-thought leakage — the session-transcript residue AI assistants leave in docs, comments, and commit-adjacent prose. Ships the cot-trim skill as an installable DeepSeek Harness plugin.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:YuanyuanMa03/cot-lint说明文档
阅读完整 README ↗cot-lint
English | 中文
扫描仓库中的"思维链泄漏"——AI 助手留在文档、注释、JSDoc 里的会话残留。
你的 coding agent 代码写得很好,但会把"思考过程"漏得到处都是:
- // This PR adds a retry loop (decision 7) so the diff stays reviewable.
- // The manager used to serialize writes itself; it no longer does after v1.
- // The cast is safe — it simply narrows the union. Probably fine for now.
+ // Retries transient provider failures up to 3 times with jittered backoff.
+ // The shared coordinator serializes writes per session.
+ // The cast narrows a union already validated at the loader boundary.
左边一列对代码的描述并没有错,错的是读者设定:它在和一个早已离开的评审者争论,引用一个谁都打不开的设计会话,叙述一次变更而不是陈述行为。
唯一测试
站在 HEAD 上的读者——没有任何会话记录、PR 讨论或未提交草稿——能否解析其中每一个引用、验证每一个断言?
不能,就是思维链泄漏。cot-lint 负责把它找出来。
快速开始
DeepSeek Harness —— 以插件形式装入 cot-trim 修复技能:
dsh plugin add cot-lint
任何仓库 / CI —— 零依赖,Node ≥ 20:
npx cot-lint # 扫描整个仓库(Markdown 等文本文件)
npx cot-lint --json # 输出 JSON,供 CI 或 agent 消费
npx cot-lint --ext ts,py # 同时逐行扫描源码文件
npx cot-lint --hidden # 进入 .agents/ 等点开头目录
退出码:0 干净 · 1 有发现 · 2 用法错误——可直接接入 CI。
检测什么
| 类别 | 示例 |
|---|---|
| 死掉的设计会话引用 | (decision 7)、design §4.7、阶段代号 W3/T4、设计稿 |
| PR/堆叠视角 | "this PR adds…"、"a later PR in this stack" |
| 变更叙述 / 版本印记 | "used to"、"no longer"、"the old X"、"the v1 refactor"、"today"、旧版/不再 |
| 评审编排 | "Rejected in review:"、"the reviewer confirmed"、上一轮评审 |
| 对评审者的辩解 | "the cast is safe — it simply…" |
| 控制流复述 | "first we X, then we Y"、"as you can see" |