no-comments
它能做什么
这个技能用于清理一组改动中的代码注释,保留那些解释外部系统的注释。适合希望代码能够自我解释的开发者。
适用场景
- ✓当代码改动中的注释只是重复代码在做什么的时候。
- ✓当差异中有为团队自身代码辩解的注释时。
- ✓当有人要求删除某些文件中不必要的注释时。
技能链接
https://github.com/remotion-dev/remotion/blob/main/.agents/skills/no-comments/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的拉取请求里有很多只是重复代码功能的注释。请帮我删除不必要的注释,但保留关于浏览器问题的说明。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会检查本次改动行上的注释。它会删除描述团队自身代码的注释,保留关于外部系统的说明,以及 eslint-disable 之类供机器读取的指令。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
No comments
Delete comments that describe our own code. Code we own should explain itself through names, types, and structure. Keep a comment only when it documents something outside our control that a reader could not learn from our code.
Scope
Use the files or diff the user named. Otherwise use the current diff against
main, including staged, unstaged, and untracked changes:
git diff main...HEAD
git diff HEAD
git ls-files --others --exclude-standard
Only touch comments on lines added or modified in scope. Do not sweep untouched code in the same file.
Keep
A comment stays only if it is about an external system and is still accurate:
- Browser behavior: Chrome/Safari/Firefox quirks, WebCodecs, Canvas, CSS, layout, event ordering, autoplay policy, linked bug trackers.
- Media and tooling: FFmpeg, codecs, containers, Mediabunny, Chromium flags, Lambda/Cloud Run limits, Node.js, Bun, TypeScript compiler, bundler behavior.
- Third-party libraries and APIs: why we call them in an unusual way, links to upstream issues.
- OS, hardware, and spec constraints: file system, GPU, Linux/macOS/Windows differences, RFCs, W3C specs.
Also keep:
- Machine-read directives:
eslint-disable*,@ts-expect-error,@ts-ignore,/// <reference>,'use client',istanbul ignore,prettier-ignore,biome-ignore,@vitest-environment, shebangs, license headers. Still check that each suppression is needed; remove dead ones. - JSDoc on public exported APIs (it surfaces in editor tooltips).
@deprecatedtags (see thedeprecate-apiskill).- Comments in docs, MDX, and code snippets that are shown to users.
Delete
- Narration of what the next lines do (
// Get the frame,// Loop over tracks). - Restating names, types, or parameters.
- Explanations of our own architecture, data flow, or design choices.
- Defenses of workarounds for our own bugs. Fix the root cause in scope or leave the code uncommented.
IMPORTANT,do not remove,keep in sync with X,talk to Y firstnotes about our own code. If the constraint is real, offer to encode it (type, shared constant, test, lint) instead; delete the comment either way.- Commented-out code,
TODO/FIXMEwithout a linked issue, changelog-style notes (// Added in v4.0.x), and section dividers.
Mixed comments: keep only the external-system sentence and delete the rest.
If a comment hides a genuine surprise in our code, prefer a clearer name, extracted variable, or type over keeping the comment. Only reshape code when it is a trivial, local change; otherwise delete the comment and mention the surprise in the report.
Steps
Collect every comment in scope (
//,/* */, JSDoc, JSX{/* */},#in shell/YAML).Classify each as keep or delete using the rules above. When unsure whether a comment is about an external system, check: would this still be true if we rewrote our code? If yes, keep. If it only makes sense because of how we wrote something, delete.
Delete. Do not change behavior. Remove blank lines left behind that would break formatting.
Run formatting and lint on touched packages:
bunx turbo run lint --filter='<package-name>'Report: number of comments deleted, comments kept with a one-line reason each, any constraints offered for encoding, and any code surprises that deserve a follow-up.
常见问题
哪些注释会被保留?
该技能会保留关于外部系统的注释,例如浏览器的特殊行为、编解码器的表现、第三方 API 以及平台缺陷。
lint 指令会被删除吗?
不会。该技能说明,eslint-disable 和 ts-expect-error 这类指令会保留。
它会修改我没有改动的代码吗?
不会。该技能只修改范围内新增或修改的行上的注释。
详情
作者的原始描述
Remove code comments that explain or defend Remotion's own code, keeping only comments about external systems we cannot change (browser quirks, codec/FFmpeg behavior, third-party APIs, OS or platform bugs). Use when the user invokes /no-comments or asks to strip unnecessary comments from a diff or files.
repo: remotion-dev/remotion
热度
- GitHub 星标
- 70k
- 排名
- #3147
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …