{"data":{"slug":"discovered-c90c8fd2b96e5ccf20973906951f1dc507988919dfc52461","title":"Comment Pass","summary":"Enforce comment rules by deleting, rewriting, or adding module headers and public comments that provide value to the caller, based on the code and its signature.","url":"https:\/\/skillshunter.net\/skills\/discovered-c90c8fd2b96e5ccf20973906951f1dc507988919dfc52461","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/discovered-c90c8fd2b96e5ccf20973906951f1dc507988919dfc52461","markdown_url":"https:\/\/skillshunter.net\/skills\/discovered-c90c8fd2b96e5ccf20973906951f1dc507988919dfc52461.md","download_url":"https:\/\/skillshunter.net\/skills\/discovered-c90c8fd2b96e5ccf20973906951f1dc507988919dfc52461\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before running, ensure the `~\/.claude-hobby\/CLAUDE.md` file is in place and contains the comment rule. The deliverable is the edited comments; do not commit or add them to version control.","instructions":"---\ndescription: Enforce the comment rule over a diff or a path \u2014 delete comments the rule disallows, rewrite the ones pitched at the wrong level, and write the missing module headers and the public comments that say more than the signature\nargument-hint: '[<base> | <path>\u2026] [--report-only]'\nallowed-tools: Bash(python3 *\/comment-candidates.py:*), Bash(git diff:*), Bash(git log:*), Bash(git -C:*), Bash(git rev-parse:*), Bash(git merge-base:*), Bash(pwd:*), Bash(ls:*), Read, Grep, Glob, Edit\n---\n\nMake the comments match the rule in `~\/.claude-hobby\/CLAUDE.md`: **a module\nheader, and a public element's comment when it tells the caller something the\nsignature does not. Nothing else.**\n\nA comment is written for a caller, at the level they use the code. The failures\nthis pass exists to remove are the ones a model produces by default: a comment\nthat restates the name, one that walks through the body, and one that belongs to\nthe conversation that wrote the code rather than to the code.\n\n**This pass is mostly a filter.** Coming out with fewer comments is the normal\nresult. It writes only two things: a missing module header, and a public\ncomment the caller actually needs.\n\n## Stage 0 \u2014 Scope\n\n1. Default scope is the branch diff. A path argument sweeps that path instead; a\n   ref argument is the diff base.\n\n   ```bash\n   python3 ~\/fun_repos\/hobby-tooling\/scripts\/comment-candidates.py --diff [<base>]\n   python3 ~\/fun_repos\/hobby-tooling\/scripts\/comment-candidates.py <path>\u2026\n   ```\n\n   It emits `path:line<TAB>CATEGORY<TAB>detail` for the four placement states it\n   can detect mechanically. Report the counts per category before changing\n   anything.\n\n2. **Vendored crates are report-only**: `mcps\/just-mcp`, `mcps\/lsp-mcp`,\n   `mcps\/tree-extract`, `lsps\/claude-lsp`, `lsps\/claude-skills-lsp`,\n   `lsps\/treesitter-class-lsp`, `lsps\/path-lsp`. They are copies of work crates and\n   every rewrite here widens the drift a re-sync has to reconcile. List their\n   findings, change nothing, unless I say otherwise.\n\n3. `--report-only` stops after the report everywhere. It is this skill's flag \u2014\n   never pass it through to the detector, which rejects unknown flags.\n\n## Stage 1 \u2014 What the detector found\n\n**`BARE-COMMENT` \u2014 a comment where the rule allows none**: in a body, a banner,\nabove a test. Read it, then:\n\n| the comment carries | do |\n|---|---|\n| nothing the code doesn't already say | delete |\n| something a caller needs \u2014 a precondition, what an error means, an observable effect | move it into the enclosing public item's comment at the caller's level; delete the inline |\n| why the body is shaped this way rather than the obvious way | delete, and list it in the report as a commit-message note |\n| what a test pins | delete; if the test's name does not say it, propose a better name in the report |\n| a section banner | delete; if the file needed them to be navigable, say so \u2014 that is a split, not a comment |\n\n**`PRIV-DOC` \u2014 a doc comment on a private element.** Delete it. If losing it\nmakes the element hard to follow, the fix is the name or the shape: report that.\n\n**`MOD-UNDOC` \u2014 no module header.** Write one: the module's responsibility, for\nsomeone deciding whether and how to use it. Never list what is in the file. If\nyou cannot state a single responsibility, report that instead of writing a header\nthat lists two.\n\n**`PUB-UNDOC` \u2014 a public element with no comment.** A candidate, not a defect.\n**Leave it uncommented** unless you can name something the caller needs that the\nnames and types do not say \u2014 a precondition, what an error case means, an effect\non state the caller can see, a unit or range the type does not carry. Write only\nthat, in a sentence or two. Do not count these as work left over.\n\n## Stage 2 \u2014 What the detector cannot see\n\nRead every module header and public comment in scope against the code and the\nsignature it sits on. Rewrite or delete:\n\n- **restatement** \u2014 the name or the types again in prose\n  (`\/\/\/ The project the tasks belong to.` on `pub project: String`): delete;\n- **too much detail** \u2014 how the body works, the algorithm, the steps: cut to\n  what the caller sees, or delete;\n- **conversation** \u2014 anything that only makes sense to someone who saw the\n  task: history (`no longer`, `used to`, `instead of the old \u2026`), references to a\n  task, issue, PR, gate, plan or notes file, who asked for it: rewrite as the\n  behaviour it describes, or delete;\n- **wrong** \u2014 says something the code does not do: fix it; a wrong comment is\n  worse than none.\n\nThe test for every sentence that survives: it reads correctly to someone who\nnever saw the conversation or the diff, it is at the caller's level, and the\nsignature does not already say it.\n\n**Never assert what you have not verified in the code.** A behaviour you cannot\nestablish is not written; the site goes in the report.\n\n## Stage 3 \u2014 Report\n\nShort:\n\n- counts per category, before and after;\n- comments written \u2014 module headers, and public comments with what they add over\n  the signature;\n- comments relocated, rewritten or deleted for level or conversation, as a count\n  with a few examples;\n- shape-decision notes pulled out for the commit message, verbatim;\n- anything not acted on, with the reason \u2014 a module with no single\n  responsibility, a private element that needs a better name, a test that needs a\n  better name, a behaviour you could not verify;\n- vendored-crate findings, listed and untouched.\n\nNever `git add` or commit. The edits are the deliverable; the decision to keep them\nis mine.\n","use_cases":["Cleaning up comments in a codebase to align with a defined comment rule","Ensuring module headers are present and describe the module's responsibility","Removing comments that restate the code or are irrelevant to the caller","Adding public comments that explain preconditions, error cases, or observable effects not covered by the signature"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/julianbieber\/hobby-tooling\/blob\/420f1f68d0f92201d2a7a51a0c463784e1e49405\/skills\/comment-pass\/skill.md","source_commit":"420f1f68d0f92201d2a7a51a0c463784e1e49405","license":null,"version":null,"listing_approved_at":"2026-11-30","created_at":"2026-11-29T11:13:14.000000Z","updated_at":"2026-11-30T06:52:26.000000Z","seo_title":"Enforce Comment Rules with Comment Pass","seo_description":"Automatically enforce comment rules by removing redundant or misplaced comments and adding necessary module headers and public comments based on code and signature.","seo_keywords":["comment pass","code comment rules","module header","public comment","code cleanup","comment enforcement","code documentation","comment review"]}}