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: