Ring:Cleaning Comments logo

Ring:Cleaning Comments

Organization
LerianStudio
ring:cleaning-comments

Cleaning redundant and obvious comments following clean code principles while preserving meaningful documentation. Supports git scope filtering (staged, unstaged, branch, commit-range). Use when code has excessive comments, during code review, or post-refactor cleanup. Skip when reviewing documentation files or comments are already minimal.

Overview

PublisherLerianStudio
Repositoryring
Skill namering:cleaning-comments
Stars
215
Forks
28
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by LerianStudio on GitHub. Read the source before you install it.

Installation

Install the Ring:Cleaning Comments AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/LerianStudio/ring.git /tmp/ring
mkdir -p .claude/skills
cp -r /tmp/ring/default/skills/cleaning-comments .claude/skills/lerianstudio-ring-cleaning-comments
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Ring:Cleaning Comments in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Ring:Cleaning Comments on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Ring:Cleaning Comments is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Cleaning Comments

When to use

  • Code has excessive, redundant, or obvious comments
  • During code review or post-refactor cleanup
  • Before committing to clean up comment noise in changed files
  • Codebase has accumulated commented-out code blocks

Skip when

  • Reviewing documentation files (README, docs/, etc.)
  • Comments are already minimal and meaningful
  • Working with generated code or third-party files

Sequence

Runs after: ring:exploring-codebases (optional, for architecture context)

Related

Complementary: ring:exploring-codebases — run first for architecture-aware cleaning that preserves critical documentation


Analyze comments in code and remove those that violate clean code principles while preserving valuable ones. You can focus on git changes for faster, more relevant cleaning, or analyze the entire codebase.

Recommended workflow: Run ring:exploring-codebases first to understand the architecture, then clean comments with that context. This preserves architectural documentation, understands which comments are critical for complex modules, and respects project-specific documentation standards.

Clean Code Comment Rules

  1. Always try to explain yourself in code — Remove comments that can be replaced with better function/variable names
  2. Don't be redundant — Remove comments that just repeat what the code obviously does
  3. Don't add obvious noise — Remove comments like i++; // increment i
  4. Don't use closing brace comments — Remove } // end of if block style comments
  5. Don't comment out code — Remove commented-out code blocks
  6. Keep explanation of intent — Preserve comments explaining WHY, not WHAT
  7. Keep warnings of consequences — Preserve comments about important side effects
  8. Keep legal and informative comments — Preserve copyright, licenses, TODOs

Examples

Before:

javascript
// Check if user is eligible for discount
if (user.age >= 65 && user.membershipYears >= 5) {
  // Apply senior discount
  total = total * 0.9 // multiply by 0.9 to get 10% discount
} // end if block

After:

javascript
if (user.isEligibleForSeniorDiscount()) {
  total = total * SENIOR_DISCOUNT_RATE
}

Process

Phase 0: Git Scope Filtering (when git options used)

If git-scope is specified, determine files in scope:

ScopeGit command
stagedgit diff --cached --name-only --diff-filter=ACMR
unstagedgit diff --name-only --diff-filter=ACMR
all-changesgit diff HEAD --name-only --diff-filter=ACMR
last-commitgit diff HEAD~1..HEAD --name-only --diff-filter=ACMR
branchgit diff $(git merge-base HEAD main)..HEAD --name-only --diff-filter=ACMR
commit-range=<range>git diff <range> --name-only --diff-filter=ACMR

If file-pattern is also specified, filter the git results to match. Show git statistics: scope name, file count, and first 10 filenames.

Phase 1: Architecture-Aware Analysis

  1. Understand Codebase Context
    • Identify key architectural patterns and conventions
    • Map critical system components and their responsibilities
    • Understand established documentation patterns
    • Identify complex modules requiring careful comment preservation

Phase 2: Targeted Comment Analysis

  1. Scan Files
    • Find all files matching the pattern (or entire codebase if no pattern specified)
    • Prioritize files with most comment issues (using codebase analysis)
    • Identify different types of comments in context of project patterns
    • Categorize by clean code rules while respecting architecture

Phase 3: Context-Aware Cleaning

  1. Clean Bad Comments

    • Remove redundant comments that repeat code
    • Remove obvious noise comments
    • Remove closing brace comments
    • Remove commented-out code blocks
    • Preserve architectural explanations identified in Phase 1
  2. Preserve Good Comments

    • Keep intent explanations and clarifications
    • Keep consequence warnings
    • Keep legal/copyright notices
    • Keep TODO comments
    • Keep system design documentation critical to understanding
    • Keep pattern explanations that help maintain conventions
  3. Suggest Code Improvements

    • Identify where comments can be replaced with better naming
    • Suggest function extractions for complex logic
    • Recommend architectural improvements based on codebase analysis

Frequently asked questions

What does the Ring:Cleaning Comments AI skill do?

Cleaning redundant and obvious comments following clean code principles while preserving meaningful documentation. Supports git scope filtering (staged, unstaged, branch, commit-range). Use when code has excessive comments, during code review, or post-refactor cleanup. Skip when reviewing documentation files or comments are already minimal.

Why use Ring:Cleaning Comments on TypingMind?

Because you install it once and use it with any model. Ring:Cleaning Comments is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Ring:Cleaning Comments in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/LerianStudio/ring/tree/main/default/skills/cleaning-comments. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Ring:Cleaning Comments?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Ring:Cleaning Comments?

As many as you like. As long as a model supports skills, you can use Ring:Cleaning Comments with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Ring:Cleaning Comments AI skill free?

Yes. It is published on GitHub by LerianStudio under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇