comments-remove
Skill0 starsChanged 2 months agoMITView on GitHub
Removes comments from source files or from a block of code. Use when the user asks to delete, strip, or clean comments in code.
In this repository4 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- comments-addSkill
- comments-rewriteSkill
- wtfSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
25 rules. About 0 are common, 22 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈22
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
If the input is a path to a file or a directory that exists, use the file or the directory.
- Distinctive: line 18
If the input looks like a path, and the path does not exist, stop.
- Distinctive: line 19
If the input is code, or the message has a code block, find that code in the project:
- Distinctive: line 20
Use Grep with a line from the code that is unusual, for example a name or a string literal.
- Distinctive: line 21
If you find one location, use that file.
- Distinctive: line 22
If you find more than one location, show the list of the files with the line numbers, and ask which one to use.
- Distinctive: line 23
If you find no location, tell the user, and show the code with the comments removed in the chat.
- Distinctive: line 24
If there is no input, and the message has no code block, stop immediately.
- Distinctive: line 30
Do this step only for a directory target.
- Distinctive: line 33
Do not use a hidden file or a hidden folder.
- Very specific: line 34
Do not use a build folder or a dependency folder, for example build, dist, .build, DerivedData, node_modules, Pods, vendor, .venv.
- Distinctive: line 35
Do not use a file that a tool made.
- Distinctive: line 36
Do not use a file that is not source code, for example an image or a data file.
- Distinctive: line 37
If the list has more than 10 files, show the list, and ask before you make a change.
- Distinctive: line 41
Delete the comments from the target.
- Distinctive: line 45
Delete line comments and block comments.
- Distinctive: line 46
Keep every comment that the compiler, a tool, or the operating system reads.
- Distinctive: line 53
If you are not sure that a comment is only for a person, keep it.
- Very specific: line 54
Keep a documentation comment that a tool reads, for example a Swift /// comment or a Python docstring.
- Distinctive: line 55
Do not change comment text that is in a string literal or a regular expression.
- Distinctive: line 56
If the comment was alone on its line, delete the full line.
- Distinctive: line 60
Do not change, refactor, or reformat the executable code.
- Very specific: line 62
Do not write a new comment.
- Distinctive: line 63
Do not change a file that is not in the target.
- Distinctive: line 72
After the work, give this data:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Input: $ARGUMENTS
Precondition
Find the target
Find the type of the input:
- If the input is a path to a file or a directory that exists, use the file or the directory.
- If the input looks like a path, and the path does not exist, stop. Show the path. Do not guess. Do not search for the path text.
- If the input is code, or the message has a code block, find that code in the project:
- Use Grep with a line from the code that is unusual, for example a name or a string literal.
- If you find one location, use that file.
- If you find more than one location, show the list of the files with the line numbers, and ask which one to use. Do not make a change.
- If you find no location, tell the user, and show the code with the comments removed in the chat. Do not write a file.
- If there is no input, and the message has no code block, stop immediately. Do not guess. Write only this message:
Usage: /comments-remove <file-or-directory | code block>
Find the files
Do this step only for a directory target.
- Make the list of the source files in the directory.
- Do not use a hidden file or a hidden folder.
- Do not use a build folder or a dependency folder, for example
build,dist,.build,DerivedData,node_modules,Pods,vendor,.venv. - Do not use a file that a tool made. A generated file usually has a header, for example "Do not edit".
- Do not use a file that is not source code, for example an image or a data file.
- If the list has more than 10 files, show the list, and ask before you make a change.
Task
Delete the comments from the target.
Rules:
- Delete line comments and block comments.
- Keep every comment that the compiler, a tool, or the operating system reads. Delete only a comment that is for a person. Keep these comments:
- The first line of the file, if it starts with
#!. - License headers and copyright headers.
- A comment that gives a version or a build rule, for example
// swift-tools-version:6.0,//go:build linux,# -*- coding: utf-8 -*-,# frozen_string_literal: true. - A directive for a tool or the compiler, for example
// swiftlint:disable,// swiftformat:disable,# type: ignore,# noqa,// @ts-ignore,// eslint-disable,// prettier-ignore,#pragma. TODO,MARK, andFIXMEcomments.- A comment that gives data that the code does not show, for example a reason, a defect number, a link, or a description of a workaround.
- The first line of the file, if it starts with
- If you are not sure that a comment is only for a person, keep it. Put it in the report.
- Keep a documentation comment that a tool reads, for example a Swift
///comment or a Python docstring. A docstring is a string, not a comment. Do not delete it. - Do not change comment text that is in a string literal or a regular expression.
- If the comment was alone on its line, delete the full line. Do not leave an empty line in its place.
Limits
- Do not change, refactor, or reformat the executable code.
- Change only the comments, and the lines that stay empty because you deleted a comment.
- Do not write a new comment. To write new comments, use
/comments-addor/comments-rewrite. - Do not change a file that is not in the target.
Output
For a file or a directory, delete the comments in the files. For a block of code that you found in the project, delete the comments in that file. Change only the lines of that block.
Report
After the work, give this data:
- A list of the files or the sections, with the number of the deleted comments.
- A list of the comments that you kept, with the reason.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

