Grok BotSoftwareShipping codeAI score · 75/100AI-assisted edit · no obvious prompt-injection riskGitHub

Auto-Cleanup Redundant Code Comments and Flag Technical Debt

Input: code repository and team comment rules; Process: scan, classify, remove redundant comments, keep non-obvious why-comments, flag workarounds; Output: one behavior-preserving PR with a root-cause fix list

Some experienceStepsWorkflowPrompt
Who
Engineering teams maintaining code quality and reducing comment bloat; best for repos with existing CI/CD
You get
Generate a PR that only deletes redundant comments without changing behavior, listing discovered workaround root causes in the PR description
You need

Constraints

Prerequisites: a writable code repository with PR workflow and test suite; team must define comment rules first (e.g., Lauren's 'no comments in main codebase' rule). Boundaries: do not remove licence headers or non-obvious invariant comments; do not auto-fix workarounds, only flag them; deletions touching excluded paths or potentially changing behavior require human approval. Triggers: nightly schedule, `/no comments` command, or PR review flag. Cost: unknown (depends on model calls and code scanning volume).

What they did

Source records this role from stream as 'Comment Sicko' / 'comments sickle' (Lauren, pstack), originating from a colleague's 'sicko mode' skill—the bot 'gets really excited about deleting comments'. Lauren banned comments outright in the main GrokBot codebase, applying the rule less strictly to game code.

How it went

Source provides no specific quantitative results; author reports the bot identifies and removes redundant comments while flagging workarounds (author_report).

Worth knowing

This bot does not own fixing workarounds, only flags them; deletions should not change behavior by definition, but source explicitly requires human approval for any deletion that might. Team must have explicit comment rules as 'source of truth' or the bot lacks judgment criteria. Source provides no specific model version or integration config; actual effectiveness depends on underlying code comprehension capability.

Steps

  1. Create the Comment Cleanup bot and paste the role description

    Create a new bot in your AI platform (e.g., GrokBot) and paste the role description below into the system prompt field. Replace all {PLACEHOLDER}s with actual values: {NAME} for the bot name (e.g., CommentSicko), {REPO} for the target repository, {LICENCE HEADERS} for the licence header identifiers to preserve.

    Setup guidance · Source text。AI platform's System Prompt field; replace variables before saving

    You are {NAME}. Your one job is deleting unnecessary comments in
    {REPO}. Remove: comments that restate the code, commented-out blocks,
    "keeping this just in case", and comments that explain a hack instead
    of fixing it. Keep: {LICENCE HEADERS}, and comments that state a
    non-obvious *why* that the code cannot express.
    
    When a comment describes a workaround, do not just delete it — list it
    in the PR description as a root cause to fix.
    
    Open one PR. Behaviour must be unchanged; attach the test run.
  2. Configure triggers and excluded paths

    Set triggers: choose nightly scheduled run, or keep `/no comments` command trigger, PR review flag trigger. In configuration, fill {EXCLUDED PATHS} for directories or files the bot must not modify (e.g., third-party libraries, generated code). Confirm approval workflow: any deletion touching excluded paths or potentially changing behavior requires human review.

  3. Execute scan and comment classification

    Bot scans the target repository per role description: identifies and marks four deletion categories—what-comments that restate code, commented-out blocks, 'keeping this just in case' comments, and comments explaining a hack instead of fixing it. Preserves: licence headers and non-obvious why-comments that code cannot express. If a comment reveals a workaround, record it separately as a root cause to fix without deleting that record.

  4. Generate PR and attach verification

    Bot opens one PR containing only comment deletions, no logic changes. PR description must include: summary of deleted comment categories, list of discovered workaround root causes. Must attach test run results proving unchanged behavior. Wait for CI pass and human approval before merge.

Prompt you can copy

Setup guidance · Editorial suggestion。Hand to setup assistant to fill into AI platform System Prompt field; confirm repo write access and PR workflow first

This block is the prompt. Ads are never placed here.

You are {NAME}. Your one job is deleting unnecessary comments in {REPO}. Remove: comments that restate the code, commented-out blocks, "keeping this just in case", and comments that explain a hack instead of fixing it. Keep: {LICENCE HEADERS}, and comments that state a non-obvious *why* that the code cannot express. When a comment describes a workaround, do not just delete it — list it in the PR description as a root cause to fix. Open one PR. Behaviour must be unchanged; attach the test run.

Replace {NAME}, {REPO}, {LICENCE HEADERS} before use; test on a small repo first to verify deletion boundaries

Source

comment-cleanup · unicodef1wn · GitHub · 2026-09-18

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related