YuanyuanMa03/cot-lint
Lint your repo for chain-of-thought leakage — the session-transcript residue AI assistants leave in docs and comments.
已收录
0
Skill
Bundle 已验证
预览
功能介绍
思维链泄漏检测:零依赖 CLI 扫描 AI 留在文档与注释里的会话残留(死设计引用、PR 视角、变更叙述、评审编排),内置 cot-trim 语义修复技能包。
适合
- 希望在 CI 中检测 Markdown、注释或 JSDoc 内会话残留的代码库。
- 需要清理死设计引用、PR 叙述、评审编排及不可验证写作上下文的中英文代码库。
- 希望通过内置 cot-trim 技能对命中项进行语义判断和修复的 Agent 工作流。
不适合
- 需要通用 AI 文风检测的用户不适合;它检测的是写作会话视角,而非措辞风格。
- 把每次命中都视为确定缺陷的工作流不适合;规则有意偏向多报,需要人工或 Agent 判断。
- Node.js 20 以下的运行环境不适合。
- 希望无需配置就自动扫描源码的场景不适合;必须显式选择额外文件扩展名。
README
cot-lint
| English | 中文 |
Lint your repo for chain-of-thought leakage — the session-transcript residue AI assistants leave in docs, comments, and JSDoc.
Your coding agent writes great code and leaks its thinking everywhere around it:
- // 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.
None of the left column is wrong about the code. It is wrong about its reader: it argues with a reviewer who has left, cites a design session nobody can open, and narrates a change instead of stating behavior.
The one test
Could a reader at HEAD — with no access to any session transcript, PR thread, or uncommitted draft — resolve every reference and verify every claim?
If no, that passage is chain-of-thought leakage. cot-lint finds it.
Quick start
DeepSeek Harness — install the cot-trim fixing skill as a plugin:
dsh plugin add cot-lint
Any repo or CI — zero dependencies, Node ≥ 20:
npx cot-lint # scan the repo (Markdown and prose files)
npx cot-lint --json # machine-readable findings for CI or agents
npx cot-lint --ext ts,py # also scan source files line-by-line
npx cot-lint --hidden # descend into dot-directories such as .agents/
Exit codes: 0 clean · 1 findings · 2 usage error — drop it straight into CI.
What it detects
| Class | Example |
|---|---|
| dead design-session citation |
(decision 7), design §4.7, phase tokens W3/T4, 设计稿
|
| stack/PR vantage | “this PR adds…”, “a later PR in this stack” |
| change narration / version stamps | “used to”, “no longer”, “the old X”, “the v1 refactor”, “today”, 旧版/不再
|
| review choreography | “Rejected in review:”, “the reviewer confirmed”, 上一轮评审
|
| reviewer-addressed justification | “the cast is safe — it simply…” |
| control-flow narration | “first we X, then we Y”, “as you can see” |
| hedge / planning residue | “probably fine for now”, “should be enough” |
| authoring-language slip | untranslated working-language fragments in the other language |
English and Chinese batteries are both built in.
What it deliberately does not flag
The keep-rules are half the tool. A zero-treatment linter that deletes RFC 9110 §10.1.5, a load-bearing TODO(alice):, or “the old connection drains before the new one accepts” (runtime lifecycle, not change history) does more damage than the leakage. So cot-lint mechanically exempts:
- issue references and marked
TODO/FIXME/XXXdeferrals, -
§-references on lines that cite an external standard such as an RFC, - lines carrying a
cot-lint-ignoresuppression — keep the reason next to it.
Batteries over-match by design. Every finding is a candidate, not a verdict; the keep-rules and rewrite method decide what survives.
Fixing, not just finding
The repo ships cot-trim, an agent skill that pairs with the CLI: it runs cot-lint --json, judges every hit against the one test, enumerates the passage’s propositions before deleting anything, and fixes owner-first (generated files via their source, model-visible strings via their owning snapshot).
Install it where your agent looks for skills:
-
DeepSeek Harness:
dsh plugin add cot-lint(orgithub:YuanyuanMa03/cot-lint) — thecot-trimskill loads through the plugin’s skill provider. -
Claude Code / generic agents: copy
skills/cot-trim/into your skills directory (~/.claude/skills/,.agents/skills/, or wherever your agent looks).
How this differs from “AI slop” style linters
Style-slop detectors flag prose that sounds like AI (word choices, em-dash habits). cot-lint flags prose whose vantage is the authoring session — references and narration that only make sense if you were there. Human-written docs can leak (copy-pasted PR descriptions do); AI-written docs can be clean. Different failure class, different tool.
Origin
The taxonomy, keep-rules, and battery approach are distilled from the engineering standards of DeepSeek Harness (MIT) — specifically its prose-hygiene practice for agent-written repositories — generalized here to work with any repo and any coding agent. See their CONTRIBUTING.md for the project’s stance on community ecosystem work.
License
常见问题常见问题
在启用了 DSH 的终端中执行已验证命令 dsh plugin --profile default add github:YuanyuanMa03/cot-lint。命令会解析公开 package 元数据,并保持插件与本页展示的目录身份一致。
兼容性以页面上展示的 bundle 与 profile 状态为准。如果某个 profile 尚未检测到,请先保持禁用,并在生产启用前阅读仓库文档。
GitHub 链接和 activity 元数据是 release 与维护状态的来源。新版本发布后重新查看本页,确认目录已经观察到最新版本。