用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/vantezzen/skills --skill remove-comments命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | remove-comments |
| description | Remove unnecessary comments |
You are tasked to remove unnecessary comments.
As a general rule: Good code comments itself. If there's a comment, especially a long one, that means the code is bad or the comment is unnecessary. The only exception is when the comment is necessary to explain external reasons behind specific code choices.
/**
* Adding is generally a safe operation, but we need to be careful with large numbers due to potential overflow issues.
* In this case we expect numbers to be small, since this is mostly used inside the numbers part of the app.
*/
const add = (a, b) => a + b;
-> This comment is useless because the code is self-explanatory. The comment can be removed completely.
/**
* We have the concept of "MachinePart" in our backend, but the frontend combines them into a single "Part" object.
* This is because the frontend doesn't need to know about the individual machine parts, and it simplifies the data model for the UI.
* This converts a MachinePart to a Part by combining the relevant fields. For this, it iterates over the
* MachinePart fields and maps them to the Part fields.
*/
const convertMachinePartToPart = (machinePart) => {
return {
id: machinePart.id,
name: machinePart.name,
description: machinePart.description,
};
};
-> Also probably can be removed completely as we can expect programmers to already understand the surrounding concepts in the app.
const fetchData = () => {
/**
* Previously we had issues with the data format cutting off at 10.000 characters when the user reloads the page
* while still being in an active game session. This was due to the fact that the data was being stored in localStorage,
* which has a limit of 10.000 characters.
* To prevent this, we're checking the length of the data before storing it in localStorage, and if it's too long, we store it in sessionStorage instead.
*/
doWeirdThing(data);
return data;
};
-> This comment is one of the few that is actually useful. Otherwise a programmer might questions why there is a weird check for the length of the data. However, it can be shortened as it is way too verbose - here again, we don't need to explain what the code does (i.e. check the length and store somewhere else), but rather why it does it:
const fetchData = () => {
// Data cuts off at 10k chars if the user reloads the page while in an active game session
doWeirdThing(data);
return data;
}
---
```ts
/**
* This now also supports the new "request" format, which is a more structured way of passing data to the handler.
*/
const handleRequest = (request) => {
// ...
}
-> This is a useful and very bad comment. It comments on a "new" state of the code, which is not useful to future readers as they will never have seen any previous iterations. Also, "new" is quickly outdated and will be confusing to future readers. This comment can be removed completely.
Generally: