Skip to content
Agentmart
Submit a tool

clean-comments

Remove comments that fail ~/.claude/rules/comments.md from source files.

Skill by O-Marsters-1997

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/o-marsters-1997-clean-comments

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Remove comments that fail ~/.claude/rules/comments.md from source files. Use when user wants to clean comments, remove redundant comments, strip obvious comments, or run /clean-comments on staged files before committing.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/clean-comments

What's inside

Skill name
clean-comments
Description
Remove comments that fail ~/.claude/rules/comments.md from source files. Use when user wants to clean comments, remove redundant comments, strip obvious comments, or run /clean-comments on staged files before committing.
License
MIT
Instructions
59 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Clean comments

## The standard

`~/.claude/rules/comments.md` decides what earns a comment. It is the only
copy. Read it before editing a file and apply it as written.

Do not restate it here, and do not work from memory of it. A subagent running
this skill may not have it loaded, so read the file. If a case it does not
cover comes up, the fix belongs in `comments.md`, not in this skill.

Deleting a load-bearing directive is the one unrecoverable mistake this skill
can make. Leave these alone: `//go:build`, `// +build`, `//go:generate`,
`// prettier-ignore`, `# fmt:`, `# -*- coding:`, shebangs.

Suppressions are not on that list. `@ts-ignore`, `eslint-disable`,
`# type: ignore`, `//nolint` are debt under `comments.md` § Suppressions.
Report them and say what each is silencing. Never delete one in this pass:
removing a suppression breaks the build or the lint run, which is a code
change, and this skill does not make those.

## Quick start

Run on staged files before a commit:
```
/clean-comments
```

Run on specific files:
```
/clean-comments src/foo.ts src/bar.go
```

## Workflow

1. Read `~/.claude/rules/comments.md`
2. If arguments are provided, treat them as file paths to clean
3. If no arguments, get staged files: `git diff --cached --name-only --diff-filter=ACM`
4. Filter to code files (`.go`, `.ts`, `.tsx`, `.js`, `.jsx`, `.py`, `.rs`)
5. For each file, read it, remove the comments that fail the standard, write it back
6. Re-stage any modified files: `git add <file>`
7. Report what was removed and from which files; if nothing needed removing, say so

Comment-only edits. Never change code in the same pass.

## The commit hook

`~/.claude/hooks/check-staged-comments.sh` runs on `PreToolUse` for Bash and
blocks `git commit` when the staged diff adds comment lines. It ignores
directives, and reads `#` as a comment marker in Python only.

Trimming a long doc comment counts as adding lines, so a cleanup pass trips it.
When every remaining comment earns its place, say so and commit with:

```
CC_COMMENTS_REVIEWED=1 git commit ...
```

From O-Marsters-1997/my-claude-code, MIT.

More from O-Marsters-1997/my-claude-code

Signals

Stars
0
Forks
0
Open issues
10
Last commit (this folder)
Sep 27, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from O-Marsters-1997

Cite this page

clean-comments skill. Agent Mart. https://agentmart.dev/skills/o-marsters-1997-clean-comments (last updated 2026-10-24)