Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
直接コマンドでは確認用 Prompt が省略されます。実行前にソースを確認してください。
npx skills add https://github.com/vantezzen/skills --skill remove-commentsコマンドは1行のまま表示されます。コピー前に横へスクロールして全体を確認してください。
ローカルで確認しますか?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: